class JRuby::Lint::AST::Visitor

Attributes

ast[R]
stack[R]

Public Class Methods

new(ast) click to toggle source
# File lib/jruby/lint/ast.rb, line 37
def initialize(ast)
  @ast = ast
end

Public Instance Methods

each(&block) click to toggle source
# File lib/jruby/lint/ast.rb, line 41
def each(&block)
  @block = block
  ast.accept(self)
ensure
  @block = nil
end
Also aliased as: each_node, traverse
each_node(&block)
Alias for: each
method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/jruby/lint/ast.rb, line 58
def method_missing(name, *args, &block)
  if name.to_s =~ /^visit/
    visit(name, *args)
  else
    super
  end
end
traverse(&block)
Alias for: each
visit(method, node) click to toggle source
# File lib/jruby/lint/ast.rb, line 51
def visit(method, node)
  @block.call(node) if @block
  node.child_nodes.each do |cn|
    cn.accept(self) rescue nil
  end
end