[antlr-interest] C target; C++ compatibility?

Jim Idle jimi at temporal-wave.com
Tue Sep 18 04:04:54 PDT 2007


Well, I didn't ever really intend to support the compiling of the C runtime
as C++ code, because it's err, C code ;-)

The way to deal with this properly is for me to ensure that generated .h
files can be included within C++ code and define the functions as extern "C"
etc. I will be working on the C++ some more starting in 2 weeks time. The or
'method' is used by error recovery code.

Jim

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Rupert Mazzucco
Sent: 11 September 2007 13:48
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] C target; C++ compatibility?

> antlr3bitset.h line 51 declares a function pointer named "or":
> 
>   struct ANTLR3_BITSET_struct  *  (*or)	    (struct
ANTLR3_BITSET_struct  * bitset1, struct ANTLR3_BITSET_struct * bitset2);

The SunPro 5.9 compiler doesn't like it either.  Does anybody have a comment
on the
use of C++ keywords as symbols in the C target?  I realize it's the C, not
C++, target,
but as the latter seems not really functional yet, using the C target via
the is the
obvious workaround. This would be much facilitated if the headers could be
included
in a C++ program as 'extern "C"'.  I would appreciate a hint on how much
work renaming
this symbol requires.  I found it in antlr3bitset.{h,c}, but it must be used
somewhere
else and grepping for "or" is not so illuminating.

Thank you
Rupert
-- 
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