[antlr-interest] definately NOT a tree transform question :)

Robert Hill rob.hill at blueyonder.co.uk
Wed Oct 18 12:20:22 PDT 2006


Novel! , I'd not thought about Maps!, that's pretty cool because then im not
lumbering all the node with additional info, in case you cant apply nodes to
specific bits of the tree, and have to blanket change the node type. I
suppose the addition of a myStuff object ref wouldn't be a problem, I have <
1000 nodes..
Cool!

Cheers Oliver!

/2ob


> -----Original Message-----
> From: Oliver Wong [mailto:owong at benchmarkconsulting.com]
> Sent: 18 October 2006 20:15
> To: Robert Hill
> Subject: RE: [antlr-interest] definately NOT a tree transform question :)
> 
> 
> From: antlr-interest-bounces at antlr.org
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Robert Hill
> Sent: Wednesday, October 18, 2006 2:55 PM
> > I have a treeparse that checks the semantics, I'd like to store some
> of
> > the usefull things I've calculated that pass for future passes, rather
> > than recalculating the same stuff at the same point in the tree. I'd
> like
> > to store extra info somewhere with this tree/token/whatever, I guess I
> > need to provide a different/extended Node type with my payload?
> 
> 	One trick I've seen is to define a Map that goes from the nodes
> to the data you wish to store associated with that node. It's like
> faking the addition of fields to a class at runtime.
> 
> 	- Oliver
> 




More information about the antlr-interest mailing list