dynaml

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2015 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",
	"req_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)

func (AdditionExpr) String

func (e AdditionExpr) String() string

type AutoExpr

type AutoExpr struct {
	Path []string
}

func (AutoExpr) Evaluate

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

func (AutoExpr) String

func (e AutoExpr) String() string

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)

func (BooleanExpr) String

func (e BooleanExpr) String() string

type CallExpr

type CallExpr struct {
	Name      string
	Arguments []Expression
}

func (CallExpr) Evaluate

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

func (CallExpr) String

func (e CallExpr) String() string

type ConcatenationExpr

type ConcatenationExpr struct {
	A Expression
	B Expression
}

func (ConcatenationExpr) Evaluate

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

func (ConcatenationExpr) String

func (e ConcatenationExpr) String() string

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 int64
}

func (IntegerExpr) Evaluate

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

func (IntegerExpr) String

func (e IntegerExpr) String() string

type ListExpr

type ListExpr struct {
	Contents []Expression
}

func (ListExpr) Evaluate

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

func (ListExpr) String

func (e ListExpr) String() string

type MergeExpr

type MergeExpr struct {
	Path []string
}

func (MergeExpr) Evaluate

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

func (MergeExpr) String

func (e MergeExpr) String() string

type NilExpr

type NilExpr struct{}

func (NilExpr) Evaluate

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

func (NilExpr) String

func (e NilExpr) String() string

type OrExpr

type OrExpr struct {
	A Expression
	B Expression
}

func (OrExpr) Evaluate

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

func (OrExpr) String

func (e OrExpr) String() string

type ReferenceExpr

type ReferenceExpr struct {
	Path []string
}

func (ReferenceExpr) Evaluate

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

func (ReferenceExpr) String

func (e ReferenceExpr) String() string

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
	Rulereq_ws

	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)

func (StringExpr) String

func (e StringExpr) String() string

type SubtractionExpr

type SubtractionExpr struct {
	A Expression
	B Expression
}

func (SubtractionExpr) Evaluate

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

func (SubtractionExpr) String

func (e SubtractionExpr) String() string

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