For a C target, you should use this setting:

        ASTLabelType=pANTLR3_BASE_TREE;

The one you are using is specific to the Java target.


On Jun 23, 2009, at 6:52 AM, Bruno Cadonna wrote:

> Hi list,
>
> I use ANTLRWorks 1.2.3 with ANTLR 3.1.2 to generate a parser for a
> small grammar in C.
>
> The option section of my grammar is:
>
> options {
>       language = C;
>       output = AST;
>       ASTLabelType = CommonTree;
> }
>
> When I want to compile the generated parser source against the C
> runtime libraries (libantlr3c-3.1.2.tar.gz), I get the following
> errors and warnings:
>
> In file included from gen/sase_fubParser.c:45:
> gen/sase_fubParser.h:124: error: syntax error before 'CommonTree'
> gen/sase_fubParser.h:124: warning: no semicolon at end of struct or
> union
>
...
> ...
> ...
>
> I use autotools (autoconf, automake, libtool) to compile the project.
> It is the first time I use them and I am not a C expert, so it could
> easily be that the problem is not related to ANTLR. But since it seems
> that there is a syntax error in the files generated by ANTLR I thought
> maybe it is a bug.
>
> Could anybody exclude or confirm that?
>
>
> Cheers,
> Bruno
>

-------------------------------
Hank Schultz
Cedrus Corporation
http://www.cedrus.com/



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to