Thursday, February 16, 2006

First release of Rubyfront

UPDATE 02/27/2006: a new version of rubyfront was released, and now it is capable to parse ruby's stable snapshot and Ruby on Rails. Thanks Mauricio Fernandez for reporting the bugs.

I am glad to announce the first release of rubyfront (a ruby parser powered by antlr), you can download it here.

Overview
The goal of this project is to create an error checking tool for ruby. Currently we are using antlr as the parser generator and java as the implementation language.


Current Status
Even though Rubyfront is in its very early stage, the current parser can accept the entire ruby standard library. So far the parser only do error checking at syntax level, no semantic checking is implemented.


What's next
We will focus on improving the parser to make it closer to C ruby's yacc counterpart.


Requirement
J2SE 5.0 and up.


Demonstration
1. Open build.xml and change "rubycode.dir" to the directory of your ruby source code.
2. Run the smoke test. On windows, you can simply type "build parsersmoketest".

For example, if you have Ruby 1.8.4's source code installed on "c:\ruby", you are going to see the following:


parsersmoketest:
[java] 1574 ruby programs have been parsed, 0 failed.


The above result shows that all 1574 ruby programs are accepted by the parser.

By the way, if you run smoke test against Ruby's windows One-Click installer, you are going to see a few failures from fxruby 1.2.6 and others. The good news is: they are known to be broken (You can use "ruby -c" to verify). If you have Ruby on Rails installed, you are going to see more failures. But all of the them are expected, since those are actually .rhtml files.