<!doctype grammar system "grammar.dtd">

<grammar>

  <title>SGML Declaration Grammar</title>

  <prod n="171+">
    <name>SGML declaration</name>
    <group>
      <delim>MDO</delim>
      <token>SGML</token>
	<group many><nt n='65' name='ps'></group>
      <nt n="76" name="minimum literal">
      <!-- The minimum literal must be "ISO 8879:1986". -->
	&psp; <nt n="172" name="document character set">
	&psp; <nt n="180" name="capacity set">
	&psp; <nt n="181" name="concrete syntax scope">
	&psp; <nt n="182" name="concrete syntax">
	&psp; <nt n="195" name="feature use">
	&psp; <nt n="199" name="application-specific information">
	&pss;
      <delim>MDC</delim>
    </group>
  </prod>

  <prod n="181">
    <name>concrete syntax scope</name>
    <group>
      <token>SCOPE</token>
	&psp;
      <group order="alt">
	<token>DOCUMENT</token> 
	<token>INSTANCE</token>
      </group>
    </group>
  </prod>

  <prod n="172">
    <name>document character set</name>
    <group>
      <token>CHARSET</token>
	&psp;
      <nt n="173+" name="character set description">
    </group>
  </prod>

  <prod n="173+">
    <name>character set description</name>
    <group>
      <nt n="174" name="base character set">
	&psp;  
      <nt n="175" name="described character set portion">
      <group status="opt" occur="many">
	  &psp; <nt n="174" name="base character set">
	  &psp; <nt n="175" name="described character set portion">
      </group>
    </group>
  </prod>

  <prod n="174">
    <name>base character set</name> 
    <group><token>BASESET</token>
	&psp; 
      <nt n="74" name="public identifier">
  <!-- (If FORMAL YES, then public identifier must be a formal public
  identifier with a public class of CHARSET.)
  -->
    </group>
  </prod>

  <prod n="175">
    <name>described character set portion</name> 
    <group>
      <token>DESCSET</token>
      <group occur="many">
	  &psp; 
	<nt n="176" name="character description">
      </group>
    </group>
  </prod>


  <prod n="176">
    <name>character description</name>
    <group>
      <nt n="177" name="described set character number">
	&psp; 
      <nt n="179" name="number of characters">
	&psp;
      <group order="alt">
	<nt n="178" name="base set character number">
	<nt n="76" name="minimum literal">
	<token>UNUSED</token>
      </group>
    </group>
  </prod>

  <prod n="177">
    <name>described set character number</name>
    <group><nt n="64" name="character number"></group>
  </prod>


  <prod n="178">
    <name>base set character number</name> 
    <group><nt n="64" name="character number"></group>
  </prod>


  <prod n="179">
    <name>number of characters</name> 
    <group><nt n="56" name="number"></group>
  </prod>

  <prod n="180">
    <name>capacity set</name> 
    <group><token>CAPACITY</token>
	&psp;
      <group order="alt"> 
	<group>
	  <token>PUBLIC</token> &psp; 
	  <nt n="74" name="public identifier">
      <!-- 
      If FORMAL YES, then public identifier must be a formal public identifier
      with a public class of CAPACITY.
      -->
	</group>
	<group>
	  <token>SGMLREF</token>
	  <group occur="many">
	      &psp; 
	    <nt n="55" name="name">
	      &psp; 
	    <nt n="56" name="number">
	  </group>
	</group>
      </group>
    </group>
  </prod>

  <prod n="182">
    <name>concrete syntax</name>
    <group><token>SYNTAX</token> &psp;
      <group order="alt">
	<nt n="183" name="public concrete syntax">
	<group>
	  <nt n="184" name="shunned character number identification">
	    &psp; <nt n="185" name="syntax-reference character set">
	    &psp; <nt n="186" name="function character identification">
	    &psp; <nt n="189" name="naming rules">
	    &psp; <nt n="190" name="delimiter set">
	    &psp; <nt n="193" name="reserved name use">
	    &psp; 
	  <nt n="194" name="quantity set">
	</group>
      </group></group></prod>

  <prod n="183">
    <name>public concrete syntax</name>
    <group><token>PUBLIC</token>
	&psp;  <nt n="74" name="public identifier">
      <!--
      If FORMAL YES, then public identifier must be a formal public identifier
      with a public class of SYNTAX.
      -->
      <group status="opt">
	  &psp; <token>SWITCHES</token>
	<group occur="many">
	    &psp; <nt n="64" name="character number">
	    &psp;  <nt n="64" name="character number">
	</group>
      </group>
    </group>
  </prod>

  <prod n="184">
    <name>shunned character number identification</name>
    <group>
      <token>SHUNCHAR</token> &psp;
      <group order="alt">
	<token>NONE</token>
	<group>
	  <group order="alt">
	    <token>CONTROLS</token> 
	    <nt n="64" name="character number">
	  </group>
	  <group status="opt" occur="many">
	      &psp; 
	    <nt n="64" name="character number">
	  </group>
	</group>
      </group>
    </group>
  </prod>

  <prod n="185">
    <name>syntax-reference character set</name> 
    <group><nt n="173+" name="character set description"></group>
  </prod>

  <prod n="186">
    <name>function character identification</name>
    <group><token>FUNCTION</token>
	&psp;  <token>RE</token>    &psp; 
      <nt n="64" name="character number">
	&psp;  <token>RS</token>    &psp; 
      <nt n="64" name="character number">
	&psp;  <token>SPACE</token> &psp; 
      <nt n="64" name="character number">
      <group status="opt" occur="many">
	  &psp; 
	<nt n="187" name="added function">
	  &psp;  
	<nt n="188" name="function class">
	  &psp;  
	<nt n="64" name="character number">
      </group>
    </group>
  </prod>


  <prod n="187">
    <name>added function</name> 
    <group><nt n="55" name="name"></group>
  </prod>

  <prod n="188">
    <name>function class</name> 
    <group order="alt">
      <token>FUNCHAR</token>
      <token>MSICHAR</token>
      <token>MSOCHAR</token>
      <token>MSSCHAR</token>
      <token>SEPCHAR</token>
    </group>
  </prod>

  <prod n="189">
    <name>naming rules</name>
    <group><token>NAMING</token>
	&psp; <token>LCNMSTRT</token> &psp; 
      <nt n="66" name="parameter literal">
	&psp; <token>UCNMSTRT</token> &psp; 
      <nt n="66" name="parameter literal">
	&psp; <token>LCNMCHAR</token> &psp; 
      <nt n="66" name="parameter literal">
	&psp; <token>UCNMCHAR</token> &psp; 
      <nt n="66" name="parameter literal">
	&psp; <token>NAMECASE</token>
	&psp; <token>GENERAL</token> &psp; 
      <group order="alt">
	<token>NO</token>  <token>YES</token>
      </group>
	&psp; <token>ENTITY</token>  &psp; 
      <group order="alt">
	<token>NO</token>  <token>YES</token>
      </group>
    </group>
  </prod>

  <prod n="190">
    <name>delimiter set</name>
    <group>
      <token>DELIM</token> &psp; 
      <nt n="191" name="general delimiters">
	&psp; <nt n="192" name="short reference delimiters">
    </group>
  </prod>

  <prod n="191">
    <name>general delimiters</name> 
    <group><token>GENERAL</token> &psp; <token>SGMLREF</token>
      <group status="opt" occur="many">
	  &psp; <nt n="55" name="name"> &psp; 
	<nt n="66" name="parameter literal">
      </group>
    </group>
  </prod>

  <prod n="192">
    <name>short reference delimiters</name>
    <group>
      <token>SHORTREF</token> &psp; 
      <group order="alt">
	<token>SGMLREF</token>  <token>NONE</token>
      </group>
      <group status="opt" occur="many">
	  &psp; <nt n="66" name="parameter literal">
      </group>
    </group>
  </prod>

  <prod n="193">
    <name>reserved name use</name>
    <group><token>NAMES</token>
	&psp; <token>SGMLREF</token>
      <group status="opt" occur="many">
	  &psp; <nt n="55" name="name"> 
	  &psp; <nt n="66" name="parameter literal">
      </group>
    </group>
  </prod>

  <prod n="194">
    <name>quantity set</name>
    <group><token>QUANTITY</token>
	&psp; <token>SGMLREF</token>
      <group status="opt" occur="many">
	  &psp; 
	<nt n="55" name="name"> 
	  &psp; 
	<nt n="56" name="number">
      </group>
    </group>
  </prod>

  <prod n="195">
    <name>feature use</name> 
    <group>
      <token>FEATURES</token> &psp; 
      <nt n="196" name="markup minimization features">
	&psp; 
      <nt n="197+" name="link type features">
	&psp;
      <nt n="198" name="other features">
    </group>
  </prod>

  <prod n="196">
    <name>markup minimization features</name>
    <group>
      <token>MINIMIZE</token> &psp;
      <token>DATATAG</token> &psp;
      <group order="alt" var="datatag">
	<token>NO</token> <token>YES</token>
      </group> &psp;
      <token>OMITTAG</token> &psp;
      <group order="alt" var="omittag">
	<token>NO</token> <token>YES</token> </group> &psp;
      <token>RANK</token> &psp;
      <group order="alt" var=rank> 
	<token>NO</token> <token>YES</token> </group> &psp;
      <token>SHORTTAG</token> &psp;
      <group order="alt" var=shorttag>
	<token>NO</token> <token>YES</token> </group>
    </group>
  </prod>

  <prod n="197+">
    <name>link type features</name> 
    <group><token>LINK</token>
	&psp; <token>SIMPLE</token>
	&psp; 
      <group order="alt">
	<token>NO</token>  
	<group>
	  <token>YES</token> &psp; <nt n="56" name="number">
	</group>
      </group>
	&psp; <token>IMPLICIT</token>
	&psp; 
      <group order="alt">
	<token>NO</token> <token>YES</token>
      </group>
	&psp;
      <token>EXPLICIT</token> &psp; 
      <group order="alt">
	<token>NO</token>  
	<group>
	  <token>YES</token> &psp; <nt n="56" name="number">
	</group>
      </group>
    </group>
  </prod>

  <prod n="198">
    <name>other features</name>
    <group>
      <token>OTHER</token>
	&psp; <token>CONCUR</token> &psp; 
      <group order="alt">
	<token>NO</token>  
	<group>
	  <token>YES</token> &psp; <nt n="56" name="number">
	</group>
      </group>
	&psp; <token>SUBDOC</token> &psp; 
      <group order="alt">
	<token>NO</token>  
	<group>
	  <token>YES</token> &psp; <nt n="56" name="number">
	</group>
      </group>
	&psp; <token>FORMAL</token>
	&psp; 
      <group order="alt">
	<token>NO</token> <token>YES</token>
      </group>
    </group>
  </prod>

  <prod n="199">
    <name>application-specific information</name>
    <group>
      <token>APPINFO</token>
	&psp; 
      <group order="alt">
	<token>NONE</token>  
	<nt n="76" name="minimum literal">
      </group>
    </group>
  </prod>
</grammar>

