Interface ITokenSemanticProvider<TChar>
Provides an interface to run semantic actions on a token.
public interface ITokenSemanticProvider<TChar>
Type Parameters
TCharThe type of characters the token is made of.
Methods
Transform(ref ParserState, TokenSymbolHandle, ReadOnlySpan<TChar>)
Converts the characters of a token to a semantic value. This method is called by the tokenizer when a token corresponding to a terminal is found.
object? Transform(ref ParserState parserState, TokenSymbolHandle symbol, ReadOnlySpan<TChar> characters)
Parameters
parserStateParserStateThe state of the parsing operation.
symbolTokenSymbolHandleThe symbol of the token that was found.
charactersReadOnlySpan<TChar>The characters of the token.
Returns
- object
The semantic value of the token.
See Also
ISemanticProvider<TChar, T>