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 {
name string
attributes map[string]interface{}
position *Position
expr Node
variadic bool
}
@ -13,6 +14,7 @@ func NewArgument(expression Node, variadic bool) Node {
map[string]interface{}{
"variadic": variadic,
},
nil,
expression,
variadic,
}
@ -34,6 +36,15 @@ func (n Argument) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

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

View File

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

View File

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

View File

@ -13,6 +13,7 @@ func NewAssign(variable node.Node, expression node.Node) node.Node {
AssignOp{
"Assign",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Assign) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

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

View File

@ -13,6 +13,7 @@ func NewAssignRef(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignRef",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n AssignRef) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignBitwiseAnd",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n BitwiseAnd) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignBitwiseOr",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n BitwiseOr) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignBitwiseXor",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -31,6 +32,15 @@ func (n BitwiseXor) SetAttribute(key string, value interface{}) {
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 {
return "BitwiseXor"
}

View File

@ -13,6 +13,7 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignConcat",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Concat) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignDiv",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Div) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignMinus",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Minus) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignMod",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Mod) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignMul",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Mul) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignPlus",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Plus) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignPow",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Pow) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignShiftLeft",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n ShiftLeft) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignShiftRight",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n ShiftRight) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

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

View File

@ -13,6 +13,7 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryBitwiseAnd",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n BitwiseAnd) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryBitwiseOr",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -31,6 +32,15 @@ func (n BitwiseOr) SetAttribute(key string, value interface{}) {
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 {
return "BitwiseOr"
}

View File

@ -13,6 +13,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryBitwiseXor",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -31,6 +32,15 @@ func (n BitwiseXor) SetAttribute(key string, value interface{}) {
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 {
return "BitwiseXor"
}

View File

@ -13,6 +13,7 @@ func NewBooleanAnd(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryBooleanAnd",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n BooleanAnd) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewBooleanOr(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryBooleanOr",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n BooleanOr) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewCoalesce(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryCoalesce",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Coalesce) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryConcat",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Concat) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryDiv",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Div) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewEqual(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryEqual",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Equal) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewGreater(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryGreater",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Greater) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryGreaterOrEqual",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n GreaterOrEqual) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewIdentical(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryIdentical",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Identical) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewLogicalAnd(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryLogicalAnd",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n LogicalAnd) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewLogicalOr(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryLogicalOr",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n LogicalOr) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewLogicalXor(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryLogicalXor",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n LogicalXor) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryMinus",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Minus) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryMod",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Mod) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryMul",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Mul) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewNotEqual(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryNotEqual",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n NotEqual) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewNotIdentical(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryNotIdentical",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n NotIdentical) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryPlus",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Plus) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryPow",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Pow) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryShiftLeft",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n ShiftLeft) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinaryShiftRight",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n ShiftRight) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewSmaller(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinarySmaller",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Smaller) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinarySmallerOrEqual",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n SmallerOrEqual) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewSpaceship(variable node.Node, expression node.Node) node.Node {
BinaryOp{
"BinarySpaceship",
map[string]interface{}{},
nil,
variable,
expression,
},
@ -35,6 +36,15 @@ func (n Spaceship) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

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

View File

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

View File

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

View File

@ -13,6 +13,7 @@ func NewCastArray(expr node.Node) node.Node {
Cast{
"CastArray",
map[string]interface{}{},
nil,
expr,
},
}
@ -34,6 +35,15 @@ func (n CastArray) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewCastBool(expr node.Node) node.Node {
Cast{
"CastBool",
map[string]interface{}{},
nil,
expr,
},
}
@ -34,6 +35,15 @@ func (n CastBool) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewCastDouble(expr node.Node) node.Node {
Cast{
"CastDouble",
map[string]interface{}{},
nil,
expr,
},
}
@ -34,6 +35,15 @@ func (n CastDouble) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewCastInt(expr node.Node) node.Node {
Cast{
"CastInt",
map[string]interface{}{},
nil,
expr,
},
}
@ -34,6 +35,15 @@ func (n CastInt) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewCastObject(expr node.Node) node.Node {
Cast{
"CastObject",
map[string]interface{}{},
nil,
expr,
},
}
@ -34,6 +35,15 @@ func (n CastObject) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewCastString(expr node.Node) node.Node {
Cast{
"CastString",
map[string]interface{}{},
nil,
expr,
},
}
@ -34,6 +35,15 @@ func (n CastString) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

@ -13,6 +13,7 @@ func NewCastUnset(expr node.Node) node.Node {
Cast{
"CastUnset",
map[string]interface{}{},
nil,
expr,
},
}
@ -34,6 +35,15 @@ func (n CastUnset) SetAttribute(key string, value interface{}) {
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) {
if v.EnterNode(n) == false {
return

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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