[antlr-interest] ANTLR3 C target and Visual Studio 6

Rupert Mazzucco mazzucco at iiasa.ac.at
Thu Oct 4 04:59:29 PDT 2007


> I've just been creating some parsers using Antlr3 and the c target. It
> all worked fine with vs2005, but would not compile with vc6. After a bit
> of investigation I found I had to make a small change to one of the
> antlr header files. 
> 
> In the file antlr3defs.h, I had to change the line (110):
> 
>         #define	ANTLR3_UINT64_LIT(lit)	    lit##ULL
> 
> So that it instead looked like this...
> 
>         #if _MSC_VER >= 1400
>         #define  ANTLR3_UINT64_LIT(lit)     lit##ULL
>         #else
>         #define  ANTLR3_UINT64_LIT(lit)     lit##ui64
>         #endif // _MSC_VER >= 1400
> 
> Now that I've modified the antlr sources, I guess this change ought to
> make it into the official source stream as a patch of some sort, but I

Your fix looks like it will break things for non VC compilers.  (Also I have to
wonder how many #ifdefs it is worth to support a nearly ten years old compiler.)
-- 
Rupert Mazzucco         <mazzucco at iiasa.ac.at>
Research Scholar, Evolution and Ecology Program
IIASA - Institute for Applied Systems Analysis
Schlossplatz 1, 2361 Laxenburg, Austria
Phone: +43 2236 807 522   Fax: +43 2236 713 13


More information about the antlr-interest mailing list