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.44

Created 08 Feb 2022 by cmsmcq

A simple toy grammar for a small set of English sentences.

Invisible XML Grammar

{ Sample grammar 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. 34 (1e) and 26 (2e).

    Rules for ws added for convenience; Grune and Jacobs assume the lexer
    eats whitespace. Peculiarity:  whitespace is allowed but not required,
    and it is allowed after any word but not at the beginning of the input. 
    }

    { Revisions:
    2018-08-10 : CMSMcQ : correct syntax error found by DCG parser
    2018-08-10 : CMSMcQ : add pointer to 2e
    2018-08-09 : CMSMcQ : made first transcription; needs checking.
    }

    Sentence: Subject, Verb, Object.
    Subject: NounPhrase.
    Object: NounPhrase.
    NounPhrase: "the", S, QualifiedNoun.
    QualifiedNoun: Noun; Adjective, QualifiedNoun.
    Noun:  noun, S.
    Adjective: adjective, S.
    Verb: verb, S.
    noun: "castle"; "caterpillar"; "cats".
    adjective: "well-read"; "white"; "wistful".
    verb: "admires"; "bark"; "criticize".

    -S: -[" "; #09; #A; #D]*.

    { Produces, inter alia:

    the well-read cats criticize the wistful caterpillar
    the cats admires the white well-read castle

    }

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 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. 34 (1e) and 26 (2e).

    Rules for ws added for convenience; Grune and Jacobs assume the lexer
    eats whitespace. Peculiarity:  whitespace is allowed but not required,
    and it is allowed after any word but not at the beginning of the input. 
    </comment>
   <comment> Revisions:
    2018-08-10 : CMSMcQ : correct syntax error found by DCG parser
    2018-08-10 : CMSMcQ : add pointer to 2e
    2018-08-09 : CMSMcQ : made first transcription; needs checking.
    </comment>
   <rule name="Sentence">
      <alt>
         <nonterminal name="Subject"/>
         <nonterminal name="Verb"/>
         <nonterminal name="Object"/>
      </alt>
   </rule>
   <rule name="Subject">
      <alt>
         <nonterminal name="NounPhrase"/>
      </alt>
   </rule>
   <rule name="Object">
      <alt>
         <nonterminal name="NounPhrase"/>
      </alt>
   </rule>
   <rule name="NounPhrase">
      <alt>
         <literal string="the"/>
         <nonterminal name="S"/>
         <nonterminal name="QualifiedNoun"/>
      </alt>
   </rule>
   <rule name="QualifiedNoun">
      <alt>
         <nonterminal name="Noun"/>
      </alt>
      <alt>
         <nonterminal name="Adjective"/>
         <nonterminal name="QualifiedNoun"/>
      </alt>
   </rule>
   <rule name="Noun">
      <alt>
         <nonterminal name="noun"/>
         <nonterminal name="S"/>
      </alt>
   </rule>
   <rule name="Adjective">
      <alt>
         <nonterminal name="adjective"/>
         <nonterminal name="S"/>
      </alt>
   </rule>
   <rule name="Verb">
      <alt>
         <nonterminal name="verb"/>
         <nonterminal name="S"/>
      </alt>
   </rule>
   <rule name="noun">
      <alt>
         <literal string="castle"/>
      </alt>
      <alt>
         <literal string="caterpillar"/>
      </alt>
      <alt>
         <literal string="cats"/>
      </alt>
   </rule>
   <rule name="adjective">
      <alt>
         <literal string="well-read"/>
      </alt>
      <alt>
         <literal string="white"/>
      </alt>
      <alt>
         <literal string="wistful"/>
      </alt>
   </rule>
   <rule name="verb">
      <alt>
         <literal string="admires"/>
      </alt>
      <alt>
         <literal string="bark"/>
      </alt>
      <alt>
         <literal string="criticize"/>
      </alt>
   </rule>
   <rule mark="-" name="S">
      <alt>
         <repeat0>
            <inclusion tmark="-">
               <member string=" "/>
               <member hex="09"/>
               <member hex="A"/>
               <member hex="D"/>
            </inclusion>
         </repeat0>
      </alt>
   </rule>
   <comment> Produces, inter alia:

    the well-read cats criticize the wistful caterpillar
    the cats admires the white well-read castle

    </comment>
</ixml>