[antlr-interest] Antlr emit vs Qt emit

Paul paulne at primus.ca
Wed Dec 28 14:00:39 PST 2011


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:

static pANTLR3_COMMON_TOKEN
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


More information about the antlr-interest mailing list