[antlr-interest] Antlr emit vs Qt emit

Jim Idle jimi at temporal-wave.com
Wed Dec 28 14:08:55 PST 2011

Please see the archives. You should:

a) Probably not include both ANTLR and QT headers in the same space - you
should not be mixing code in with ANTLR code I think;
b) If you must do this, and I can't see why you must, as you should call
external helper methods from actions, then undef emit before including the
antlr headers.

But, the answer is to decouple your code really.


> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Paul
> Sent: Wednesday, December 28, 2011 2:01 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Antlr emit vs Qt emit
> After some confusion using antlr v3.4 with c++ and the Qt toolkit, Qt
> defines "emit" as a keyword.
> This conflicts with the definition of emit in antlr v3:
> emit       (pANTLR3_LEXER lexer)
> {
> ...
> Unfortunately changing this requires changes in both the antlr
> generator and the C runtime. Without the changes antlr v3 is unusable
> in C++ source files that also use Qt.
> Changing the antler emit to emitT resolves the issue.
> Would it be possible to propagate such a change through the antlr v3
> source?
> Thank you,
> Paul Neelands
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address

More information about the antlr-interest mailing list