Inherits GCompileTools, and GScriptUtils.
Public Member Functions | |
bool | Asm0 (int Tok, uint8 Op) |
Assemble a zero argument instruction. | |
bool | Asm1 (int Tok, uint8 Op, GVarRef a) |
Assemble one arg instruction. | |
bool | Asm2 (int Tok, uint8 Op, GVarRef a, GVarRef b) |
Assemble two arg instruction. | |
bool | Asm3 (int Tok, uint8 Op, GVarRef a, GVarRef b, GVarRef c) |
Assemble three arg instruction. | |
bool | Asm4 (int Tok, uint8 Op, GVarRef a, GVarRef b, GVarRef c, GVarRef d) |
Assemble four arg instruction. | |
bool | Lex (char *Source, char *FileName) |
Convert the source from one big string into an array of tokens. | |
void | AllocNull (GVarRef &r) |
Create a null var ref. | |
void | AllocConst (GVarRef &r, double d) |
Allocate a constant double. | |
void | AllocConst (GVarRef &r, int i) |
Allocate a constant int. | |
void | AllocConst (GVarRef &r, char *s, int len=-1) |
Allocate a constant string. | |
void | AllocConst (GVarRef &r, char16 *s, int len) |
Allocate a constant wide string. | |
GVarRef | FindVariable (GVariant &Name, bool Create) |
Find a variable by name, creating it if needed. | |
bool | AssignVarRef (Node &n, GVarRef &Value) |
Build asm to assign a var ref. | |
bool | TokenToVarRef (Node &n) |
Convert a token stream to a var ref. | |
bool | Expression (int &Cur, GArray< Node > &n, int Depth=0) |
Parse expression into a node tree. | |
bool | AllocReg (GVarRef &r, char *file, int line) |
Allocate a register (must be mirrored with DeallocReg). | |
bool | DeallocReg (GVarRef &r) |
Deallocate a register. | |
int | RegAllocCount () |
Count allocated registers. | |
bool | AsmExpression (GVarRef *Result, GArray< Node > &n, int Depth=0) |
Creates byte code to evaluate an expression. | |
bool | DoExpression (int &Cur, GVarRef *Result) |
Parses and assembles an expression. | |
bool | DoStatements (int &Cur, bool MoreThanOne=true) |
Parses statements. | |
bool | DoIf (int &Cur) |
Parses if/else if/else construct. | |
bool | DoWhile (int &Cur) |
Parses while construct. | |
bool | DoFor (int &Cur) |
Parses for construct. | |
bool | DoReturn (int &Cur) |
Compiles return construct. | |
bool | DoStruct (int &Cur) |
Compiles struct construct. | |
bool | Compile () |
Compiler entry point. |
Creates byte code to evaluate an expression.
Result | Where the result got stored |
n | The nodes to create code for |
Depth | The depth of recursion |
References GArray< Type >::DeleteAt(), GV_STRING, GArray< Type >::Length(), GVariant::Str(), GVariant::String, GVariant::Type, GVarRef::Valid(), and GVariant::Value.