Module Simula

Class AssignmentOperation


public final class AssignmentOperation extends Expression
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 Details

    • lhs

      private Expression lhs
      The left hand side
    • opr

      private final KeyWord opr
      The arithmetic operation
    • rhs

      private Expression rhs
      The right hand side
    • textValueAssignment

      private boolean textValueAssignment
      Indicates that this assignment is a text value assignment.
  • Constructor Details

    • AssignmentOperation

      public AssignmentOperation(Expression lhs, KeyWord opr, Expression rhs)
      AssignmentOperation.
      Parameters:
      lhs - the left hand side
      opr - the operation
      rhs - 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 class SyntaxClass
    • maybeStatement

      public boolean maybeStatement()
      Description copied from class: Expression
      Returns true if this expression may be used as a statement.
      Specified by:
      maybeStatement in class Expression
      Returns:
      true if this expression may be used as a statement
    • toJavaCode

      public String toJavaCode()
      Description copied from class: SyntaxClass
      Generate Java code for this Syntax Class.
      Overrides:
      toJavaCode in class SyntaxClass
      Returns:
      Java code
    • doCodeTextValueAssignment

      private String doCodeTextValueAssignment()
      Coding Utility: Code text value assignment.
      Returns:
      the resulting Java source code
    • doCodeAssignment

      private String 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 dot
      array - the array variable
      rightPart - right part of assignment
      Returns:
      the resulting Java source code
    • toString

      public String toString()
      Overrides:
      toString in class Expression