BadScript 2
Loading...
Searching...
No Matches
BadNullCoalescingExpressionCompiler.cs
Go to the documentation of this file.
2
4
8public class BadNullCoalescingExpressionCompiler : BadExpressionCompiler<BadNullCoalescingExpression>
9{
11 public override void Compile(BadExpressionCompileContext context, BadNullCoalescingExpression expression)
12 {
13 context.Compile(expression.Left);
14 context.Emit(BadOpCode.Dup, expression.Position);
15 int jend = context.EmitEmpty();
16 context.Emit(BadOpCode.Pop, expression.Position);
17 context.Compile(expression.Right);
18 context.ResolveEmpty(jend, BadOpCode.JumpRelativeIfNotNull, expression.Position, context.InstructionCount - jend - 1);
19 }
20}
Implements the Null Coalescing Expression LEFT ?? RIGHT.
BadSourcePosition Position
The source Position of the Expression.
BadExpression Right
Right side of the Expression.
override void Compile(BadExpressionCompileContext context, BadNullCoalescingExpression expression)
Contains the Access Expressions for the BadScript2 Language.
BadOpCode
Defines the Operations that the BadVirtualMachine can execute.
Definition BadOpCode.cs:7
void ResolveEmpty(int index, BadOpCode code, BadSourcePosition position, params object[] args)