C# Class Axiom.Scripting.Compiler.ScriptCompiler

This is the main class for the compiler. It calls the parser and processes the CST into an AST and then uses translators to translate the AST into the final resources.
Show file Open project: mono-soc-2011/axiom Class Usage Examples

Public Methods

Method Description
Compile ( IList nodes, string group ) : bool
Compile ( IList nodes, string group, bool doImports ) : bool
Compile ( IList nodes, string group, bool doImports, bool doObjects ) : bool
Compile ( IList nodes, string group, bool doImports, bool doObjects, bool doVariables ) : bool

Compiles the given abstract syntax tree

Compile ( String script, String source, String group ) : bool

Takes in a string of script code and compiles it into resources

ScriptCompiler ( ) : System

Private Methods

Method Description
AddError ( CompileErrorCode code, string file, uint line ) : void
AddError ( CompileErrorCode code, string file, uint line, string msg ) : void

Adds the given error to the compiler's list of errors

Compile ( IList nodes, string group ) : bool

Compiles resources from the given concrete node list

InitializeWordMap ( ) : void
_convertToAST ( IList nodes ) : IList
_fireEvent ( ScriptCompilerEvent &evt ) : bool
_fireEvent ( ScriptCompilerEvent &evt, object &retVal ) : bool

Internal method for firing the handleEvent method

_isNameExcluded ( string cls, AbstractNode parent ) : bool

Returns true if the given class is name excluded

_loadImportPath ( string name ) : IList

Loads the requested script and converts it to an AST

_locateTarget ( IList nodes, string target ) : List

Returns the abstract nodes from the given tree which represent the target

_overlayObject ( AbstractNode source, Axiom.Scripting.Compiler.AST.ObjectAbstractNode dest ) : void
_processImports ( IList &nodes ) : void

This built-in function processes import nodes

_processObjects ( IList &nodes, IList top ) : void

Handles object inheritance and variable expansion

_processVariables ( IList &nodes ) : void

Handles processing the variables

Method Details

Compile() public method

public Compile ( IList nodes, string group ) : bool
nodes IList
group string
return bool

Compile() public method

public Compile ( IList nodes, string group, bool doImports ) : bool
nodes IList
group string
doImports bool
return bool

Compile() public method

public Compile ( IList nodes, string group, bool doImports, bool doObjects ) : bool
nodes IList
group string
doImports bool
doObjects bool
return bool

Compile() public method

Compiles the given abstract syntax tree
public Compile ( IList nodes, string group, bool doImports, bool doObjects, bool doVariables ) : bool
nodes IList
group string
doImports bool
doObjects bool
doVariables bool
return bool

Compile() public method

Takes in a string of script code and compiles it into resources
public Compile ( String script, String source, String group ) : bool
script String The script code
source String The source of the script code (e.g. a script file)
group String The resource group to place the compiled resources into
return bool

ScriptCompiler() public method

public ScriptCompiler ( ) : System
return System