BadScript 2
Loading...
Searching...
No Matches
BadTableExpressionCompiler.cs
Go to the documentation of this file.
5
7
11public class BadTableExpressionCompiler : BadExpressionCompiler<BadTableExpression>
12{
14 public override void Compile(BadExpressionCompileContext context, BadTableExpression expression)
15 {
16 foreach (KeyValuePair<BadWordToken, BadExpression> kvp in expression.Table.ToArray().Reverse())
17 {
18 context.Emit(BadOpCode.Push, kvp.Key.SourcePosition, (BadObject)kvp.Key.Text);
19 context.Compile(kvp.Value);
20 }
21
22 context.Emit(BadOpCode.TableInit, expression.Position, expression.Length);
23 }
24}
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
override void Compile(BadExpressionCompileContext context, BadTableExpression expression)
Contains the Constant Expressions for the BadScript2 Language.
Contains the Expressions for the BadScript2 Language.
Contains the Reader Tokens for the BadScript2 Language.
Contains the Runtime Objects.
Definition BadArray.cs:10
BadOpCode
Defines the Operations that the BadVirtualMachine can execute.
Definition BadOpCode.cs:7