On Sat, Jun 15, 2002 at 03:19:34PM +0200, Marcel Gruenauer wrote:
> Now, could you just do
>
> rule leftop ($leftop, $op) {
> <$leftop> [$op <$leftop>]*
> }
>
> rule leftop ($leftop, $op, $rightop) {
> <$leftop> [$op <$rightop>]*
> }
At the very least you should be able to do this:
rule leftop($leftop,$op;$rightop) {
$other := { (defined $rightop) ?? $rightop :: $leftop }
<$leftop> [$op <$other>]*
}
or, an ickier version:
{ my $other;
rule leftop($leftop,$op;$rightop) {
{ $other = (defined $rightop) ?? $rightop :: $leftop }
<$leftop> [$op <$other>]*
}
}
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]