On Wednesday 04 October 2006 07:13, Aaron Sherman wrote:
> chromatic wrote:
> > That's part of it, but mostly it's for transforming one tree-based
> > representation of a program into another. See for example Pheme's
> > lib/*.tg files.
> I'm confused. I thought that this is what TGE did. Is TGE going away, or
> are we talking about something that extends TGE in some way?
TGE needs an embedded language to say "You gave me a PGE tree. I want to turn
that into a PAST tree, by turning this node into that node, copying that
information, and adding this other information." Note that this language has
nothing to do with *finding* nodes (as in XPath). That's what TGE does.
This mini language is just the stuff in curly braces in the TGE Grammar
files:
transform result (empty_list) :language('PIR') {
.local pmc result
result = new 'PAST::Exp'
.local pmc cons
cons = new 'PAST::Op'
cons.'op'( '__make_empty_cons' )
result.'add_child'( cons )
.return( result )
}
It turns out that assembly language makes things like looping and declaring
complex data structures rather tedious.
-- c