java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.expression.Expression
simula.compiler.syntaxClass.expression.RelationalOperation
Relational Operation.
Simula Standard: 3.3 Relations
Syntax used during Parsing:
relational-operation = expression relational-operator expression relational-operator = value-relational-operator | reference-comparator value-relational-operator = < | <= | = | >= | > | <> reference-comparator = == | =/=Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Field Summary
Modifier and TypeFieldDescriptionprivate Expression
The left hand sideprivate final KeyWord
The relational operationprivate Expression
The right hand sideFields inherited from class simula.compiler.syntaxClass.expression.Expression
backLink, type
Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
lineNumber
-
Constructor Summary
ConstructorDescriptionRelationalOperation
(Expression lhs, KeyWord opr, Expression rhs) Create a new RelationalOperation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Perform semantic checking.private String
Coding Utility: Code text reference relationprivate String
Coding Utility: Code text value relationboolean
Returns true if this expression may be used as a statement.Generate Java code for this Syntax Class.toString()
Methods inherited from class simula.compiler.syntaxClass.expression.Expression
acceptExpression, checkCompatibility, evaluate, expectExpression, get, getInt, getNumber, getQualification, getWriteableVariable, printTree, put
Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, doDeclarationCoding, doJavaCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, print, SET_SEMANTICS_CHECKED
-
Field Details
-
lhs
The left hand side -
opr
The relational operation -
rhs
The right hand side
-
-
Constructor Details
-
RelationalOperation
RelationalOperation(Expression lhs, KeyWord opr, Expression rhs) Create a new RelationalOperation.- Parameters:
lhs
- the left hand sideopr
- the relationrhs
- the right hand side
-
-
Method Details
-
doChecking
public void doChecking()Description copied from class:SyntaxClass
Perform semantic checking.This must be redefined in every subclass.
- Overrides:
doChecking
in classSyntaxClass
-
maybeStatement
public boolean maybeStatement()Description copied from class:Expression
Returns true if this expression may be used as a statement.- Specified by:
maybeStatement
in classExpression
- Returns:
- true if this expression may be used as a statement
-
toJavaCode
Description copied from class:SyntaxClass
Generate Java code for this Syntax Class.- Overrides:
toJavaCode
in classSyntaxClass
- Returns:
- Java code
-
doCodeTextValueRelation
Coding Utility: Code text value relation- Returns:
- the resulting Java source code
-
doCodeTextRefRelation
Coding Utility: Code text reference relation- Returns:
- the resulting Java source code
-
toString
- Overrides:
toString
in classExpression
-