Created
January 16, 2011 23:21
-
-
Save xxx/782256 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parser = File.open(outfile.path) { |f| LPC::Parser.new(f) } | |
return_val = parser.translation_unit | |
tokens = parser.input | |
tree = return_val.tree | |
# Everything is OK up to here. | |
node_stream = ANTLR3::CommonTreeNodeStream.new(tree) | |
optimizations = LPCTreeRewrites::TreeParser.new(node_stream) | |
tree = optimizations.downup(tree, false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby LPCTreeRewrites.rb --lexer-name "LPC::Lexer" --parser-name "LPC::Parser" --parser-rule "translation_unit" < foobar.cpp | |
/usr/home/pope/.rvm/gems/ruby-1.8.7-p248/gems/antlr3-1.8.8/lib/antlr3/main.rb:576:in `send': nil is not a symbol (TypeError) | |
from /usr/home/pope/.rvm/gems/ruby-1.8.7-p248/gems/antlr3-1.8.8/lib/antlr3/main.rb:576:in `recognize' | |
from /usr/home/pope/.rvm/gems/ruby-1.8.7-p248/gems/antlr3-1.8.8/lib/antlr3/main.rb:162:in `execute' | |
from /usr/home/pope/.rvm/gems/ruby-1.8.7-p248/gems/antlr3-1.8.8/lib/antlr3/tree.rb:108:in `main' | |
from LPCTreeRewrites.rb:297 | |
from LPCTreeRewrites.rb:297 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment