36 IEnumerable<BadExpression>? elseBranch,
104 yield
return keyExpr;
134 foreach (
BadObject o
in keyValuePair.Key.Execute(context))
141 conditionResult = conditionResult.Dereference();
155 if (keyValuePair.Value.Length == 0)
161 context.Scope.CreateChild(
168 foreach (
BadObject o
in branchContext.Execute(keyValuePair.Value))
182 context.Scope.CreateChild(
Describes a specific position inside a source file.
Implements a simple constant folding optimization.
static BadExpression Optimize(BadExpression expr)
Optimizes the given expression.
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.
Implements the If Statement Expression.
readonly Dictionary< BadExpression, BadExpression[]> m_ConditionalBranches
The Conditional Branches.
IEnumerable< BadExpression >? ElseBranch
The (optional) Else Branch.
void SetElseBranch(IEnumerable< BadExpression >? branch)
Sets the Else Branch.
IDictionary< BadExpression, BadExpression[]> ConditionalBranches
The Conditional Branches.
override void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
BadIfExpression(Dictionary< BadExpression, BadExpression[]> branches, IEnumerable< BadExpression >? elseBranch, BadSourcePosition position)
Constructor of the If Expression.
override IEnumerable< BadExpression > GetDescendants()
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
List< BadExpression >? m_ElseBranch
The (optional) Else Branch.
The Execution Context. Every execution of a script needs a context the script is running in....
Gets thrown by the runtime.
The Base Class for all BadScript Objects.
static readonly BadObject Null
The Null Value for the BadScript Language.
Implements the Interface for Native Boolean.
Contains Shared Data Structures and Functionality.
Contains the BadScript2 Constant Folding Optimizations.
Contains the Block Expressions for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains the Native Runtime Objects.
Contains the Runtime Objects.
Contains the Runtime Implementation.