Usability of grammars

What also struck me when looking at the translation of the IRIs grammar, is 
that for general-purpose grammars like this to be useful, they shouldn't 
only be correct in what they accept, but also useful in what they produce.


So for instance, the IRI grammar will produce for /2002/xforms/index.html
<ipath-abempty>
    <isegment>2002</isegment>
    <isegment>xforms</isegment>
    <isegment>index.xhtml</isegment>
</ipath-abempty>


which is useful, but for www.w3.org, only

<ihost>
    <ireg-name>www.w3.org</ireg-name>
</ihost>

and similar unstructuredness for IPv6 addresses.

(I was looking at this because the XForms spec has some data types 
expressed as fairly unreadable regexes, and I was looking at the 
possibility of using ixml instead).

Steven

Received on Friday, 12 August 2022 13:14:19 UTC