1using System.Runtime.ExceptionServices;
36 public IEnumerable<BadExpression>
Attributes {
get;
private set; }
60 IEnumerable<BadExpression> args;
65 args = invoc.Arguments;
82 if (ctx.Scope.HasVariable(varExpr.Name, ctx.Scope))
84 BadObject? attribObj = ctx.Scope.GetVariable(varExpr.Name, ctx.Scope)
95 if (attribClass ==
null &&
96 !varExpr.
Name.EndsWith(
"Attribute") &&
97 ctx.Scope.HasVariable(varExpr.Name +
"Attribute", ctx.Scope))
99 BadObject? attribObj = ctx.Scope.GetVariable(varExpr.Name +
"Attribute", ctx.Scope)
112 foreach (
BadObject? o
in mac.Left.Execute(ctx))
132 if (parent.
HasProperty(mac.Right.Text +
"Attribute", ctx.Scope))
145 if (attribClass ==
null)
160 foreach (
BadObject? o
in attrib.Execute(ctx))
203 yield
return descendant;
239 ExceptionDispatchInfo.Capture(err)
242 catch (Exception exception)
298 foreach (
BadObject o
in func.Invoke(
new[] { right },
Describes a specific position inside a source file.
Public Debugger Interface.
static void Step(BadDebuggerStep stepInfo)
Sends a step event to the debugger.
static bool IsAttached
True if a debugger is attached.
Implements the Member Access to set or get properties from an object. LEFT.RIGHT.
Base Implementation for all Expressions used inside the Script.
IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
Is used to evaluate the Expression.
static IEnumerable< BadObject > ExecuteOperatorOverride(BadObject left, BadObject right, BadExecutionContext context, string name, BadSourcePosition position)
Helper function that executes an operator override function if implemented.
IEnumerable< BadObject > ComputeAttributes(BadExecutionContext ctx, List< BadObject > attributes)
IEnumerable< BadExpression > GetDescendantsAndSelf()
Returns all Descendants of the Expression and the Expression itself.
IEnumerable< BadExpression > Attributes
virtual void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
static IEnumerable< BadObject > ExecuteOperatorOverride(BadObject left, BadExecutionContext context, string name, BadSourcePosition position)
Executes an operator override function if implemented.
BadSourcePosition Position
The source Position of the Expression.
BadExpression(bool isConstant, BadSourcePosition position)
Constructor.
IEnumerable< BadExpression > GetDescendants()
Returns all Descendants of the Expression.
void SetPosition(BadSourcePosition pos)
Sets the Source Position of the Expression.
void SetAttributes(IEnumerable< BadExpression > attributes)
IEnumerable< BadObject > Execute(BadExecutionContext context)
Evaluates the Expression within the current Execution Context.
IEnumerable< BadObject > ExecuteWithCatch(BadExecutionContext context)
bool IsConstant
Indicates if the expression stays constant at all times.
Base Class of all Constant Expressions.
Implements the Invocation Expression.
Implements the New Expression.
Implements the Variable Expression.
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
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.
Gets thrown by the runtime.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
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.
Implements a Type Instance in the BadScript Language.
Implements a Class Prototype for the BadScript Language.
string Name
The Name of the Type.
Helper Class that Builds a Native Class from a Prototype.
static readonly BadInterfacePrototype Attribute
Provides runtime settings.
static T Instance
Returns the Instance of the Settings Provider.
Contains Shared Data Structures and Functionality.
Contains the debugging abstractions for the BadScript2 Runtime.
Contains the Access Expressions for the BadScript2 Language.
Contains the Constant Expressions for the BadScript2 Language.
Contains the Function Expressions for the BadScript2 Language.
Contains the Type Expressions for the BadScript2 Language.
Contains the Variable Expressions for the BadScript2 Language.
Contains the Expressions for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains Runtime Function Objects.
Contains Runtime Type Objects.
Contains the Runtime Objects.
Contains Runtime Settings Objects.
Contains the Runtime Implementation.
Represents a Debugging Step.