[antlr-interest] supress ANTLR comments in the Generated Lexer and Parser code

Manikandan Subramanian vsmani.chrome at gmail.com
Fri Mar 6 06:33:50 PST 2009


Hi,

Is there any way to supress ANTLR comments in the Generated Lexer and Parser
code.

Every where it says, // $ANTLR 3.1.1
D:\\dev\\workspace\\workspace_contivo\\TranslatorType3Rpt.g 2009-03-06
19:55:09

in all the rules, it includes comments like below, it is referring physical
location, the generated java files has checked in to the CVS repository and
doesnt make sense to have local machine's foldernames.

   // $ANTLR start "document"
    // D:\\dev\\workspace\\workspace_contivo\\TranslatorType3Rpt.g:231:1:
document : translationType inputSection outputSection ;


Similary I want to give the grammar file location in the resource file name
and read it from there, instead of having the absolute path like below
in the generated Parser code.

public String getGrammarFileName() { return
"D:\\dev\\workspace\\workspace_contivo\\Conversion
Utility\\TranslatorType3RptStd.g"; }

I searched in the ANTLR book and couldnt find anything.

Any help would be great.

Thanks in advance.

Regards,
Mani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090306/4d725b22/attachment.html 


More information about the antlr-interest mailing list