[antlr-interest] philosophy about translation
Terence Parr
parrt at cs.usfca.edu
Tue Oct 10 13:58:04 PDT 2006
On Oct 10, 2006, at 1:38 PM, Monty Zukowski wrote:
> Note that the E language guys came up with a nice shorthand described
> tersely here: http://www.erights.org/elang/grammar/quasi-terms.html
> and http://www.erights.org/elang/grammar/quasi-xml.html. Basically it
cool.
> lets you parse something like ADD @v1:expr TO @v2:expr into a tree
> that can be matched against your source tree. Then you can write the
> --> @v2 += @v1 on the other side, which is parsed into a tree and it
> will substitute the AST nodes appropriately, So basically you are
> specifying in text yet working in trees.
>
> Ter, I think we discussed this at the Cabal. The trick is that the
> parser and lexer needs to know how to just return a generic EXPR token
> for @v1:expr -- and build a tree with that as a placeholder.
Correct. We discussed and I remember your excellent trick of doing
that EXPR node well! Been thinking about it ever since :)
>> Personally, I think that a hybrid system that does most of the work
>> in a tree walker but with rules, for all of the special cases that
>> Andy has pointed out, would be great!
>>
>
> Yes, I agree. This is quite an interesting discussion.
Heh heh heh...hopefully the current ANTLR book (in prep) or next will
be able to delve into these questions!
Ter
More information about the antlr-interest
mailing list