Re: More on grammar metadata

Norm,
There is an irksome ambiguity in the characterisation of whitespace 
after the version and any metadata:

prolog: version, RWS, (metadata+ | RS).

which means that without metadata any whitespace between version and the 
first rule can be accounted across two required whitespace nonterminals, 
i.e. RWS, RS. (It also means that there must be at least two whitespace 
characters between version and the first rule.) Changing it to:

prolog: version, (RWS, metadata+ | RS).

seems to fix the problem.
The rest of the metadata parsing seems to work fine, at least the iXML 
grammar can parse your metadata examples on the jωiXML Workbench
<https://johnlumley.github.io/jwiXML.xhtml>
<https://johnlumley.github.io/jwiXML.xhtml>Will see how easy my 
hand-crafted parser can be changed.

John

On 15/03/2024 12:08, Norm Tovey-Walsh wrote:
> Hi folks,
>
> I got some encouraging replies to my earlier post about grammar metadata, so I thought it might be useful if I made it a little easier to play with. To that end, I’ve crafted a branch that incorporates the changes into the spec:
>
>    https://ndw.github.io/ixml/branch/metadata/
>
> and builds a complete grammar that includes the feature:
>
>    https://ndw.github.io/ixml/branch/metadata/ixml.ixml.html
>
> You can parse experimental grammars with this grammar to see the how the metadata is represented. For example, if you save that grammar as “metadata.ixml”:
>
>    coffeepot -g:metadata.ixml -i:test.ixml -pp
>
> You can’t use “test.ixml” to actually parse input because current iXML processors won’t recognize the metadata in the prolog. But if this idea gets traction, I’ll publish a NineML release that supports it as an experimental feature.
>
>                                          Be seeing you,
>                                            norm
>
> --
> Norm Tovey-Walsh
> Saxonica


-- 
*John Lumley* MA PhD CEng FIEE
john@saxonica.com

Received on Friday, 15 March 2024 13:17:34 UTC