1using System.Runtime.ExceptionServices;
36 public IEnumerable<BadExpression>
Attributes {
get;
private set; }
49 IEnumerable<BadExpression> args;
54 args = invoc.Arguments;
70 if (ctx.Scope.HasVariable(varExpr.Name, ctx.Scope))
72 var attribObj = ctx.Scope.GetVariable(varExpr.Name, ctx.Scope).Dereference();
82 if(attribClass ==
null && !varExpr.
Name.EndsWith(
"Attribute") && ctx.Scope.HasVariable(varExpr.Name +
"Attribute", ctx.Scope))
84 var attribObj = ctx.Scope.GetVariable(varExpr.Name +
"Attribute", ctx.Scope).Dereference();
97 foreach (var o
in mac.Left.Execute(ctx))
101 var parent = obj.Dereference();
103 if (parent.HasProperty(mac.Right.Text, ctx.Scope))
105 var attribObj = parent.
GetProperty(mac.Right.Text, ctx.Scope).Dereference();
112 if(parent.HasProperty(mac.Right.Text +
"Attribute", ctx.Scope))
114 var attribObj = parent.
GetProperty(mac.Right.Text +
"Attribute", ctx.Scope).Dereference();
123 if(attribClass ==
null)
137 foreach (var o
in attrib.Execute(ctx))
143 var a = obj.Dereference();
188 yield
return descendant;
223 ExceptionDispatchInfo.Capture(err).Throw();
225 catch (Exception exception)
272 $
"{left.GetType().Name} has no {name} property",
307 $
"{left.GetType().Name} has no {name} property",
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.
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.