[antlr-interest] Compilation linking error with ANTLR 3.x

Thomas Davis thomas.davis at student.adelaide.edu.au
Mon Sep 6 05:06:36 PDT 2010


Hi all,

Just wondering if anyone could help me out with this. I've got ANTLR 3.2 as
part of a qt project, its compiled using qmake and then makefiles to
initiate the compilation. Within one of my files i include the antlr lexer
and parser which was produced using the C target. I should mention this is
being compiled into a c++ project. Whenever i try to compile i get the
following error:


make[1]: Entering directory
`/home/timmas/UniWork/2010/semester2/SEGP2_RSP2010/projects/guiGen/trunk/src'
g++ -c -pipe -frtti -Wall -Wextra -pg -fprofile-arcs -ftest-coverage -frtti
-Wall -Wextra -pg -fprofile-arcs -ftest-coverage -g -Wall -W
-I/usr/local/include/yaml-cpp -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB
-DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.. -I../include
-I../include/lib -I../include -I../include/lib -I../include/components
-I../build -o ../build/ComponentDescriptorUtil.o
../src/components/ComponentDescriptorUtil.cpp
In file included from /usr/local/include/antlr3baserecognizer.h:363,
                 from /usr/local/include/antlr3cyclicdfa.h:38,
                 from /usr/local/include/antlr3.h:40,
                 from ../include/components/AntlrLexer.h:96,
                 from ../include/components/ExpressionParser.h:3,
                 from ../include/components/ConditionTree.h:5,
                 from ../include/components/ComponentDescriptor.h:25,
                 from ../include/components/NodeItem.h:8,
                 from ../include/components/ComponentDescriptorUtil.h:5,
                 from ../src/components/ComponentDescriptorUtil.cpp:1:
/usr/local/include/antlr3lexer.h:130: error: expected unqualified-id before
‘)’ token
make[1]: *** [../build/ComponentDescriptorUtil.o] Error 1
make[1]: Leaving directory
`/home/timmas/UniWork/2010/semester2/SEGP2_RSP2010/projects/guiGen/trunk/src'
make: *** [sub-src-make_default-ordered] Error 2


AntlrLexer.h is the header file for the lexer produced by ANTLR, which is
included from expression parser which is included from ConditionTree etc.. I
have absolutely no idea what this error is or how to fix it, and i've tried
installation of the antlr libraries (all 3.x version) across both windows
and Ubuntu and both give me the same error in the same file, i.e. at this
line in the Antlr Source:

    /** Pointer to a function that constructs a new token from the lexer
stored information
     */
    pANTLR3_COMMON_TOKEN    (*emit)            (struct ANTLR3_LEXER_struct *
lexer);


Any help with this issue would be greatly appreciated, as i've wasted
countless hours trying to solve it :(

Cheers,

Tom


More information about the antlr-interest mailing list