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

Kieran Simpson kierans777 at gmail.com
Thu Nov 3 04:59:45 PDT 2011


Ivan,
   You were spot on the money.  I'm using Qt with Antlr so the macros 
were colliding.

Thanks.

On 23/07/64 5:59 AM, Ivan Brezina wrote:
> 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=pt/local
>> --build=6_64-apple-darwin10
>> --enable-languages=c++,objc,obj-c++,java,fortran
>> --libdir=pt/local/lib/gcc44 --includedir=/opt/local/include/gcc44
>> --infodir=pt/local/share/info --mandir=/opt/local/share/man
>> --with-local-prefix=pt/local --with-system-zlib --disable-nls
>> --program-suffix=p-4.4
>> --with-gxx-include-dir=pt/local/include/gcc44/c++/
>> --with-gmp=pt/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