[antlr-interest] Re: ANTLR 3 tree structure stuff
atripp54321
atripp at comcast.net
Wed Nov 10 11:49:45 PST 2004
--- In antlr-interest at yahoogroups.com, "John D. Mitchell"
<johnm-antlr at n...> wrote:
> >>>>> "matthew" == matthew ford <Matthew.Ford at f...> writes:
> [...]
>
> > Hi Ter, While I like any improvment to trees that would eliminate
cycles
> > you mention at the end
>
> > " A further restriction is that you should not add the same tree more
> > than once if you want the getNextSibling() stuff to work. This
would be
> > too expensive to enforce probably. "
>
> > If you cannot inforce correct tree construction then not bother change
> > the existing one. Tree contruction and manipulation has been the
bane of
> > my work with Antlr. I want robust tree construction that will throw a
> > useful error when I try and do some thing silly or just don't
understand
> > what is happening.
>
> I strongly concur.
>
> Thanks,
> John
Or, make everyone happy by giving us a choice.
Have one Node class that keeps it's children in a TreeSet
(ordered, no dups, fast insert). And have another that
uses a ArrayList (ordered, dups OK, slower insert).
They'd both implement your "Tree" interface.
Andy
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