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

@ -3,6 +3,7 @@ package node
type Argument struct { type Argument struct {
name string name string
attributes map[string]interface{} attributes map[string]interface{}
position *Position
expr Node expr Node
variadic bool variadic bool
} }
@ -13,6 +14,7 @@ func NewArgument(expression Node, variadic bool) Node {
map[string]interface{}{ map[string]interface{}{
"variadic": variadic, "variadic": variadic,
}, },
nil,
expression, expression,
variadic, variadic,
} }
@ -34,6 +36,15 @@ func (n Argument) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Argument) Position() *Position {
return n.position
}
func (n Argument) SetPosition(p *Position) Node {
n.position = p
return n
}
func (n Argument) Walk(v Visitor) { func (n Argument) Walk(v Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

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

View File

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

View File

@ -7,6 +7,7 @@ import (
type ArrayItem struct { type ArrayItem struct {
name string name string
attributes map[string]interface{} attributes map[string]interface{}
position *node.Position
key node.Node key node.Node
val node.Node val node.Node
} }
@ -17,6 +18,7 @@ func NewArrayItem(key node.Node, val node.Node, byRef bool) node.Node {
map[string]interface{}{ map[string]interface{}{
"byRef": byRef, "byRef": byRef,
}, },
nil,
key, key,
val, val,
} }
@ -38,6 +40,15 @@ func (n ArrayItem) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n ArrayItem) Position() *node.Position {
return n.position
}
func (n ArrayItem) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ArrayItem) Walk(v node.Visitor) { func (n ArrayItem) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewAssign(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"Assign", "Assign",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Assign) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Assign) Position() *node.Position {
return n.position
}
func (n Assign) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Assign) Walk(v node.Visitor) { func (n Assign) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -7,6 +7,7 @@ import (
type AssignOp struct { type AssignOp struct {
name string name string
attributes map[string]interface{} attributes map[string]interface{}
position *node.Position
variable node.Node variable node.Node
expression node.Node expression node.Node
} }

View File

@ -13,6 +13,7 @@ func NewAssignRef(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignRef", "AssignRef",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n AssignRef) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n AssignRef) Position() *node.Position {
return n.position
}
func (n AssignRef) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n AssignRef) Walk(v node.Visitor) { func (n AssignRef) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignBitwiseAnd", "AssignBitwiseAnd",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n BitwiseAnd) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n BitwiseAnd) Position() *node.Position {
return n.position
}
func (n BitwiseAnd) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseAnd) Walk(v node.Visitor) { func (n BitwiseAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignBitwiseOr", "AssignBitwiseOr",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n BitwiseOr) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n BitwiseOr) Position() *node.Position {
return n.position
}
func (n BitwiseOr) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseOr) Walk(v node.Visitor) { func (n BitwiseOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignBitwiseXor", "AssignBitwiseXor",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -31,6 +32,15 @@ func (n BitwiseXor) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n BitwiseXor) Position() *node.Position {
return n.position
}
func (n BitwiseXor) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseXor) Name() string { func (n BitwiseXor) Name() string {
return "BitwiseXor" return "BitwiseXor"
} }

View File

@ -13,6 +13,7 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignConcat", "AssignConcat",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Concat) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Concat) Position() *node.Position {
return n.position
}
func (n Concat) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Concat) Walk(v node.Visitor) { func (n Concat) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignDiv", "AssignDiv",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Div) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Div) Position() *node.Position {
return n.position
}
func (n Div) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Div) Walk(v node.Visitor) { func (n Div) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignMinus", "AssignMinus",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Minus) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Minus) Position() *node.Position {
return n.position
}
func (n Minus) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Minus) Walk(v node.Visitor) { func (n Minus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignMod", "AssignMod",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Mod) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Mod) Position() *node.Position {
return n.position
}
func (n Mod) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Mod) Walk(v node.Visitor) { func (n Mod) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignMul", "AssignMul",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Mul) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Mul) Position() *node.Position {
return n.position
}
func (n Mul) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Mul) Walk(v node.Visitor) { func (n Mul) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignPlus", "AssignPlus",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Plus) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Plus) Position() *node.Position {
return n.position
}
func (n Plus) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Plus) Walk(v node.Visitor) { func (n Plus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignPow", "AssignPow",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Pow) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Pow) Position() *node.Position {
return n.position
}
func (n Pow) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Pow) Walk(v node.Visitor) { func (n Pow) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignShiftLeft", "AssignShiftLeft",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n ShiftLeft) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n ShiftLeft) Position() *node.Position {
return n.position
}
func (n ShiftLeft) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ShiftLeft) Walk(v node.Visitor) { func (n ShiftLeft) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
AssignOp{ AssignOp{
"AssignShiftRight", "AssignShiftRight",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n ShiftRight) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n ShiftRight) Position() *node.Position {
return n.position
}
func (n ShiftRight) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ShiftRight) Walk(v node.Visitor) { func (n ShiftRight) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -7,6 +7,7 @@ import (
type BinaryOp struct { type BinaryOp struct {
name string name string
attributes map[string]interface{} attributes map[string]interface{}
position *node.Position
left node.Node left node.Node
right node.Node right node.Node
} }

View File

@ -13,6 +13,7 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryBitwiseAnd", "BinaryBitwiseAnd",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n BitwiseAnd) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n BitwiseAnd) Position() *node.Position {
return n.position
}
func (n BitwiseAnd) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseAnd) Walk(v node.Visitor) { func (n BitwiseAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryBitwiseOr", "BinaryBitwiseOr",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -31,6 +32,15 @@ func (n BitwiseOr) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n BitwiseOr) Position() *node.Position {
return n.position
}
func (n BitwiseOr) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseOr) Name() string { func (n BitwiseOr) Name() string {
return "BitwiseOr" return "BitwiseOr"
} }

View File

@ -13,6 +13,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryBitwiseXor", "BinaryBitwiseXor",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -31,6 +32,15 @@ func (n BitwiseXor) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n BitwiseXor) Position() *node.Position {
return n.position
}
func (n BitwiseXor) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseXor) Name() string { func (n BitwiseXor) Name() string {
return "BitwiseXor" return "BitwiseXor"
} }

View File

@ -13,6 +13,7 @@ func NewBooleanAnd(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryBooleanAnd", "BinaryBooleanAnd",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n BooleanAnd) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n BooleanAnd) Position() *node.Position {
return n.position
}
func (n BooleanAnd) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BooleanAnd) Walk(v node.Visitor) { func (n BooleanAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewBooleanOr(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryBooleanOr", "BinaryBooleanOr",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n BooleanOr) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n BooleanOr) Position() *node.Position {
return n.position
}
func (n BooleanOr) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BooleanOr) Walk(v node.Visitor) { func (n BooleanOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewCoalesce(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryCoalesce", "BinaryCoalesce",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Coalesce) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Coalesce) Position() *node.Position {
return n.position
}
func (n Coalesce) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Coalesce) Walk(v node.Visitor) { func (n Coalesce) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryConcat", "BinaryConcat",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Concat) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Concat) Position() *node.Position {
return n.position
}
func (n Concat) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Concat) Walk(v node.Visitor) { func (n Concat) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryDiv", "BinaryDiv",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Div) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Div) Position() *node.Position {
return n.position
}
func (n Div) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Div) Walk(v node.Visitor) { func (n Div) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewEqual(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryEqual", "BinaryEqual",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Equal) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Equal) Position() *node.Position {
return n.position
}
func (n Equal) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Equal) Walk(v node.Visitor) { func (n Equal) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewGreater(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryGreater", "BinaryGreater",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Greater) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Greater) Position() *node.Position {
return n.position
}
func (n Greater) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Greater) Walk(v node.Visitor) { func (n Greater) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryGreaterOrEqual", "BinaryGreaterOrEqual",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n GreaterOrEqual) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n GreaterOrEqual) Position() *node.Position {
return n.position
}
func (n GreaterOrEqual) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n GreaterOrEqual) Walk(v node.Visitor) { func (n GreaterOrEqual) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewIdentical(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryIdentical", "BinaryIdentical",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Identical) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Identical) Position() *node.Position {
return n.position
}
func (n Identical) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Identical) Walk(v node.Visitor) { func (n Identical) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewLogicalAnd(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryLogicalAnd", "BinaryLogicalAnd",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n LogicalAnd) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n LogicalAnd) Position() *node.Position {
return n.position
}
func (n LogicalAnd) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n LogicalAnd) Walk(v node.Visitor) { func (n LogicalAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewLogicalOr(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryLogicalOr", "BinaryLogicalOr",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n LogicalOr) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n LogicalOr) Position() *node.Position {
return n.position
}
func (n LogicalOr) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n LogicalOr) Walk(v node.Visitor) { func (n LogicalOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewLogicalXor(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryLogicalXor", "BinaryLogicalXor",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n LogicalXor) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n LogicalXor) Position() *node.Position {
return n.position
}
func (n LogicalXor) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n LogicalXor) Walk(v node.Visitor) { func (n LogicalXor) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryMinus", "BinaryMinus",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Minus) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Minus) Position() *node.Position {
return n.position
}
func (n Minus) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Minus) Walk(v node.Visitor) { func (n Minus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryMod", "BinaryMod",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Mod) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Mod) Position() *node.Position {
return n.position
}
func (n Mod) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Mod) Walk(v node.Visitor) { func (n Mod) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryMul", "BinaryMul",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Mul) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Mul) Position() *node.Position {
return n.position
}
func (n Mul) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Mul) Walk(v node.Visitor) { func (n Mul) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewNotEqual(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryNotEqual", "BinaryNotEqual",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n NotEqual) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n NotEqual) Position() *node.Position {
return n.position
}
func (n NotEqual) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n NotEqual) Walk(v node.Visitor) { func (n NotEqual) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewNotIdentical(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryNotIdentical", "BinaryNotIdentical",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n NotIdentical) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n NotIdentical) Position() *node.Position {
return n.position
}
func (n NotIdentical) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n NotIdentical) Walk(v node.Visitor) { func (n NotIdentical) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryPlus", "BinaryPlus",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Plus) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Plus) Position() *node.Position {
return n.position
}
func (n Plus) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Plus) Walk(v node.Visitor) { func (n Plus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryPow", "BinaryPow",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Pow) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Pow) Position() *node.Position {
return n.position
}
func (n Pow) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Pow) Walk(v node.Visitor) { func (n Pow) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryShiftLeft", "BinaryShiftLeft",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n ShiftLeft) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n ShiftLeft) Position() *node.Position {
return n.position
}
func (n ShiftLeft) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ShiftLeft) Walk(v node.Visitor) { func (n ShiftLeft) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinaryShiftRight", "BinaryShiftRight",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n ShiftRight) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n ShiftRight) Position() *node.Position {
return n.position
}
func (n ShiftRight) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ShiftRight) Walk(v node.Visitor) { func (n ShiftRight) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewSmaller(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinarySmaller", "BinarySmaller",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Smaller) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Smaller) Position() *node.Position {
return n.position
}
func (n Smaller) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Smaller) Walk(v node.Visitor) { func (n Smaller) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinarySmallerOrEqual", "BinarySmallerOrEqual",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n SmallerOrEqual) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n SmallerOrEqual) Position() *node.Position {
return n.position
}
func (n SmallerOrEqual) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n SmallerOrEqual) Walk(v node.Visitor) { func (n SmallerOrEqual) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewSpaceship(variable node.Node, expression node.Node) node.Node {
BinaryOp{ BinaryOp{
"BinarySpaceship", "BinarySpaceship",
map[string]interface{}{}, map[string]interface{}{},
nil,
variable, variable,
expression, expression,
}, },
@ -35,6 +36,15 @@ func (n Spaceship) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Spaceship) Position() *node.Position {
return n.position
}
func (n Spaceship) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Spaceship) Walk(v node.Visitor) { func (n Spaceship) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

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

View File

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

View File

@ -7,5 +7,6 @@ import (
type Cast struct { type Cast struct {
name string name string
attributes map[string]interface{} attributes map[string]interface{}
position *node.Position
expr node.Node expr node.Node
} }

View File

@ -13,6 +13,7 @@ func NewCastArray(expr node.Node) node.Node {
Cast{ Cast{
"CastArray", "CastArray",
map[string]interface{}{}, map[string]interface{}{},
nil,
expr, expr,
}, },
} }
@ -34,6 +35,15 @@ func (n CastArray) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n CastArray) Position() *node.Position {
return n.position
}
func (n CastArray) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n CastArray) Walk(v node.Visitor) { func (n CastArray) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewCastBool(expr node.Node) node.Node {
Cast{ Cast{
"CastBool", "CastBool",
map[string]interface{}{}, map[string]interface{}{},
nil,
expr, expr,
}, },
} }
@ -34,6 +35,15 @@ func (n CastBool) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n CastBool) Position() *node.Position {
return n.position
}
func (n CastBool) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n CastBool) Walk(v node.Visitor) { func (n CastBool) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewCastDouble(expr node.Node) node.Node {
Cast{ Cast{
"CastDouble", "CastDouble",
map[string]interface{}{}, map[string]interface{}{},
nil,
expr, expr,
}, },
} }
@ -34,6 +35,15 @@ func (n CastDouble) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n CastDouble) Position() *node.Position {
return n.position
}
func (n CastDouble) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n CastDouble) Walk(v node.Visitor) { func (n CastDouble) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewCastInt(expr node.Node) node.Node {
Cast{ Cast{
"CastInt", "CastInt",
map[string]interface{}{}, map[string]interface{}{},
nil,
expr, expr,
}, },
} }
@ -34,6 +35,15 @@ func (n CastInt) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n CastInt) Position() *node.Position {
return n.position
}
func (n CastInt) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n CastInt) Walk(v node.Visitor) { func (n CastInt) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewCastObject(expr node.Node) node.Node {
Cast{ Cast{
"CastObject", "CastObject",
map[string]interface{}{}, map[string]interface{}{},
nil,
expr, expr,
}, },
} }
@ -34,6 +35,15 @@ func (n CastObject) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n CastObject) Position() *node.Position {
return n.position
}
func (n CastObject) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n CastObject) Walk(v node.Visitor) { func (n CastObject) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewCastString(expr node.Node) node.Node {
Cast{ Cast{
"CastString", "CastString",
map[string]interface{}{}, map[string]interface{}{},
nil,
expr, expr,
}, },
} }
@ -34,6 +35,15 @@ func (n CastString) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n CastString) Position() *node.Position {
return n.position
}
func (n CastString) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n CastString) Walk(v node.Visitor) { func (n CastString) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -13,6 +13,7 @@ func NewCastUnset(expr node.Node) node.Node {
Cast{ Cast{
"CastUnset", "CastUnset",
map[string]interface{}{}, map[string]interface{}{},
nil,
expr, expr,
}, },
} }
@ -34,6 +35,15 @@ func (n CastUnset) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n CastUnset) Position() *node.Position {
return n.position
}
func (n CastUnset) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n CastUnset) Walk(v node.Visitor) { func (n CastUnset) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -16,6 +16,15 @@ func (n ClassConstFetch) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n ClassConstFetch) Position() *node.Position {
return n.position
}
func (n ClassConstFetch) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ClassConstFetch) Name() string { func (n ClassConstFetch) Name() string {
return "ClassConstFetch" return "ClassConstFetch"
} }
@ -23,6 +32,7 @@ func (n ClassConstFetch) Name() string {
type ClassConstFetch struct { type ClassConstFetch struct {
name string name string
attributes map[string]interface{} attributes map[string]interface{}
position *node.Position
class node.Node class node.Node
constantName node.Node constantName node.Node
} }
@ -31,6 +41,7 @@ func NewClassConstFetch(class node.Node, constantName node.Node) node.Node {
return ClassConstFetch{ return ClassConstFetch{
"ClassConstFetch", "ClassConstFetch",
map[string]interface{}{}, map[string]interface{}{},
nil,
class, class,
constantName, constantName,
} }

View File

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

View File

@ -7,6 +7,7 @@ import (
type Closure struct { type Closure struct {
name string name string
attributes map[string]interface{} attributes map[string]interface{}
position *node.Position
params []node.Node params []node.Node
uses []node.Node uses []node.Node
returnType node.Node returnType node.Node
@ -20,6 +21,7 @@ func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmt
"isReturnRef": isReturnRef, "isReturnRef": isReturnRef,
"isStatic": isStatic, "isStatic": isStatic,
}, },
nil,
params, params,
uses, uses,
returnType, returnType,
@ -43,6 +45,15 @@ func (n Closure) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Closure) Position() *node.Position {
return n.position
}
func (n Closure) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Closure) Walk(v node.Visitor) { func (n Closure) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,6 +13,7 @@ func NewFullyQualified(parts []node.Node) node.Node {
NameNode{ NameNode{
"FullyQualifiedName", "FullyQualifiedName",
map[string]interface{}{}, map[string]interface{}{},
nil,
parts, parts,
}, },
} }

View File

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

View File

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

View File

@ -13,6 +13,7 @@ func NewRelative(parts []node.Node) node.Node {
NameNode{ NameNode{
"RelativeName", "RelativeName",
map[string]interface{}{}, map[string]interface{}{},
nil,
parts, parts,
}, },
} }

View File

@ -1,13 +1,24 @@
package node package node
type Node interface {
Attributer
Positioner
Name() string
Walk(v Visitor)
}
type Attributer interface { type Attributer interface {
Attributes() map[string]interface{} Attributes() map[string]interface{}
Attribute(key string) interface{} Attribute(key string) interface{}
SetAttribute(key string, value interface{}) SetAttribute(key string, value interface{})
} }
type Node interface { type Positioner interface {
Attributer Position() *Position
Name() string SetPosition(p *Position) Node
Walk(v Visitor) }
type Position struct {
StartLine int
EndLine int
} }

View File

@ -3,6 +3,7 @@ package node
type Nullable struct { type Nullable struct {
name string name string
attributes map[string]interface{} attributes map[string]interface{}
position *Position
expr Node expr Node
} }
@ -10,6 +11,7 @@ func NewNullable(expression Node) Node {
return Nullable{ return Nullable{
"Nullable", "Nullable",
map[string]interface{}{}, map[string]interface{}{},
nil,
expression, expression,
} }
} }
@ -30,6 +32,15 @@ func (n Nullable) SetAttribute(key string, value interface{}) {
n.attributes[key] = value n.attributes[key] = value
} }
func (n Nullable) Position() *Position {
return n.position
}
func (n Nullable) SetPosition(p *Position) Node {
n.position = p
return n
}
func (n Nullable) Walk(v Visitor) { func (n Nullable) Walk(v Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

Some files were not shown because too many files have changed in this diff Show More