Re: Usability of grammars

Steven Pemberton <steven.pemberton@cwi.nl> writes:

> 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.

Yes, the definition of IPv6 addresses in RFC 3986 and 3987 is rather
opaque. And the definition of reg-name is in effect

    host-name-char*

Imposing some structure on domain names and IP v6 addresses would
involve going beyond what is said in the RFCs for URI and IRI.  I chose
not to do that when transcribing the grammars, since my goal was an ixml
rendering of the normative grammar.

What kind of structure do you think would be useful within reg-name or
IP 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).



-- 
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
http://blackmesatech.com

Received on Friday, 12 August 2022 15:34:46 UTC