iXML Community Group Test Suite

21 Jun 2022 (20 Aug 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.

Instance Syntax tests (ixml)

01 Jun 2022

Syntax tests provided by Steven Pemberton in December 2021.

Most 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 ixml form of the ixml grammar and describes all the tests as instance tests.


Created 16 Dec 2021 by SP

Invisible XML Grammar

{version 2022-05-17}
         ixml: s, rule++RS, s.

           -s: (whitespace; comment)*. {Optional spacing}
          -RS: (whitespace; comment)+. {Required spacing}
  -whitespace: -[Zs]; tab; lf; cr.
         -tab: -#9.
          -lf: -#a.
          -cr: -#d.
      comment: -"{", (cchar; comment)*, -"}".
       -cchar: ~["{}"].

         rule: (mark, s)?, name, s, -["=:"], s, -alts, -".".
        @mark: ["@^-"].
         alts: alt++(-[";|"], s).
          alt: term**(-",", s).
        -term: factor;
      -factor: terminal;
               -"(", s, alts, -")", s.
      repeat0: factor, (-"*", s; -"**", s, sep).
      repeat1: factor, (-"+", s; -"++", s, sep).
       option: factor, -"?", s.
          sep: factor.
  nonterminal: (mark, s)?, name, s.

        @name: namestart, namefollower*.
   -namestart: ["_"; L].
-namefollower: namestart; ["-.·‿⁀"; Nd; Mn].

    -terminal: literal; 
      literal: quoted;
      -quoted: (tmark, s)?, string, s.

       @tmark: ["^-+"].
      @string: -'"', dchar+, -'"';
               -"'", schar+, -"'".
       -dchar: ~['"'; #a; #d];
               '"', -'"'. {all characters except line breaks; quotes must be doubled}
       -schar: ~["'"; #a; #d];
               "'", -"'". {all characters except line breaks; quotes must be doubled}
     -encoded: (tmark, s)?, -"#", hex, s.
         @hex: ["0"-"9"; "a"-"f"; "A"-"F"]+.

     -charset: inclusion; 
    inclusion: (tmark, s)?,          set.
    exclusion: (tmark, s)?, -"~", s, set.
         -set: -"[", s,  (member, s)**(-[";|"], s), -"]", s.
       member: string;
               -"#", hex;
       -range: from, s, -"-", s, to.
        @from: character.
          @to: character.
   -character: -'"', dchar, -'"';
               -"'", schar, -"'";
               "#", hex.
       -class: code.
        @code: capital, letter?.
     -capital: ["A"-"Z"].
      -letter: ["a"-"z"].

Test case: rule

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

Input string (35 characters)

a: b, c. 
b . {missing colon}
c: .

Expected result

The input does not match the grammar.