ASTGen

contains functions and stuff to convert a QScript from tokens to Syntax Trees

Constructors

this
this()

Constructor

Destructor

~this
~this()
Undocumented in source.

Members

Functions

generateAssignmentAST
AssignmentNode generateAssignmentAST(CodeNode lvalue)

generates AST for assignment operator

generateBlockAST
BlockNode generateBlockAST()

generates AST for a {block-of-code}

generateCodeAST
CodeNode generateCodeAST()

generates AST for "actual code" like 2 + 2 - 6.

generateDoWhileAST
DoWhileNode generateDoWhileAST()

generates AST for do-while loops statements

generateEnumAST
EnumNode generateEnumAST()

generates AST for a enum definition

generateForAST
ForNode generateForAST()

generates AST for for loop statements

generateFunctionAST
FunctionNode generateFunctionAST()

generates AST for a function definition

generateFunctionCallAST
FunctionCallNode generateFunctionCallAST()

generates AST for function call, changes index to token after statementEnd

generateIfAST
IfNode generateIfAST()

generates AST for if statements

generateLiteralAST
LiteralNode generateLiteralAST()

generates LiteralNode

generateNegativeNode
NegativeValueNode generateNegativeNode()

generates AST for -x where x is a codenode

generateNodeAST
CodeNode generateNodeAST(CodeNode r)

returns a node representing either of the following: 1. String literal 2. Number literal 3. Function Call (uses generateFunctionCallAST) 4. Variable (uses generateVariableAST) 5. Some code inside parantheses (uses generateCodeAST) 6. A literal array ([x, y, z])

generateOperatorAST
OperatorNode generateOperatorAST(CodeNode firstOperand)

generates AST for operators like +, -...

generateReturnAST
ReturnNode generateReturnAST()

returns a node representing a return statement

generateSOperatorAST
SOperatorNode generateSOperatorAST()

generates AST for single operand operators

generateScriptAST
ScriptNode generateScriptAST(TokenList scriptTokens)

generates an AST representing a script.

generateStatementAST
StatementNode generateStatementAST()

generates AST for one statement

generateStructAST
StructNode generateStructAST()

generates AST for a struct definition

generateVarDeclareAST
VarDeclareNode generateVarDeclareAST()

generates AST for variable declarations

generateVariableAST
VariableNode generateVariableAST()

generates AST for a variable (or array) and changes value of index to the token after variable ends

generateWhileAST
WhileNode generateWhileAST()

generates AST for while statements

Properties

errors
CompileError[] errors [@property getter]

Meta