C# Class Pokemon3D.Scripting.ScriptProcessor

Show file Open project: nilllzz/Pokemon3D Class Usage Examples

Private Properties

Property Type Description
BuildLambdaFunction string
CaptureLeft ElementCapture
CaptureRight ElementCapture
CreateArray Pokemon3D.Scripting.Types.SArray
CreateArray Pokemon3D.Scripting.Types.SArray
CreateBool Pokemon3D.Scripting.Types.SBool
CreateNumber Pokemon3D.Scripting.Types.SNumber
CreateString Pokemon3D.Scripting.Types.SString
CreateString Pokemon3D.Scripting.Types.SString
EvaluateLambda string
EvaluateOperator string
EvaluateReverseBool string
ExecuteAssignment Pokemon3D.Scripting.Types.SObject
ExecuteAsync Pokemon3D.Scripting.Types.SObject
ExecuteBreak Pokemon3D.Scripting.Types.SObject
ExecuteCatch Pokemon3D.Scripting.Types.SObject
ExecuteClass Pokemon3D.Scripting.Types.SObject
ExecuteContinue Pokemon3D.Scripting.Types.SObject
ExecuteElse Pokemon3D.Scripting.Types.SObject
ExecuteElseIf Pokemon3D.Scripting.Types.SObject
ExecuteExecutable Pokemon3D.Scripting.Types.SObject
ExecuteFinally Pokemon3D.Scripting.Types.SObject
ExecuteFor Pokemon3D.Scripting.Types.SObject
ExecuteFunction Pokemon3D.Scripting.Types.SObject
ExecuteIf Pokemon3D.Scripting.Types.SObject
ExecuteImport Pokemon3D.Scripting.Types.SObject
ExecuteLink Pokemon3D.Scripting.Types.SObject
ExecuteReturn Pokemon3D.Scripting.Types.SObject
ExecuteStatement Pokemon3D.Scripting.Types.SObject
ExecuteThrow Pokemon3D.Scripting.Types.SObject
ExecuteTry Pokemon3D.Scripting.Types.SObject
ExecuteVar Pokemon3D.Scripting.Types.SObject
ExecuteWhile Pokemon3D.Scripting.Types.SObject
GetLineNumber int
GetOperatorPositions int[]
InvokeMember Pokemon3D.Scripting.Types.SObject
InvokeMemberOrMethod Pokemon3D.Scripting.Types.SObject
InvokeMethod Pokemon3D.Scripting.Types.SObject
IsDotOperatorDecimalSeparator bool
IsValidIdentifier bool
ParseParameters Pokemon3D.Scripting.Types.SObject[]
ProcessStatements Pokemon3D.Scripting.Types.SObject
ResolveParentheses string
ScriptProcessor Pokemon3D.Scripting.Types
ScriptProcessor Pokemon3D.Scripting.Types
ToScriptObject Pokemon3D.Scripting.Types.SObject

Public Methods

Method Description
Run ( string code ) : SObject

Runs raw source code and returns the result.

ScriptProcessor ( ) : Pokemon3D.Scripting.Types

Creates a new instance of the ScriptProcessor.

ScriptProcessor ( IEnumerable inputPrototypes ) : Pokemon3D.Scripting.Types

Creates a new instance of the ScriptProcessor with defined prototypes.

Private Methods

Method Description
BuildLambdaFunction ( string lambdaCode ) : string

Builds a function() {} from a lambda statement.

CaptureLeft ( string exp, int index ) : ElementCapture

Captures an element left from the starting index.

CaptureRight ( string exp, int index ) : ElementCapture

Captures an element right from the starting index.

CreateArray ( SObject elements ) : SArray
CreateArray ( int length ) : SArray
CreateBool ( bool value ) : SBool

Creates an instance of the bool primitive.

CreateNumber ( double value ) : SNumber

Creates an instance of the number primitive.

CreateString ( string value ) : SString

Creates an instance of the string primitive.

CreateString ( string value, bool escaped, bool interpolate ) : SString

Creates an instance of the string primitive, also setting the escaped status.

EvaluateLambda ( string exp ) : string
EvaluateOperator ( string exp, string op ) : string
EvaluateReverseBool ( string exp ) : string
ExecuteAssignment ( ScriptStatement statement ) : SObject
ExecuteAsync ( ScriptStatement statement ) : SObject
ExecuteBreak ( ScriptStatement statement ) : SObject
ExecuteCatch ( ScriptStatement statement ) : SObject
ExecuteClass ( ScriptStatement statement ) : SObject
ExecuteContinue ( ScriptStatement statement ) : SObject
ExecuteElse ( ScriptStatement statement ) : SObject
ExecuteElseIf ( ScriptStatement statement ) : SObject
ExecuteExecutable ( ScriptStatement statement ) : SObject
ExecuteFinally ( ScriptStatement statement ) : SObject
ExecuteFor ( ScriptStatement statement ) : SObject
ExecuteFunction ( ScriptStatement statement ) : SObject
ExecuteIf ( ScriptStatement statement ) : SObject
ExecuteImport ( ScriptStatement statement ) : SObject
ExecuteLink ( ScriptStatement statement ) : SObject
ExecuteReturn ( ScriptStatement statement ) : SObject
ExecuteStatement ( ScriptStatement statement ) : SObject
ExecuteThrow ( ScriptStatement statement ) : SObject
ExecuteTry ( ScriptStatement statement ) : SObject
ExecuteVar ( ScriptStatement statement ) : SObject
ExecuteWhile ( ScriptStatement statement ) : SObject
GetLineNumber ( ) : int

Returns the line number of the currently active statement.

GetOperatorPositions ( string exp, string op ) : int[]

Returns positions of the given operator in the expression, sorted from left to right.

InvokeMember ( SObject owner, string memberName ) : SObject
InvokeMemberOrMethod ( SObject owner, string memberOrMethod ) : SObject

Invokes a member or method on an SObject and returns the result.

InvokeMethod ( SObject owner, string methodName ) : SObject
IsDotOperatorDecimalSeparator ( string elementLeft, string elementRight ) : bool
IsValidIdentifier ( string identifier ) : bool

Returns if the given string is a valid identifier.

ParseParameters ( string exp ) : Pokemon3D.Scripting.Types.SObject[]

Parses a list of parameters into a list of script objects.

ProcessStatements ( ) : SObject
ResolveParentheses ( string exp ) : string

Resolves parentheses and adds ".call" to direct function calls on variables.

ScriptProcessor ( ScriptContext context ) : Pokemon3D.Scripting.Types

Creates a new instance of the ScriptProcessor and sets a context.

ScriptProcessor ( ScriptContext context, int parentLineNumber ) : Pokemon3D.Scripting.Types
ToScriptObject ( string exp ) : SObject

Converts a string expression into a script object.

Method Details

Run() public method

Runs raw source code and returns the result.
public Run ( string code ) : SObject
code string The source code to run.
return Pokemon3D.Scripting.Types.SObject

ScriptProcessor() public method

Creates a new instance of the ScriptProcessor.
public ScriptProcessor ( ) : Pokemon3D.Scripting.Types
return Pokemon3D.Scripting.Types

ScriptProcessor() public method

Creates a new instance of the ScriptProcessor with defined prototypes.
public ScriptProcessor ( IEnumerable inputPrototypes ) : Pokemon3D.Scripting.Types
inputPrototypes IEnumerable An enumeration of prototypes.
return Pokemon3D.Scripting.Types