module RuboCop::AST::Traversal

def on_block(node)

def on_block(node)
  children = node.children
  child = children[0]
  send(:"on_#{child.type}", child) # can be send, zsuper...
  on_args(children[1])
  return unless (child = children[2])
  send(:"on_#{child.type}", child)
end

def on_case(node)

def on_case(node)
  node.children.each do |child|
    send(:"on_#{child.type}", child) if child
  end
  nil
end

def on_casgn(node)

def on_casgn(node)
  children = node.children
  if (child = children[0]) # always const???
    send(:"on_#{child.type}", child)
  end
  return unless (child = children[2])
  send(:"on_#{child.type}", child)
end

def on_class(node)

def on_class(node)
  children = node.children
  child = children[0] # always const???
  send(:"on_#{child.type}", child)
  if (child = children[1])
    send(:"on_#{child.type}", child)
  end
  return unless (child = children[2])
  send(:"on_#{child.type}", child)
end

def on_const(node)

def on_const(node)
  return unless (child = node.children[0])
  send(:"on_#{child.type}", child)
end

def on_def(node)

def on_def(node)
  children = node.children
  on_args(children[1])
  return unless (child = children[2])
  send(:"on_#{child.type}", child)
end

def on_defs(node)

def on_defs(node)
  children = node.children
  child = children[0]
  send(:"on_#{child.type}", child)
  on_args(children[2])
  return unless (child = children[3])
  send(:"on_#{child.type}", child)
end

def on_if(node)

def on_if(node)
  children = node.children
  child = children[0]
  send(:"on_#{child.type}", child)
  if (child = children[1])
    send(:"on_#{child.type}", child)
  end
  return unless (child = children[2])
  send(:"on_#{child.type}", child)
end

def on_numblock(node)

def on_numblock(node)
  children = node.children
  child = children[0]
  send(:"on_#{child.type}", child)
  return unless (child = children[2])
  send(:"on_#{child.type}", child)
end

def on_op_asgn(node)

def on_op_asgn(node)
  children = node.children
  child = children[0]
  send(:"on_#{child.type}", child)
  child = children[2]
  send(:"on_#{child.type}", child)
end

def on_send(node)

def on_send(node)
  node.children.each_with_index do |child, i|
    next if i == 1
    send(:"on_#{child.type}", child) if child
  end
  nil
end

def on_while(node)

def on_while(node)
  children = node.children
  child = children[0]
  send(:"on_#{child.type}", child)
  return unless (child = children[1])
  send(:"on_#{child.type}", child)
end

def walk(node)

def walk(node)
  return if node.nil?
  send(:"on_#{node.type}", node)
  nil
end