internal

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType added in v0.1.9

type ActionType int
const (
	ActAccept ActionType = iota // (ACCEPT)
	ActReduce                   // (REDUCE)
	ActShift                    // (SHIFT)
)

func (ActionType) String added in v0.1.9

func (i ActionType) String() string

type Event added in v0.1.11

type Event struct {
	// contains filtered or unexported fields
}

func NewEvent added in v0.1.11

func NewEvent(item *Item, expected_next string) *Event

func (Event) Action added in v0.1.11

func (e Event) Action() ActionType

func (Event) ExpectedNext added in v0.1.11

func (e Event) ExpectedNext() string

func (Event) Rule added in v0.1.11

func (e Event) Rule() *Rule

type Item added in v0.1.9

type Item struct {
	// contains filtered or unexported fields
}

func NewItem added in v0.1.9

func NewItem(rule *Rule, pos int) (*Item, error)

func (Item) Action added in v0.1.11

func (item Item) Action() ActionType

func (Item) BackwardRhs added in v0.1.9

func (item Item) BackwardRhs() iter.Seq[string]

func (Item) ExpectLookahead added in v0.1.11

func (item Item) ExpectLookahead() bool

func (Item) HasLookahead added in v0.1.11

func (item Item) HasLookahead(la string) bool

func (Item) IndicesOf added in v0.1.11

func (item Item) IndicesOf(symbol string) []int

func (Item) Lhs added in v0.1.9

func (item Item) Lhs() string

func (Item) NextRhs added in v0.1.11

func (item Item) NextRhs() (string, bool)

NextRhs returns the symbol after the current position in the RHS.

Returns:

  • string: The symbol after the current position in the RHS.
  • bool: True if the retrieval was successful, false otherwise.

func (Item) Pos added in v0.1.9

func (item Item) Pos() int

func (Item) RhsAt added in v0.1.9

func (item Item) RhsAt(idx int) (string, bool)

func (*Item) SetLookaheads added in v0.1.9

func (item *Item) SetLookaheads(lookaheads []string) error

func (Item) String added in v0.1.9

func (item Item) String() string

type Rule added in v0.1.9

type Rule struct {
	// contains filtered or unexported fields
}

func NewRule added in v0.1.9

func NewRule(lhs string, rhss []string) *Rule

func (Rule) BackwardRhs added in v0.1.9

func (r Rule) BackwardRhs() iter.Seq[string]

func (Rule) IndicesOf added in v0.1.9

func (r Rule) IndicesOf(target string) []int

func (Rule) Lhs added in v0.1.9

func (r Rule) Lhs() string

func (Rule) Rhs added in v0.1.11

func (r Rule) Rhs() iter.Seq[string]

func (Rule) RhsAt added in v0.1.9

func (r Rule) RhsAt(idx int) (string, bool)

func (Rule) Size added in v0.1.9

func (r Rule) Size() int

func (Rule) Symbols added in v0.1.11

func (r Rule) Symbols() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL