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.

Instance Syntax tests (xml)

01 Jun 2022

Syntax tests provided by Steven Pemberton in December 2021.

Most but not all tests are negative (the file.ixml files do not conform to the grammar for ixml).

Since these are all parsed against the grammar for ixml grammars, the expected result could be given as 'assert-not-a-grammar' as well as 'assert-not-a-sentence'. The inputs are not sentences in the language defined by the grammar for grammars, which means they are not ixml grammars.

Three catalogs are provided, using different formulations. This one uses the XML form of the ixml grammar and describes all the tests as instance tests.

syntax-xml-instance

Created 16 Dec 2021 by SP

Invisible XML Grammar

<ixml>
   <comment>version 2022-05-17</comment>
   <rule name="ixml">
      <alt>
         <nonterminal name="s"/>
         <repeat1>
            <nonterminal name="rule"/>
            <sep>
               <nonterminal name="RS"/>
            </sep>
         </repeat1>
         <nonterminal name="s"/>
      </alt>
   </rule>
   <rule mark="-" name="s">
      <alt>
         <repeat0>
            <alts>
               <alt>
                  <nonterminal name="whitespace"/>
               </alt>
               <alt>
                  <nonterminal name="comment"/>
               </alt>
            </alts>
         </repeat0>
      </alt>
   </rule>
   <comment>Optional spacing</comment>
   <rule mark="-" name="RS">
      <alt>
         <repeat1>
            <alts>
               <alt>
                  <nonterminal name="whitespace"/>
               </alt>
               <alt>
                  <nonterminal name="comment"/>
               </alt>
            </alts>
         </repeat1>
      </alt>
   </rule>
   <comment>Required spacing</comment>
   <rule mark="-" name="whitespace">
      <alt>
         <inclusion tmark="-">
            <member code="Zs"/>
         </inclusion>
      </alt>
      <alt>
         <nonterminal name="tab"/>
      </alt>
      <alt>
         <nonterminal name="lf"/>
      </alt>
      <alt>
         <nonterminal name="cr"/>
      </alt>
   </rule>
   <rule mark="-" name="tab">
      <alt>
         <literal tmark="-" hex="9"/>
      </alt>
   </rule>
   <rule mark="-" name="lf">
      <alt>
         <literal tmark="-" hex="a"/>
      </alt>
   </rule>
   <rule mark="-" name="cr">
      <alt>
         <literal tmark="-" hex="d"/>
      </alt>
   </rule>
   <rule name="comment">
      <alt>
         <literal tmark="-" string="{"/>
         <repeat0>
            <alts>
               <alt>
                  <nonterminal name="cchar"/>
               </alt>
               <alt>
                  <nonterminal name="comment"/>
               </alt>
            </alts>
         </repeat0>
         <literal tmark="-" string="}"/>
      </alt>
   </rule>
   <rule mark="-" name="cchar">
      <alt>
         <exclusion>
            <member string="{}"/>
         </exclusion>
      </alt>
   </rule>
   <rule name="rule">
      <alt>
         <option>
            <alts>
               <alt>
                  <nonterminal name="mark"/>
                  <nonterminal name="s"/>
               </alt>
            </alts>
         </option>
         <nonterminal name="name"/>
         <nonterminal name="s"/>
         <inclusion tmark="-">
            <member string="=:"/>
         </inclusion>
         <nonterminal name="s"/>
         <nonterminal mark="-" name="alts"/>
         <literal tmark="-" string="."/>
      </alt>
   </rule>
   <rule mark="@" name="mark">
      <alt>
         <inclusion>
            <member string="@^-"/>
         </inclusion>
      </alt>
   </rule>
   <rule name="alts">
      <alt>
         <repeat1>
            <nonterminal name="alt"/>
            <sep>
               <alts>
                  <alt>
                     <inclusion tmark="-">
                        <member string=";|"/>
                     </inclusion>
                     <nonterminal name="s"/>
                  </alt>
               </alts>
            </sep>
         </repeat1>
      </alt>
   </rule>
   <rule name="alt">
      <alt>
         <repeat0>
            <nonterminal name="term"/>
            <sep>
               <alts>
                  <alt>
                     <literal tmark="-" string=","/>
                     <nonterminal name="s"/>
                  </alt>
               </alts>
            </sep>
         </repeat0>
      </alt>
   </rule>
   <rule mark="-" name="term">
      <alt>
         <nonterminal name="factor"/>
      </alt>
      <alt>
         <nonterminal name="option"/>
      </alt>
      <alt>
         <nonterminal name="repeat0"/>
      </alt>
      <alt>
         <nonterminal name="repeat1"/>
      </alt>
   </rule>
   <rule mark="-" name="factor">
      <alt>
         <nonterminal name="terminal"/>
      </alt>
      <alt>
         <nonterminal name="nonterminal"/>
      </alt>
      <alt>
         <literal tmark="-" string="("/>
         <nonterminal name="s"/>
         <nonterminal name="alts"/>
         <literal tmark="-" string=")"/>
         <nonterminal name="s"/>
      </alt>
   </rule>
   <rule name="repeat0">
      <alt>
         <nonterminal name="factor"/>
         <alts>
            <alt>
               <literal tmark="-" string="*"/>
               <nonterminal name="s"/>
            </alt>
            <alt>
               <literal tmark="-" string="**"/>
               <nonterminal name="s"/>
               <nonterminal name="sep"/>
            </alt>
         </alts>
      </alt>
   </rule>
   <rule name="repeat1">
      <alt>
         <nonterminal name="factor"/>
         <alts>
            <alt>
               <literal tmark="-" string="+"/>
               <nonterminal name="s"/>
            </alt>
            <alt>
               <literal tmark="-" string="++"/>
               <nonterminal name="s"/>
               <nonterminal name="sep"/>
            </alt>
         </alts>
      </alt>
   </rule>
   <rule name="option">
      <alt>
         <nonterminal name="factor"/>
         <literal tmark="-" string="?"/>
         <nonterminal name="s"/>
      </alt>
   </rule>
   <rule name="sep">
      <alt>
         <nonterminal name="factor"/>
      </alt>
   </rule>
   <rule name="nonterminal">
      <alt>
         <option>
            <alts>
               <alt>
                  <nonterminal name="mark"/>
                  <nonterminal name="s"/>
               </alt>
            </alts>
         </option>
         <nonterminal name="name"/>
         <nonterminal name="s"/>
      </alt>
   </rule>
   <rule mark="@" name="name">
      <alt>
         <nonterminal name="namestart"/>
         <repeat0>
            <nonterminal name="namefollower"/>
         </repeat0>
      </alt>
   </rule>
   <rule mark="-" name="namestart">
      <alt>
         <inclusion>
            <member string="_"/>
            <member code="L"/>
         </inclusion>
      </alt>
   </rule>
   <rule mark="-" name="namefollower">
      <alt>
         <nonterminal name="namestart"/>
      </alt>
      <alt>
         <inclusion>
            <member string="-.·‿⁀"/>
            <member code="Nd"/>
            <member code="Mn"/>
         </inclusion>
      </alt>
   </rule>
   <rule mark="-" name="terminal">
      <alt>
         <nonterminal name="literal"/>
      </alt>
      <alt>
         <nonterminal name="charset"/>
      </alt>
   </rule>
   <rule name="literal">
      <alt>
         <nonterminal name="quoted"/>
      </alt>
      <alt>
         <nonterminal name="encoded"/>
      </alt>
   </rule>
   <rule mark="-" name="quoted">
      <alt>
         <option>
            <alts>
               <alt>
                  <nonterminal name="tmark"/>
                  <nonterminal name="s"/>
               </alt>
            </alts>
         </option>
         <nonterminal name="string"/>
         <nonterminal name="s"/>
      </alt>
   </rule>
   <rule mark="@" name="tmark">
      <alt>
         <inclusion>
            <member string="^-+"/>
         </inclusion>
      </alt>
   </rule>
   <rule mark="@" name="string">
      <alt>
         <literal tmark="-" string="&#34;"/>
         <repeat1>
            <nonterminal name="dchar"/>
         </repeat1>
         <literal tmark="-" string="&#34;"/>
      </alt>
      <alt>
         <literal tmark="-" string="'"/>
         <repeat1>
            <nonterminal name="schar"/>
         </repeat1>
         <literal tmark="-" string="'"/>
      </alt>
   </rule>
   <rule mark="-" name="dchar">
      <alt>
         <exclusion>
            <member string="&#34;"/>
            <member hex="a"/>
            <member hex="d"/>
         </exclusion>
      </alt>
      <alt>
         <literal string="&#34;"/>
         <literal tmark="-" string="&#34;"/>
      </alt>
   </rule>
   <comment>all characters except line breaks; quotes must be doubled</comment>
   <rule mark="-" name="schar">
      <alt>
         <exclusion>
            <member string="'"/>
            <member hex="a"/>
            <member hex="d"/>
         </exclusion>
      </alt>
      <alt>
         <literal string="'"/>
         <literal tmark="-" string="'"/>
      </alt>
   </rule>
   <comment>all characters except line breaks; quotes must be doubled</comment>
   <rule mark="-" name="encoded">
      <alt>
         <option>
            <alts>
               <alt>
                  <nonterminal name="tmark"/>
                  <nonterminal name="s"/>
               </alt>
            </alts>
         </option>
         <literal tmark="-" string="#"/>
         <nonterminal name="hex"/>
         <nonterminal name="s"/>
      </alt>
   </rule>
   <rule mark="@" name="hex">
      <alt>
         <repeat1>
            <inclusion>
               <member from="0" to="9"/>
               <member from="a" to="f"/>
               <member from="A" to="F"/>
            </inclusion>
         </repeat1>
      </alt>
   </rule>
   <rule mark="-" name="charset">
      <alt>
         <nonterminal name="inclusion"/>
      </alt>
      <alt>
         <nonterminal name="exclusion"/>
      </alt>
   </rule>
   <rule name="inclusion">
      <alt>
         <option>
            <alts>
               <alt>
                  <nonterminal name="tmark"/>
                  <nonterminal name="s"/>
               </alt>
            </alts>
         </option>
         <nonterminal name="set"/>
      </alt>
   </rule>
   <rule name="exclusion">
      <alt>
         <option>
            <alts>
               <alt>
                  <nonterminal name="tmark"/>
                  <nonterminal name="s"/>
               </alt>
            </alts>
         </option>
         <literal tmark="-" string="~"/>
         <nonterminal name="s"/>
         <nonterminal name="set"/>
      </alt>
   </rule>
   <rule mark="-" name="set">
      <alt>
         <literal tmark="-" string="["/>
         <nonterminal name="s"/>
         <repeat0>
            <alts>
               <alt>
                  <nonterminal name="member"/>
                  <nonterminal name="s"/>
               </alt>
            </alts>
            <sep>
               <alts>
                  <alt>
                     <inclusion tmark="-">
                        <member string=";|"/>
                     </inclusion>
                     <nonterminal name="s"/>
                  </alt>
               </alts>
            </sep>
         </repeat0>
         <literal tmark="-" string="]"/>
         <nonterminal name="s"/>
      </alt>
   </rule>
   <rule name="member">
      <alt>
         <nonterminal name="string"/>
      </alt>
      <alt>
         <literal tmark="-" string="#"/>
         <nonterminal name="hex"/>
      </alt>
      <alt>
         <nonterminal name="range"/>
      </alt>
      <alt>
         <nonterminal name="class"/>
      </alt>
   </rule>
   <rule mark="-" name="range">
      <alt>
         <nonterminal name="from"/>
         <nonterminal name="s"/>
         <literal tmark="-" string="-"/>
         <nonterminal name="s"/>
         <nonterminal name="to"/>
      </alt>
   </rule>
   <rule mark="@" name="from">
      <alt>
         <nonterminal name="character"/>
      </alt>
   </rule>
   <rule mark="@" name="to">
      <alt>
         <nonterminal name="character"/>
      </alt>
   </rule>
   <rule mark="-" name="character">
      <alt>
         <literal tmark="-" string="&#34;"/>
         <nonterminal name="dchar"/>
         <literal tmark="-" string="&#34;"/>
      </alt>
      <alt>
         <literal tmark="-" string="'"/>
         <nonterminal name="schar"/>
         <literal tmark="-" string="'"/>
      </alt>
      <alt>
         <literal string="#"/>
         <nonterminal name="hex"/>
      </alt>
   </rule>
   <rule mark="-" name="class">
      <alt>
         <nonterminal name="code"/>
      </alt>
   </rule>
   <rule mark="@" name="code">
      <alt>
         <nonterminal name="capital"/>
         <option>
            <nonterminal name="letter"/>
         </option>
      </alt>
   </rule>
   <rule mark="-" name="capital">
      <alt>
         <inclusion>
            <member from="A" to="Z"/>
         </inclusion>
      </alt>
   </rule>
   <rule mark="-" name="letter">
      <alt>
         <inclusion>
            <member from="a" to="z"/>
         </inclusion>
      </alt>
   </rule>
</ixml>

Test case: rule6

Repository URI: …/tests/syntax/catalog-as-instance-tests-xml.xml

Input string (44 characters)

a: b, c. 
b:: b, c. {double colon} 
c: ".".

Expected result

The input does not match the grammar.