[antlr-interest] C target broken?

Florent Teichteil florent.teichteil at gmail.com
Thu Sep 25 07:11:59 PDT 2008


Hi,

After 1 month working on an other project, I am trying to recompile an
ANTLR3.1 project. My grammar was generated using ANTLR 3.1b2, but the
corresponding C target is no more available. Then, I install
libantlr3c-3.1 : the C target runtime library is not compatible with
the code generated using ANTLR 3.1b2 !

As a result, I regenerate my grammar with ANTLR 3.1, but the generated
code does not compile because "tree" variables in C structures are not
declared:

// BEGIN OF CODE

typedef struct ppddlParser_ppddlDoc_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree
parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    	tree;                                                  // ERROR HERE!

}
    ppddlParser_ppddlDoc_return;

// END OF CODE

I tried both ANTLRworks and ANTLR IDE v3 for eclipse, without success...
In other words, it seems the code generator and the C runtime library
provided on ANTLR website are not compatible.
Which version of ANTLR and of the C runtime library should I use?

By the way, based on my own experience, it is often quite difficult to
find the C target runtime library whose version corresponds to the
right version of ANTLR that generated the C code. Would there be a
clearer way to associate the versions of the code generator and of the
runtime libraries?

Best,
Florent


More information about the antlr-interest mailing list