C# Class Jurassic.Compiler.MethodGenerator

Represents the unit of compilation.
Show file Open project: paulbartrum/jurassic

Public Methods

Method Description
GenerateCode ( ) : void

Generates IL for the script.

Optimize ( ) : void

Optimizes the abstract syntax tree.

Parse ( ) : void

Parses the source text into an abstract syntax tree.

Protected Methods

Method Description
GenerateCode ( ILGenerator generator, OptimizationInfo optimizationInfo ) : void

Generates IL for the script.

GetDelegate ( ) : Type

Retrieves a delegate for the generated method.

GetMethodName ( ) : string

Gets a name for the generated method.

GetParameterTypes ( ) : System.Type[]

Gets an array of types - one for each parameter accepted by the method generated by this context.

GetStackName ( ) : string

Gets a name for the function, as it appears in the stack trace.

MethodGenerator ( ScriptEngine engine, Scope scope, ScriptSource source, Jurassic.Compiler.CompilerOptions options ) : System

Creates a new MethodGenerator instance.

Method Details

GenerateCode() public method

Generates IL for the script.
public GenerateCode ( ) : void
return void

GenerateCode() protected abstract method

Generates IL for the script.
protected abstract GenerateCode ( ILGenerator generator, OptimizationInfo optimizationInfo ) : void
generator ILGenerator The generator to output the CIL to.
optimizationInfo OptimizationInfo Information about any optimizations that should be performed.
return void

GetDelegate() protected method

Retrieves a delegate for the generated method.
protected GetDelegate ( ) : Type
return System.Type

GetMethodName() protected abstract method

Gets a name for the generated method.
protected abstract GetMethodName ( ) : string
return string

GetParameterTypes() protected method

Gets an array of types - one for each parameter accepted by the method generated by this context.
protected GetParameterTypes ( ) : System.Type[]
return System.Type[]

GetStackName() protected method

Gets a name for the function, as it appears in the stack trace.
protected GetStackName ( ) : string
return string

MethodGenerator() protected method

Creates a new MethodGenerator instance.
protected MethodGenerator ( ScriptEngine engine, Scope scope, ScriptSource source, Jurassic.Compiler.CompilerOptions options ) : System
engine ScriptEngine The script engine.
scope Scope The initial scope.
source ScriptSource The source of javascript code.
options Jurassic.Compiler.CompilerOptions Options that influence the compiler.
return System

Optimize() public method

Optimizes the abstract syntax tree.
public Optimize ( ) : void
return void

Parse() public abstract method

Parses the source text into an abstract syntax tree.
public abstract Parse ( ) : void
return void