Re: ixampl now supports insertions

BR Chrisman <brchrisman@gmail.com> writes:

> On Wed, Jul 27, 2022 at 11:46 PM Norm Tovey-Walsh <norm@saxonica.com> wrote:
>
>  BR Chrisman <brchrisman@gmail.com> writes:
>  > Is there an XML format for the ixml referenced here?
>
>  Sure. You can get the xml format for any ixml grammar by parsing it with
>  the ixml grammar for ixml.

>  ...

> I think what I was kind of looking for was a descriptive XML format
> that would be more clear about what each piece is doing and allow me
> to perform some queries/transformations on it.  The base syntax is
> extremely concise and may adhere to what's common in parsers, ...

The spec grammar of ixml is indeed very much in the standard style for
formal grammars.

I'm not really very clear on how the XML form of an ixml grammar differs
from what you want.  The names (rule, @name, repeat0, repeat1, etc.)
seem descriptive to me.  I suppose the names only make sense to those
with some understanding of how context-free grammars define languages.
If you don't already have such an understanding, I think the tutorials
pointed to from the ixml web site, and the spec itself, may be helpful.

And for what it's worth it is certainly possible to perform queries and
transformations on ixml grammars -- my Gingersnap library (see
https://github.com/cmsmcq/Gingersnap) is a collection of XSLT transforms
for ixml grammars.  Some of them perform simple visualizations (e.g. of
the possible parent/child relations between nonterminals in the
grammar), others transform a grammar G into a related grammar G' that
defines a related language.  One series of transformations, for example,
transforms a grammar G definining a context-free language L into a
related grammar G' defining a regular language L', where L' is related
to L in specific ways. 

> ... but
> there wouldn't be a relaxng or xsd for the definition of the parse or
> the possibilities.  I will reread this after a while and see if it
> makes more sense to me then.

I'm not quite sure what you mean here.

  - If you are looking for a schema for ixml grammars, see the schemas/
    directory in the ixml repository [1]
    
  - If you are looking for a a schema for the XML documents an ixml
    processor will produce for inputs that match a given ixml grammar,
    see the ixml-to-rng tool in Gingersnap [2], which is what is used to
    generate the RelaxNG schema for ixml grammar -- but be warned that
    it has not been tested on any serious grammars other than the ixml
    specification grammar.
    
[1] https://github.com/invisibleXML/ixml/tree/master/schemas)
[2] https://github.com/cmsmcq/gingersnap/blob/main/src/ixml-to-rng.xsl

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

Received on Wednesday, 3 August 2022 13:31:07 UTC