node position

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

View File

@@ -7,6 +7,7 @@ import (
type 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