25 bool isReadOnly =
false) : base(false, position)
65 obj = obj.Dereference();
75 List<BadObject> attributes =
new List<BadObject>();
101 bool isReadOnly =
false) : base(
127 return IsReadOnly ? $
"{BadStaticKeys.CONSTANT_DEFINITION_KEY} {Name}" : $
"{BadStaticKeys.VARIABLE_DEFINITION_KEY} {Name}";
146 obj = obj.Dereference();
165 List<BadObject> attributes =
new List<BadObject>();
172 foreach (
BadObject o
in base.InnerExecute(context))
185 yield
return typeExpression;
191 yield
return descendant;
Describes a specific position inside a source file.
Base Implementation for all Expressions used inside the Script.
IEnumerable< BadObject > ComputeAttributes(BadExecutionContext ctx, List< BadObject > attributes)
IEnumerable< BadExpression > GetDescendantsAndSelf()
Returns all Descendants of the Expression and the Expression itself.
BadSourcePosition Position
The source Position of the Expression.
IEnumerable< BadExpression > GetDescendants()
Returns all Descendants of the Expression.
IEnumerable< BadObject > Execute(BadExecutionContext context)
Evaluates the Expression within the current Execution Context.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
BadExpression? TypeExpression
BadExpression GetExpression
override IEnumerable< BadExpression > GetDescendants()
BadExpression? SetExpression
BadPropertyDefinitionExpression(BadWordToken name, BadSourcePosition position, BadExpression getExpression, BadExpression? typeExpression=null, BadExpression? setExpression=null, bool isReadOnly=false)
Implements the Variable Definition Expression.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
bool IsReadOnly
Indicates if the Variable will be declared as Read-Only.
override string ToString()
String Representation of the Expression.
override IEnumerable< BadExpression > GetDescendants()
BadVariableDefinitionExpression(string name, BadSourcePosition position, BadExpression? typeExpression=null, bool isReadOnly=false)
Constructor of the Variable Definition Expression.
BadExpression? TypeExpression
The (optional) Type of the Variable.
Implements the Variable Expression.
string Name
Name of the Variable.
string Text
The Text Representation of the Token.
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
BadClass? ClassObject
The Class Object of the Scope.
bool HasLocal(string name, BadScope caller, bool useExtensions=true)
returns true if the specified variable is defined in the current scope
Gets thrown by the runtime.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
The Base Class for all BadScript Objects.
static readonly BadObject Null
The Null Value for the BadScript Language.
Stores Meta Information about a Property.
The Any Prototype, Base type for all types.
static readonly BadAnyPrototype Instance
The Instance of the BadAnyPrototype.
Implements a Class Prototype for the BadScript Language.
The Void Prototype, can be assigned to nothing, can not be inherited from, can not be instantiated....
static BadVoidPrototype Instance
The Instance of the BadVoidPrototype.
Contains Shared Data Structures and Functionality.
Contains the Variable Expressions for the BadScript2 Language.
Contains the Reader Tokens for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains Runtime Type Objects.
Contains the Runtime Objects.
Contains the Runtime Implementation.