BadScript 2
Loading...
Searching...
No Matches
BadBinaryExpressionCompiler.cs
Go to the documentation of this file.
2
4
10 where T : BadBinaryExpression
11{
15 protected virtual bool IsLeftAssociative => true;
16
20 protected virtual bool EmitLeft => true;
21
25 protected virtual bool EmitRight => true;
26
33 public abstract void CompileBinary(BadExpressionCompileContext context, T expression);
34
36 public override void Compile(BadExpressionCompileContext context, T expression)
37 {
39 {
40 if (EmitLeft)
41 {
42 context.Compile(expression.Left);
43 }
44
45 if (EmitRight)
46 {
47 context.Compile(expression.Right);
48 }
49 }
50 else
51 {
52 if (EmitRight)
53 {
54 context.Compile(expression.Right);
55 }
56
57 if (EmitLeft)
58 {
59 context.Compile(expression.Left);
60 }
61 }
62 CompileBinary(context, expression);
63 }
64}
Base Implementation of all Binary Expressions.
void CompileBinary(BadExpressionCompileContext context, T expression)
Compiles a Binary Expression.
Contains the Binary Expressions for the BadScript2 Language.