[antlr-interest] ANTLR 3.0 tree construction proposal

John D. Mitchell johnm-antlr at non.net
Tue Feb 1 21:06:16 PST 2005


>>>>> "Loring" == Loring Craymer <Loring.G.Craymer at jpl.nasa.gov> writes:
>>>>>>> "Loring" == Loring Craymer <Loring.G.Craymer at jpl.nasa.gov> writes:
>>>>>>>> At 03:24 PM 2/1/2005, John D. Mitchell wrote:
[...Tree surgery...]

>> Sorry for being dense (it's been a long week :-) but... If the
>> fragments are in dynamic attributes, what's the analysis problem?

> Each insertion point ends up defining a rule; the trick is to then find
> all of the possible insertions, their relationships (if you insert bar
> after foo, for example, or if bar and foo are alternative inserts), and
> account for the optional [ ()? ] and looping [ ()* or ()+ ] constructs
> that enclose the insert sources so that they can be reflected in the
> insertion point rule.  I think that I understand the algorithm well
> enough to implement it in two or three months of solid effort.

Ah, I see, I'm stupid and missed that you're talking specifically about
generating a tree grammar.  I don't personally care much about that.  I'm
much more concerned about being able to cleanly implement significant tree
surgery.


[...Error handling...]

>> AFAIAC, if we can't do high-quality error handling (detection,
>> logging/notification, and recovery) then whatever we're doing is wrong.

> A key point: with automatically generated tree grammars, ANTLR errors can
> only occur in the lexer or parser.  Even if Paul Lucas' idea of
> propagating error trees is adopted, we can still handle that.  So the
> problem is one of what error-handling support, if any, is provided to
> users for their use.

Huh?  You're talking about generating all of my tree grammars for me?  Did
I miss something?

Thanks,
	John


More information about the antlr-interest mailing list