[antlr-interest] can tree grammers have an output of AST?

Hill, Robert rhill03 at eds.com
Sun Oct 15 23:30:44 PDT 2006


Thanks for that Loring :)
I'd checked out Yggdrasil a while back when you first posted the release
notice :)
Looks pretty cool I must say!

>Ter's latest statement on translation philosophy is that trees 
>are built during parsing and then walked one or more times 
>without transformation (that started the latest thread on 
>translation approaches, after all).  

Hmm, I was (trying) to follow the thread , I must have missed that bit
:(
All I wanted to do was make successive passes only deal with the rules
that are
Relevent at that pass, so for instance if I optimise away unused
paramters, I wouldn't have to deal with them on the next pass, instead
of simply setUnused(true).. And checking it everywhere :( Its just a
source code thing , in that if you modify your parser, you have to
cascade that rule change/addition down through all the tree parsers too
:( in fact, I think the first post I made about this is what kicked off
the whole translation philosophy argument in the first place!
Oh well, I'll go with what I have then! 


>ANTLR 3 was not designed 
>to do complex multi-pass transformations, nor was it designed 
>_not_ to support such transformations, for that matter. 
>However, features usually don't "just happen" in software, but 
>instead are the result of explicit design or redesign efforts.

My misunderstanding, I just assumed that you could output either another
AST or a template from the treeparser. Just seemed natural to me, I
guess I was jumping the gun a bit ;)



>Yggdrasil is a work in progress--it does not automatically 
>generate tree grammars yet, for example--but it will support 
>complex multi-pass transformation in its current form.

I will have to look at this in more detail, although I've got everything
invested in V3.0 at the moment, so my time to check it out in detail
will be limited.

Cheers,
Rob


More information about the antlr-interest mailing list