TomlLexer Class
Provides incremental lexical tokenization for TOML text.
public sealed class TomlLexerProperties
| Name | Description |
|---|---|
| Current | Gets the current token. |
| CurrentSpan | Gets the source span associated with the current token. |
| Errors | Gets diagnostics produced by the lexer. |
| HasErrors | Gets a value indicating whether lexer diagnostics include errors. |
| Mode | Gets or sets the lexer mode. |
| SourceName | Gets the source name associated with this lexer. |
Current
TomlLexer.csCurrentSpan
TomlLexer.csGets the source span associated with the current token.
public TomlSourceSpan CurrentSpan { get; }Property value
Errors
TomlLexer.csGets diagnostics produced by the lexer.
public IEnumerable<DiagnosticMessage> Errors { get; }Property value
HasErrors
TomlLexer.csMode
TomlLexer.csSourceName
TomlLexer.csMethods
| Name | Description |
|---|---|
| Create(TextReader, TomlLexerOptions, string?) | Creates a lexer over TOML text from a TextReader. |
| Create(TextReader, string?) | Creates a lexer over TOML text from a TextReader. |
| Create(string, TomlLexerOptions, string?) | Creates a lexer over TOML text. |
| Create(string, string?) | Creates a lexer over TOML text. |
| GetText(TomlToken) | Gets the raw source text represented by a token. |
| MoveNext() | Advances to the next token. |
Create overloads
Create(TextReader, TomlLexerOptions, string?)
TomlLexer.csCreates a lexer over TOML text from a TextReader.
public static TomlLexer Create(TextReader reader, TomlLexerOptions lexerOptions, string? sourceName = null)Parameters
readerTextReader- The text reader.
lexerOptionsTomlLexerOptions- Options controlling lexer behavior.
sourceNamestring?- An optional source name used in diagnostics.
Returns
TomlLexer A lexer instance positioned before the first token.
Exceptions
ArgumentNullExceptionreaderisnull.ArgumentNullExceptionlexerOptionsisnull.
Create(TextReader, string?)
TomlLexer.csCreates a lexer over TOML text from a TextReader.
public static TomlLexer Create(TextReader reader, string? sourceName = null)Parameters
readerTextReader- The text reader.
sourceNamestring?- An optional source name used in diagnostics.
Returns
TomlLexer A lexer instance positioned before the first token.
Exceptions
ArgumentNullExceptionreaderisnull.
Create(string, TomlLexerOptions, string?)
TomlLexer.csCreates a lexer over TOML text.
public static TomlLexer Create(string toml, TomlLexerOptions lexerOptions, string? sourceName = null)Parameters
tomlstring- The TOML payload.
lexerOptionsTomlLexerOptions- Options controlling lexer behavior.
sourceNamestring?- An optional source name used in diagnostics.
Returns
TomlLexer A lexer instance positioned before the first token.
Exceptions
ArgumentNullExceptiontomlisnull.ArgumentNullExceptionlexerOptionsisnull.
Create(string, string?)
TomlLexer.csCreates a lexer over TOML text.
Parameters
Returns
TomlLexer A lexer instance positioned before the first token.
Exceptions
ArgumentNullExceptiontomlisnull.