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.

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.

J2SE 5.0 and up.

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:

[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.


Blogger GZ said...


This looks like a very interesting project. I downloaded the code (2/27/06) but am getting some errors while trying to compile it (Fedora/JDK 1.5/ant 1.6.2). Any ideas?


11:43 AM  
Blogger yawl said...

Hello GZ,
Thank you for trying it out! I have not tried rubyfront on Fedora, but it works on my Ubuntu 5.10.
You need to make sure JDK 5.0 (from SUN) is installed correctly. On lots of linux distributions GCJ is installed and you may accidentally launched it when you type "java" and "javac".

Here is what I did:
yong@ubuntu:~/rubyfront$ export PATH=~/jdk1.5.0_06/bin:$PATH
yong@ubuntu:~/rubyfront$ export JAVA_HOME=~/jdk1.5.0_06
yong@ubuntu:~/rubyfront$ java -cp lib/ant/ant-1.6.5.jar:lib/ant/ant-launcher-1.6.5.jar:lib/ant/ant-antlr-1.6.5.jar:lib/ant/ant-junit-1.6.5.jar:lib/junit/junit-3.8.1.jar:$JAVA_HOME/lib/tools.jar

2:16 PM  
Anonymous Anonymous said...

Any more development on this? It looks like it fails on quite a few files in Rails 1.1.

9:29 AM  
Blogger yawl said...

Rubyfront works well on rails 1.0. Actually, it will complain on a few files, but that is expected since they are in .rhtml format(not valid ruby, rails requires erb to preprocess them). I have not try rails 1.1 yet, but will work on it soon.

9:42 AM  

Post a Comment

<< Home