Class InspectVariableDeclaration


public class InspectVariableDeclaration extends Declaration

InspectVariable Declaration.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

  • Constructor Details

    • InspectVariableDeclaration

      public InspectVariableDeclaration(Type type, String identifier, DeclarationScope connectionScope, ConnectionStatement connectionStatement)
      Create a new InspectVariableDeclaration.
      Parameters:
      type - the variable type
      identifier - the variable identifier
      connectionScope - the connectionScope
      connectionStatement - the connectionStatement
    • InspectVariableDeclaration

      public InspectVariableDeclaration()
      Default constructor used by Attribute File I/O
  • 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
    • toJavaCode

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

      public FieldRefEntry getFieldRefEntry(ConstantPoolBuilder pool)
      ClassFile coding utility: get FieldRefEntry of this InspectVariable.
      Parameters:
      pool - the ConstantPoolBuilder to use.
      Returns:
      the FieldRefEntry of this InspectVariable.
    • getFieldIdentifier

      public String getFieldIdentifier()
      Description copied from class: Declaration
      ClassFile coding utility: get getFieldIdentifier.
      Overrides:
      getFieldIdentifier in class Declaration
      Returns:
      the resulting String.
    • buildDeclaration

      public void buildDeclaration(ClassBuilder classBuilder, BlockDeclaration encloser)
      Description copied from class: Declaration
      Output Java ByteCode. Treat Declaration.
      Overrides:
      buildDeclaration in class Declaration
      Parameters:
      classBuilder - the classBuilder to use.
      encloser - the owning block.
    • buildInitAttribute

      public void buildInitAttribute(CodeBuilder codeBuilder)
      Description copied from class: Declaration
      Output Java ByteCode. Build init code for an Attribute.
      Overrides:
      buildInitAttribute in class Declaration
      Parameters:
      codeBuilder - the codeBuilder to use.
    • printTree

      public void printTree(int indent, Object head)
      Description copied from class: SyntaxClass
      Utility print syntax tree method.
      Overrides:
      printTree in class SyntaxClass
      Parameters:
      indent - number of spaces leading the lines
      head - the head of the tree.
    • 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 InspectVariableDeclaration readObject(AttributeInputStream inpt) throws IOException
      Read and return an InspectVariableDeclaration object.
      Parameters:
      inpt - the AttributeInputStream to read from
      Returns:
      the object read from the stream.
      Throws:
      IOException - if something went wrong.