Package icyllis.arc3d.compiler

# Class TranslationUnit

java.lang.Object
icyllis.arc3d.compiler.tree.Node
icyllis.arc3d.compiler.TranslationUnit

All Implemented Interfaces:
  `Iterable<TopLevelElement>`

public final class TranslationUnit extends Node implements Iterable<TopLevelElement>
A fully-resolved AST of a single shader executable, ready for code generation.

- ## 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 inherited from class icyllis.arc3d.compiler.tree.Node

  `mPosition`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TranslationUnit(char[] source, int sourceOffset, int sourceLength, ShaderKind kind, CompileOptions options, BuiltinTypes types, SymbolTable symbolTable, ArrayList<TopLevelElement> uniqueElements, List<Map.Entry<String,String>> extensions)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `accept(TreeVisitor visitor)`
  Visit this AST with a given visitor.
  `List<Map.Entry<String,String>>`
  `getExtensions()`
  A list of (extension_name, behavior) pairs.
  `ShaderKind`
  `getKind()`
  `CompileOptions`
  `getOptions()`
  `ArrayList<TopLevelElement>`
  `getSharedElements()`
  `char[]`
  `getSource()`
  `int`
  `getSourceLength()`
  `int`
  `getSourceOffset()`
  `SymbolTable`
  `getSymbolTable()`
  `BuiltinTypes`
  `getTypes()`
  `ArrayList<TopLevelElement>`
  `getUniqueElements()`
  `SymbolUsage`
  `getUsage()`
  `Iterator<TopLevelElement>`
  `iterator()`
  `String`
  `toString()`

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

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### TranslationUnit

    public TranslationUnit(char[] source, int sourceOffset, int sourceLength, ShaderKind kind, CompileOptions options, BuiltinTypes types, SymbolTable symbolTable, ArrayList<TopLevelElement> uniqueElements, List<Map.Entry<String,String>> extensions)

- ## Method Details

  - ### getSource

    public char[] getSource()

  - ### getSourceOffset

    public int getSourceOffset()

  - ### getSourceLength

    public int getSourceLength()

  - ### getKind

    public ShaderKind getKind()

  - ### getOptions

    public CompileOptions getOptions()

  - ### getTypes

    public BuiltinTypes getTypes()

  - ### getSymbolTable

    public SymbolTable getSymbolTable()

  - ### getUniqueElements

    public ArrayList<TopLevelElement> getUniqueElements()

  - ### getSharedElements

    public ArrayList<TopLevelElement> getSharedElements()

  - ### getExtensions

    public List<Map.Entry<String,String>> getExtensions()
    A list of (extension_name, behavior) pairs. This list is mutable, you can add or remove elements.

  - ### getUsage

    public SymbolUsage getUsage()

  - ### iterator

    @Nonnull public Iterator<TopLevelElement> iterator()
    Specified by:
      `iterator` in interface `Iterable<TopLevelElement>`

  - ### accept

    public boolean accept(@Nonnull TreeVisitor visitor)
    Description copied from class: `Node`
    Visit this AST with a given visitor.
    Specified by:
      `accept` in class `Node`
    Returns:
      true to stop recursion and propagate true up the stack, false to continue

  - ### toString

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