18 private readonly List<BadExpression>
m_Body;
32 IEnumerable<BadExpression> body,
65 public void SetBody(IEnumerable<BadExpression> body)
78 for (
int i = 0; i <
m_Body.Count; i++)
102 foreach (
BadExpression descendant
in m_Body.SelectMany(expression => expression.GetDescendantsAndSelf()))
104 yield
return descendant;
136 loopCtx.Scope.CreateChild(
151 if (loopContext.Scope.IsBreak || loopContext.Scope.ReturnValue !=
null)
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.
IEnumerable< BadObject > Execute(BadExecutionContext context)
Evaluates the Expression within the current Execution Context.
Implements the For Loop Expression.
void SetBody(IEnumerable< BadExpression > body)
Sets the Body of the Loop.
override IEnumerable< BadExpression > GetDescendants()
override void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
BadForExpression(BadExpression varDef, BadExpression condition, BadExpression varIncrement, IEnumerable< BadExpression > body, BadSourcePosition position)
Constructor of the For Expression.
IEnumerable< BadExpression > Body
Loop Body.
BadExpression VarDef
The Variable Definition part of the for loop.
BadExpression Condition
The Exit Condition of the For Loop.
BadExpression VarIncrement
The Variable Modifier Expression of the For Loop.
readonly List< BadExpression > m_Body
Loop Body.
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
BadScope CreateChild(string name, BadScope? caller, bool? useVisibility, BadScopeFlags flags=BadScopeFlags.RootScope)
Creates a subscope of the current scope.
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.
new bool Value
The Boolean Value.
Contains Shared Data Structures and Functionality.
Contains the BadScript2 Constant Folding Optimizations.
Contains the Loop 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.
BadScopeFlags
Defines Different Behaviours for the Current Scope.