[antlr-interest] file names and grammar names

Don Caton dcaton at shorelinesoftware.com
Fri May 19 07:08:17 PDT 2006


Ter:

> Do people think I should force the grammar name (including 
> case) to be same as filename (with .g suffix)?

Yes.  This is standard behavior.  If you compile foo.cpp, by default you get
foo.obj out the other end.  Any other generated files also have the same
base name 'foo' as well.

If you want an output name that's different that the input file name,
provide a command line switch to override the output name.  That should
satisfy both needs.  I don't think you need a 'grammar foo' statement at
all.

And even if foo.g hasn't changed, the timestamps of the output files should
be guaranteed to be later than foo.g.

Please don't perpetuate this weird behavior in Antlr 3, it causes lots of
grief for those of us who try to integrate Antlr into a normal build system
that depends on timestamps.  Or provide another command line switch so we
can choose the behavior that's appropriate for our particular build systems.

Don




More information about the antlr-interest mailing list