parse

package
v0.0.0-...-93cae28 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any

func Any(parsers ...Parser) *parseAny

func ILiteral

func ILiteral(lit string) *parseLiteral

func Label

func Label(label string, parser Parser) *parseLabel

func Literal

func Literal(lit string) *parseLiteral

func Longest

func Longest(parsers ...Parser) *parseLongest

func Omit

func Omit(parser Parser) *parseOmit

func Regexp

func Regexp(re string) *parseRegexp

func Series

func Series(parsers ...Parser) *parseSeries

Types

type Node

type Node struct {
	Text     string
	Children map[string]*Node
	Next     *Node
}

func (*Node) Get

func (n *Node) Get(token string) (*Node, bool)

func (*Node) String

func (n *Node) String() string

type Parser

type Parser interface {
	Parse(str string) (string, *Node)
}

Parsers have a `Parse` method that takes a string and returns the remainder of the string after parsing, and a `Node` for the parse result.

func Repeat

func Repeat(times int, p Parser) Parser

func Separating

func Separating(str string, parsers ...Parser) Parser

func Surrounding

func Surrounding(start string, end string, parser Parser) Parser

func ZeroOrMore

func ZeroOrMore(p Parser) Parser

Jump to

Keyboard shortcuts

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