extract

package
v0.0.0-...-d851957 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: CC-BY-4.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTag

func ExtractTag(r io.Reader, tag string) (string, error)

ExtractTag returns the tag contents of r.

func GenerateBNF

func GenerateBNF(addr string) (ebnf []byte, err error)

Opens or downloads the .y file at addr and returns at as an EBNF file. Unimplemented branches are removed. Resulting empty nodes and their uses are further removed. Empty nodes are elided.

func GenerateRR

func GenerateRR(bnf []byte) ([]byte, error)

generates the RR XHTML from a EBNF file

func InnerTag

func InnerTag(r io.Reader, tag string) (string, error)

InnerTag returns the inner contents of <tag> from r.

func ReplaceToken

func ReplaceToken(p Productions, f func(Token) Expression)

func WalkToken

func WalkToken(e Expression, f func(Token))

func XHTMLtoHTML

func XHTMLtoHTML(r io.Reader) (string, error)

XHTMLtoHTML converts the XHTML railroad diagrams to HTML.

Types

type Comment

type Comment string

func (Comment) String

func (c Comment) String() string

type Expression

type Expression interface {
	String() string
}

type Grammar

type Grammar map[string]Productions

func ParseGrammar

func ParseGrammar(r io.Reader) (Grammar, error)

Parser the grammar from b.

func (Grammar) ExtractProduction

func (g Grammar) ExtractProduction(name string, descend bool, match, exclude *regexp.Regexp) ([]byte, error)

ExtractProduction extracts the named statement and all its dependencies, in order, into a BNF file. If descend is false, only the named statement is extracted. Inline contains a set of names to include directly where they are used.

func (Grammar) Inline

func (g Grammar) Inline(names ...string) error

func (Grammar) Simplify

func (g Grammar) Simplify()

type Group

type Group Productions

func (Group) String

func (g Group) String() string

type Literal

type Literal string

func (Literal) String

func (l Literal) String() string

type Productions

type Productions []Expression

func Simplify

func Simplify(name string, prods Productions) Productions

func (Productions) Match

func (p Productions) Match(match, exclude *regexp.Regexp) Productions

func (Productions) String

func (p Productions) String() string

type Repeat

type Repeat struct {
	Expression
}

func (Repeat) String

func (r Repeat) String() string

type Sequence

type Sequence []Expression

func (Sequence) String

func (s Sequence) String() string

type Token

type Token string

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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