MCPcopy
hub / github.com/purpleidea/mgmt / Node

Interface Node

lang/interfaces/ast.go:46–54  ·  view source on GitHub ↗

Node represents either a Stmt or an Expr. It contains the minimum set of methods that they must both implement. In practice it is not used especially often since we usually know which kind of node we want.

Source from the content-addressed store, hash-verified

44// methods that they must both implement. In practice it is not used especially
45// often since we usually know which kind of node we want.
46type Node interface {
47 //fmt.Stringer // already provided by pgraph.Vertex
48 pgraph.Vertex // must implement this since we store these in our graphs
49
50 // Apply is a general purpose iterator method that operates on any node.
51 Apply(fn func(Node) error) error
52
53 //Parent() Node // TODO: should we implement this?
54}
55
56// Stmt represents a statement node in the language. A stmt could be a resource,
57// a `bind` statement, or even an `if` statement. (Different from an `if`

Callers 8

ApplyMethod · 0.65
ApplyMethod · 0.65
ApplyMethod · 0.65
ApplyMethod · 0.65
ApplyMethod · 0.65
ApplyMethod · 0.65
ApplyMethod · 0.65
ApplyMethod · 0.65

Implementers 15

StmtBindlang/ast/structs.go
StmtReslang/ast/structs.go
StmtEdgelang/ast/structs.go
StmtIflang/ast/structs.go
StmtForlang/ast/structs.go
StmtProglang/ast/structs.go
StmtFunclang/ast/structs.go
StmtClasslang/ast/structs.go
StmtIncludelang/ast/structs.go
StmtImportlang/ast/structs.go
StmtCommentlang/ast/structs.go
ExprBoollang/ast/structs.go

Calls

no outgoing calls

Tested by

no test coverage detected