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
19 context.Compile(expression.Left);
20
21 if (expression.NullChecked)
22 {
23 context.Emit(BadOpCode.LoadMemberNullChecked,
24 expression.Position,
25 expression.Right.Text,
26 expression.GenericArguments.Count
27 );
28 }
29 else
30 {
31 context.Emit(BadOpCode.LoadMember,
32 expression.Position,
33 expression.Right.Text,
34 expression.GenericArguments.Count
35 );
36 }
37 }
38}
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