Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Jparsec is now ported to Ruby, with a way lighter syntax than Java.

The following is the ruby version of calculator:

As easy as that!

The above example directly calculates the result. What if we want to construct abstract syntax tree instead?

The first step is of course to create the abstract syntax tree classes. For example:

There's only one change to make in the parser code: change "" to "

Unknown macro: {|s|}


Nothing else needs to be changed.

rparsec can be downloaded at

API document is available online

Created by benyu benyu
On Sun Oct 08 14:53:56 CDT 2006
Using TimTam

  • No labels