BadScript 2
Loading...
Searching...
No Matches
BadLogicAssignOrExpressionCompiler.cs
Go to the documentation of this file.
2
4
8public class BadLogicAssignOrExpressionCompiler : BadBinaryExpressionCompiler<BadLogicAssignOrExpression>
9{
11 protected override bool EmitLeft => false;
12
14 protected override bool EmitRight => false;
15
18 {
19 context.Compile(expression.Left);
20 context.Emit(BadOpCode.Dup, expression.Position);
21 int jumpPos = context.EmitEmpty();
22 context.Compile(expression.Right);
23 context.Emit(BadOpCode.Assign, expression.Position);
24 context.ResolveEmpty(jumpPos, BadOpCode.JumpRelativeIfTrue, expression.Position, context.InstructionCount - jumpPos - 1);
25 }
26}
BadSourcePosition Position
The source Position of the Expression.
BadExpression Right
Right side of the Expression.
override void CompileBinary(BadExpressionCompileContext context, BadLogicAssignOrExpression expression)
Contains the Self-Assigning Logic 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)