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

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

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

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

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

      public Modifiers getModifiers()
    • getBaseType

      public @NonNull Type getBaseType()
    • getArraySize

      public int getArraySize()
    • isBuiltin

      public boolean isBuiltin()
    • getStorage

      public byte getStorage()
    • initialValue

      public @Nullable Expression initialValue()
    • getDeclaration

      public @Nullable VariableDeclaration getDeclaration()
    • getGlobalVariable

      public @Nullable GlobalVariable getGlobalVariable()
    • setDeclaration

      public void setDeclaration(VariableDeclaration decl)
    • setGlobalVariable

      public void setGlobalVariable(GlobalVariable global)
    • getInterfaceBlock

      public @Nullable InterfaceBlock getInterfaceBlock()
    • setInterfaceBlock

      public void setInterfaceBlock(InterfaceBlock interfaceBlock)
    • toString

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