Class PrefixedBlockDeclaration


public final class PrefixedBlockDeclaration extends ClassDeclaration

Prefixed Block Declaration.

Simula Standard: 4.10.1 Prefixed blocks

 prefixed-block = block-prefix main-block
 
    block-prefix = class-identifier [ actual-parameter-part ]
    
    main-block
       = block
       | compound-statement
       
      actual-parameter-part = "(" actual-parameter { , actual-parameter } ")"
      
         actual-parameter = expression
                          | array-identifier-1
                          | switch-identifier
                          | procedure-identifier-1
         
         compound-statement = BEGIN statement { ; statement } END

Link to GitHub: Source File.

Author:
SIMULA Standards Group, Øystein Myhre Andersen
  • Field Details

  • Constructor Details

    • PrefixedBlockDeclaration

      private PrefixedBlockDeclaration(boolean isMainModule)
      PrefixedBlock.
      Parameters:
      isMainModule - true: this is the main module.
    • PrefixedBlockDeclaration

      private PrefixedBlockDeclaration()
      Private Constructor used by Attribute File I/O.
  • Method Details

    • expectPrefixedBlock

      public static PrefixedBlockDeclaration expectPrefixedBlock(VariableExpression blockPrefix, boolean isMainModule)
      Parse Utility: Expect PrefixedBlockDeclaration
      Parameters:
      blockPrefix - the block prefix
      isMainModule - true if main module
      Returns:
      the resulting PrefixedBlockDeclaration
    • doChecking

      public void doChecking()
      Description copied from class: SyntaxClass

      Perform semantic checking.

      This must be redefined in every subclass.

      Overrides:
      doChecking in class ClassDeclaration
    • doJavaCoding

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

      private void doCodeConstructor()
      Coding Utility: Code the constructor.
    • buildByteCode

      public void buildByteCode(CodeBuilder codeBuilder)
      Description copied from class: SyntaxClass
      Build Java ClassFile ByteCode.
      Overrides:
      buildByteCode in class SyntaxClass
      Parameters:
      codeBuilder - the codeBuilder to use.
    • buildClassFile

      public byte[] buildClassFile()
      Description copied from class: DeclarationScope
      Build Class File
      Overrides:
      buildClassFile in class ClassDeclaration
      Returns:
      Class File bytes
    • print

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

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

      public String toString()
      Overrides:
      toString in class ClassDeclaration
    • writeObject

      public void writeObject(AttributeOutputStream oupt) throws IOException
      Description copied from class: SyntaxClass
      Write a SyntaxClass object to a AttributeOutputStream.
      Overrides:
      writeObject in class ClassDeclaration
      Parameters:
      oupt - the AttributeOutputStream to write to.
      Throws:
      IOException - if something went wrong.
    • readObject

      public static PrefixedBlockDeclaration readObject(AttributeInputStream inpt) throws IOException
      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.