ast

package
v0.0.0-...-c64e826 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AST

type AST struct {
	Statements []*Statement
	// contains filtered or unexported fields
}

func (*AST) Clone

func (a *AST) Clone() *AST

func (*AST) LineDone

func (a *AST) LineDone()

func (*AST) String

func (a *AST) String() string

type CommandNode

type CommandNode struct {
	CmdResult interface{}
	CmdErr    error

	Action, Entity string
	Refs           map[string]string
	Params         map[string]interface{}
	Aliases        map[string]string
	Holes          map[string]string
}

func (*CommandNode) Err

func (n *CommandNode) Err() error

func (*CommandNode) ProcessHoles

func (n *CommandNode) ProcessHoles(fills map[string]interface{}) map[string]interface{}

func (*CommandNode) ProcessRefs

func (n *CommandNode) ProcessRefs(fills map[string]interface{})

func (*CommandNode) Result

func (n *CommandNode) Result() interface{}

func (*CommandNode) String

func (n *CommandNode) String() string

type DeclarationNode

type DeclarationNode struct {
	Ident string
	Expr  ExpressionNode
}

func (*DeclarationNode) String

func (n *DeclarationNode) String() string

type ExpressionNode

type ExpressionNode interface {
	Node
	Result() interface{}
	Err() error
}

type Node

type Node interface {
	String() string
	// contains filtered or unexported methods
}

type Peg

type Peg struct {
	*AST

	Buffer string

	Pretty bool
	// contains filtered or unexported fields
}

func (*Peg) AST

func (t *Peg) AST() *node32

func (*Peg) Add

func (t *Peg) Add(rule pegRule, begin, end, index uint32)

func (*Peg) Execute

func (p *Peg) Execute()

func (*Peg) Init

func (p *Peg) Init()

func (*Peg) Parse

func (p *Peg) Parse(rule ...int) error

func (*Peg) PrettyPrintSyntaxTree

func (t *Peg) PrettyPrintSyntaxTree(buffer string)

func (*Peg) Print

func (t *Peg) Print()

func (*Peg) PrintSyntaxTree

func (p *Peg) PrintSyntaxTree()

func (*Peg) Reset

func (p *Peg) Reset()

func (*Peg) Tokens

func (t *Peg) Tokens() []token32

func (*Peg) Trim

func (t *Peg) Trim(length uint32)

type Statement

type Statement struct {
	Node
}

Jump to

Keyboard shortcuts

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