56 public void SetArgs(IEnumerable<BadExpression> exprs)
105 args.Add(argObj.Dereference());
121 public static IEnumerable<BadObject>
Invoke(
123 IEnumerable<BadObject> args,
129 foreach (
BadObject o
in func.Invoke(args.ToArray(), context))
143 foreach (
BadObject o
in invocationOp.Invoke(args.ToArray(), context))
150 yield
return r.Dereference();
155 "Cannot invoke non-function object",
174 left = left.Dereference();
189 List<BadObject> args =
new List<BadObject>();
206 return $
"({Left}({string.Join(",
", m_Arguments.Select(x => x.ToString()))}))";
Describes a specific position inside a source file.
Contains Static Data for the BadScript Language.
const string INVOCATION_OPERATOR_NAME
const string CONSTRUCTOR_NAME
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 Invocation Expression.
readonly List< BadExpression > m_Arguments
The Invocation Arguments.
override IEnumerable< BadExpression > GetDescendants()
static IEnumerable< BadObject > Invoke(BadObject left, IEnumerable< BadObject > args, BadSourcePosition position, BadExecutionContext context)
Invokes a function.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
void SetArgs(IEnumerable< BadExpression > exprs)
Sets the arguments of the invocation.
IEnumerable< BadExpression > Arguments
The Arguments of the Invocation.
BadExpression Left
The Left side of the Invocation.
override void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
int ArgumentCount
Argument Count of the Invocation.
BadInvocationExpression(BadExpression left, IEnumerable< BadExpression > args, BadSourcePosition position)
Constructor of the Invocation Expression.
IEnumerable< BadObject > GetArgs(BadExecutionContext context, List< BadObject > args)
Returns the argument objects.
override string ToString()
Implements the Variable Expression.
string Name
Name of the Variable.
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
Gets thrown by the runtime.
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.
Defines the interface for BadScript Access Expressions.
Contains Shared Data Structures and Functionality.
Contains the BadScript2 Constant Folding Optimizations.
Contains the Access Expressions for the BadScript2 Language.
Contains the Function Expressions for the BadScript2 Language.
Contains the Variable Expressions for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains Runtime Function Objects.
Contains the Runtime Objects.
Contains the Runtime Implementation.