Package icyllis.arc3d.compiler

# Class Context

java.lang.Object
icyllis.arc3d.compiler.Context

public final class Context extends Object
Contains objects and state associated with `ShaderCompiler` (i.e. `Parser` or CodeGenerator).

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Expression`
  `convertIdentifier(int position, String name)`
  Create expressions with the given identifier name and current symbol table.
  `void`
  `enterScope()`
  Enters a scope level.
  `void`
  `error(int start, int end, String msg)`
  `void`
  `error(int position, String msg)`
  `ErrorHandler`
  `getErrorHandler()`
  Returns the ErrorHandler which will be notified of any errors that occur during DSL calls.
  `ShaderKind`
  `getKind()`
  `CompileOptions`
  `getOptions()`
  `SymbolTable`
  `getSymbolTable()`
  Returns the current SymbolTable.
  `BuiltinTypes`
  `getTypes()`
  Returns the BuiltinTypes used by DSL operations in the current thread.
  `boolean`
  `isActive()`
  Returns true if the DSL has been started.
  `boolean`
  `isBuiltin()`
  `boolean`
  `isModule()`
  `void`
  `leaveScope()`
  Leaves a scope level.
  `void`
  `setErrorHandler(ErrorHandler errorHandler)`
  Installs an ErrorHandler which will be notified of any errors that occur during DSL calls.
  `void`
  `warning(int start, int end, String msg)`
  `void`
  `warning(int position, String msg)`

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

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

- ## Method Details

  - ### isActive

    public boolean isActive()
    Returns true if the DSL has been started.

  - ### getKind

    public ShaderKind getKind()

  - ### getOptions

    public CompileOptions getOptions()

  - ### isBuiltin

    public boolean isBuiltin()
    Returns:
      true if we are at built-in level

  - ### isModule

    public boolean isModule()
    Returns:
      true if we are processing include files

  - ### getTypes

    public BuiltinTypes getTypes()
    Returns the BuiltinTypes used by DSL operations in the current thread.

  - ### getSymbolTable

    public SymbolTable getSymbolTable()
    Returns the current SymbolTable.

  - ### enterScope

    public void enterScope()
    Enters a scope level.

  - ### leaveScope

    public void leaveScope()
    Leaves a scope level.

  - ### error

    public void error(int position, String msg)

  - ### error

    public void error(int start, int end, String msg)

  - ### warning

    public void warning(int position, String msg)

  - ### warning

    public void warning(int start, int end, String msg)

  - ### getErrorHandler

    public ErrorHandler getErrorHandler()
    Returns the ErrorHandler which will be notified of any errors that occur during DSL calls. The default error handler throws RuntimeException on any error.

  - ### setErrorHandler

    public void setErrorHandler(ErrorHandler errorHandler)
    Installs an ErrorHandler which will be notified of any errors that occur during DSL calls.

  - ### convertIdentifier

    @Nullable public Expression convertIdentifier(int position, String name)
    Create expressions with the given identifier name and current symbol table. Report errors via `ErrorHandler`; return null on error.