Class Declarator

All Implemented Interfaces:
Serializable, TokenId

public class Declarator extends ASTList implements TokenId
Variable declarator.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      default serialVersionUID
      See Also:
    • varType

      protected int varType
    • arrayDim

      protected int arrayDim
    • localVar

      protected int localVar
    • qualifiedClass

      protected String qualifiedClass
  • Constructor Details

    • Declarator

      public Declarator(int type, int dim)
    • Declarator

      public Declarator(ASTList className, int dim)
    • Declarator

      public Declarator(int type, String jvmClassName, int dim, int var, Symbol sym)
  • Method Details

    • make

      public Declarator make(Symbol sym, int dim, ASTree init)
    • getType

      public int getType()
    • getArrayDim

      public int getArrayDim()
    • addArrayDim

      public void addArrayDim(int d)
    • getClassName

      public String getClassName()
    • setClassName

      public void setClassName(String s)
    • getVariable

      public Symbol getVariable()
    • setVariable

      public void setVariable(Symbol sym)
    • getInitializer

      public ASTree getInitializer()
    • setLocalVar

      public void setLocalVar(int n)
    • getLocalVar

      public int getLocalVar()
    • getTag

      public String getTag()
      Description copied from class: ASTree
      Returns the type of this node. This method is used by toString().
      Overrides:
      getTag in class ASTree
    • accept

      public void accept(Visitor v) throws CompileError
      Description copied from class: ASTree
      Is a method for the visitor pattern. It calls atXXX() on the given visitor, where XXX is the class name of the node object.
      Overrides:
      accept in class ASTList
      Throws:
      CompileError
    • astToClassName

      public static String astToClassName(ASTList name, char sep)
    • astToClassName

      private static void astToClassName(StringBuilder sbuf, ASTList name, char sep)