Class Token
An atomic lexical unit produced by LexerEngine. Each token records its source position, the rule that matched it, the active lexer mode at the time of the match, and the matched text.
public record Token : IEquatable<Token>
- Inheritance
-
Token
- Implements
- Inherited Members
- Extension Methods
Constructors
Token(SourceSpan, string, string, string, string)
An atomic lexical unit produced by LexerEngine. Each token records its source position, the rule that matched it, the active lexer mode at the time of the match, and the matched text.
public Token(SourceSpan Span, string RuleName, string ModeName, string Channel, string Text)
Parameters
SpanSourceSpanPosition and length of the token in the source text.
RuleNamestringName of the lexer rule that produced this token, for example
"ID".ModeNamestringName of the active lexer mode when this token was produced.
ChannelstringChannel name assigned to this token.
TextstringRaw matched text.
Properties
Channel
Channel name assigned to this token.
public string Channel { get; init; }
Property Value
ModeName
Name of the active lexer mode when this token was produced.
public string ModeName { get; init; }
Property Value
RuleName
Name of the lexer rule that produced this token, for example "ID".
public string RuleName { get; init; }
Property Value
Span
Position and length of the token in the source text.
public SourceSpan Span { get; init; }
Property Value
Text
Raw matched text.
public string Text { get; init; }