parser

package
v3.1.10 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(s string) (token.Tokens, error)

func Pretty

func Pretty(pretty bool) func(*Parser) error

func Size

func Size(size int) func(*Parser) error

Types

type Parser

type Parser struct {
	ParserFunc

	Buffer string

	Pretty bool
	// contains filtered or unexported fields
}

func (*Parser) AST

func (t *Parser) AST() *node32

func (*Parser) Add

func (t *Parser) Add(rule pegRule, begin, end, index uint32)

func (*Parser) Execute

func (p *Parser) Execute()

func (*Parser) Init

func (p *Parser) Init(options ...func(*Parser) error) error

func (*Parser) Parse

func (p *Parser) Parse(rule ...int) error

func (*Parser) PrettyPrintSyntaxTree

func (t *Parser) PrettyPrintSyntaxTree(buffer string)

func (*Parser) Print

func (t *Parser) Print()

func (*Parser) PrintSyntaxTree

func (p *Parser) PrintSyntaxTree()

func (*Parser) Reset

func (p *Parser) Reset()

func (*Parser) SprintSyntaxTree

func (p *Parser) SprintSyntaxTree() string

func (*Parser) Tokens

func (t *Parser) Tokens() []token32

func (*Parser) Trim

func (t *Parser) Trim(length uint32)

func (*Parser) WriteSyntaxTree

func (p *Parser) WriteSyntaxTree(w io.Writer)

type ParserFunc

type ParserFunc struct {
	// pegが生成するTokensと名前が衝突するので別名にする
	Tk token.Tokens
}

Jump to

Keyboard shortcuts

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