Table of Contents

Interface ITokenSemanticProvider<TChar>

Namespace
Farkle.Parser.Semantics
Assembly
Farkle.dll

Provides an interface to run semantic actions on a token.

public interface ITokenSemanticProvider<TChar>

Type Parameters

TChar

The 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

parserState ParserState

The state of the parsing operation.

symbol TokenSymbolHandle

The symbol of the token that was found.

characters ReadOnlySpan<TChar>

The characters of the token.

Returns

object

The semantic value of the token.

See Also

ISemanticProvider<TChar, T>