A rule with an empty right-hand side is clearly not allowed, since we have:
rule = rulename defined-as elements c-nl
and elements
cannot match an empty sequence. (That's backed up by the actual text, which defines elements
as "one or more rule names or terminal specifications".)
It appears to me that both ""
and 0FOO
(where FOO
is any non-terminal) are legal elements
, and the only possible interpretation of either of them would be an empty sequence. On the other hand, I don't believe I've ever seen either of these formulations, since it is extremely easy to indicate that an element is optional, and it is much more normal to write [NAME]
than to define NAME
with an alternative including an empty string.