On 19 Nov 2006, at 16:49, Paolo Bonzini wrote:
Declaring $ as part of the value name might help:
exp($sum): exp($term1) '+' exp($term2)
Not that much. Yes, this makes a Perl back-end for Bison even more
difficult, but given Perl 6 has grammars this is not a likely event
anyway (unlike the Java back-end -- shameless plug for my %language
patch).
If Bison moves that far, to multilingual output support, I expect the
parsing in each {...} be output language specific anyway. So it is
not any point in worrying about the fact that say "$" does not work
in this or that output language.
Please, let's keep $sum and @sum.
So this seems simplest.
Or maybe it should be possible to name these separately:
exp($sum, @sum): exp($term1, @term1) '+' exp($term2, @term2)
Please don't.
I think too, that such ideas will make the grammars rather unreadable
to humans. :-)
I think the best way is to think of it as one defines objects named
"sum", "term1", etc., from which value, location, plus perhaps some,
can be extracted. Right now, this is done using "$" and "@".
Hans Aberg