amotoen

package module
v0.0.0-...-1daaa0b Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2016 License: BSD-3-Clause, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false
View Source
var Grammar = O(S(Z(ES(" \t\n")), rule, zws, R('\n')))

Functions

This section is empty.

Types

type DeferredState

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

func (*DeferredState) Handle

func (s *DeferredState) Handle(input Input) (Tree, error)

func (*DeferredState) Label

func (s *DeferredState) Label(label string) State

func (*DeferredState) Post

func (s *DeferredState) Post(ph PostHandler) State

func (*DeferredState) PostHandle

func (s *DeferredState) PostHandle(t Tree) PostResult

func (*DeferredState) Set

func (s *DeferredState) Set(newState State)

func (*DeferredState) String

func (s *DeferredState) String() string

type Input

type Input interface {
	Peek() (interface{}, error)
	Cursor() int64
	LinedCursor() string
	Consume(n int64)
	Revert(n int64)
	AtEOI() bool
	Debug(State)
}

func StringInput

func StringInput(s string) Input

type PostHandler

type PostHandler func(Tree) PostResult

type PostResult

type PostResult struct {
	Content interface{}
	Err     error
}

type State

type State interface {
	Handle(Input) (Tree, error)
	Label(string) State
	Post(PostHandler) State
	PostHandle(Tree) PostResult
	Stringer
}

func E

func E(args ...State) State

func ES

func ES(arg string) State

func N

func N(arg State) State

func O

func O(arg State) State

func R

func R(arg rune) State

func S

func S(args ...State) State

func Z

func Z(arg State) State

type Stringer

type Stringer interface {
	String() string
}

type Tree

type Tree interface {
	Append(Tree) Tree
	Source() State
	Process() interface{}
	Stringer
}

func Manual

func Manual(root State, input Input, mustConsumeAll bool) Tree

type Writer

type Writer interface {
	Write([]byte) (int, error)
}
var DebugOut Writer

Jump to

Keyboard shortcuts

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