parser

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParseErr = fmt.Errorf("parse error")

	SynErrFragmentInvalidSymbol = fmt.Errorf("invalid fragment symbol")
)

Functions

func ApplyFragments

func ApplyFragments(t CPTree, fragments map[spec.LexKindName]CPTree) (bool, error)

func CompleteFragments

func CompleteFragments(fragments map[spec.LexKindName]CPTree) error

func NewParser

func NewParser(kind spec.LexKindName, src io.Reader) *parser

Types

type CPRange

type CPRange struct {
	From rune
	To   rune
}

type CPTree

type CPTree interface {
	fmt.Stringer
	Range() (rune, rune, bool)
	Optional() (CPTree, bool)
	Repeatable() (CPTree, bool)
	Concatenation() (CPTree, CPTree, bool)
	Alternatives() (CPTree, CPTree, bool)
	Describe() (spec.LexKindName, []spec.LexKindName, error)
	// contains filtered or unexported methods
}

type PatternEntry

type PatternEntry struct {
	ID      spec.LexModeKindID
	Pattern []byte
}

Jump to

Keyboard shortcuts

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