61 private readonly Dictionary<Type, IBadExpressionCompiler>
m_Compilers =
new Dictionary<Type, IBadExpressionCompiler>
310 Type t = expression.GetType();
314 compiler.Compile(context, expression);
340 if (clearStack && position !=
null)
342 context.Emit(
BadOpCode.ClearStack, position);
352 public static IEnumerable<BadInstruction>
Compile(
string src)
359 public static IEnumerable<BadInstruction>
Compile(IEnumerable<BadExpression> expressions)
Describes a specific position inside a source file.
The Parser of the Language. It turns Source Code into an Expression Tree.
static BadSourceParser Create(string fileName, string source)
Creates a BadSourceParser Instance based on the source and filename provided.
static IEnumerable< BadExpression > Parse(string fileName, string source)
Parses a BadExpression from the Source Reader.
Implements the Array Access to set or get properties from an object. LEFT[RIGHT].
Implements the Reverse Array Access to set or get properties from an object. LEFT[^RIGHT].
Implements the Member Access to set or get properties from an object. LEFT.RIGHT.
Implements the Null Coalescing Assign Expression LEFT ??= RIGHT.
Implements the Null Coalescing Expression LEFT ?? RIGHT.
Implements the Ternary Expression LEFT ? TRUE_RET : FALSE_RET.
Implements an expression that Deletes an object pointed to by BadObjectReference.
Base Implementation for all Expressions used inside the Script.
BadSourcePosition Position
The source Position of the Expression.
Implements the 'instanceof' operator.
Implements the 'typeof' operator.
Implements the Assign Expression LEFT = RIGHT.
Implements the binary ... operator. This operator is used to unpack the right side into the left side...
Implements the 'in' operator. The 'in' operator is used to check if a key is present in an instance o...
Implements the Range Expression START..END.
Implements the unary ... operator. This operator is used to unpack a table into the current execution...
Implements the Equality Expression LEFT == RIGHT.
Implements the Greater or Equal Expression LEFT >= RIGHT.
Implements the Greater Than Expression.
Implements the Inequality Expression.
Implements the Less or Equal Expression LEFT <= RIGHT.
Implements the Less Than Expression.
Implements the Assign Logic And Expression.
Implements the Assign Logic Or Expression.
Implements the Assign Logic Exclusive Or Expression.
Implements the Logic And Expression.
Implements the Logic Not Exression.
Implements the Logic Or Expression.
Implements the Logic Exclusive Or Expression.
Implements the Add Assignment Expression.
Implements the Divide Assignment Expression.
Implements the Exponentiation Assign Expression.
Implements the Modulus Assign Expression.
Implements the Multiply Assignment Expression.
Implements the Subtract Assign Expression.
Implements the Post Decrement Expression.
Implements the Post Increment Expression.
Implements the Pre Decrement Expression.
Implements the Pre Increment Expression.
Implements the Add Expression.
Implements the Divide Expression.
Implements the Exponentiation Expression.
Implements the Modulus Expression.
Implements the Multiply Expression.
Implements the Negation Expression.
Implements the Subtract Expression.
Implements the If Statement Expression.
Implements the Switch Statement Expression.
Implements the Try Catch Statement Expression.
Implements the Using Block Expression.
Implements the Using Statement Expression.
Implements the Lock Expression.
Implements the For Each Expression.
Implements the For Loop Expression.
Implements the While Expression.
Implements the Array Expression.
Implements the Boolean Expression.
Base Class of all Constant Expressions.
Implements the Null Expression.
Implements the Number Expression.
Implements the String Expression.
Implements the Table Expression.
Implements the Break Expression that is used to prematurely exit a loop.
Implements the Break Expression that is used to skip a loop iteraion.
Implements the Return expression that is used to exit the current function with an Optional Return Va...
Implements the Throw Expression that is used to raise errors inside the Script.
Implements the Function Expression.
Implements the Invocation Expression.
Exports the Default Value of the current execution.
A Import Expression that is used to import a module from a specified path.
Exports a Named Value from the current execution.
Implements the Class Prototype Expression.
Implements an Interface Prototype Expression.
Implements the New Expression.
Implements the Variable Definition Expression.
Implements the Variable Expression.
Gets thrown when a Compiler is not able to compile a specific BadExpression.
Implements the Compile for the BadVirtualMachine.
static IEnumerable< BadInstruction > Compile(string src)
Compiles the given source into a set of BadInstructions.
readonly Dictionary< Type, IBadExpressionCompiler > m_Compilers
The Dictionary of Compilers for the different BadExpression types.
void Compile(BadExpressionCompileContext context, BadExpression expression)
Compiles the given BadExpression into a set of BadInstructions.
static readonly BadCompiler Instance
The Default Compiler Instance.
static IEnumerable< BadInstruction > Compile(IEnumerable< BadExpression > expressions)
BadCompiler(bool allowEval=false)
Creates a new BadCompiler instance.
readonly bool AllowEval
Indicates whether or not the Compiler should allow Eval Instructions.
void Compile(BadExpressionCompileContext context, IEnumerable< BadExpression > expressions, bool clearStack=true)
Compiles the given BadExpressions into a set of BadInstructions.
Compiles the BadArrayAccessExpression.
Compiles the BadTernaryExpression.
Compiles the BadNullCoalescingAssignExpression.
Compiles the BadMemberAccessExpression.
Compiles the BadNullCoalescingExpression.
Compiles the BadArrayAccessReverseExpression.
Compiles the BadDeleteExpression.
Compiles the BadInstanceOfExpression.
Compiles the BadTypeOfExpression.
Compiles the BadLogicAssignOrExpression.
Compiles the BadAssignExpression.
Compiles the BadLogicAssignAndExpression.
Compiles the BadAddAssignExpression.
Compiles the BadGreaterThanExpression.
Compiles the BadUnaryUnpackExpression.
Compiles the BadEqualityExpression.
Compiles the BadLogicOrExpression.
Compiles the BadDivideExpression.
Compiles the BadExponentiationAssignExpression.
Compiles the BadAddExpression.
Compiles the BadMultiplyAssignExpression.
Compiles the BadLogicAssignXOrExpression.
Compiles the BadPostDecrementExpression.
Compiles the BadDivideAssignExpression.
Compiles the BadInequalityExpression.
Compiles the BadRangeExpression.
Compiles the BadSubtractExpression.
Compiles the BadSubtractAssignExpression.
Compiles the BadLessOrEqualExpression.
Compiles the BadModulusExpression.
Compiles the BadPostIncrementExpression.
Compiles the BadInExpression.
Compiles the BadBinaryUnpackExpression.
Compiles the BadNegationExpression.
Compiles the BadLogicXOrExpression.
Compiles the BadLogicNotExpression.
Compiles the BadExponentiationExpression.
Compiles the BadLessThanExpression.
Compiles the BadPreIncrementExpression.
Compiles the BadPreDecrementExpression.
Compiles the BadLogicAndExpression.
Compiles the BadGreaterOrEqualExpression.
Compiles the BadMultiplyExpression.
Compiles the BadModulusAssignExpression.
Compiles the BadIfExpression.
Compiles the BadUsingStatementExpression.
Compiles the BadWhileExpression.
Compiles the BadForExpression.
Compiles the BadTryCatchExpression.
Compiles the BadLockExpression.
Compiles the BadUsingExpression.
Compiles the BadForEachExpression.
Compiles the BadNullExpression.
Compiles the BadNumberExpression.
Compiles the BadArrayExpression.
Compiles the BadTableExpression.
Compiles the BadBooleanExpression.
Compiles the BadConstantExpression.
Compiles the BadStringExpression.
Compiles the BadReturnExpression.
Compiles the BadBreakExpression.
Compiles the BadContinueExpression.
Compiles the BadThrowExpression.
Compiles the BadFunctionExpression.
Compiles the BadInvocationExpression.
Compiles the BadNamedExportExpression.
Compiles the BadDefaultExportExpression.
Compiles the BadImportExpression.
Compiles the BadNewExpression.
Compiles the BadInterfacePrototypeExpression.
Compiles the BadClassPrototypeExpression.
Compiles the BadFormattedStringExpression.
Compiles the BadVariableDefinitionExpression.
Compiles the BadVariableExpression.
Defines a Compiler for a specific BadExpression.
Contains Shared Data Structures and Functionality.
Contains the Access Expressions for the BadScript2 Language.
Contains the Comparison Expressions for the BadScript2 Language.
Contains the Self-Assigning Logic Expressions for the BadScript2 Language.
Contains the Logic Expressions for the BadScript2 Language.
Contains the Self-Assigning Math Expressions for the BadScript2 Language.
Contains the Atomic Math Expressions for the BadScript2 Language.
Contains the Math Expressions for the BadScript2 Language.
Contains the Binary Expressions for the BadScript2 Language.
Contains the Locking Expressions for the BadScript2 Language.
Contains the Loop Expressions for the BadScript2 Language.
Contains the Block Expressions for the BadScript2 Language.
Contains the Constant Expressions for the BadScript2 Language.
Contains the Controlflow 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 Parser for the BadScript2 Language.
Contains Access Expression Compilers.
Contains Binary Comparison Expression Compilers.
Contains Binary Self-Assignung Logic Expression Compilers.
Contains Binary Logic Expression Compilers.
Contains Binary Self-Assignung Math Expression Compilers.
Contains Atomic Logic Expression Compilers.
Contains Binary Math Expression Compilers.
Contains Binary Expression Compilers.
Contains Block Expression Compilers.
Contains Constant Expression Compilers.
Contains Controlflow Expression Compilers.
Contains Function Expression Compilers.
Contains Type Expression Compilers.
Contains Variable Expression Compilers.
Contains Expression Compilers.
Contains the Compiler for the BadVirtualMachine.
BadOpCode
Defines the Operations that the BadVirtualMachine can execute.
void Emit(BadInstruction instruction)
BadInstruction[] GetInstructions()