iXML Community Group Test Suite

23 Oct 2023 (22 Nov 2023)

Top-level catalog for tests in the iXML Community Group Test Suite.

Tests have been contributed from several sources, but the core of the test collection are the tests contributed by Steven Pemberton in December 2021.

Misc tests 3

28 Jun 2022

Grammars 41-60.

Tests compiled manually in 2018 and 2019, re-packaged and extended (supplying test cases where needed) in 2022.

Note that some tests have alternate results for processors operating in non-standard modes, in particular modes in which they tolerate multiple definitions and undefined nonterminals or in which they do not tolerate non-productive nonterminals or unreachable nonterminals.

For a description of the form in which alternate results are recorded, see tests/misc-grammar/test-catalog.xml.

sample.grammar.53

Created 08 Feb 2022 by cmsmcq

Another grammar for the same one-sentence language.

Invisible XML Grammar

{ Sample grammar adapted from Dick Grune and Ceriel J. H. Jacobs,
    Parsing techniques: A practical guide (New York: Ellis Horwood, 1990;
    second edition New York:  Springer, 2008), pp. 96 (1e) and 120 (2e).

    They use this grammar to illustrate grammar cleaning (in the course
    of their discussion of CYK parsing); this is the result of applying
    their epsilon-rule elimination scheme to sample grammar 52.

    Its interest here is that it is an example of a machine-generated
    grammar and that it has non-productive and/or unreachable non-terminals.
    (Cleaning the grammar reduces it to the rule S: "a".)

    }

    { Revisions:
    2018-08-09 : CMSMcQ : made first transcription.
    }

    S: L1, "a", M1; "a", M1; L1, "a"; "a".
    L: L1, M1; L1; M1; {nil}.
    M: M1, M1; M1; {nil}.
    L1: L1, M1; L1; M1.
    M1: M1, M1; M1.


    

Test case: Grammar test

Repository URI: …/tests/misc/misc-041-060-catalog.xml

Expected result

<ixml xmlns:ap="http://blackmesatech.com/2019/iXML/Aparecium"
       xmlns:ixml="http://invisiblexml.org/NS"
       xmlns:tc="https://github.com/invisibleXML/ixml/test-catalog">
   <comment> Sample grammar adapted from Dick Grune and Ceriel J. H. Jacobs,
    Parsing techniques: A practical guide (New York: Ellis Horwood, 1990;
    second edition New York:  Springer, 2008), pp. 96 (1e) and 120 (2e).

    They use this grammar to illustrate grammar cleaning (in the course
    of their discussion of CYK parsing); this is the result of applying
    their epsilon-rule elimination scheme to sample grammar 52.

    Its interest here is that it is an example of a machine-generated
    grammar and that it has non-productive and/or unreachable non-terminals.
    (Cleaning the grammar reduces it to the rule S: "a".)

    </comment>
   <comment> Revisions:
    2018-08-09 : CMSMcQ : made first transcription.
    </comment>
   <rule name="S">
      <alt>
         <nonterminal name="L1"/>
         <literal string="a"/>
         <nonterminal name="M1"/>
      </alt>
      <alt>
         <literal string="a"/>
         <nonterminal name="M1"/>
      </alt>
      <alt>
         <nonterminal name="L1"/>
         <literal string="a"/>
      </alt>
      <alt>
         <literal string="a"/>
      </alt>
   </rule>
   <rule name="L">
      <alt>
         <nonterminal name="L1"/>
         <nonterminal name="M1"/>
      </alt>
      <alt>
         <nonterminal name="L1"/>
      </alt>
      <alt>
         <nonterminal name="M1"/>
      </alt>
      <comment>nil</comment>
      <alt/>
   </rule>
   <rule name="M">
      <alt>
         <nonterminal name="M1"/>
         <nonterminal name="M1"/>
      </alt>
      <alt>
         <nonterminal name="M1"/>
      </alt>
      <comment>nil</comment>
      <alt/>
   </rule>
   <rule name="L1">
      <alt>
         <nonterminal name="L1"/>
         <nonterminal name="M1"/>
      </alt>
      <alt>
         <nonterminal name="L1"/>
      </alt>
      <alt>
         <nonterminal name="M1"/>
      </alt>
   </rule>
   <rule name="M1">
      <alt>
         <nonterminal name="M1"/>
         <nonterminal name="M1"/>
      </alt>
      <alt>
         <nonterminal name="M1"/>
      </alt>
   </rule>
</ixml>

Application specific extension

  • Q{http://blackmesatech.com/2019/iXML/Aparecium}unproductive-symbols = error
  • Q{http://blackmesatech.com/2019/iXML/Aparecium}unreachable-symbols = error

Expected result

Expected result

The grammar is invalid. Raises a static error.