46 string errorName) : base(false, position)
121 IEnumerable<BadObject>? catchEnumerable =
null;
132 if (!enumerator.MoveNext())
148 catchContext.Scope.DefineVariable(
ErrorName, error);
158 if (catchEnumerable !=
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.
Implements the Try Catch Statement Expression.
readonly BadExpression[] m_CatchExpressions
The Catch Block.
IEnumerable< BadExpression > CatchExpressions
The Catch Block.
readonly BadExpression[] m_FinallyExpressions
The Finally Block.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
override void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
IEnumerable< BadExpression > TryExpressions
The Try Block.
readonly BadExpression[] m_Expressions
The Try Block.
override IEnumerable< BadExpression > GetDescendants()
readonly string ErrorName
The Variable name of the Exception inside the catch block.
IEnumerable< BadExpression > FinallyExpressions
The Finally Block.
BadTryCatchExpression(BadSourcePosition position, BadExpression[] expressions, BadExpression[] catchExpressions, BadExpression[] finallyExpressions, string errorName)
Constructor for the Try Catch Expression.
The Execution Context. Every execution of a script needs a context the script is running in....
IEnumerable< BadObject > Execute(IEnumerable< BadExpression > expressions)
Executes an enumeration of expressions.
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.
string GetStackTrace()
Returns the Stack Trace of the Current scope.
Gets thrown if the runtime encounters an error.
Implements the Error Object Type.
static BadRuntimeError FromException(Exception e, string? scriptStackTrace=null)
Creates a BadRuntimeError from an Exception.
The Base Class for all BadScript Objects.
static readonly BadObject Null
The Null Value for the BadScript Language.
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 Runtime Objects.
Contains the Runtime Implementation.
BadScopeFlags
Defines Different Behaviours for the Current Scope.