so

Incomplete grammars

Volume 9, Issue 26; 27 Oct 2025

Do incomplete grammars have a place in a world of modular Invisible XML?

I’ve been thinking more about modularity in Invisible XML. Michael Sperberg-McQueen first drew my attention to the similarities between Invisible XML and RELAX NG: they are both expressions of a grammar that parses a sequence of input tokens, perhaps ambiguously.

The RELAX NG tutorial includes a nested grammar example that relates to tables. It didn’t take me long to construct a roughly analogous example in iXML:

table = row+ .
row   = (-'|', cell)+, -'|', nl .
cell  = -cell-content .
-nl   = -#a .

In the RELAX NG case, you could define cell-content as notAllowed, but iXML doesn’t have anything like “not allowed”, so I’ve left the rule out. That’s an incomplete grammar that won’t parse.

But suppose that you had a modularity framework that let you say: “use that tables grammar with this definition of cell-content​”:

cell-content = -" "*, ["0"-"9"]+, (".", ["0"-"9"]*)?, -" "* .

Now you’d have a grammar that would parse a table of numbers. Similarly, if you defined cell-content this way, you’d have a grammar that would parse a table of words:

cell-content = -" "*, [L]+, -" "* .

That seems like it could be interesting.

#Invisible XML #MarkupMonday #XML

Please provide your name and email address. Your email address will not be displayed and I won’t spam you, I promise. Your name and a link to your web address, if you provide one, will be displayed.

Your name:

Your email:

Homepage:

Do you comprehend the words on this page? (Please demonstrate that you aren't a mindless, screen-scraping robot.)

What is four plus one?   (e.g. six plus two is 8)

Enter your comment in the box below. You may style your comment with the CommonMark flavor of Markdown.

All comments are moderated. I don’t promise to preserve all of your formatting and I reserve the right to remove comments for any reason.