[antlr-interest] C Target: what to use instead of CommonTree when writing tree grammars, antlr 3.0

Hardy, Stephen Stephen_Hardy at rabbit.com
Sat Jul 7 12:17:07 PDT 2007


Jim,

 

I can't get my head around this.  Have you implemented the necessary
infrastructure for using tree walkers with the C target?  I would like
to use templates, however they are not yet available for C.  So, I am
happy to use printf's and other hacks to get going.  The trouble is, I
can't relate the java examples in the book to how to do this in C, and
there are no examples.  For example, I am writing

 

type_id:

            : IDENTIFIER { printf("\%s ", $IDENTIFIER.text->chars); }

            ;

 

But it obviously isn't that simple since I get errors all over the
place.  Also, what is the correct ASTLabelType incantation to use in the
options section?  It isn't CommonTree, that's for sure.

 

Regards,

SJH

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070707/784a3f76/attachment.html 


More information about the antlr-interest mailing list