Module Simula

Class RelationalOperation


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

    • lhs

      private Expression lhs
      The left hand side
    • opr

      private final KeyWord opr
      The relational operation
    • rhs

      private Expression rhs
      The right hand side
  • Constructor Details

    • RelationalOperation

      RelationalOperation(Expression lhs, KeyWord opr, Expression rhs)
      Create a new RelationalOperation.
      Parameters:
      lhs - the left hand side
      opr - the relation
      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
    • doCodeTextValueRelation

      private String doCodeTextValueRelation()
      Coding Utility: Code text value relation
      Returns:
      the resulting Java source code
    • doCodeTextRefRelation

      private String doCodeTextRefRelation()
      Coding Utility: Code text reference relation
      Returns:
      the resulting Java source code
    • toString

      public String toString()
      Overrides:
      toString in class Expression