Versions in this module Expand all Collapse all v0 v0.1.12 Nov 5, 2024 v0.1.11 Nov 3, 2024 Changes in this version + var ErrExhausted error + func NewUnsupportedValue(kind, expected string) error + type Active struct + func NewActive(global *baseParser, tokens []*slgr.Token) (*Active, error) + func (active *Active) ApplyEvent(event *internal.Event) error + func (active *Active) Forest() []*ParseTree + func (active *Active) NextEvents() ([]*internal.Event, error) + func (active Active) DebugInputStreamString() string + func (active Active) DebugStackString() string + func (active Active) GetError() error + func (active Active) HasError() bool + func (active Active) Shadow() (*Active, error) type Builder + func (b *Builder) AddRule(lhs string, rhss ...string) error + type Iterator struct + func NewIterator(init_fn func() (*Active, error)) (*Iterator, error) + func (itr Iterator) Next() (*Result, error) + func (itr Iterator) Stop() + type ParseTree struct + func NewParseTree(tk *slgr.Token) (*ParseTree, error) + func (pt ParseTree) Equals(other *ParseTree) bool + func (pt ParseTree) Root() *slgr.Token + func (pt ParseTree) Slice() []*slgr.Token + func (pt ParseTree) String() string type Parser + func NewParser(table map[string][]*internal.Item) Parser + ItemsOf func(type_ string) ([]*internal.Item, bool) + type PhaseType int + const PhaseCheckBranch + const PhasePrediction + const PhaseReduction + const PhaseShifting + type Result struct + func (r Result) Emulate() iter.Seq[*Active] + func (r Result) Forest() []*ParseTree + func (r Result) GetError() error v0.1.10 Sep 23, 2024 v0.1.9 Sep 21, 2024 Changes in this version + type ActiveParser struct + func NewActiveParser[T gr.TokenTyper](global *Parser[T]) (*ActiveParser[T], error) + func (ap *ActiveParser[T]) Align(history *bck.History[*internal.Item[T]]) bool + func (ap *ActiveParser[T]) ApplyEvent(item *internal.Item[T]) bool + func (ap *ActiveParser[T]) DetermineNextEvents() []*internal.Item[T] + func (ap ActiveParser[T]) Error() error + func (ap ActiveParser[T]) HasError() bool + func (p *ActiveParser[T]) Reset() + func (p *ActiveParser[T]) SetTokens(tokens []*gr.Token[T]) + func (p ActiveParser[T]) Forest() []*gr.ParseTree[T] + func (p ActiveParser[T]) Pop() (*gr.ParseTree[T], bool) + type ItemSet struct + func NewItemSet[T gr.TokenTyper]() ItemSet[T] + func (b ItemSet[T]) Build() *Parser[T] + func (is *ItemSet[T]) AddRule(lhs T, rhss ...T) error + func (is ItemSet[T]) ItemsWithLhsOf(lhs T) []*internal.Item[T] + func (is ItemSet[T]) PrintTable() []string type Parser + func Build[T gr.TokenTyper](is *ItemSet[T]) *Parser[T] + func (p Parser[T]) ParseFnOf(symbol T) (ParseFn[T], bool) v0.1.8 Sep 15, 2024 Changes in this version + func CheckLookahead[T gr.TokenTyper](lookahead *gr.Token[T], allowed ...T) bool + func CheckTop[T gr.TokenTyper](parser *Parser[T], allowed ...T) (*gr.Token[T], bool) type ErrUnexpectedToken + Expecteds []T type Item + func MustNewItem[T gr.TokenTyper](rule *Rule[T], pos int) *Item[T] + func (i Item[T]) Pos() int + func (i Item[T]) RhsAt(idx int) (T, bool) type ParseFn + func UnambiguousRule[T gr.TokenTyper](items ...*Item[T]) ParseFn[T] v0.1.7 Sep 15, 2024 Changes in this version + type Builder struct + func NewBuilder[T gr.TokenTyper]() Builder[T] + func (b *Builder[T]) Register(rhs T, fn ParseFn[T]) + func (b *Builder[T]) Reset() + func (b Builder[T]) Build() Parser[T] + type ErrUnexpectedToken struct + After *T + Expected T + Got *T + func NewErrUnexpectedToken[T gr.TokenTyper](expected T, after, got *T) *ErrUnexpectedToken[T] + func (e ErrUnexpectedToken[T]) Error() string + type Item struct + func NewItem[T gr.TokenTyper](rule *Rule[T], pos int) (*Item[T], error) + type ParseFn func(parser *Parser[T], top1 *gr.Token[T], lookahead *gr.Token[T]) ([]*Item[T], error) + type Parser struct + func (p *Parser[T]) Parse() error + func (p *Parser[T]) Reset() + func (p *Parser[T]) SetTokens(tokens []*gr.Token[T]) + func (p Parser[T]) Forest() []*gr.Token[T] + func (p Parser[T]) Pop() (*gr.Token[T], bool) + type Rule struct + func NewRule[T gr.TokenTyper](lhs T, rhss ...T) (*Rule[T], error)