items

package
v3.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	BasicProdIdx int
	Id           string
	Symbols      []string
	Position     int
	NextItem     *Item
	// contains filtered or unexported fields
}

A general CFG item without context. Context is the set of symbols which may follow an item.

func NewItem

func NewItem(head string, alt *ast.SyntaxAlternate, index int) []*Item

NewItem returns the LR(0) item of a basic production index: index of prod in list of basic productions after rewrite from parsed productions.

func (*Item) Equal

func (this *Item) Equal(that *Item) bool

func (*Item) ExpectedSymbol

func (this *Item) ExpectedSymbol() string

func (*Item) HashKey

func (this *Item) HashKey() string

func (*Item) Reduce

func (this *Item) Reduce() bool

Return true iff this is of the form: u -> α•

func (*Item) Shift

func (this *Item) Shift() bool

Return true iff this is of the form: u -> α•β and len(β) > 0

func (*Item) String

func (this *Item) String() string

func (*Item) TailString

func (this *Item) TailString() []string

Return the symbols following the expected symbol. Possibly empty

type Items

type Items struct {
	List []*Item
	// contains filtered or unexported fields
}

func NewItems

func NewItems(prods []*basicprod.Production) *Items

func (*Items) StartItems

func (this *Items) StartItems(prodId string) []*Item

func (*Items) String

func (this *Items) String() string

Jump to

Keyboard shortcuts

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