Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder[T gr.TokenTyper] struct { // contains filtered or unexported fields }
func NewBuilder ¶
func NewBuilder[T gr.TokenTyper]() Builder[T]
type ErrUnexpectedToken ¶
type ErrUnexpectedToken[T gr.TokenTyper] struct { Expected T After *T Got *T }
func NewErrUnexpectedToken ¶
func NewErrUnexpectedToken[T gr.TokenTyper](expected T, after, got *T) *ErrUnexpectedToken[T]
func (ErrUnexpectedToken[T]) Error ¶
func (e ErrUnexpectedToken[T]) Error() string
type Item ¶
type Item[T gr.TokenTyper] struct { // contains filtered or unexported fields }
Item is an item in the parsing table.
type Parser ¶
type Parser[T gr.TokenTyper] struct { // contains filtered or unexported fields }
Parser is a parser.
func (*Parser[T]) Parse ¶
Parse parses the list of tokens.
Parameters:
- tokens: the list of tokens.
Returns:
- error: if an error occurred.
func (Parser[T]) Pop ¶
Pop pops a token from the stack.
Returns:
- grammar.Token[T]: the popped token.
- bool: true if the token was found, false otherwise.
type Rule ¶
type Rule[T gr.TokenTyper] struct { // contains filtered or unexported fields }
A rule is a production of a grammar.
Click to show internal directories.
Click to hide internal directories.