Re: The semantics of the disambiguation constructs

Having a "not rule" does not make sense to me. I cannot see how to 
implement it either.
An example I used in my ambiguity paper was


 id: !keyword, word.  {or word!keyword}
 word: L+, !L.
 L: [L].
 keyword: ("if"; "then"; "else"; ...), !L.


which I think is a good use case.


As for implementation, I know of some already (not ixml, though it is on my 
to-do list). 


For Earley for instance:


 A: !B, C.


If B succeeds then A fails. If B fails then C is parsed from the point in 
the input where B started.


In the form


 A: C!B.


C and B can be parsed in parallel (in the same way that alternatives of a 
rule are parsed in parallel), and if C succeeds and B fails, the whole 
construct succeeds, and parsing continues from where C left off, otherwise 
the whole construct fails.


Steven

Received on Tuesday, 3 March 2026 13:00:10 UTC