Grammy: Ruby Recursive Descent Parser Generator

| No Comments | No TrackBacks

Grammy is a very small recursive descent parser generator framework written in ruby. It has several similarities with boost::spirit.

Short example:

You can use the defined grammar to parse strings:

An example image (not for this grammar):

error: image not loaded

Grammy supports:

  • Most EBNF features: Sequences, Repetition, Alternatives, Optional rules
  • Shortcut for lists: list and list?
  • Skipping of characters: comments, whitespaces between words
  • Generation of an AST. Most unused tokens can be removed automatically.
  • AST can be written to an image file with help of graphviz.

You can get grammy at github: Grammy on github

There is also a more detailed description there.

No TrackBacks

TrackBack URL: http://ragmaanir.mypresident.de/mt/mt-tb.cgi/14

Leave a comment