- From: Norm Tovey-Walsh <norm@saxonica.com>
- Date: Tue, 07 Jul 2026 14:01:23 +0100
- To: Steven Pemberton <steven.pemberton@cwi.nl>
- Cc: "Bethan Tovey-Walsh" <bytheway@linguacelta.com>, ixml <public-ixml@w3.org>
Steven Pemberton <steven.pemberton@cwi.nl> writes:
> Hmm. I think of it as a disambiguation construct, because it allows me to disambiguate grammars that would otherwise be ambiguous.
Surely it isn’t a question of how any of us thinks of it. It’s a question of what it changes about the grammar can recognize.
> ixml can already do lookahead:
>
> input: aBook, "a";
> bBook, "b'.
> aBook: book.
> bBook: book.
> book: chapter+. {etc}.
I don’t think that’s really the same thing. And I think it’s an unhelpful way to think about it. The parser doesn’t “look ahead” to see if book is followed by “a” or “b”, it simply consumes all of the input. That’s no different than saying ("a", "b", "c") matches an “a” followed by a “b” followed by a “c” (or it fails to match).
> I agree it is new, I do see it as related to *, +, ? because it does guarantee that exactly zero of those things are present at that point. Any construct that includes empty as one of its productions, either explicitly or implicitly, is a non-consuming structure. This one just gives the reason why.
I think it’s a mistake to think of match ε as “not consuming anything”. It consumes the empty string. That’s just like consuming an “a” or a “b” or a “c”. It’s not like consuming “abc” and then rejecting the parse because they match. That’s completely new.
--
Norm Tovey-Walsh
CEO, Saxonica
Received on Tuesday, 7 July 2026 13:01:32 UTC