cockroach: Index | Files

package yacc

import ""

Package yacc parses .y files.


Package Files

lex.go node.go parse.go

type ExpressionNode Uses

type ExpressionNode struct {
    Items   []Item
    Command string

ExpressionNode hold a single expression.

type Item Uses

type Item struct {
    Value string
    Typ   ItemTyp

Item hold an item.

type ItemTyp Uses

type ItemTyp int

ItemTyp is the item type.

const (
    // TypToken is the token type.
    TypToken ItemTyp = iota
    // TypLiteral is the literal type.

type Pos Uses

type Pos int

Pos represents a byte position in the original input text from which this template was parsed.

type ProductionNode Uses

type ProductionNode struct {
    Name        string
    Expressions []*ExpressionNode

ProductionNode holds is a named production of multiple expressions.

type Tree Uses

type Tree struct {
    Name        string // name of the template represented by the tree.
    Productions []*ProductionNode
    // contains filtered or unexported fields

Tree is the representation of a single parsed file.

func New Uses

func New(name string) *Tree

New allocates a new parse tree with the given name.

func Parse Uses

func Parse(name, text string) (t *Tree, err error)

Parse parses the yacc file text with optional name.

func (*Tree) Parse Uses

func (t *Tree) Parse(text string) (err error)

Parse parses the yacc string to construct a representation of the file for analysis.

Package yacc imports 6 packages (graph) and is imported by 3 packages. Updated 2020-05-16. Refresh now. Tools for package owners.