parser

package
v0.0.0-...-bc2ff70 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TokMap = token.NewTokenMap(
	[]string{
		"INVALID",
		"␚",
		"empty",
		";",
		"package",
		"tok_identifier",
		"import",
		"tok_literal",
		"enum",
		"{",
		"}",
		"message",
		"=",
		"true",
		"false",
		"tok_num",
		"map",
		"<",
		",",
		">",
		"[",
		"]",
		"repeated",
		"service",
		"call",
		":",
		"notify",
		"(",
		")",
		"project",
		"tok_doc",
	},
	map[string]token.Type{
		"INVALID":        0,
		"␚":              1,
		"empty":          2,
		";":              3,
		"package":        4,
		"tok_identifier": 5,
		"import":         6,
		"tok_literal":    7,
		"enum":           8,
		"{":              9,
		"}":              10,
		"message":        11,
		"=":              12,
		"true":           13,
		"false":          14,
		"tok_num":        15,
		"map":            16,
		"<":              17,
		",":              18,
		">":              19,
		"[":              20,
		"]":              21,
		"repeated":       22,
		"service":        23,
		"call":           24,
		":":              25,
		"notify":         26,
		"(":              27,
		")":              28,
		"project":        29,
		"tok_doc":        30,
	},
)

Functions

This section is empty.

Types

type Attrib

type Attrib interface {
}

type Context

type Context interface{}

Parser-specific user-defined and entirely-optional context, accessible as '$Context' in SDT actions.

type Parser

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

func NewParser

func NewParser() *Parser

func (*Parser) Error

func (p *Parser) Error(err error, scanner Scanner) (recovered bool, errorAttrib *parseError.Error)

func (*Parser) Parse

func (p *Parser) Parse(scanner Scanner) (res interface{}, err error)

func (*Parser) Reset

func (p *Parser) Reset()

type ProdTab

type ProdTab [numProductions]ProdTabEntry

type ProdTabEntry

type ProdTabEntry struct {
	String     string
	Id         string
	NTType     int
	Index      int
	NumSymbols int
	ReduceFunc func([]Attrib, interface{}) (Attrib, error)
}

type Scanner

type Scanner interface {
	Scan() (tok *token.Token)
}

Jump to

Keyboard shortcuts

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