<?xml version="1.0"?>


<!-- Regular Expressions are widely used for pattern matching
issues. A regular expression on a finite alphabet S. Several
definitions (semantically but not syntactically equivalent)
exist. Here we consider that a regular expression is defined by
elements of S, Union, product and stars (other approaches are
described in Regi.xml files). We use the following grammar (the U and
the product are encoded as sequences since they are
associative). Initial symbol is E.
S generates the alphabet
Eunion generates expressions begining by a union
Estar generates expressions begining by a star
Eprod generates expression begining by a product


S -> a | b | c | d
E -> Estar| Eprod | Eunion
Enonstar -> Eprod | Eunion | S
Enonprod -> Estar | Eunion | S
Enonunion -> Eprod | Estar | S
Estar -> Enonstar*
Eprod -> Seq(Enonprod)
Enonunion -> Seq(Enonunion)

-->




<!DOCTYPE specification SYSTEM "seed.dtd">


<specification>
  <start idref="All"/> 

  <union id="All"> <!-- defintion of a regular expression-->
    <child idref="S"/> <!-- either a letter-->
    <child idref="Prod"/> <!-- or the product of two expressions-->
    <child idref="Union"/><!-- or the union of two expressions-->
    <child idref="Star"/><!-- or the star of an expression-->
  </union> 

  <constants id="S"> <!-- defintion of the alphabet-->
    <symbol value="a"/>
    <symbol value="b"/>
    <symbol value="c"/>
    <symbol value="d"/>
  </constants>

  <union id="nonProd"> <!-- definition of non-product expressions -->
    <child idref="Star"/><!-- either a star-->
    <child idref="Union"/><!-- or a union-->
    <child idref="S"/> <!-- or a letter-->
  </union>

  <union id="nonStar"> <!-- definition of non-star expressions -->
    <child idref="Prod"/> <!-- either a product -->
    <child idref="Union"/><!-- or a union-->
    <child idref="S"/> <!-- or a letter-->
  </union>

  <union id="nonUnion"> <!-- definition of non-union expressions -->
    <child idref="Prod"/><!-- either a product -->
    <child idref="Star"/><!-- or a star-->
    <child idref="S"/> <!-- or a letter-->
  </union>


  <sequence id="Prod"> <!-- definition of product -->
    <symbol value="."/>
    <child idref="nonProd"/>
  </sequence>

  <sequence id="Union"> <!-- definition of union-->
    <symbol value="+"/>
    <child idref="nonUnion"/>
  </sequence>


  <unary id="Star"> <!-- stars of expressions -->
    <symbol value="*"/>
    <child idref="nonStar"/>
  </unary>

</specification>

