Documentation ¶
Index ¶
- func ExtractTag(r io.Reader, tag string) (string, error)
- func GenerateBNF(addr string) (ebnf []byte, err error)
- func GenerateRRJar(jar string, bnf []byte) ([]byte, error)
- func GenerateRRNet(bnf []byte) ([]byte, error)
- func InnerTag(r io.Reader, tag string) (string, error)
- func ReplaceToken(p Productions, f func(Token) Expression)
- func WalkToken(e Expression, f func(Token))
- func XHTMLtoHTML(r io.Reader) (string, error)
- type Comment
- type Expression
- type Grammar
- type Group
- type Literal
- type Productions
- type Repeat
- type Sequence
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTag ¶
ExtractTag returns the tag contents of r.
func GenerateBNF ¶
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 GenerateRRNet ¶
generates the RR XHTML from a EBNF file
func ReplaceToken ¶
func ReplaceToken(p Productions, f func(Token) Expression)
func WalkToken ¶
func WalkToken(e Expression, f func(Token))
Types ¶
type Expression ¶
type Expression interface {
String() string
}
type Grammar ¶
type Grammar map[string]Productions
func (Grammar) ExtractProduction ¶
func (g Grammar) ExtractProduction(name string, descend, nosplit 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.
type Productions ¶
type Productions []Expression
func Simplify ¶
func Simplify(name string, prods Productions) Productions
func (Productions) Match ¶
func (p Productions) Match(nosplit bool, match, exclude []*regexp.Regexp) string
func (Productions) String ¶
func (p Productions) String() string
type Repeat ¶
type Repeat struct {
Expression
}
type Sequence ¶
type Sequence []Expression
Click to show internal directories.
Click to hide internal directories.