17 private readonly Dictionary<BadWordToken, BadExpression>
m_Table;
45 return m_Table.SelectMany(kvp => kvp.Value.GetDescendantsAndSelf());
51 KeyValuePair<BadWordToken, BadExpression>[] branches =
m_Table.ToArray();
54 foreach (KeyValuePair<BadWordToken, BadExpression> branch
in branches)
63 Dictionary<string, BadObject> table =
new Dictionary<string, BadObject>();
65 foreach (KeyValuePair<BadWordToken, BadExpression> entry
in m_Table)
69 foreach (
BadObject o
in entry.Value.Execute(context))
76 value = value.Dereference();
78 table[entry.Key.Text] = value;
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.
Implements the Table Expression.
int Length
The Length of the initializer list.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
BadTableExpression(Dictionary< BadWordToken, BadExpression > table, BadSourcePosition position)
Constructor of the Table Expression.
readonly Dictionary< BadWordToken, BadExpression > m_Table
The Initializer List of the Table.
override IEnumerable< BadExpression > GetDescendants()
override void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
IDictionary< BadWordToken, BadExpression > Table
The Initializer List of the Table.
The Execution Context. Every execution of a script needs a context the script is running in....
The Base Class for all BadScript Objects.
static readonly BadObject Null
The Null Value for the BadScript Language.
Implements a Table Structure for the BadScript Language.
Contains Shared Data Structures and Functionality.
Contains the BadScript2 Constant Folding Optimizations.
Contains the Constant Expressions for the BadScript2 Language.
Contains the Reader Tokens for the BadScript2 Language.
Contains the Runtime Objects.
Contains the Runtime Implementation.