"Joel E. Denny" <[EMAIL PROTECTED]> writes: > Sorry, I have no experience with ML. Would you should me how this might > look in a Bison rule?
Not offhand. C isn't ML, and we'd have to construct types or something like that. It'd take some thinking. But the basic idea is that the EBNF X* has type "list of whatever X returns", and X? maps to "either an X-type value, or a null pointer". > Maybe it's just me, but I prefer Hans' suggestion: > > exp/sum: exp/term1 '+' exp/term2 > > over > > exp#sum: exp#term1 '+' exp#term2 > > I can't think of any semantic reason to prefer one over the other. The > slash is just a little easier on my eyes. I think "/" bugs me because it means "or" in ABNF, which is the standard grammatical notation used in Internet RFCs; see <http://www.ietf.org/rfc/rfc4234>. I could live with "/", I suppose. > I don't much like the `-' to mean nothing. I had originally suggested `!' > instead, but I found a reason why I don't like it either, and that reason > also applies to `-'. This one post might help you catch up: > > http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html Sorry, I don't follow the argument there. How does it apply to "/" (or "#" or whatever)?
