Class TokenReader
Assembly: RCaron.dll
Declaration
csharp
Declaration
csharp
Properties
ReturnIgnored
Declaration
csharp
public bool ReturnIgnored { get; set; }
Declaration
csharp
public bool ReturnIgnored { get; set; }
ErrorHandler
Declaration
csharp
public IParsingErrorHandler ErrorHandler { get; }
Declaration
csharp
public IParsingErrorHandler ErrorHandler { get; }
Fields
IgnorePosToken
Declaration
csharp
public static readonly PosToken IgnorePosToken
Declaration
csharp
public static readonly PosToken IgnorePosToken
Methods
Read()
Declaration
csharp
Declaration
csharp
Returns
RCaron.PosToken
CollectExecutableKeyword(in ReadOnlySpan<char>)
Declaration
csharp
public int CollectExecutableKeyword(in ReadOnlySpan<char> span)
Declaration
csharp
public int CollectExecutableKeyword(in ReadOnlySpan<char> span)
Returns
System.Int32
Parameters
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
CollectPathOrKeyword(in ReadOnlySpan<char>, bool)
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
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
System.Boolean | allowFirstDoubleDot |
CollectAnyNumber(in ReadOnlySpan<char>)
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
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
CollectAlphaNumeric(in ReadOnlySpan<char>)
Declaration
csharp
public int CollectAlphaNumeric(in ReadOnlySpan<char> span)
Declaration
csharp
public int CollectAlphaNumeric(in ReadOnlySpan<char> span)
Returns
System.Int32
Parameters
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
CollectAlphaNumericAndSome(in ReadOnlySpan<char>)
Declaration
csharp
public int CollectAlphaNumericAndSome(in ReadOnlySpan<char> span)
Declaration
csharp
public int CollectAlphaNumericAndSome(in ReadOnlySpan<char> span)
Returns
System.Int32
Parameters
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
CollectAlphaNumericAndSomeAndDot(in ReadOnlySpan<char>)
Declaration
csharp
public int CollectAlphaNumericAndSomeAndDot(in ReadOnlySpan<char> span)
Declaration
csharp
public int CollectAlphaNumericAndSomeAndDot(in ReadOnlySpan<char> span)
Returns
System.Int32
Parameters
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
CollectString(in ReadOnlySpan<char>, char)
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
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
System.Char | endQuote |
GetEscapedCharacter(ReadOnlySpan<char>, ref int, char)
Does not do Utf32 escapes.
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
Type | Name | Description |
---|
System.ReadOnlySpan<System.Char> | span | |
System.Int32 | i | The index after the escaping forward slash. Will get incremented by 3 if the escape was Utf16. |
System.Char | endQuote | |
GetCharactersForUnicodeEscape(in ReadOnlySpan<char>, int, int, char)
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
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
System.Int32 | start |
System.Int32 | length |
System.Char | endQuote |
IsMatch(in ReadOnlySpan<char>, ReadOnlySpan<char>)
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
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
System.ReadOnlySpan<System.Char> | toMatch |
CollectOperation(in ReadOnlySpan<char>)
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
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
GetLocation(int, int)
Declaration
csharp
public TextSpan GetLocation(int startIndex, int length)
Declaration
csharp
public TextSpan GetLocation(int startIndex, int length)
Returns
RCaron.Parsing.TextSpan
Parameters
Type | Name |
---|
System.Int32 | startIndex |
System.Int32 | length |
GetLocation(ReadOnlySpan<char>, int, int)
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
Type | Name |
---|
System.ReadOnlySpan<System.Char> | subSpan |
System.Int32 | startIndexInSubSpan |
System.Int32 | length |
GetNumberSuffixType(ReadOnlySpan<char>, bool, bool, out int)
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
Type | Name |
---|
System.ReadOnlySpan<System.Char> | span |
System.Boolean | isHex |
System.Boolean | isDouble |
System.Int32 | suffixLength |
ParseNumber(ReadOnlySpan<char>, NumberType, bool)
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
Extension Methods