Skip to content

Instantly share code, notes, and snippets.

@xxx
Created January 10, 2011 04:45
Show Gist options
  • Save xxx/772368 to your computer and use it in GitHub Desktop.
Save xxx/772368 to your computer and use it in GitHub Desktop.
$ ruby treedumper.rb
/usr/home/pope/.rvm/gems/ruby-1.8.7-p248/gems/antlr3-1.8.5/lib/antlr3/dot.rb:122:in `define_nodes': undefined method `node_number' for #<ANTLR3::DOT::TreeGenerator:0x2d1ab058> (NoMethodError)
from /usr/home/pope/.rvm/gems/ruby-1.8.7-p248/gems/antlr3-1.8.5/lib/antlr3/dot.rb:110:in `to_dot'
from /usr/home/pope/.rvm/gems/ruby-1.8.7-p248/gems/antlr3-1.8.5/lib/antlr3/dot.rb:93:in `generate'
from treedumper.rb:9
require './SearchExpressionParser'
parser = SearchExpression::Parser.new("a and b or c and not d")
return_val = parser.search_expression
tree = return_val.tree
dot = ANTLR3::DOT::TreeGenerator.generate(tree) # boom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment