[antlr-interest] Converting Tree operands ('^' '!') to rewrite rules ( '-> ^(...)')
Jens Boeykens
jens.boeykens at gmail.com
Fri Jul 11 04:15:30 PDT 2008
Thanks Johannes and Gavin. It works and it seems to me that it can even be
simplified to this:
rule : (id -> id) ( '+' id -> ^('+' $rule id))*;
Correct me if I'm wrong. The simpler the rewrite the easier it is to
reconstruct...
Oh and an anwser to Johannes' question: I will work on the tool until the
end of July and then it will probably be released under BSD license (like
ANTLR). We don't know yet how to donate it to the community (sourceforge
project, via ANTLR website if it is approved and allowed, a simple archive
through the mailing list, ...).
Jens
2008/7/11 Gavin Lambert <antlr at mirality.co.nz>:
> At 21:34 11/07/2008, Jens Boeykens wrote:
>
>> Bounced on a problem:
>>
>> What should be the rewrite rule for this operand rule:
>> rule : id ('+'^ id)*;
>>
>
> IIRC:
>
> rule
> : (a=id -> $a)
> ('+' b=id -> ^('+' $rule $b))*
> ;
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080711/6adc2d0f/attachment.html
More information about the antlr-interest
mailing list