Building C target grammar parser, need to know how to include when compile

I am tring to build a parser (in C language) with antlrIDE on Windows 7 platform. I finished the grammar (.g of combined grammar), which automatically generates lexer and parser for me. However, I don't know how to compile the .c and .h file. I tried but get error because the header include (the antlrIDE auto generates the header #include "antlr.h" in the parser dot c file). I have read this article Using ANTLR3 C Target

But it does not help me, could you guys please show me how to do that? Thank you in advanced.

Upvotes: 0

Views: 306

Answers (1)

Clemens
Clemens

Reputation: 1817

You need to add the ANTLR runtime to your project/solution. Here is the link to download the runtime library ANTLR C runtime (from the article you put the link in your question).

Add the runtime to your build and also set the additional include directories to the include folder of the runtime lib (where the compiler can find the antlr.h header).

Upvotes: 1

Related Questions