parser

package module
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2015 License: MIT Imports: 4 Imported by: 0

README

parser

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EOF = rune('∎')
View Source
var ErrEOF = errors.New("End of File")

Functions

This section is empty.

Types

type ASTNode

type ASTNode interface {
	AddChild(ASTNode)
}

type Parser

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

func New added in v0.0.3

func New(input string, root ASTNode) *Parser

func (*Parser) Accept

func (p *Parser) Accept(valid string) bool

func (*Parser) AcceptRun

func (p *Parser) AcceptRun(valid string)

func (*Parser) AddNode

func (p *Parser) AddNode(n ASTNode)

func (*Parser) Backup

func (p *Parser) Backup()

backup steps back one rune can be called only once per call of next

func (*Parser) Emit added in v0.0.4

func (p *Parser) Emit() string

emit passes an item back to the client

func (*Parser) Errorf

func (p *Parser) Errorf(format string, args ...interface{})

func (*Parser) ForwardUntil added in v0.0.5

func (p *Parser) ForwardUntil(stopper string)

runs forward until one of the stopper

func (*Parser) HasError added in v0.0.6

func (p *Parser) HasError() bool

func (*Parser) Ignore

func (p *Parser) Ignore()

func (*Parser) IsEOF added in v0.0.6

func (p *Parser) IsEOF() bool

func (*Parser) Last added in v0.0.12

func (p *Parser) Last() ASTNode

func (*Parser) Next

func (p *Parser) Next() (rune_ rune)

func (*Parser) Peek

func (p *Parser) Peek() rune

func (*Parser) PopNode

func (p *Parser) PopNode()

func (*Parser) QueueLen added in v0.0.10

func (p *Parser) QueueLen() int

QueueLen returns the length of the astQueue

func (*Parser) Root

func (p *Parser) Root() ASTNode

func (*Parser) Run

func (p *Parser) Run(fn State) (err error)

type State

type State func(p *Parser) (next State)

last State must return ErrEOF

Jump to

Keyboard shortcuts

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