[antlr-interest] file names and grammar names

Micheal J open.zone at virgin.net
Fri May 19 13:00:26 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.

Not quite the same. And not standard at all. Foo.cpp may actually contain
types NotFoo<T> and SomethingElse. Same with Foo.cs, Foo.C, Foo.py etc

Only Java has this as standard behaviour afaict. Not nice but, may just work
for ANTLR given the past fews days discussion.

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

You mean due to a previous build right?. Not suggesting the outputfiles be
touched always?

> 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.

Making it an option is more user-friendly than my previous API/library
suggestion. Not as flexible mind but...


Micheal



More information about the antlr-interest mailing list