BadScript 2
Loading...
Searching...
No Matches
BadArrayAccessExpressionCompiler.cs
Go to the documentation of this file.
2
7
11public class BadArrayAccessExpressionCompiler : BadExpressionCompiler<BadArrayAccessExpression>
12{
14 public override void Compile(BadExpressionCompileContext context, BadArrayAccessExpression expression)
15 {
16 context.Compile(expression.Arguments);
17 context.Compile(expression.Left);
18 if (expression.NullChecked)
19 {
20 context.Emit(BadOpCode.LoadArrayAccessNullChecked, expression.Position, expression.ArgumentCount);
21 }
22 else
23 {
24 context.Emit(BadOpCode.LoadArrayAccess, expression.Position, expression.ArgumentCount);
25 }
26 }
27}
Implements the Array Access to set or get properties from an object. LEFT[RIGHT].
IEnumerable< BadExpression > Arguments
The Arguments of the Array Access.
bool NullChecked
Indicates if the expression will be null-checked by the runtime.
BadSourcePosition Position
The source Position of the Expression.
override void Compile(BadExpressionCompileContext context, BadArrayAccessExpression expression)
Contains the Access Expressions for the BadScript2 Language.
BadOpCode
Defines the Operations that the BadVirtualMachine can execute.
Definition BadOpCode.cs:7