Class RelationalOperation
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
FieldsModifier and TypeFieldDescriptionprivate ExpressionThe left hand sideprivate intThe relational operationprivate ExpressionThe right hand sideFields inherited from class Expression
backLink, typeFields inherited from class SyntaxClass
CHECKED, lineNumber, OBJECT_SEQU -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDefault constructor used by Attribute File I/O(package private)RelationalOperation(Expression lhs, int opr, Expression rhs) Create a new RelationalOperation. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildEvaluation(Expression rightPart, CodeBuilder codeBuilder) ClassFile coding utility: Build Evaluation Code.private voidbuildTextRelation(CodeBuilder codeBuilder) ClassFile coding utility: Build Text Relation.voidPerform semantic checking.private StringCoding Utility: Code text reference relationprivate StringCoding Utility: Code text value relationbooleanReturns true if this expression may be used as a statement.static RelationalOperationRead and return an object.Generate Java code for this Syntax Class.toString()voidWrite a SyntaxClass object to a AttributeOutputStream.Methods inherited from class Expression
acceptExpression, checkCompatibility, evaluate, expectExpression, get, getInt, getNumber, getQualification, getWriteableVariable, printTree, putMethods inherited from class SyntaxClass
ASSERT_SEMANTICS_CHECKED, buildByteCode, doDeclarationCoding, doJavaCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, print, SET_SEMANTICS_CHECKED, setLineNumber
-
Field Details
-
lhs
The left hand side -
opr
private int oprThe relational operation -
rhs
The right hand side
-
-
Constructor Details
-
RelationalOperation
RelationalOperation(Expression lhs, int opr, Expression rhs) Create a new RelationalOperation.- Parameters:
lhs- the left hand sideopr- the relationrhs- the right hand side
-
RelationalOperation
private RelationalOperation()Default constructor used by Attribute File I/O
-
-
Method Details
-
doChecking
public void doChecking()Description copied from class:SyntaxClassPerform semantic checking.
This must be redefined in every subclass.
- Overrides:
doCheckingin classSyntaxClass
-
maybeStatement
public boolean maybeStatement()Description copied from class:ExpressionReturns true if this expression may be used as a statement.- Specified by:
maybeStatementin classExpression- Returns:
- true if this expression may be used as a statement
-
toJavaCode
Description copied from class:SyntaxClassGenerate Java code for this Syntax Class.- Overrides:
toJavaCodein 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
-
buildEvaluation
Description copied from class:ExpressionClassFile coding utility: Build Evaluation Code.- Specified by:
buildEvaluationin classExpression- Parameters:
rightPart- expressioncodeBuilder- the codeBuilder used.
-
buildTextRelation
ClassFile coding utility: Build Text Relation.- Parameters:
codeBuilder- the codeBuiløder to use.
-
toString
- Overrides:
toStringin classExpression
-
writeObject
Description copied from class:SyntaxClassWrite a SyntaxClass object to a AttributeOutputStream.- Overrides:
writeObjectin classSyntaxClass- Parameters:
oupt- the AttributeOutputStream to write to.- Throws:
IOException- if something went wrong.
-
readObject
Read and return an object.- Parameters:
inpt- the AttributeInputStream to read from- Returns:
- the object read from the stream.
- Throws:
IOException- if something went wrong.
-