BadScript 2
Loading...
Searching...
No Matches
BadMemberAccessExpressionCompiler.cs
Go to the documentation of this file.
3
5
9public class BadMemberAccessExpressionCompiler : BadExpressionCompiler<BadMemberAccessExpression>
10{
12 public override void Compile(BadExpressionCompileContext context, BadMemberAccessExpression expression)
13 {
14 foreach (BadExpression? parameter in expression.GenericArguments)
15 {
16 context.Compile(parameter);
17 }
18 context.Compile(expression.Left);
19 if (expression.NullChecked)
20 {
21 context.Emit(BadOpCode.LoadMemberNullChecked, expression.Position, expression.Right.Text, expression.GenericArguments.Count);
22 }
23 else
24 {
25 context.Emit(BadOpCode.LoadMember, expression.Position, expression.Right.Text, expression.GenericArguments.Count);
26 }
27 }
28}
Implements the Member Access to set or get properties from an object. LEFT.RIGHT.
Base Implementation for all Expressions used inside the Script.
override void Compile(BadExpressionCompileContext context, BadMemberAccessExpression expression)
Contains the Access Expressions for the BadScript2 Language.
Contains the Expressions for the BadScript2 Language.
BadOpCode
Defines the Operations that the BadVirtualMachine can execute.
Definition BadOpCode.cs:7