iXML Community Group Test Suite

21 Jun 2022 (28 Jun 2022)

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

21 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.56bis

Created 08 Feb 2022 by cmsmcq

Updated 16 Jun 2022 by cmsmcq

merged multiple definitions

Modified version of grammar 56.

Definitions of A, B, and F have been merged, reference to undefined nonterminal D has been replaced by an unsatisfiable reference to an empty character set, but unproductive nonterminal E and unreachable nonterminal F remain.

Unlike grammar 56, this grammar is conformant.

Alternate expected results are given for processors running either with an option to treat unreachable symbols as errors or an option to treat unproductive nonterminals as errors.

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. 109 (1e) and 142 (2e).

    This is an augmented form of the regular grammar in 55, intended to
    illustrate the existence of undefined, unproductive, and unreachable
    non-terminals in regular grammars.
    }

    { Revisions:
    2022-06-16 : CMSMcQ : made revised version.
    2018-08-09 : CMSMcQ : made first transcription.
    }

    S: "a", A; "a", B.
    A: "b", B; "b", C.
    B: "c", A; "c", C; "c", []; "c", E.
    
    C: "a".

    E: "e", E. { unproductive }
    F: "f", A; "h".  { unreachable }

    

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. 109 (1e) and 142 (2e).

    This is an augmented form of the regular grammar in 55, intended to
    illustrate the existence of undefined, unproductive, and unreachable
    non-terminals in regular grammars.
    </comment>
   <comment> Revisions:
    2022-06-16 : CMSMcQ : made revised version.
    2018-08-09 : CMSMcQ : made first transcription.
    </comment>
   <rule name="S">
      <alt>
         <literal string="a"/>
         <nonterminal name="A"/>
      </alt>
      <alt>
         <literal string="a"/>
         <nonterminal name="B"/>
      </alt>
   </rule>
   <rule name="A">
      <alt>
         <literal string="b"/>
         <nonterminal name="B"/>
      </alt>
      <alt>
         <literal string="b"/>
         <nonterminal name="C"/>
      </alt>
   </rule>
   <rule name="B">
      <alt>
         <literal string="c"/>
         <nonterminal name="A"/>
      </alt>
      <alt>
         <literal string="c"/>
         <nonterminal name="C"/>
      </alt>
      <alt>
         <literal string="c"/>
         <inclusion/>
      </alt>
      <alt>
         <literal string="c"/>
         <nonterminal name="E"/>
      </alt>
   </rule>
   <rule name="C">
      <alt>
         <literal string="a"/>
      </alt>
   </rule>
   <rule name="E">
      <alt>
         <literal string="e"/>
         <nonterminal name="E"/>
      </alt>
   </rule>
   <comment> unproductive </comment>
   <rule name="F">
      <alt>
         <literal string="f"/>
         <nonterminal name="A"/>
      </alt>
      <alt>
         <literal string="h"/>
      </alt>
   </rule>
   <comment> unreachable </comment>
</ixml>

Application specific extension

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

Expected result

Expected result

The grammar is invalid. Raises a static error.