Functioning treetop grammar for reading debian Packages.gz. Not necessarily optimal!
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Gemfile
Packages.test.gz
README
debian.treetop
debian_apt_sources.treetop
dependency_line.txt
package_list.rb
parser.rb
sample_entry.txt
syntax_nodes.rb

README

A DEBIAN PACKAGES.GZ GRAMMER

My first attempt at a treetop grammar. Not a real project just yet, but it gives you the grammar and a starting point for getting the code up and running. The grammar is more succinct now that I have learned some PEG idioms for end-of-match semantics.

Usage instructions:

bundle install gems
bundle exec ./parser.rb

Other useful places to look for references:
http://treetop.rubyforge.org/syntactic_recognition.html
http://treetop.rubyforge.org/pitfalls_and_advanced_techniques.html
http://groups.google.com/group/treetop-dev
https://github.com/aarongough/koi-reference-parser/
http://learnruby.com/examples/ruby-quiz-155.shtml

That should start the slow trudge through the file and allow you to see if it is working properly.

Offered with no license, but that Packages.test.gz included here probably has one. So we'll go with whatever Debian is using for that.