walker: leave node event
This commit is contained in:
@@ -23,17 +23,19 @@ func NewAssign(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n Assign) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewAssignRef(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n AssignRef) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n BitwiseAnd) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n BitwiseOr) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func (n BitwiseXor) Name() string {
|
||||
}
|
||||
|
||||
func (n BitwiseXor) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n Concat) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n Div) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n Minus) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n Mod) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n Mul) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n Plus) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n Pow) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n ShiftLeft) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
@@ -23,17 +23,19 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n ShiftRight) Walk(v node.Visitor) {
|
||||
if v.Visit(n) == false {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
}
|
||||
|
||||
if n.variable != nil {
|
||||
vv := v.Children("variable")
|
||||
vv := v.GetChildrenVisitor("variable")
|
||||
n.variable.Walk(vv)
|
||||
}
|
||||
|
||||
if n.expression != nil {
|
||||
vv := v.Children("expression")
|
||||
vv := v.GetChildrenVisitor("expression")
|
||||
n.expression.Walk(vv)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user