32 bool nullChecked =
false) : base(
68 yield
return expression;
75 yield
return descendant;
101 public static IEnumerable<BadObject>
Access(
104 IEnumerable<BadObject> args,
114 throw new BadRuntimeException(
"Array access reverse operator is not a function", position);
119 foreach (
BadObject o
in func.Invoke(args.ToArray(), context!))
146 left = left.Dereference();
155 List<BadObject> args =
new List<BadObject>();
168 args.Add(argObj.Dereference());
Describes a specific position inside a source file.
Contains Static Data for the BadScript Language.
const string ARRAY_ACCESS_REVERSE_OPERATOR_NAME
Implements a simple constant folding optimization.
static BadExpression Optimize(BadExpression expr)
Optimizes the given expression.
Implements the Reverse Array Access to set or get properties from an object. LEFT[^RIGHT].
readonly BadExpression[] m_Arguments
Arguments of the array access.
static IEnumerable< BadObject > Access(BadExecutionContext context, BadObject left, IEnumerable< BadObject > args, BadSourcePosition position)
Executes the Array Access Expression.
bool NullChecked
Indicates if the expression will be null-checked by the runtime.
int ArgumentCount
The count of the right side arguments.
BadExpression Left
Left side of the Expression.
IEnumerable< BadExpression > Arguments
The Arguments of the Array Access.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
BadArrayAccessReverseExpression(BadExpression left, BadExpression[] args, BadSourcePosition position, bool nullChecked=false)
Constructor of the Array Access Expression.
override void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
override IEnumerable< BadExpression > GetDescendants()
Base Implementation for all Expressions used inside the Script.
IEnumerable< BadExpression > GetDescendantsAndSelf()
Returns all Descendants of the Expression and the Expression itself.
BadSourcePosition Position
The source Position of the Expression.
IEnumerable< BadObject > Execute(BadExecutionContext context)
Evaluates the Expression within the current Execution Context.
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
Gets thrown by the runtime.
The Base Class for all BadScript Objects.
virtual BadObjectReference GetProperty(string propName, BadScope? caller=null)
Returns a Reference to the Property with the given Name.
virtual bool HasProperty(string propName, BadScope? caller=null)
Returns true if the object contains a given property or there exists an extension for the current Ins...
static readonly BadObject Null
The Null Value for the BadScript Language.
Implements a function that can be called from the script.
Defines the interface for BadScript Access Expressions.
Contains Shared Data Structures and Functionality.
Contains the BadScript2 Constant Folding Optimizations.
Contains the Access Expressions for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains Runtime Function Objects.
Contains the Runtime Objects.
Contains the Runtime Implementation.