parser

package
v100.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package parser is generated by gogll. Do not edit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {

	// Grammar slot at which the error occured.
	Slot slot.Label

	// The token at which the error occurred.
	Token *token.Token

	// The line and column in the input text at which the error occurred
	Line, Column int

	// The tokens expected at the point where the error occurred
	Expected map[token.Type]string
	// contains filtered or unexported fields
}

Error is returned by Parse at every point at which the parser fails to parse a grammar production. For non-LL-1 grammars there will be an error for each alternate attempted by the parser.

The errors are sorted in descending order of input position (index of token in the stream of tokens).

Normally the error of interest is the one that has parsed the largest number of tokens.

func Parse

func Parse(l *lexer.Lexer) (*bsr.Set, []*Error)

Parse returns the BSR set containing the parse forest. If the parse was successfull []*Error is nil

func (*Error) String

func (pe *Error) String() string

Directories

Path Synopsis
Package bsr implements a Binary Subtree Representation set as defined in
Package bsr implements a Binary Subtree Representation set as defined in
Package slot is generated by gogll.
Package slot is generated by gogll.
Package symbols is generated by gogll.
Package symbols is generated by gogll.

Jump to

Keyboard shortcuts

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