跳到主要内容
版本:0.1.0

Class Motor

Assembly: RCaron.dll
View Source
Declaration
csharp
public class Motor
Declaration
csharp
public class Motor

Properties

Lines

View Source
Declaration
csharp
public IList<Line> Lines { get; set; }
Declaration
csharp
public IList<Line> Lines { get; set; }

BlockStack

View Source
Declaration
csharp
public NiceStack<Motor.StackThing> BlockStack { get; set; }
Declaration
csharp
public NiceStack<Motor.StackThing> BlockStack { get; set; }

MainFileScope

View Source
Declaration
csharp
public FileScope MainFileScope { get; set; }
Declaration
csharp
public FileScope MainFileScope { get; set; }

Options

View Source
Declaration
csharp
public MotorOptions Options { get; }
Declaration
csharp
public MotorOptions Options { get; }

ElseState

If true and meets an else(if), it will be skipped.

View Source
Declaration
csharp
public bool ElseState { get; set; }
Declaration
csharp
public bool ElseState { get; set; }

GlobalScope

View Source
Declaration
csharp
public LocalScope GlobalScope { get; set; }
Declaration
csharp
public LocalScope GlobalScope { get; set; }

CurrentLineIndex

View Source
Declaration
csharp
public int CurrentLineIndex { get; }
Declaration
csharp
public int CurrentLineIndex { get; }

Methods

UseContext(RCaronParserContext, bool)

View Source
Declaration
csharp
public void UseContext(RCaronParserContext parserContext, bool withFileScope = true)
Declaration
csharp
public void UseContext(RCaronParserContext parserContext, bool withFileScope = true)
Parameters
TypeName
RCaron.Parsing.RCaronParserContextparserContext
System.BooleanwithFileScope

Run(int)

View Source
Declaration
csharp
public object? Run(int startIndex = 0)
Declaration
csharp
public object? Run(int startIndex = 0)
Returns

System.Object

Parameters
TypeName
System.Int32startIndex

GetLineNumber(FileScope?, int?)

View Source
Declaration
csharp
public int GetLineNumber(FileScope? fileScope = null, int? position = null)
Declaration
csharp
public int GetLineNumber(FileScope? fileScope = null, int? position = null)
Returns

System.Int32

Parameters
TypeName
RCaron.FileScopefileScope
System.Nullable<System.Int32>position

RunLine(Line)

View Source
Declaration
csharp
public (bool Exit, object? Result) RunLine(Line baseLine)
Declaration
csharp
public (bool Exit, object? Result) RunLine(Line baseLine)
Returns

System.ValueTuple<System.Boolean,System.Object>

Parameters
TypeName
RCaron.LinebaseLine

RunCodeBlock(CodeBlockToken)

View Source
Declaration
csharp
public object? RunCodeBlock(CodeBlockToken codeBlock)
Declaration
csharp
public object? RunCodeBlock(CodeBlockToken codeBlock)
Returns

System.Object

Parameters
TypeName
RCaron.CodeBlockTokencodeBlock

RunLinesList(IList<Line>)

View Source
Declaration
csharp
public object? RunLinesList(IList<Line> lines)
Declaration
csharp
public object? RunLinesList(IList<Line> lines)
Returns

System.Object

Parameters
TypeName
System.Collections.Generic.IList<RCaron.Line>lines

MethodCall(string, ArraySegment<PosToken>, CallLikePosToken?, object?, Pipeline?, bool)

View Source
Declaration
csharp
public object? MethodCall(string nameArg, ArraySegment<PosToken> argumentTokens = default, CallLikePosToken? callToken = null, object? instance = null, Pipeline? pipeline = null, bool isLeftOfPipeline = false)
Declaration
csharp
public object? MethodCall(string nameArg, ArraySegment<PosToken> argumentTokens = default, CallLikePosToken? callToken = null, object? instance = null, Pipeline? pipeline = null, bool isLeftOfPipeline = false)
Returns

System.Object

Parameters
TypeName
System.StringnameArg
System.ArraySegment<RCaron.PosToken>argumentTokens
RCaron.CallLikePosTokencallToken
System.Objectinstance
RCaron.Pipelinepipeline
System.BooleanisLeftOfPipeline

GetAssigner(Span<PosToken>)

View Source
Declaration
csharp
public IAssigner GetAssigner(Span<PosToken> tokens)
Declaration
csharp
public IAssigner GetAssigner(Span<PosToken> tokens)
Returns

RCaron.IAssigner

Parameters
TypeName
System.Span<RCaron.PosToken>tokens

EvaluateDotThingsAsPath(ReadOnlySpan<PosToken>)

View Source
Declaration
csharp
public static string EvaluateDotThingsAsPath(ReadOnlySpan<PosToken> tokens)
Declaration
csharp
public static string EvaluateDotThingsAsPath(ReadOnlySpan<PosToken> tokens)
Returns

System.String

Parameters
TypeName
System.ReadOnlySpan<RCaron.PosToken>tokens

EvaluateDotThings(Span<PosToken>, Pipeline?)

View Source
Declaration
csharp
public object? EvaluateDotThings(Span<PosToken> instanceTokens, Pipeline? pipeline = null)
Declaration
csharp
public object? EvaluateDotThings(Span<PosToken> instanceTokens, Pipeline? pipeline = null)
Returns

System.Object

Parameters
TypeName
System.Span<RCaron.PosToken>instanceTokens
RCaron.Pipelinepipeline

EvaluateMultipleValues(in Span<PosToken>, int)

View Source
Declaration
csharp
public object?[] EvaluateMultipleValues(in Span<PosToken> tokens, int tokensStartIndex = 0)
Declaration
csharp
public object?[] EvaluateMultipleValues(in Span<PosToken> tokens, int tokensStartIndex = 0)
Returns

System.Object[]

Parameters
TypeName
System.Span<RCaron.PosToken>tokens
System.Int32tokensStartIndex

EvaluateVariable(string)

View Source
Declaration
csharp
public object? EvaluateVariable(string name)
Declaration
csharp
public object? EvaluateVariable(string name)
Returns

System.Object

Parameters
TypeName
System.Stringname

EvaluateExpressionSingle(PosToken, bool, Pipeline?)

View Source
Declaration
csharp
public object? EvaluateExpressionSingle(PosToken token, bool isLeftOfPipeline = false, Pipeline? pipeline = null)
Declaration
csharp
public object? EvaluateExpressionSingle(PosToken token, bool isLeftOfPipeline = false, Pipeline? pipeline = null)
Returns

System.Object

Parameters
TypeName
RCaron.PosTokentoken
System.BooleanisLeftOfPipeline
RCaron.Pipelinepipeline

EvaluateExpressionValue(ArraySegment<PosToken>)

View Source
Declaration
csharp
[CollectionAccess(CollectionAccessType.Read)]
public object EvaluateExpressionValue(ArraySegment<PosToken> tokens)
Declaration
csharp
[CollectionAccess(CollectionAccessType.Read)]
public object EvaluateExpressionValue(ArraySegment<PosToken> tokens)
Returns

System.Object

Parameters
TypeName
System.ArraySegment<RCaron.PosToken>tokens

EvaluateExpressionHigh(ArraySegment<PosToken>, Pipeline?, bool)

View Source
Declaration
csharp
public object? EvaluateExpressionHigh(ArraySegment<PosToken> tokens, Pipeline? pipeline = null, bool isLeftOfPipeline = false)
Declaration
csharp
public object? EvaluateExpressionHigh(ArraySegment<PosToken> tokens, Pipeline? pipeline = null, bool isLeftOfPipeline = false)
Returns

System.Object

Parameters
TypeName
System.ArraySegment<RCaron.PosToken>tokens
RCaron.Pipelinepipeline
System.BooleanisLeftOfPipeline

FunctionCall(Function, CallLikePosToken?, ArraySegment<PosToken>, ClassInstance?, ClassDefinition?, Pipeline?)

View Source
Declaration
csharp
public object? FunctionCall(Function function, CallLikePosToken? callToken = null, ArraySegment<PosToken> argumentTokens = default, ClassInstance? classInstance = null, ClassDefinition? staticClassDefinition = null, Pipeline? pipeline = null)
Declaration
csharp
public object? FunctionCall(Function function, CallLikePosToken? callToken = null, ArraySegment<PosToken> argumentTokens = default, ClassInstance? classInstance = null, ClassDefinition? staticClassDefinition = null, Pipeline? pipeline = null)
Returns

System.Object

Parameters
TypeName
RCaron.Functionfunction
RCaron.CallLikePosTokencallToken
System.ArraySegment<RCaron.PosToken>argumentTokens
RCaron.Classes.ClassInstanceclassInstance
RCaron.Classes.ClassDefinitionstaticClassDefinition
RCaron.Pipelinepipeline

EvaluateBool(PosToken[])

View Source
Declaration
csharp
public bool EvaluateBool(PosToken[] tokens)
Declaration
csharp
public bool EvaluateBool(PosToken[] tokens)
Returns

System.Boolean

Parameters
TypeName
RCaron.PosToken[]tokens

EvaluateComparisonOperation(ComparisonValuePosToken)

View Source
Declaration
csharp
public bool EvaluateComparisonOperation(ComparisonValuePosToken comparisonValuePosToken)
Declaration
csharp
public bool EvaluateComparisonOperation(ComparisonValuePosToken comparisonValuePosToken)
Returns

System.Boolean

Parameters
TypeName
RCaron.ComparisonValuePosTokencomparisonValuePosToken

EvaluateLogicalOperation(LogicalOperationValuePosToken)

View Source
Declaration
csharp
public bool EvaluateLogicalOperation(LogicalOperationValuePosToken comparisonValuePosToken)
Declaration
csharp
public bool EvaluateLogicalOperation(LogicalOperationValuePosToken comparisonValuePosToken)
Returns

System.Boolean

Parameters
TypeName
RCaron.LogicalOperationValuePosTokencomparisonValuePosToken

RunLeftPipeline(PosToken[], Pipeline?)

View Source
Declaration
csharp
public Pipeline RunLeftPipeline(PosToken[] tokens, Pipeline? pipelineIn = null)
Declaration
csharp
public Pipeline RunLeftPipeline(PosToken[] tokens, Pipeline? pipelineIn = null)
Returns

RCaron.Pipeline

Parameters
TypeName
RCaron.PosToken[]tokens
RCaron.PipelinepipelineIn

GetVar(string)

View Source
Declaration
csharp
public object? GetVar(string name)
Declaration
csharp
public object? GetVar(string name)
Returns

System.Object

Parameters
TypeName
System.Stringname

GetVarRef(string)

View Source
Declaration
csharp
public ref object? GetVarRef(string name)
Declaration
csharp
public ref object? GetVarRef(string name)
Returns

System.Object

Parameters
TypeName
System.Stringname

SetVar(string, object?)

View Source
Declaration
csharp
public void SetVar(string name, object? value)
Declaration
csharp
public void SetVar(string name, object? value)
Parameters
TypeName
System.Stringname
System.Objectvalue

GetFileScope()

View Source
Declaration
csharp
public FileScope GetFileScope()
Declaration
csharp
public FileScope GetFileScope()
Returns

RCaron.FileScope

TryGetClassDefinition(string, FileScope, out ClassDefinition)

View Source
Declaration
csharp
public static bool TryGetClassDefinition(string name, FileScope fileScope, out ClassDefinition classDefinition)
Declaration
csharp
public static bool TryGetClassDefinition(string name, FileScope fileScope, out ClassDefinition classDefinition)
Returns

System.Boolean

Parameters
TypeName
System.Stringname
RCaron.FileScopefileScope
RCaron.Classes.ClassDefinitionclassDefinition

TryGetClassDefinition(List<ClassDefinition>?, string, out ClassDefinition)

View Source
Declaration
csharp
public static bool TryGetClassDefinition(List<ClassDefinition>? classDefinitions, string name, out ClassDefinition classDefinition)
Declaration
csharp
public static bool TryGetClassDefinition(List<ClassDefinition>? classDefinitions, string name, out ClassDefinition classDefinition)
Returns

System.Boolean

Parameters
TypeName
System.Collections.Generic.List<RCaron.Classes.ClassDefinition>classDefinitions
System.Stringname
RCaron.Classes.ClassDefinitionclassDefinition

TryGetFunction(string, FileScope, out Function)

View Source
Declaration
csharp
public bool TryGetFunction(string name, FileScope fileScope, out Function function)
Declaration
csharp
public bool TryGetFunction(string name, FileScope fileScope, out Function function)
Returns

System.Boolean

Parameters
TypeName
System.Stringname
RCaron.FileScopefileScope
RCaron.Functionfunction

TryCallFunction(string, FileScope, CallLikePosToken?, ArraySegment<PosToken>, ClassInstance?, out object?, ClassDefinition?, Pipeline?)

View Source
Declaration
csharp
public bool TryCallFunction(string name, FileScope fileScope, CallLikePosToken? callToken, ArraySegment<PosToken> argumentTokens, ClassInstance? classInstance, out object? result, ClassDefinition? classDefinition = null, Pipeline? pipeline = null)
Declaration
csharp
public bool TryCallFunction(string name, FileScope fileScope, CallLikePosToken? callToken, ArraySegment<PosToken> argumentTokens, ClassInstance? classInstance, out object? result, ClassDefinition? classDefinition = null, Pipeline? pipeline = null)
Returns

System.Boolean

Parameters
TypeName
System.Stringname
RCaron.FileScopefileScope
RCaron.CallLikePosTokencallToken
System.ArraySegment<RCaron.PosToken>argumentTokens
RCaron.Classes.ClassInstanceclassInstance
System.Objectresult
RCaron.Classes.ClassDefinitionclassDefinition
RCaron.Pipelinepipeline

Extension Methods