Class ForListElement

java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.statement.ForListElement
Direct Known Subclasses:
ForWhileElement, StepUntilElement

public class ForListElement extends SyntaxClass
Utility class ForListElement implementing a single value element.
  • Field Details

  • Constructor Details

    • ForListElement

      public ForListElement(ForStatement forStatement, Expression expr1)
      Create a new ForListElement.
      Parameters:
      forStatement - the ForStatement
      expr1 - The first expression
    • ForListElement

      protected ForListElement()
      Default constructor used by Attribute File I/O
  • Method Details

    • doChecking

      public void doChecking()
      Perform semantic checking.
      Overrides:
      doChecking in class SyntaxClass
    • edCode

      public String edCode(String classIdent, Type xType)
      Edit Java source code for this ForListElement.
      Parameters:
      classIdent - Java class identifier
      xType - control variable's type
      Returns:
      the resulting Java source code for this ForListElement
    • isOptimisable

      public ForListElement isOptimisable()
      Checks if this ForListElement can be optimized.
      Returns:
      this ForListElement if it can be optimized
    • doSimplifiedJavaCoding

      public void doSimplifiedJavaCoding()
      Perform simplified JavaCoding.
    • doSingleElementByteCoding

      public void doSingleElementByteCoding(CodeBuilder codeBuilder)
      Build SingleElement ByteCoding
      Parameters:
      codeBuilder - the codeBuilder to use.
    • buildByteCode

      public void buildByteCode(CodeBuilder codeBuilder, VariableExpression controlVariable)
      Build byte code.
      Parameters:
      codeBuilder - the codeBuilder to use.
      controlVariable - the ForStatement's controlVariable.
    • toString

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

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

      public static ForListElement 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.