java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.expression.Expression
simula.compiler.syntaxClass.expression.AssignmentOperation
Assignment Operation.
The Simula assignment statement is for convenience implemented as an assignment operation.
Simula Standard: 4.1 Assignment statements assignment-operation = expression assignment-operator expression assignment-operator = := | :-Link to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Field Summary
Modifier and TypeFieldDescriptionprivate Expression
The left hand sideprivate final KeyWord
The arithmetic operationprivate Expression
The right hand sideprivate boolean
Indicates that this assignment is a text value assignment.Fields inherited from class simula.compiler.syntaxClass.expression.Expression
backLink, type
Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
lineNumber
-
Constructor Summary
ConstructorDescriptionAssignmentOperation
(Expression lhs, KeyWord opr, Expression rhs) AssignmentOperation. -
Method Summary
Modifier and TypeMethodDescriptionprivate String
doAccessRemoteArray
(Expression beforeDot, VariableExpression array, String rightPart) Coding Utility: Code access remote array.void
Perform semantic checking.private String
Coding Utility: Code assignment.private String
Coding Utility: Code text value assignment.boolean
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 arithmetic operation -
rhs
The right hand side -
textValueAssignment
private boolean textValueAssignmentIndicates that this assignment is a text value assignment.
-
-
Constructor Details
-
AssignmentOperation
AssignmentOperation.- Parameters:
lhs
- the left hand sideopr
- the operationrhs
- 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
-
doCodeTextValueAssignment
Coding Utility: Code text value assignment.- Returns:
- the resulting Java source code
-
doCodeAssignment
Coding Utility: Code assignment.- Returns:
- the resulting Java source code
-
doAccessRemoteArray
private String doAccessRemoteArray(Expression beforeDot, VariableExpression array, String rightPart) Coding Utility: Code access remote array.- Parameters:
beforeDot
- expression before dotarray
- the array variablerightPart
- right part of assignment- Returns:
- the resulting Java source code
-
toString
- Overrides:
toString
in classExpression
-