parser

package
v0.0.0-...-dcc2aae Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LLOne

type LLOne struct {
	Tokens []*token.Token
	Index  int
}

func NewLLOne

func NewLLOne(tokens []*token.Token) *LLOne

func (*LLOne) Match

func (llo *LLOne) Match() (*ast.Node, error)

type NFA

type NFA struct {
	Tokens    []*token.Token
	Index     int
	InitState *State
}

func NewNFA

func NewNFA(tokens []*token.Token) *NFA

NewNFA returns a new *NFA

func (*NFA) Match

func (nfa *NFA) Match() (*ast.Node, error)

func (*NFA) Print

func (nfa *NFA) Print()

type Parser

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

func NewParser

func NewParser(fa dependency.Parser) *Parser

func (*Parser) Parse

func (p *Parser) Parse() (*ast.Node, error)

type State

type State struct {
	Index  int
	Node   *ast.Node
	Parent *ast.Node
	Next   map[token.Type][]*State
}

func NewState

func NewState(i int) *State

func (*State) AddNext

func (s *State) AddNext(t token.Type, ns *State)

func (*State) EpsilonMove

func (s *State) EpsilonMove() []*State

func (*State) Print

func (s *State) Print()

func (*State) SetNode

func (s *State) SetNode(node *ast.Node)

func (*State) SetParent

func (s *State) SetParent(parent *ast.Node)

Jump to

Keyboard shortcuts

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