[antlr-interest] antlr + build tools : does antlr only re-generate files that have changed?

Ross Bencina rbencina at iprimus.com.au
Sat Mar 15 01:00:53 PST 2003


Hi Everyone

I'm using ANTLR 2.7.2 on WinXP(no service pack) with Sun JRE 1.4.0_01. I'm
trying to set up a build system with jam
(http://www.perforce.com/jam/jam.html).

I have a grammar file which generates both Parser.cpp/.hpp and
Lexer.cpp/.hpp files. What seems to be happening is that only the generated
.cpp or .h files that need to change are actually written to disk - for
example if I edit a semantic action in the parser grammar, only Parser.cpp
gets modified (Parser.h, Lexer.cpp/.hpp file modification dates remain
unchanged.) My first question is - is this the expected an normal behavior
of antlr?

If the above is normal behavior, I'm wondering if there is a way to force
antlr to regenerate all source files when the grammar is processed?

The problem I'm having at the moment is that because antlr only seems to
update the source files that need to change, my build script is getting
confused and sometimes gets stuck thinking that the .cpp/.h files always
need to be regenerated because their file modification dates are older than
the .g file's modification date.

My current workaround is to touch all of the generated files, but I'd prefer
not to require touch on Win32 to make the build work.

Has anyone dealt with this in the past? Any suggestions would be
appreciated.

Thanks

Ross.


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list