Original-Via: uk.ac.ed.dcs; Fri, 17 Jan 92 17:56:56 GMT
I was to lazy to get the new version (1.2 beta),
but I guess the following slight modification would do the desired effect
for expressions like (+) :
Add "op^{(a,i)}" as a further alternative for "exp".
This would even allow to write lists like
[+,*,-]
but at most places one had still to put parentheses around the
operators. In any case, white-space around the operators would be
allowed, of course.
Similarly one could move the sections to the corresponding
exp^i, e.g. a further alternative for exp^i would be
exp^i --> exp^{i+1} op^{(r,i)}
The advantage of this is that parentheses become "true" parentheses,
i.e. they are then used to change precedence level of an expression
and for nothing else.
And in that case, treating `id` on the lexical level, disallowing
white-space around the id, would be perfectly normal.
For a parser generator (LALR(1)) such an addition (the sections)
shouldn't be a problem,
at least if you have an expanded grammar for the exp^i -
using as abbreviation the operator feature of yacc/bison/...
might be problematic, I don't know.
Stefan Kahrs