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