[antlr-interest] [3.1.1] ANTLR3_MIN_TOKEN_TYPE define possibly incorrect
Sven Van Echelpoel
sven.van.echelpoel at empolis.com
Thu Mar 26 01:59:41 PDT 2009
> >
> > Should LT(1) return a node in (2), or does that signal that something's
> > amiss? If the behavior of LT(1) is correct, how can I determine that a
> > node has no next sibling?
>
> <UP> signals the end of the current "level" of tree. I've not played
> with it much, but I believe the idea is that, in a tree parser, you
> don't need to pay attention to <UP> and <DOWN>. If you've got a true
> single-root tree, there will always be an <UP> just before the EOF.
> However, my understanding is that tree-grammar writers don't have to
> bother with these. LT will still show them, I guess. Wouldn't it be
> better to have the tree parser control the application of the rule by
> only applying it "under" the node above? Or if this *is* at the top
> level, your solution might well work, as you've demonstrated that you
> only get the <UP> when there isn't a next sibling.
>
I don't think I can write a grammar to capture what I'm trying to do
(See my other reply). I may be wrong, in which case I'll happily stand
corrected.
Thanks,
Sven
More information about the antlr-interest
mailing list