[antlr-interest] Don't want to pervert reference grammar like Terence Parr one on Java 1.5

Freddy Mallet freddy.mallet at gmail.com
Wed Nov 12 01:43:26 PST 2008


Hi all,

I'd like to create my own Open Source library to calculate metrics on java
and pl/sql source code. Those metrics could be lines of code, cyclomatic
complexity, maintainability index (SEI), etc. I've studied javacc and antlr,
then read the definitive ANTLR Reference.

At that point, I guess I've enough material to begin writing this library
but ... there is a recurring question I can't evacuate from my brain.

Here is my issue : on the shelf, there is already two reference grammars
available to parse java and pl/sql. Of course, those two reference grammars
will evolve in time to follow java and pl/sql evolutions.

Tomorrow, beginning to touch those two grammars to build my own AST or to
add my own actions on rules is equivalent to create a new branch on a source
code. After few months, the differences between the grammars will be so
important that I couldn't synchronize them. So after a while, I couldn't
capitalize on ANTLR community work.

That's exactly what happens currently to JavaNCSS library. The library used
javacc and all work has been done from a Java 1.1 grammar which has now
great difficulty to evolve.

So, is there an abstraction mechanism which allow us to use on the shelf
grammars without modifying them directly ?

Thanks for your help,

Freddy



-- 
Freddy Mallet,
Sonar , Embrace Quality
http://sonar.codehaus.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081112/a0cfe395/attachment.html 


More information about the antlr-interest mailing list