C# Class Blamite.Blam.Scripting.Compiler.ScriptCompiler

Inheritance: HS_Gen1BaseListener
Show file Open project: XboxChaos/Assembly

Public Methods

Method Description
EnterBranch ( HS_Gen1Parser.BranchContext context ) : void
EnterCall ( HS_Gen1Parser.CallContext context ) : void

Processes function calls and script references. Links to a datum. Opens one or more datums. Pops a value type. Pushes parameter types.

EnterCond ( HS_Gen1Parser.CondContext context ) : void
EnterCondGroup ( HS_Gen1Parser.CondGroupContext context ) : void
EnterGlobalDeclaration ( HS_Gen1Parser.GlobalDeclarationContext context ) : void

Processes global declarations. Opens a datum. Creates the global node. Pushes the value type.

EnterHsc ( HS_Gen1Parser.HscContext context ) : void

Generate script and global lookups.

EnterLiteral ( HS_Gen1Parser.LiteralContext context ) : void

Processes regular expressions, script variables and global references. Links to a datum. Opens a datum.

EnterScriptDeclaration ( HS_Gen1Parser.ScriptDeclarationContext context ) : void

Processes script declarations. Opens a datum. Creates the script node and the initial "begin" expression. Generates the variable lookup. Pushes return types.

ExitBranch ( HS_Gen1Parser.BranchContext context ) : void
ExitCall ( HS_Gen1Parser.CallContext context ) : void

Closes a datum.

ExitCond ( HS_Gen1Parser.CondContext context ) : void
ExitCondGroup ( HS_Gen1Parser.CondGroupContext context ) : void
ExitGlobalDeclaration ( HS_Gen1Parser.GlobalDeclarationContext context ) : void

Closes a datum.

ExitHsc ( HS_Gen1Parser.HscContext context ) : void

Output Debug Info

ExitScriptDeclaration ( HS_Gen1Parser.ScriptDeclarationContext context ) : void

Closes a datum.

Result ( ) : ScriptData
ScriptCompiler ( ICacheFile casheFile, EngineDescription buildInfo, OpcodeLookup opCodes, ScriptingContextCollection context, IProgress progress, ScriptCompilerLogger logger, bool debug ) : System

Private Methods

Method Description
CreateFunctionCall ( FunctionInfo info, ushort returnTypeOpcode, uint textPosition, short lineNumber ) : void
CreateInitialBegin ( string returnType, uint textPosition ) : void
CreateScriptReference ( Blamite.Blam.Scripting.Compiler.ScriptInfo info, ushort returnTypeOpcode, uint textPosition, short lineNumber ) : void
DetermineReturnType ( IScriptingConstantInfo info, string expectedType, ParserRuleContext context ) : string
GenerateBranches ( ) : void
GetEqualityArgumentOP ( ushort normalOpcode ) : ushort
GetGlobalOpCode ( ushort globalOpcode, RuleContext context ) : ushort
IsGlobalsReference ( string expectedType, ParserRuleContext context ) : bool
IsScriptParameter ( string expectedReturnType, ParserRuleContext context ) : bool
IsScriptReference ( string expectedReturnType, int expectedParameterCount, HS_Gen1Parser.CallContext context ) : bool
PushCallParameters ( FunctionInfo info, int contextParameterCount, string expectedReturnType, HS_Gen1Parser.CallContext context ) : void

Calculates the value types for the parameters of a function and pushes them to the stack.

Method Details

EnterBranch() public method

public EnterBranch ( HS_Gen1Parser.BranchContext context ) : void
context HS_Gen1Parser.BranchContext
return void

EnterCall() public method

Processes function calls and script references. Links to a datum. Opens one or more datums. Pops a value type. Pushes parameter types.
public EnterCall ( HS_Gen1Parser.CallContext context ) : void
context HS_Gen1Parser.CallContext
return void

EnterCond() public method

public EnterCond ( HS_Gen1Parser.CondContext context ) : void
context HS_Gen1Parser.CondContext
return void

EnterCondGroup() public method

public EnterCondGroup ( HS_Gen1Parser.CondGroupContext context ) : void
context HS_Gen1Parser.CondGroupContext
return void

EnterGlobalDeclaration() public method

Processes global declarations. Opens a datum. Creates the global node. Pushes the value type.
public EnterGlobalDeclaration ( HS_Gen1Parser.GlobalDeclarationContext context ) : void
context HS_Gen1Parser.GlobalDeclarationContext
return void

EnterHsc() public method

Generate script and global lookups.
public EnterHsc ( HS_Gen1Parser.HscContext context ) : void
context HS_Gen1Parser.HscContext
return void

EnterLiteral() public method

Processes regular expressions, script variables and global references. Links to a datum. Opens a datum.
public EnterLiteral ( HS_Gen1Parser.LiteralContext context ) : void
context HS_Gen1Parser.LiteralContext
return void

EnterScriptDeclaration() public method

Processes script declarations. Opens a datum. Creates the script node and the initial "begin" expression. Generates the variable lookup. Pushes return types.
public EnterScriptDeclaration ( HS_Gen1Parser.ScriptDeclarationContext context ) : void
context HS_Gen1Parser.ScriptDeclarationContext
return void

ExitBranch() public method

public ExitBranch ( HS_Gen1Parser.BranchContext context ) : void
context HS_Gen1Parser.BranchContext
return void

ExitCall() public method

Closes a datum.
public ExitCall ( HS_Gen1Parser.CallContext context ) : void
context HS_Gen1Parser.CallContext
return void

ExitCond() public method

public ExitCond ( HS_Gen1Parser.CondContext context ) : void
context HS_Gen1Parser.CondContext
return void

ExitCondGroup() public method

public ExitCondGroup ( HS_Gen1Parser.CondGroupContext context ) : void
context HS_Gen1Parser.CondGroupContext
return void

ExitGlobalDeclaration() public method

Closes a datum.
public ExitGlobalDeclaration ( HS_Gen1Parser.GlobalDeclarationContext context ) : void
context HS_Gen1Parser.GlobalDeclarationContext
return void

ExitHsc() public method

Output Debug Info
public ExitHsc ( HS_Gen1Parser.HscContext context ) : void
context HS_Gen1Parser.HscContext
return void

ExitScriptDeclaration() public method

Closes a datum.
public ExitScriptDeclaration ( HS_Gen1Parser.ScriptDeclarationContext context ) : void
context HS_Gen1Parser.ScriptDeclarationContext
return void

Result() public method

public Result ( ) : ScriptData
return ScriptData

ScriptCompiler() public method

public ScriptCompiler ( ICacheFile casheFile, EngineDescription buildInfo, OpcodeLookup opCodes, ScriptingContextCollection context, IProgress progress, ScriptCompilerLogger logger, bool debug ) : System
casheFile ICacheFile
buildInfo EngineDescription
opCodes OpcodeLookup
context ScriptingContextCollection
progress IProgress
logger ScriptCompilerLogger
debug bool
return System