cockroach: Index | Files

package extract

import ""


Package Files

extract.go xhtml.go

func GenerateBNF Uses

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

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 GenerateRRJar Uses

func GenerateRRJar(jar string, bnf []byte) ([]byte, error)

GenerateRRJar generates via the Railroad jar.

func GenerateRRNet Uses

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

GenerateRRNet generates the RR XHTML from a EBNF file.

func InnerTag Uses

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

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

func Tag Uses

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

Tag returns the tag contents of r.

func XHTMLtoHTML Uses

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

XHTMLtoHTML converts the XHTML railroad diagrams to HTML.

type Grammar Uses

type Grammar map[string]productions

Grammar represents a parsed grammar.

func ParseGrammar Uses

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

ParseGrammar parses the grammar from b.

func (Grammar) ExtractProduction Uses

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.

func (Grammar) Inline Uses

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

Inline inlines names.

Package extract imports 16 packages (graph) and is imported by 1 packages. Updated 2019-11-29. Refresh now. Tools for package owners.