Package icyllis.arc3d.compiler.tree

# Class Variable

java.lang.Object
icyllis.arc3d.compiler.tree.Node
icyllis.arc3d.compiler.tree.Symbol
icyllis.arc3d.compiler.tree.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.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.arc3d.compiler.tree.Node

  `Node.ElementKind, Node.ExpressionKind, Node.StatementKind, Node.SymbolKind`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final byte`
  `kGlobal_Storage`
  `static final byte`
  `kLocal_Storage`
  `static final byte`
  `kParameter_Storage`

  ### Fields inherited from class icyllis.arc3d.compiler.tree.Node

  `mPosition`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Variable(int position, Modifiers modifiers, Type type, String name, byte storage, boolean builtin)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Variable`
  `convert(Context context, int pos, Modifiers modifiers, Type type, String name, byte storage)`
  `GlobalVariableDecl`
  `getGlobalVariableDecl()`
  `InterfaceBlock`
  `getInterfaceBlock()`
  `Node.SymbolKind`
  `getKind()`
  `Modifiers`
  `getModifiers()`
  `byte`
  `getStorage()`
  `Type`
  `getType()`
  `VariableDecl`
  `getVariableDecl()`
  `Expression`
  `initialValue()`
  `boolean`
  `isBuiltin()`
  `static Variable`
  `make(int pos, Modifiers modifiers, Type type, String name, byte storage, boolean builtin)`
  `void`
  `setGlobalVariableDecl(GlobalVariableDecl globalDecl)`
  `void`
  `setInterfaceBlock(InterfaceBlock interfaceBlock)`
  `void`
  `setVariableDecl(VariableDecl decl)`
  `String`
  `toString()`

  ### Methods inherited from class icyllis.arc3d.compiler.tree.Symbol

  `accept, getName, setName`

  ### Methods inherited from class icyllis.arc3d.compiler.tree.Node

  `getEndOffset, getStartOffset`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### kLocal_Storage

    public static final byte kLocal_Storage
    See Also:
      - Constant Field Values

  - ### kGlobal_Storage

    public static final byte kGlobal_Storage
    See Also:
      - Constant Field Values

  - ### kParameter_Storage

    public static final byte kParameter_Storage
    See Also:
      - Constant Field Values

- ## 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:
      - `Node.SymbolKind`

  - ### 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