- From: Steven Pemberton <steven.pemberton@cwi.nl>
- Date: Tue, 03 Mar 2026 13:00:01 +0000
- To: public-ixml@w3.org
Received on Tuesday, 3 March 2026 13:00:10 UTC
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