[antlr-interest] ANTLR 3.0 tree construction proposal

Loring Craymer Loring.G.Craymer at jpl.nasa.gov
Wed Feb 2 11:05:14 PST 2005


At 09:29 AM 2/2/2005, John D. Mitchell wrote:
> >>>>> "Loring" == Loring Craymer <Loring.G.Craymer at jpl.nasa.gov> writes:
>[...]
>
> >> Huh?  You're talking about generating all of my tree grammars for me?
> >> Did
>
> > Modulo refactoring, yes.  And the set of refactorings for grammars looks
> > to be reasonably small--about 10 or so.  That's the key reason I
> > developed a target-language-independent construction syntax in the first
> > place: when you specify the transformation, you provide enough
> > information to define a corresponding tree grammar which can then be
> > refactored into a useful form.  The only piece missing right now is the
> > insertion analysis.
>
>Hmm... But that presumes a constructivist approach.  I.e., one would have
>to create the phases in order so that this automated tree grammar would be
>constructed.  Sometimes, it's much better to e.g., work backwards from the
>tree that you want and then determine the (sequence of) transformations to
>make that.

So you sketch backward and then implement forward.  The key is that 
automatic tree generation makes the implement forward phase very fast (I 
did tree transformation development for a pretty complete expression 
grammar in about 2 hours).


>In that sense, I guess that I'm saying that I'm less concerned with
>automated tree grammar construction and very concerned with being able to
>check that the output conforms of a phase conforms to the input of other
>phases (i.e., the so-called tree diff tool).

Check out <http://developer.berlios.de/projects/tdm/>.  It uses SAX parsing 
(shudder), but should be adaptable to an ANTLR front end.


>Thanks,
>         John




More information about the antlr-interest mailing list