dynaml

package
v0.0.0-...-683c689 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2013 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const END_SYMBOL byte = 0

Variables

View Source
var Rul3s = [...]string{
	"Unknown",
	"Dynaml",
	"Expression",
	"Level2",
	"Or",
	"Level1",
	"Concatenation",
	"Addition",
	"Subtraction",
	"Level0",
	"Grouped",
	"Call",
	"Arguments",
	"Name",
	"Comma",
	"Integer",
	"String",
	"Boolean",
	"Nil",
	"List",
	"Contents",
	"Merge",
	"Auto",
	"Reference",
	"ws",

	"Pre_",
	"_In_",
	"_Suf",
}

Functions

This section is empty.

Types

type AdditionExpr

type AdditionExpr struct {
	A Expression
	B Expression
}

func (AdditionExpr) Evaluate

func (e AdditionExpr) Evaluate(binding Binding) (yaml.Node, bool)

type AutoExpr

type AutoExpr struct {
	Path []string
}

func (AutoExpr) Evaluate

func (e AutoExpr) Evaluate(binding Binding) (yaml.Node, bool)

type Binding

type Binding interface {
	FindFromRoot([]string) (yaml.Node, bool)
	FindReference([]string) (yaml.Node, bool)
	FindInStubs([]string) (yaml.Node, bool)
}

type BooleanExpr

type BooleanExpr struct {
	Value bool
}

func (BooleanExpr) Evaluate

func (e BooleanExpr) Evaluate(Binding) (yaml.Node, bool)

type CallExpr

type CallExpr struct {
	Name      string
	Arguments []Expression
}

func (CallExpr) Evaluate

func (e CallExpr) Evaluate(binding Binding) (yaml.Node, bool)

type ConcatenationExpr

type ConcatenationExpr struct {
	A Expression
	B Expression
}

func (ConcatenationExpr) Evaluate

func (e ConcatenationExpr) Evaluate(binding Binding) (yaml.Node, bool)

type DynamlGrammar

type DynamlGrammar struct {
	Buffer string

	Parse func(rule ...int) error
	Reset func()
	TokenTree
	// contains filtered or unexported fields
}

func (*DynamlGrammar) Highlighter

func (p *DynamlGrammar) Highlighter()

func (*DynamlGrammar) Init

func (p *DynamlGrammar) Init()

func (*DynamlGrammar) PrintSyntaxTree

func (p *DynamlGrammar) PrintSyntaxTree()

type Expression

type Expression interface {
	Evaluate(Binding) (yaml.Node, bool)
}

func Parse

func Parse(source string, path []string) (Expression, error)

type IntegerExpr

type IntegerExpr struct {
	Value int
}

func (IntegerExpr) Evaluate

func (e IntegerExpr) Evaluate(Binding) (yaml.Node, bool)

type ListExpr

type ListExpr struct {
	Contents []Expression
}

func (ListExpr) Evaluate

func (e ListExpr) Evaluate(binding Binding) (yaml.Node, bool)

type MergeExpr

type MergeExpr struct {
	Path []string
}

func (MergeExpr) Evaluate

func (e MergeExpr) Evaluate(binding Binding) (yaml.Node, bool)

type NilExpr

type NilExpr struct{}

func (NilExpr) Evaluate

func (e NilExpr) Evaluate(Binding) (yaml.Node, bool)

type OrExpr

type OrExpr struct {
	A Expression
	B Expression
}

func (OrExpr) Evaluate

func (e OrExpr) Evaluate(binding Binding) (yaml.Node, bool)

type ReferenceExpr

type ReferenceExpr struct {
	Path []string
}

func (ReferenceExpr) Evaluate

func (e ReferenceExpr) Evaluate(binding Binding) (yaml.Node, bool)

type Rule

type Rule uint8

The rule types inferred from the grammar are below.

const (
	RuleUnknown Rule = iota
	RuleDynaml
	RuleExpression
	RuleLevel2
	RuleOr
	RuleLevel1
	RuleConcatenation
	RuleAddition
	RuleSubtraction
	RuleLevel0
	RuleGrouped
	RuleCall
	RuleArguments
	RuleName
	RuleComma
	RuleInteger
	RuleString
	RuleBoolean
	RuleNil
	RuleList
	RuleContents
	RuleMerge
	RuleAuto
	RuleReference
	Rulews

	RulePre_
	Rule_In_
	Rule_Suf
)

type State16

type State16 struct {
	// contains filtered or unexported fields
}

func (*State16) GetToken32

func (t *State16) GetToken32() token32

func (*State16) String

func (t *State16) String() string

type State32

type State32 struct {
	// contains filtered or unexported fields
}

func (*State32) GetToken32

func (t *State32) GetToken32() token32

func (*State32) String

func (t *State32) String() string

type StringExpr

type StringExpr struct {
	Value string
}

func (StringExpr) Evaluate

func (e StringExpr) Evaluate(Binding) (yaml.Node, bool)

type SubtractionExpr

type SubtractionExpr struct {
	A Expression
	B Expression
}

func (SubtractionExpr) Evaluate

func (e SubtractionExpr) Evaluate(binding Binding) (yaml.Node, bool)

type TokenTree

type TokenTree interface {
	Print()
	PrintSyntax()
	PrintSyntaxTree(buffer string)
	Add(rule Rule, begin, end, next, depth int)
	Expand(index int) TokenTree
	Tokens() <-chan token32
	Error() []token32
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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