Christopher is right that I could make null RHS's part of the syntax of other rules.. I don't because:

1.) Null alternatives would be easy to create by accident.

2.) Null alternatives are very special in the adverbs they do and do not allow.

3.) Null rules can make parent symbols nullable, which can have tricky or unintended results.

4.) Allowing null alternatives does not eliminate the non-orthogonality. It just moves the issue elsewhere -- null alternatives in a prioritized rule would almost certanily mean a typo, or an attempt to do something that won't really work, and probably should be banned.

All of which means that forcing a user to specify a null RHS as a special separate rule is in keeping with the Principle of Least Surprise. Note that one of the people who might be victim of these surprises is me -- in my own SLIF grammars, I don't regret having to make my null rules separate.

Finally, I welcome experimentation. It's quite possible to create your own front-end to the SLIF, if you think you can improve on the SLIF and handle null rules in a way that combines safety and elegance. As I've said before, the SLIF exists because of the experiments by Peter Stuifzand and Andrew Rodland, experiments which took Marpa beyond where I'd gone and showed me that I could and should improve on Marpa's original interface (the NAIF).

-- jeffrey

On 06/19/2014 11:42 AM, Christopher Layne wrote:
If you ignore the null rule it'll blow your mind less if you think about it as:

A ::= B | 'hello!'
A ::=

There's no conceptual reason that the null rule couldn't be the last 
"alternative" but I believe the DSL grammar won't allow it hence it's a 
separate statement.

On Jun 18, 2014, at 9:37, Paul Bennett <[email protected]> wrote:

A ::= B
A ::= 'hello!'
A ::= # empty
Point not taken. Point, in fact, blew my mind. More research is required.

--
You received this message because you are subscribed to the Google Groups "marpa 
parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to