C# Class Axiom.Scripting.Compiler.ScriptCompilerListener

This is a listener for the compiler. The compiler can be customized with this listener. It lets you listen in on events occuring during compilation, hook them, and change the behavior.
Show file Open project: WolfgangSt/axiom

Public Methods

Method Description
HandleError ( ScriptCompiler compiler, ScriptCompiler err ) : void

Called when an error occurred

HandleEvent ( ScriptCompiler compiler, ScriptCompilerEvent &evt, object &retVal ) : bool

Called when an event occurs during translation, return true if handled

This function is called from the translators when an event occurs that that can be responded to. Often this is overriding names, or it can be a request for custom resource creation.

ImportFile ( ScriptCompiler compiler, String name ) : IList

Returns the concrete node list from the given file

PostConversion ( ScriptCompiler compiler, IList nodes ) : bool

Allows vetoing of continued compilation after the entire AST conversion process finishes

Once the script is turned completely into an AST, including import and override handling, this function allows a listener to exit the compilation process.

PreConversion ( ScriptCompiler compiler, IList nodes ) : void

Allows for responding to and overriding behavior before a CST is translated into an AST

Method Details

HandleError() public method

Called when an error occurred
public HandleError ( ScriptCompiler compiler, ScriptCompiler err ) : void
compiler ScriptCompiler A reference to the compiler
err ScriptCompiler
return void

HandleEvent() public method

Called when an event occurs during translation, return true if handled
This function is called from the translators when an event occurs that that can be responded to. Often this is overriding names, or it can be a request for custom resource creation.
public HandleEvent ( ScriptCompiler compiler, ScriptCompilerEvent &evt, object &retVal ) : bool
compiler ScriptCompiler A reference to the compiler
evt ScriptCompilerEvent The event object holding information about the event to be processed
retVal object A possible return value from handlers
return bool

ImportFile() public method

Returns the concrete node list from the given file
public ImportFile ( ScriptCompiler compiler, String name ) : IList
compiler ScriptCompiler A reference to the compiler
name String
return IList

PostConversion() public method

Allows vetoing of continued compilation after the entire AST conversion process finishes
Once the script is turned completely into an AST, including import and override handling, this function allows a listener to exit the compilation process.
public PostConversion ( ScriptCompiler compiler, IList nodes ) : bool
compiler ScriptCompiler A reference to the compiler
nodes IList
return bool

PreConversion() public method

Allows for responding to and overriding behavior before a CST is translated into an AST
public PreConversion ( ScriptCompiler compiler, IList nodes ) : void
compiler ScriptCompiler A reference to the compiler
nodes IList
return void