parser

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0, BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

A parser for the DOT grammar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(r io.Reader) (*ast.Graph, error)

Parses a reader which contains a DOT string and outputs the abstract syntax tree representing the graph.

func ParseBytes

func ParseBytes(dotBytes []byte) (*ast.Graph, error)

Parses the bytes representing a DOT string and outputs the abstract syntax tree representing the graph.

func ParseFile

func ParseFile(filename string) (*ast.Graph, error)

Parses a file which contains a DOT string and outputs the abstract syntax tree representing the graph.

func ParseString

func ParseString(dotString string) (*ast.Graph, error)

Parses a DOT string and outputs the abstract syntax tree representing the graph.

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