parser

package
v0.0.0-...-2932577 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedToken = errors.New("unexpected token")
)

Возможные синтаксические ошибки

Functions

This section is empty.

Types

type ActionNode

type ActionNode struct {
	Name string
	// contains filtered or unexported fields
}

ActionNode вершина дерева разбора, представляющая собой действие.

func (*ActionNode) Coords

func (n *ActionNode) Coords() recognizer.Fragment

type Node

type Node interface {
	Coords() recognizer.Fragment
}

Node интерфейс для представления вершины дерева разбора.

type OperaionNode

type OperaionNode struct {
	Op   Operation
	Next []Node
	// contains filtered or unexported fields
}

OperaionNode вершина дерева разбора, представляющая собой операцию.

func (*OperaionNode) Coords

func (n *OperaionNode) Coords() recognizer.Fragment

type Operation

type Operation int

Operation алиас для определения типа операции

const (
	AlternativeOperation Operation = iota
	SequentialOperation
	ParallelOperation
)

Доступные виды операций

func (Operation) String

func (o Operation) String() string

type SyntaxAnalyzer

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

SyntaxAnalyzer структура представляющая синтаксический анализатор

func NewSyntaxAnalyzer

func NewSyntaxAnalyzer(r *recognizer.LexicalRecognizer) *SyntaxAnalyzer

NewSyntaxAnalyzer создает новый синтаксический анализатор, связанный с переданным лексическим распознавателем.

func (*SyntaxAnalyzer) Parse

func (a *SyntaxAnalyzer) Parse() (Node, error)

Parse выполняет построение дерева разбора.

Jump to

Keyboard shortcuts

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