node position

This commit is contained in:
z7zmey
2017-12-31 12:59:22 +02:00
parent 8edc05c8d5
commit f2d972582f
158 changed files with 1644 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import (
type AltElse struct {
name string
attributes map[string]interface{}
position *node.Position
stmt node.Node
}
@@ -14,6 +15,7 @@ func NewAltElse(stmt node.Node) node.Node {
return AltElse{
"AltElse",
map[string]interface{}{},
nil,
stmt,
}
}
@@ -34,6 +36,15 @@ func (n AltElse) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n AltElse) Position() *node.Position {
return n.position
}
func (n AltElse) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n AltElse) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type AltElseIf struct {
name string
attributes map[string]interface{}
position *node.Position
cond node.Node
stmt node.Node
}
@@ -15,6 +16,7 @@ func NewAltElseIf(cond node.Node, stmt node.Node) node.Node {
return AltElseIf{
"AltElseIf",
map[string]interface{}{},
nil,
cond,
stmt,
}
@@ -36,6 +38,15 @@ func (n AltElseIf) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n AltElseIf) Position() *node.Position {
return n.position
}
func (n AltElseIf) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n AltElseIf) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type AltIf struct {
name string
attributes map[string]interface{}
position *node.Position
cond node.Node
stmt node.Node
elseIf []node.Node
@@ -17,6 +18,7 @@ func NewAltIf(cond node.Node, stmt node.Node) node.Node {
return AltIf{
"AltIf",
map[string]interface{}{},
nil,
cond,
stmt,
nil,
@@ -40,6 +42,15 @@ func (n AltIf) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n AltIf) Position() *node.Position {
return n.position
}
func (n AltIf) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n AltIf) AddElseIf(elseIf node.Node) node.Node {
if n.elseIf == nil {
n.elseIf = make([]node.Node, 0)

View File

@@ -7,6 +7,7 @@ import (
type Break struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
}
@@ -14,6 +15,7 @@ func NewBreak(expr node.Node) node.Node {
return Break{
"Break",
map[string]interface{}{},
nil,
expr,
}
}
@@ -34,6 +36,15 @@ func (n Break) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Break) Position() *node.Position {
return n.position
}
func (n Break) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Break) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Case struct {
name string
attributes map[string]interface{}
position *node.Position
cond node.Node
stmts []node.Node
}
@@ -15,6 +16,7 @@ func NewCase(cond node.Node, stmts []node.Node) node.Node {
return Case{
"Case",
map[string]interface{}{},
nil,
cond,
stmts,
}
@@ -36,6 +38,15 @@ func (n Case) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Case) Position() *node.Position {
return n.position
}
func (n Case) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Case) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Catch struct {
name string
attributes map[string]interface{}
position *node.Position
types []node.Node
variable node.Node
stmts []node.Node
@@ -16,6 +17,7 @@ func NewCatch(types []node.Node, variable node.Node, stmts []node.Node) node.Nod
return Catch{
"Catch",
map[string]interface{}{},
nil,
types,
variable,
stmts,
@@ -38,6 +40,15 @@ func (n Catch) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Catch) Position() *node.Position {
return n.position
}
func (n Catch) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Catch) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Class struct {
name string
attributes map[string]interface{}
position *node.Position
className node.Node
modifiers []node.Node
args []node.Node
@@ -19,6 +20,7 @@ func NewClass(className node.Node, modifiers []node.Node, args []node.Node, exte
return Class{
"Class",
map[string]interface{}{},
nil,
className,
modifiers,
args,
@@ -44,6 +46,15 @@ func (n Class) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Class) Position() *node.Position {
return n.position
}
func (n Class) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Class) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type ClassConstList struct {
name string
attributes map[string]interface{}
position *node.Position
modifiers []node.Node
consts []node.Node
}
@@ -15,6 +16,7 @@ func NewClassConstList(modifiers []node.Node, consts []node.Node) node.Node {
return ClassConstList{
"ClassConstList",
map[string]interface{}{},
nil,
modifiers,
consts,
}
@@ -36,6 +38,15 @@ func (n ClassConstList) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n ClassConstList) Position() *node.Position {
return n.position
}
func (n ClassConstList) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ClassConstList) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type ClassMethod struct {
name string
attributes map[string]interface{}
position *node.Position
methodName node.Node
modifiers []node.Node
params []node.Node
@@ -20,6 +21,7 @@ func NewClassMethod(methodName node.Node, modifiers []node.Node, returnsRef bool
map[string]interface{}{
"returnsRef": returnsRef,
},
nil,
methodName,
modifiers,
params,
@@ -44,6 +46,15 @@ func (n ClassMethod) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n ClassMethod) Position() *node.Position {
return n.position
}
func (n ClassMethod) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ClassMethod) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type ConstList struct {
name string
attributes map[string]interface{}
position *node.Position
consts []node.Node
}
@@ -14,6 +15,7 @@ func NewConstList(consts []node.Node) node.Node {
return ConstList{
"ConstList",
map[string]interface{}{},
nil,
consts,
}
}
@@ -34,6 +36,15 @@ func (n ConstList) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n ConstList) Position() *node.Position {
return n.position
}
func (n ConstList) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ConstList) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Constant struct {
name string
attributes map[string]interface{}
position *node.Position
constantName node.Node
expr node.Node
}
@@ -15,6 +16,7 @@ func NewConstant(constantName node.Node, expr node.Node) node.Node {
return Constant{
"Constant",
map[string]interface{}{},
nil,
constantName,
expr,
}
@@ -36,6 +38,15 @@ func (n Constant) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Constant) Position() *node.Position {
return n.position
}
func (n Constant) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Constant) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Continue struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
}
@@ -14,6 +15,7 @@ func NewContinue(expr node.Node) node.Node {
return Continue{
"Continue",
map[string]interface{}{},
nil,
expr,
}
}
@@ -34,6 +36,15 @@ func (n Continue) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Continue) Position() *node.Position {
return n.position
}
func (n Continue) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Continue) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Declare struct {
name string
attributes map[string]interface{}
position *node.Position
consts []node.Node
stmt node.Node
}
@@ -15,6 +16,7 @@ func NewDeclare(consts []node.Node, stmt node.Node) node.Node {
return Declare{
"Declare",
map[string]interface{}{},
nil,
consts,
stmt,
}
@@ -36,6 +38,15 @@ func (n Declare) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Declare) Position() *node.Position {
return n.position
}
func (n Declare) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Declare) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Default struct {
name string
attributes map[string]interface{}
position *node.Position
stmts []node.Node
}
@@ -14,6 +15,7 @@ func NewDefault(stmts []node.Node) node.Node {
return Default{
"Default",
map[string]interface{}{},
nil,
stmts,
}
}
@@ -34,6 +36,15 @@ func (n Default) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Default) Position() *node.Position {
return n.position
}
func (n Default) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Default) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Do struct {
name string
attributes map[string]interface{}
position *node.Position
stmt node.Node
cond node.Node
}
@@ -15,6 +16,7 @@ func NewDo(stmt node.Node, cond node.Node) node.Node {
return Do{
"Do",
map[string]interface{}{},
nil,
stmt,
cond,
}
@@ -36,6 +38,15 @@ func (n Do) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Do) Position() *node.Position {
return n.position
}
func (n Do) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Do) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Echo struct {
name string
attributes map[string]interface{}
position *node.Position
exprs []node.Node
}
@@ -14,6 +15,7 @@ func NewEcho(exprs []node.Node) node.Node {
return Echo{
"Echo",
map[string]interface{}{},
nil,
exprs,
}
}
@@ -34,6 +36,15 @@ func (n Echo) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Echo) Position() *node.Position {
return n.position
}
func (n Echo) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Echo) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Else struct {
name string
attributes map[string]interface{}
position *node.Position
stmt node.Node
}
@@ -14,6 +15,7 @@ func NewElse(stmt node.Node) node.Node {
return Else{
"Else",
map[string]interface{}{},
nil,
stmt,
}
}
@@ -34,6 +36,15 @@ func (n Else) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Else) Position() *node.Position {
return n.position
}
func (n Else) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Else) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type ElseIf struct {
name string
attributes map[string]interface{}
position *node.Position
cond node.Node
stmt node.Node
}
@@ -15,6 +16,7 @@ func NewElseIf(cond node.Node, stmt node.Node) node.Node {
return ElseIf{
"ElseIf",
map[string]interface{}{},
nil,
cond,
stmt,
}
@@ -36,6 +38,15 @@ func (n ElseIf) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n ElseIf) Position() *node.Position {
return n.position
}
func (n ElseIf) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ElseIf) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Expression struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
}
@@ -14,6 +15,7 @@ func NewExpression(expr node.Node) node.Node {
return Expression{
"Expression",
map[string]interface{}{},
nil,
expr,
}
}
@@ -34,6 +36,15 @@ func (n Expression) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Expression) Position() *node.Position {
return n.position
}
func (n Expression) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Expression) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Finally struct {
name string
attributes map[string]interface{}
position *node.Position
stmts []node.Node
}
@@ -14,6 +15,7 @@ func NewFinally(stmts []node.Node) node.Node {
return Finally{
"Finally",
map[string]interface{}{},
nil,
stmts,
}
}
@@ -34,6 +36,15 @@ func (n Finally) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Finally) Position() *node.Position {
return n.position
}
func (n Finally) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Finally) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type For struct {
name string
attributes map[string]interface{}
position *node.Position
init []node.Node
cond []node.Node
loop []node.Node
@@ -17,6 +18,7 @@ func NewFor(init []node.Node, cond []node.Node, loop []node.Node, stmt node.Node
return For{
"For",
map[string]interface{}{},
nil,
init,
cond,
loop,
@@ -40,6 +42,15 @@ func (n For) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n For) Position() *node.Position {
return n.position
}
func (n For) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n For) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Foreach struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
key node.Node
variable node.Node
@@ -19,6 +20,7 @@ func NewForeach(expr node.Node, key node.Node, variable node.Node, stmt node.Nod
map[string]interface{}{
"byRef": byRef,
},
nil,
expr,
key,
variable,
@@ -42,6 +44,15 @@ func (n Foreach) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Foreach) Position() *node.Position {
return n.position
}
func (n Foreach) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Foreach) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Function struct {
name string
attributes map[string]interface{}
position *node.Position
functionName node.Node
params []node.Node
returnType node.Node
@@ -19,6 +20,7 @@ func NewFunction(functionName node.Node, returnsRef bool, params []node.Node, re
map[string]interface{}{
"returnsRef": returnsRef,
},
nil,
functionName,
params,
returnType,
@@ -42,6 +44,15 @@ func (n Function) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Function) Position() *node.Position {
return n.position
}
func (n Function) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Function) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Global struct {
name string
attributes map[string]interface{}
position *node.Position
vars []node.Node
}
@@ -14,6 +15,7 @@ func NewGlobal(vars []node.Node) node.Node {
return Global{
"Global",
map[string]interface{}{},
nil,
vars,
}
}
@@ -34,6 +36,15 @@ func (n Global) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Global) Position() *node.Position {
return n.position
}
func (n Global) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Global) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Goto struct {
name string
attributes map[string]interface{}
position *node.Position
label node.Node
}
@@ -14,6 +15,7 @@ func NewGoto(label node.Node) node.Node {
return Goto{
"Goto",
map[string]interface{}{},
nil,
label,
}
}
@@ -34,6 +36,15 @@ func (n Goto) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Goto) Position() *node.Position {
return n.position
}
func (n Goto) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Goto) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type GroupUse struct {
name string
attributes map[string]interface{}
position *node.Position
useType node.Node
prefix node.Node
useList []node.Node
@@ -16,6 +17,7 @@ func NewGroupUse(useType node.Node, prefix node.Node, useList []node.Node) node.
return GroupUse{
"GroupUse",
map[string]interface{}{},
nil,
useType,
prefix,
useList,
@@ -38,6 +40,15 @@ func (n GroupUse) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n GroupUse) Position() *node.Position {
return n.position
}
func (n GroupUse) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n GroupUse) SetUseType(useType node.Node) node.Node {
n.useType = useType
return n

View File

@@ -7,12 +7,14 @@ import (
type HaltCompiler struct {
name string
attributes map[string]interface{}
position *node.Position
}
func NewHaltCompiler() node.Node {
return HaltCompiler{
"HaltCompiler",
map[string]interface{}{},
nil,
}
}
@@ -32,6 +34,15 @@ func (n HaltCompiler) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n HaltCompiler) Position() *node.Position {
return n.position
}
func (n HaltCompiler) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n HaltCompiler) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type If struct {
name string
attributes map[string]interface{}
position *node.Position
cond node.Node
stmt node.Node
elseIf []node.Node
@@ -17,6 +18,7 @@ func NewIf(cond node.Node, stmt node.Node) node.Node {
return If{
"If",
map[string]interface{}{},
nil,
cond,
stmt,
nil,
@@ -40,6 +42,15 @@ func (n If) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n If) Position() *node.Position {
return n.position
}
func (n If) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n If) AddElseIf(elseIf node.Node) node.Node {
if n.elseIf == nil {
n.elseIf = make([]node.Node, 0)

View File

@@ -7,6 +7,7 @@ import (
type InlineHtml struct {
name string
attributes map[string]interface{}
position *node.Position
}
func NewInlineHtml(value string) node.Node {
@@ -15,6 +16,7 @@ func NewInlineHtml(value string) node.Node {
map[string]interface{}{
"value": value,
},
nil,
}
}
@@ -34,6 +36,15 @@ func (n InlineHtml) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n InlineHtml) Position() *node.Position {
return n.position
}
func (n InlineHtml) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n InlineHtml) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Interface struct {
name string
attributes map[string]interface{}
position *node.Position
interfaceName node.Node
extends []node.Node
stmts []node.Node
@@ -16,6 +17,7 @@ func NewInterface(interfaceName node.Node, extends []node.Node, stmts []node.Nod
return Interface{
"Interface",
map[string]interface{}{},
nil,
interfaceName,
extends,
stmts,
@@ -38,6 +40,15 @@ func (n Interface) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Interface) Position() *node.Position {
return n.position
}
func (n Interface) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Interface) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Label struct {
name string
attributes map[string]interface{}
position *node.Position
labelName node.Node
}
@@ -14,6 +15,7 @@ func NewLabel(labelName node.Node) node.Node {
return Label{
"Label",
map[string]interface{}{},
nil,
labelName,
}
}
@@ -34,6 +36,15 @@ func (n Label) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Label) Position() *node.Position {
return n.position
}
func (n Label) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Label) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Namespace struct {
name string
attributes map[string]interface{}
position *node.Position
namespaceName node.Node
stmts []node.Node
}
@@ -15,6 +16,7 @@ func NewNamespace(namespaceName node.Node, stmts []node.Node) node.Node {
return Namespace{
"Namespace",
map[string]interface{}{},
nil,
namespaceName,
stmts,
}
@@ -36,6 +38,15 @@ func (n Namespace) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Namespace) Position() *node.Position {
return n.position
}
func (n Namespace) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Namespace) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,12 +7,14 @@ import (
type Nop struct {
name string
attributes map[string]interface{}
position *node.Position
}
func NewNop() node.Node {
return Nop{
"Nop",
map[string]interface{}{},
nil,
}
}
@@ -32,6 +34,15 @@ func (n Nop) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Nop) Position() *node.Position {
return n.position
}
func (n Nop) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Nop) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Property struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
expr node.Node
}
@@ -15,6 +16,7 @@ func NewProperty(variable node.Node, expr node.Node) node.Node {
return Property{
"Property",
map[string]interface{}{},
nil,
variable,
expr,
}
@@ -35,6 +37,15 @@ func (n Property) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Property) Position() *node.Position {
return n.position
}
func (n Property) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Property) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type PropertyList struct {
name string
attributes map[string]interface{}
position *node.Position
modifiers []node.Node
properties []node.Node
}
@@ -15,6 +16,7 @@ func NewPropertyList(modifiers []node.Node, properties []node.Node) node.Node {
return PropertyList{
"PropertyList",
map[string]interface{}{},
nil,
modifiers,
properties,
}
@@ -36,6 +38,15 @@ func (n PropertyList) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n PropertyList) Position() *node.Position {
return n.position
}
func (n PropertyList) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n PropertyList) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Return struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
}
@@ -14,6 +15,7 @@ func NewReturn(expr node.Node) node.Node {
return Return{
"Return",
map[string]interface{}{},
nil,
expr,
}
}
@@ -34,6 +36,15 @@ func (n Return) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Return) Position() *node.Position {
return n.position
}
func (n Return) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Return) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Static struct {
name string
attributes map[string]interface{}
position *node.Position
vars []node.Node
}
@@ -14,6 +15,7 @@ func NewStatic(vars []node.Node) node.Node {
return Static{
"Static",
map[string]interface{}{},
nil,
vars,
}
}
@@ -34,6 +36,15 @@ func (n Static) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Static) Position() *node.Position {
return n.position
}
func (n Static) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Static) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type StaticVar struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
expr node.Node
}
@@ -15,6 +16,7 @@ func NewStaticVar(variable node.Node, expr node.Node) node.Node {
return StaticVar{
"StaticVar",
map[string]interface{}{},
nil,
variable,
expr,
}
@@ -36,6 +38,15 @@ func (n StaticVar) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n StaticVar) Position() *node.Position {
return n.position
}
func (n StaticVar) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n StaticVar) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type StmtList struct {
name string
attributes map[string]interface{}
position *node.Position
stmts []node.Node
}
@@ -14,6 +15,7 @@ func NewStmtList(stmts []node.Node) node.Node {
return StmtList{
"StmtList",
map[string]interface{}{},
nil,
stmts,
}
}
@@ -34,6 +36,15 @@ func (n StmtList) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n StmtList) Position() *node.Position {
return n.position
}
func (n StmtList) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n StmtList) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -17,6 +17,15 @@ func (n Switch) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Switch) Position() *node.Position {
return n.position
}
func (n Switch) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Switch) Name() string {
return "Switch"
}
@@ -24,6 +33,7 @@ func (n Switch) Name() string {
type Switch struct {
name string
attributes map[string]interface{}
position *node.Position
token token.Token
cond node.Node
cases []node.Node
@@ -33,6 +43,7 @@ func NewSwitch(token token.Token, cond node.Node, cases []node.Node) node.Node {
return Switch{
"Switch",
map[string]interface{}{},
nil,
token,
cond,
cases,

View File

@@ -7,6 +7,7 @@ import (
type Throw struct {
name string
attributes map[string]interface{}
position *node.Position
expr node.Node
}
@@ -14,6 +15,7 @@ func NewThrow(expr node.Node) node.Node {
return Throw{
"Throw",
map[string]interface{}{},
nil,
expr,
}
}
@@ -34,6 +36,15 @@ func (n Throw) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Throw) Position() *node.Position {
return n.position
}
func (n Throw) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Throw) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Trait struct {
name string
attributes map[string]interface{}
position *node.Position
traitName node.Node
stmts []node.Node
}
@@ -15,6 +16,7 @@ func NewTrait(traitName node.Node, stmts []node.Node) node.Node {
return Trait{
"Trait",
map[string]interface{}{},
nil,
traitName,
stmts,
}
@@ -36,6 +38,15 @@ func (n Trait) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Trait) Position() *node.Position {
return n.position
}
func (n Trait) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Trait) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type TraitMethodRef struct {
name string
attributes map[string]interface{}
position *node.Position
trait node.Node
method node.Node
}
@@ -15,6 +16,7 @@ func NewTraitMethodRef(trait node.Node, method node.Node) node.Node {
return TraitMethodRef{
"TraitMethodRef",
map[string]interface{}{},
nil,
trait,
method,
}
@@ -36,6 +38,15 @@ func (n TraitMethodRef) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n TraitMethodRef) Position() *node.Position {
return n.position
}
func (n TraitMethodRef) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n TraitMethodRef) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type TraitUse struct {
name string
attributes map[string]interface{}
position *node.Position
traits []node.Node
adaptations []node.Node
}
@@ -15,6 +16,7 @@ func NewTraitUse(traits []node.Node, adaptations []node.Node) node.Node {
return TraitUse{
"TraitUse",
map[string]interface{}{},
nil,
traits,
adaptations,
}
@@ -36,6 +38,15 @@ func (n TraitUse) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n TraitUse) Position() *node.Position {
return n.position
}
func (n TraitUse) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n TraitUse) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type TraitUseAlias struct {
name string
attributes map[string]interface{}
position *node.Position
ref node.Node
modifier node.Node
alias node.Node
@@ -16,6 +17,7 @@ func NewTraitUseAlias(ref node.Node, modifier node.Node, alias node.Node) node.N
return TraitUseAlias{
"TraitUseAlias",
map[string]interface{}{},
nil,
ref,
modifier,
alias,
@@ -38,6 +40,15 @@ func (n TraitUseAlias) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n TraitUseAlias) Position() *node.Position {
return n.position
}
func (n TraitUseAlias) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n TraitUseAlias) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type TraitUsePrecedence struct {
name string
attributes map[string]interface{}
position *node.Position
ref node.Node
insteadof node.Node
}
@@ -15,6 +16,7 @@ func NewTraitUsePrecedence(ref node.Node, insteadof node.Node) node.Node {
return TraitUsePrecedence{
"TraitUsePrecedence",
map[string]interface{}{},
nil,
ref,
insteadof,
}
@@ -36,6 +38,15 @@ func (n TraitUsePrecedence) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n TraitUsePrecedence) Position() *node.Position {
return n.position
}
func (n TraitUsePrecedence) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n TraitUsePrecedence) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Try struct {
name string
attributes map[string]interface{}
position *node.Position
stmts []node.Node
catches []node.Node
finally node.Node
@@ -16,6 +17,7 @@ func NewTry(stmts []node.Node, catches []node.Node, finally node.Node) node.Node
return Try{
"Try",
map[string]interface{}{},
nil,
stmts,
catches,
finally,
@@ -38,6 +40,15 @@ func (n Try) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Try) Position() *node.Position {
return n.position
}
func (n Try) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Try) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Unset struct {
name string
attributes map[string]interface{}
position *node.Position
vars []node.Node
}
@@ -14,6 +15,7 @@ func NewUnset(vars []node.Node) node.Node {
return Unset{
"Unset",
map[string]interface{}{},
nil,
vars,
}
}
@@ -34,6 +36,15 @@ func (n Unset) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Unset) Position() *node.Position {
return n.position
}
func (n Unset) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Unset) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type Use struct {
name string
attributes map[string]interface{}
position *node.Position
useType node.Node
use node.Node
alias node.Node
@@ -16,6 +17,7 @@ func NewUse(useType node.Node, use node.Node, alias node.Node) node.Node {
return Use{
"Use",
map[string]interface{}{},
nil,
useType,
use,
alias,
@@ -38,6 +40,15 @@ func (n Use) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Use) Position() *node.Position {
return n.position
}
func (n Use) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Use) SetUseType(useType node.Node) node.Node {
n.useType = useType
return n

View File

@@ -7,6 +7,7 @@ import (
type UseList struct {
name string
attributes map[string]interface{}
position *node.Position
useType node.Node
uses []node.Node
}
@@ -15,6 +16,7 @@ func NewUseList(useType node.Node, uses []node.Node) node.Node {
return UseList{
"UseList",
map[string]interface{}{},
nil,
useType,
uses,
}
@@ -36,6 +38,15 @@ func (n UseList) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n UseList) Position() *node.Position {
return n.position
}
func (n UseList) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n UseList) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -8,6 +8,7 @@ import (
type While struct {
name string
attributes map[string]interface{}
position *node.Position
token token.Token
cond node.Node
stmt node.Node
@@ -17,6 +18,7 @@ func NewWhile(token token.Token, cond node.Node, stmt node.Node) node.Node {
return While{
"While",
map[string]interface{}{},
nil,
token,
cond,
stmt,
@@ -39,6 +41,15 @@ func (n While) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n While) Position() *node.Position {
return n.position
}
func (n While) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n While) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return