ast

package
v0.0.21 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidAction

func IsInvalidAction(s string) bool

func IsInvalidEntity

func IsInvalidEntity(s string) bool

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 Action

type Action string
const (
	UnknownAction Action = "unknown"
	NoneAction    Action = "none"

	Create Action = "create"
	Delete Action = "delete"
	Update Action = "update"

	Check Action = "check"

	Start Action = "start"
	Stop  Action = "stop"

	Attach Action = "attach"
	Detach Action = "detach"
)

type CommandNode

type CommandNode struct {
	CmdResult interface{}
	CmdErr    error

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

func (*CommandNode) Equal

func (n *CommandNode) Equal(n2 Node) bool

func (*CommandNode) Err

func (n *CommandNode) Err() error

func (*CommandNode) Keys

func (n *CommandNode) Keys() (keys []string)

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) Equal

func (n *DeclarationNode) Equal(n2 Node) bool

func (*DeclarationNode) String

func (n *DeclarationNode) String() string

type Entity

type Entity string
const (
	UnknownEntity Entity = "unknown"
	NoneEntity    Entity = "none"

	Vpc             Entity = "vpc"
	Subnet          Entity = "subnet"
	Instance        Entity = "instance"
	Volume          Entity = "volume"
	Tag             Entity = "tag"
	Securitygroup   Entity = "securitygroup"
	Keypair         Entity = "keypair"
	Internetgateway Entity = "internetgateway"
	Routetable      Entity = "routetable"
	Route           Entity = "route"
	Loadbalancer    Entity = "loadbalancer"
	Listener        Entity = "listener"
	Targetgroup     Entity = "targetgroup"
	Database        Entity = "database"
	Dbsubnetgroup   Entity = "dbsubnetgroup"

	Zone   Entity = "zone"
	Record Entity = "record"

	User      Entity = "user"
	Group     Entity = "group"
	Role      Entity = "role"
	Policy    Entity = "policy"
	Accesskey Entity = "accesskey"

	Bucket        Entity = "bucket"
	Storageobject Entity = "storageobject"

	Subscription Entity = "subscription"
	Topic        Entity = "topic"
	Queue        Entity = "queue"
)

type ExpressionNode

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

type Node

type Node interface {
	String() string
	Equal(Node) bool
	// 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
}

func (*Statement) Clone

func (s *Statement) Clone() *Statement

Jump to

Keyboard shortcuts

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