Module Simula

Class BlockStatement


public final class BlockStatement extends Statement
BlockStatement.
 Simula Standard: 4.10 Blocks
 
   block
      = subblock
      | prefixed-block
      
         subblock = BEGIN declaration { ; declaration } ; statement { ; statement } END
         
         prefixed-block
            = block-prefix main-block
            
            block-prefix
               = class-identifier [ actual-parameter-part ]
               
            main-block
            
               = block
               | BEGIN statement { ; statement } END
 
Link to GitHub: Source File.
Author:
SIMULA Standards Group, Øystein Myhre Andersen
  • Field Details

    • blockDeclaration

      private final BlockDeclaration blockDeclaration
      The associated block declaration.
  • Constructor Details

    • BlockStatement

      public BlockStatement(BlockDeclaration blockDeclaration)
      Create a new BlockStatement.
      Parameters:
      blockDeclaration - the BlockDeclaration
  • Method Details

    • isCompoundStatement

      boolean isCompoundStatement()
      Check if this BlockStatement is a CompoundStatement.
      Returns:
      true if this BlockStatement is a CompoundStatement
    • doChecking

      public void doChecking()
      Description copied from class: SyntaxClass
      Perform semantic checking.

      This must be redefined in every subclass.

      Overrides:
      doChecking in class SyntaxClass
    • addLeadingLabel

      void addLeadingLabel(String labelcode)
      Add a leading label to this BlockStatement.
      Parameters:
      labelcode - the label code
    • doJavaCoding

      public void doJavaCoding()
      Description copied from class: SyntaxClass
      Output Java code.
      Overrides:
      doJavaCoding in class Statement
    • print

      public void print(int indent)
      Description copied from class: SyntaxClass
      Utility print method.
      Overrides:
      print in class SyntaxClass
      Parameters:
      indent - number of spaces leading the line
    • printTree

      public void printTree(int indent)
      Description copied from class: SyntaxClass
      Utility print syntax tree method.
      Overrides:
      printTree in class SyntaxClass
      Parameters:
      indent - number of spaces leading the lines
    • toString

      public String toString()
      Overrides:
      toString in class Object