item

package
v0.0.0-...-d977049 Latest Latest
Warning

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

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

Documentation

Overview

Package item implements a lexical dotted item

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Rule *ast.LexRule
	Pos  *pos.Pos
}

Item contains the dotted item for one lex rule

func From

func From(rule *ast.LexRule, pos *pos.Pos) *Item

func New

func New(rule *ast.LexRule) *Item

func (*Item) Clone

func (i *Item) Clone() *Item

func (*Item) Emoves

func (i *Item) Emoves() []*Item

func (*Item) Equal

func (i *Item) Equal(other *Item) bool

Equal is true if i and other have the same rule and position.

func (*Item) GetRegExp

func (i *Item) GetRegExp() *ast.RegExp

GetRegExp returns the RegExp containing the current symbol in i. If pos.Len() > 1 this will be an alternate of a LexBracket.

func (*Item) IsReduce

func (i *Item) IsReduce() bool

IsReduce returns true if the position of i is after the last symbol of i

func (*Item) Next

func (i *Item) Next() *Item

Next returns the next item after i. If i is a reduce item Next returns nil

func (*Item) String

func (i *Item) String() string

func (*Item) Symbol

func (i *Item) Symbol() ast.LexSymbol

Symbol returns the base (not bracket) symbol after the item place marker. If i is a reduce item Symbol returns nil

Directories

Path Synopsis
Package pos implements the position of a lexical dotted item
Package pos implements the position of a lexical dotted item

Jump to

Keyboard shortcuts

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