Class Variable


public final class Variable extends Symbol
Represents a variable symbol, whether local, global, or a function parameter. This represents the variable itself (the storage location), which is shared between all VariableReferences which read or write that storage location.
  • Field Details

  • Constructor Details

    • Variable

      public Variable(int position, Modifiers modifiers, Type type, String name, byte storage, boolean builtin)
  • Method Details

    • convert

      @Nonnull public static Variable convert(@Nonnull Context context, int pos, @Nonnull Modifiers modifiers, @Nonnull Type type, @Nonnull String name, byte storage)
    • make

      @Nonnull public static Variable make(int pos, @Nonnull Modifiers modifiers, @Nonnull Type type, @Nonnull String name, byte storage, boolean builtin)
    • getKind

      @Nonnull public Node.SymbolKind getKind()
      Specified by:
      getKind in class Symbol
      See Also:
    • getType

      @Nonnull public Type getType()
      Specified by:
      getType in class Symbol
    • getModifiers

      public Modifiers getModifiers()
    • isBuiltin

      public boolean isBuiltin()
    • getStorage

      public byte getStorage()
    • initialValue

      @Nullable public Expression initialValue()
    • getVariableDecl

      @Nullable public VariableDecl getVariableDecl()
    • getGlobalVariableDecl

      @Nullable public GlobalVariableDecl getGlobalVariableDecl()
    • setVariableDecl

      public void setVariableDecl(VariableDecl decl)
    • setGlobalVariableDecl

      public void setGlobalVariableDecl(GlobalVariableDecl globalDecl)
    • getInterfaceBlock

      @Nullable public InterfaceBlock getInterfaceBlock()
    • setInterfaceBlock

      public void setInterfaceBlock(InterfaceBlock interfaceBlock)
    • toString

      @Nonnull public String toString()
      Specified by:
      toString in class Node
      Returns:
      a string representation of this AST node