[antlr-interest] AST Stuff

Ric Klaren klaren at cs.utwente.nl
Thu Apr 15 04:33:17 PDT 2004


On Thu, Apr 15, 2004 at 11:23:14AM -0000, jbfraleigh wrote:
> I've read through the Antlr documentation several times and I've 
> looked at the code generated by this, but I still can't get a good 
> handle on exactly what it's doing.
> 
> Can someone please explain to me what this does?
>   { ##  = #(#[CONDITION] , ##) ; }

## is basically a shorthand for #rule_name. This piece of code inserts an
AST node of type CONDITION on top of the tree generated so far for the
rule. It's a very common construct for adding imaginary nodes to the top of
specific subtrees so they're easier to recognize in treewalkers.

Cheers,

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
 'And this 'rebooting' business? Give it a good kicking, do you?' 'Oh, no,
  of course, we ... that is ... well, yes, in fact,' said Ponder. 'Adrian
    goes round the back and ... er ... prods it with his foot. But in a
     technical way,' he added. --- From: Hogfather by Terry Pratchett.



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list