[antlr-interest] Problem building custom error handlers against C target 3.4

Ivan Brezina ibre5041 at ibrezina.net
Tue Nov 1 09:28:25 PDT 2011


Hi,
look at the line 130.
Such a kind of error usually means, that you have collision between
#define macro and antlr internal identifier name.

For example QT declares macro "#define emit().." while antlr has it's  
own emit function.

Try to preprocess your source using "gcc -EPC" and you'll see.

Ivan


Quoting Kieran Simpson <kierans777 at gmail.com>:

> I'm using the 3.4 tarball (which when decompressed is really
> libantlr3c-3.4-beta4)
>
> I'm wanting to override the default error handlers so that they're more
> flexible in my application.  However trying to compile my (C++) code I get
>
> In file included from <my source>
> /usr/include/antlr3lexer.h:130: error: expected unqualified-id before
> ')' token
>
> $ g++ -v
> Using built-in specs.
> Target: x86_64-apple-darwin10
> Configured with: ../gcc-4.4.6/configure --prefix=/opt/local
> --build=x86_64-apple-darwin10
> --enable-languages=c,c++,objc,obj-c++,java,fortran
> --libdir=/opt/local/lib/gcc44 --includedir=/opt/local/include/gcc44
> --infodir=/opt/local/share/info --mandir=/opt/local/share/man
> --with-local-prefix=/opt/local --with-system-zlib --disable-nls
> --program-suffix=-mp-4.4
> --with-gxx-include-dir=/opt/local/include/gcc44/c++/
> --with-gmp=/opt/local --with-mpfr=/opt/local --enable-stage1-checking
> --disable-multilib --enable-fully-dynamic-string
> Thread model: posix
> gcc version 4.4.6 (GCC)
>
> Has anyone else had this problem on OSX Snow Leopard and the above g++
> version?
>
> Cheers,
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:   
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the antlr-interest mailing list