[antlr-interest] Recover grammar file from generated code?

Jim Idle jimi at temporal-wave.com
Fri Sep 25 08:53:00 PDT 2009


On 09/25/2009 01:16 AM, Hoang Phung wrote:
> Hi all,
>
> In my project, I inherited the code (Parser and Lexer) generated with
> ANTLR by someone else but I couldn't retrieve the original grammar file
> from him. Can someone tell me if there is a way to recover the grammar
> file from the generated code and embedded comments? Thanks in advance.
>    
The only practical way is to read the code manually and type in the 
grammar again. I suppose you could construct somethign to do this, but 
you would need a full parser for the target langauge and lots of 
inherent knowledge of ANTLR and so on. It is probably quicker to type up 
a new grammar from scratch.

Jim


More information about the antlr-interest mailing list