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

Rupert Mazzucco mazzucco at iiasa.ac.at
Thu Sep 13 02:31:30 PDT 2007


There doesn't seem to be much interest in this problem, anyway I fixed it
for me by simply renaming the offending "or" to "orCopy" in three files.
I don't know if lexers or parsers can ever reference this symbol; mine don't.

diff -ur a/include/antlr3bitset.h b/include/antlr3bitset.h
--- a/include/antlr3bitset.h    Wed Jun 20 03:55:55 2007
+++ b/include/antlr3bitset.h    Thu Sep 13 10:56:12 2007
@@ -48,7 +48,7 @@
     ANTLR3_UINT32    length;

     struct ANTLR3_BITSET_struct  *  (*clone)       (struct ANTLR3_BITSET_struct  * inSet);
-    struct ANTLR3_BITSET_struct  *  (*or)          (struct ANTLR3_BITSET_struct  * bitset1, struct ANTLR3_BITSET_struct * bitset2);
+    struct ANTLR3_BITSET_struct  *  (*orCopy)      (struct ANTLR3_BITSET_struct  * bitset1, struct ANTLR3_BITSET_struct * bitset2);
     void                           (*orInPlace)    (struct ANTLR3_BITSET_struct  * bitset,  struct ANTLR3_BITSET_struct * bitset2);
     ANTLR3_UINT32                  (*size)         (struct ANTLR3_BITSET_struct  * bitset);
     void                           (*add)          (struct ANTLR3_BITSET_struct  * bitset, ANTLR3_INT32 bit);
diff -ur a/src/antlr3baserecognizer.c b/src/antlr3baserecognizer.c
--- a/src/antlr3baserecognizer.c        Fri Aug 10 21:23:05 2007
+++ b/src/antlr3baserecognizer.c        Thu Sep 13 10:57:55 2007
@@ -1217,7 +1217,7 @@

        /* Knowing that, we can or in the follow set
         */
-       newFollow   = follow->or(follow, viableToksFollowingRule);
+       newFollow   = follow->orCopy(follow, viableToksFollowingRule);

        /* Remove the EOR token, which we do not wish to compute with
         */
diff -ur a/src/antlr3bitset.c b/src/antlr3bitset.c
--- a/src/antlr3bitset.c        Wed Jun 20 03:55:55 2007
+++ b/src/antlr3bitset.c        Thu Sep 13 10:57:09 2007
@@ -92,7 +92,7 @@
 antlr3BitsetSetAPI(pANTLR3_BITSET bitset)
 {
     bitset->clone      =    antlr3BitsetClone;
-    bitset->or         =    antlr3BitsetOR;
+    bitset->orCopy             =    antlr3BitsetOR;
     bitset->orInPlace  =    antlr3BitsetORInPlace;
     bitset->size       =    antlr3BitsetSize;
     bitset->add                =    antlr3BitsetAdd;
-- 
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