Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cat abc.treetop
- grammar A
- include X
- rule ma
- 'a'
- end
- end
- #
- # cat xyz.treetop
- grammar X
- rule mx
- 'x'
- end
- end
- #
- # cat foo.rb
- #!/usr/bin/env ruby
- require 'rubygems'
- require 'polyglot'
- require 'treetop'
- Treetop.load 'abc'
- Treetop.load 'xyz'
- a = AParser.new
- x = XParser.new#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement