[antlr-interest] Need help getting the Antlr C runtime to link into test app.
Jeffrey Newman
jeffn at photorepo.com
Thu Dec 9 04:15:57 PST 2010
Hi,
I'm trying to bring up a C++/C development environment for Antlr.
I have this same problem with 3.2 and the 3.3 snapshot.
The error is expected unqualified-id before ')' token in antlr3l3xer.h
105 (the line below).
/** Pointer to a function that constructs a new token from the lexer stored information */
pANTLR3_COMMON_TOKEN (*emit) (struct ANTLR3_LEXER_struct * lexer);
I build the source with ./configure --enable-64bit.
Then installed (as root). This seemed to go fine.
I didn't see a test in the install.
I built a "treeparser.h" from all of the h files. (attached)
Here is the source file with the extern "C"...
#include <iostream>
#include "AntlrApp.h"
extern "C" {
#include "treeparser.h"
}
AntlrApp::AntlrApp(int & argc, char ** argv)
: QCoreApplication(argc, argv)
{
}
int AntlrApp::exec()
{
std::cout << "Hello World";
antlrCTest();
exit();
}
void AntlrApp::antlrCTest()
{
}
When I comment out the offending line, the source complies.
I really don't expect it to work.
Any help getting this resolved would appreciated.
thanks
Jeffrey
More information about the antlr-interest
mailing list