Marty Andrews

artful code

Sunday, September 7, 2008

Roodi on ParseTree instead of JRuby

I started out building Roodi using the JRuby apis to parse Ruby code and build an AST. My main alternative to that was to use ParseTree. The advantage of using JRuby was twofold. Firstly - I could get access to newline characters as part of the AST, which I wanted to use in checks. Secondly - I could get access to line numbers, which I wanted to use as part of the error message output.

I've just sacrificed both of those advantages and switched the code base to use ParseTree instead. Why? Because it makes the tool more widely usable. I had my own non-JRuby projects that I was trying to run Roodi in, and it became a pain in the ass. Now I get much better portability, which is worth the sacrifices I had to make. I suspect I can patch line numbers in later, and I'm not that fussed about losing the checks that needed to check the newline characters.

No comments:

Post a Comment