跳到主要内容
版本:Next

Class TokenReader

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

Properties

ReturnIgnored

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

ErrorHandler

View Source
Declaration
csharp
public IParsingErrorHandler ErrorHandler { get; }
Declaration
csharp
public IParsingErrorHandler ErrorHandler { get; }

Fields

IgnorePosToken

View Source
Declaration
csharp
public static readonly PosToken IgnorePosToken
Declaration
csharp
public static readonly PosToken IgnorePosToken

Methods

Read()

View Source
Declaration
csharp
public PosToken? Read()
Declaration
csharp
public PosToken? Read()
Returns

RCaron.PosToken

CollectExecutableKeyword(in ReadOnlySpan<char>)

View Source
Declaration
csharp
public int CollectExecutableKeyword(in ReadOnlySpan<char> span)
Declaration
csharp
public int CollectExecutableKeyword(in ReadOnlySpan<char> span)
Returns

System.Int32

Parameters
TypeName
System.ReadOnlySpan<System.Char>span

CollectPathOrKeyword(in ReadOnlySpan<char>, bool)

View Source
Declaration
csharp
public (int index, string path, bool isPath) CollectPathOrKeyword(in ReadOnlySpan<char> span, bool allowFirstDoubleDot = false)
Declaration
csharp
public (int index, string path, bool isPath) CollectPathOrKeyword(in ReadOnlySpan<char> span, bool allowFirstDoubleDot = false)
Returns

System.ValueTuple<System.Int32,System.String,System.Boolean>

Parameters
TypeName
System.ReadOnlySpan<System.Char>span
System.BooleanallowFirstDoubleDot

CollectAnyNumber(in ReadOnlySpan<char>)

View Source
Declaration
csharp
public (int index, bool isDecimal, bool hasSpacing) CollectAnyNumber(in ReadOnlySpan<char> span)
Declaration
csharp
public (int index, bool isDecimal, bool hasSpacing) CollectAnyNumber(in ReadOnlySpan<char> span)
Returns

System.ValueTuple<System.Int32,System.Boolean,System.Boolean>

Parameters
TypeName
System.ReadOnlySpan<System.Char>span

CollectAlphaNumeric(in ReadOnlySpan<char>)

View Source
Declaration
csharp
public int CollectAlphaNumeric(in ReadOnlySpan<char> span)
Declaration
csharp
public int CollectAlphaNumeric(in ReadOnlySpan<char> span)
Returns

System.Int32

Parameters
TypeName
System.ReadOnlySpan<System.Char>span

CollectAlphaNumericAndSome(in ReadOnlySpan<char>)

View Source
Declaration
csharp
public int CollectAlphaNumericAndSome(in ReadOnlySpan<char> span)
Declaration
csharp
public int CollectAlphaNumericAndSome(in ReadOnlySpan<char> span)
Returns

System.Int32

Parameters
TypeName
System.ReadOnlySpan<System.Char>span

CollectAlphaNumericAndSomeAndDot(in ReadOnlySpan<char>)

View Source
Declaration
csharp
public int CollectAlphaNumericAndSomeAndDot(in ReadOnlySpan<char> span)
Declaration
csharp
public int CollectAlphaNumericAndSomeAndDot(in ReadOnlySpan<char> span)
Returns

System.Int32

Parameters
TypeName
System.ReadOnlySpan<System.Char>span

CollectString(in ReadOnlySpan<char>, char)

View Source
Declaration
csharp
public (int endIndex, string value) CollectString(in ReadOnlySpan<char> span, char endQuote = '\'')
Declaration
csharp
public (int endIndex, string value) CollectString(in ReadOnlySpan<char> span, char endQuote = '\'')
Returns

System.ValueTuple<System.Int32,System.String>

Parameters
TypeName
System.ReadOnlySpan<System.Char>span
System.CharendQuote

GetEscapedCharacter(ReadOnlySpan<char>, ref int, char)

Does not do Utf32 escapes.

View Source
Declaration
csharp
public char GetEscapedCharacter(ReadOnlySpan<char> span, ref int i, char endQuote = '\'')
Declaration
csharp
public char GetEscapedCharacter(ReadOnlySpan<char> span, ref int i, char endQuote = '\'')
Returns

System.Char: The escaped character.

Parameters
TypeNameDescription
System.ReadOnlySpan<System.Char>span
System.Int32iThe index after the escaping forward slash. Will get incremented by 3 if the escape was Utf16.
System.CharendQuote

GetCharactersForUnicodeEscape(in ReadOnlySpan<char>, int, int, char)

View Source
Declaration
csharp
public ReadOnlySpan<char> GetCharactersForUnicodeEscape(in ReadOnlySpan<char> span, int start, int length, char endQuote = '\'')
Declaration
csharp
public ReadOnlySpan<char> GetCharactersForUnicodeEscape(in ReadOnlySpan<char> span, int start, int length, char endQuote = '\'')
Returns

System.ReadOnlySpan<System.Char>

Parameters
TypeName
System.ReadOnlySpan<System.Char>span
System.Int32start
System.Int32length
System.CharendQuote

IsMatch(in ReadOnlySpan<char>, ReadOnlySpan<char>)

View Source
Declaration
csharp
public bool IsMatch(in ReadOnlySpan<char> span, ReadOnlySpan<char> toMatch)
Declaration
csharp
public bool IsMatch(in ReadOnlySpan<char> span, ReadOnlySpan<char> toMatch)
Returns

System.Boolean

Parameters
TypeName
System.ReadOnlySpan<System.Char>span
System.ReadOnlySpan<System.Char>toMatch

CollectOperation(in ReadOnlySpan<char>)

View Source
Declaration
csharp
public (int, TokenType tokenType, OperationEnum operationEnum) CollectOperation(in ReadOnlySpan<char> span)
Declaration
csharp
public (int, TokenType tokenType, OperationEnum operationEnum) CollectOperation(in ReadOnlySpan<char> span)
Returns

System.ValueTuple<System.Int32,RCaron.TokenType,RCaron.OperationEnum>

Parameters
TypeName
System.ReadOnlySpan<System.Char>span

GetLocation(int, int)

View Source
Declaration
csharp
public TextSpan GetLocation(int startIndex, int length)
Declaration
csharp
public TextSpan GetLocation(int startIndex, int length)
Returns

RCaron.Parsing.TextSpan

Parameters
TypeName
System.Int32startIndex
System.Int32length

GetLocation(ReadOnlySpan<char>, int, int)

View Source
Declaration
csharp
public TextSpan GetLocation(ReadOnlySpan<char> subSpan, int startIndexInSubSpan, int length)
Declaration
csharp
public TextSpan GetLocation(ReadOnlySpan<char> subSpan, int startIndexInSubSpan, int length)
Returns

RCaron.Parsing.TextSpan

Parameters
TypeName
System.ReadOnlySpan<System.Char>subSpan
System.Int32startIndexInSubSpan
System.Int32length

GetNumberSuffixType(ReadOnlySpan<char>, bool, bool, out int)

View Source
Declaration
csharp
public TokenReader.NumberType GetNumberSuffixType(ReadOnlySpan<char> span, bool isHex, bool isDouble, out int suffixLength)
Declaration
csharp
public TokenReader.NumberType GetNumberSuffixType(ReadOnlySpan<char> span, bool isHex, bool isDouble, out int suffixLength)
Returns

RCaron.Parsing.TokenReader.NumberType

Parameters
TypeName
System.ReadOnlySpan<System.Char>span
System.BooleanisHex
System.BooleanisDouble
System.Int32suffixLength

ParseNumber(ReadOnlySpan<char>, NumberType, bool)

View Source
Declaration
csharp
public object ParseNumber(ReadOnlySpan<char> span, TokenReader.NumberType numberType, bool isHex)
Declaration
csharp
public object ParseNumber(ReadOnlySpan<char> span, TokenReader.NumberType numberType, bool isHex)
Returns

System.Object

Parameters
TypeName
System.ReadOnlySpan<System.Char>span
RCaron.Parsing.TokenReader.NumberTypenumberType
System.BooleanisHex

Extension Methods