<?xml version="1.0" encoding="windows-1251"?>

<custom xmlns="uri:colorer:custom">

  <!-- Colorer HRC schema extension. Parse RE content -->

  <custom-type targetNamespace="http://colorer.sf.net/2003/hrc">

    <prefix>hrc</prefix>
    <empty-prefix/>
    <contributors>Cail Lomecb, Eugene Efremov</contributors>

    <outline>
      <element name='type' extract='withAttribute' description='Type definition'/>
      <element name='prototype' extract='withAttribute' description='Prototype definition'/>
      <element name='import' extract='withAttribute' description='Type Import'/>
      <element name='region' extract='withAttribute' description='Region definition'/>
      <element name='entity' extract='withAttribute' description='Entity definition'/>
      <element name='scheme' extract='withAttribute' description='Scheme declaration'/>
      <element name='keywords' extract='withAttribute' description='Keywords list'/>
    </outline>

    <type xmlns="http://colorer.sf.net/2003/hrc">

      <region name="Entity"    parent="xml:EntityRef"/>
      <region name="op"        parent="Operator"/>
      <region name="EscapeSeq" parent="StringContent"/>
      <region name="NamedRegion"  parent="StringContent"/>
      <region name="BracketStart" parent="StringEdge"/>
      <region name="BracketEnd"   parent="StringEdge"/>
      <region name="Scheme.nsprefix" parent="xml:Attribute.nsprefix"/>
      <region name="Scheme.nscolon" parent="xml:Attribute.nscolon"/>
      <region name="Scheme.name" parent="def:String"/>

      <scheme name="CharClass">
        <regexp match="/\\x[\da-fA-F]{2}/" region0="EscapeSeq"/>
        <regexp match="/\\[^&amp;&lt;]/" region0="EscapeSeq"/>
        <regexp match="/-/" region0="op"/>
        <regexp match="/\)|\(/" region0="Error"/>
        <regexp match="/\%%xml:Name;\;/" region0="Entity"/>
        <block start="/(\[)/" end="/(\])/" scheme="CharClass"
               region00="BracketStart" region01="PairStart"
               region10="BracketEnd" region11="PairEnd"/>
        <inherit scheme="xml:Reference"/>
        <!--!!!CHECK for quotes type! <inherit scheme="xml:AttValue.content"/>-->
        <!--!!!CHECK for possible quot/apos mistakes!!! -->
      </scheme>

      <scheme name="RE-String">
        <block start="/( \(\?\{ (?{NamedRegion}(%xml:Name;)?) \} )/x"
               end="/( \) )/x" scheme="RE-String"
               region00="BracketStart" region01="PairStart"
               region10="BracketEnd" region11="PairEnd"/>
        <block start="/(\()/" end="/(\))/" scheme="RE-String"
               region00="BracketStart" region01="PairStart"
               region10="BracketEnd" region11="PairEnd"/>
        <block start="/(\[)/" end="/(\])/" scheme="CharClass"
               region00="BracketStart" region01="PairStart"
               region10="BracketEnd" region11="PairEnd"/>
        <regexp match="/\)/" region="Error" priority="low"/>
        <regexp match="/\?\#\d/" region="op"/>
        <regexp match="/[\~\*\.\?\!\=\^\$\|\[\]\{\}]/" region="op"/>
        <regexp match="/\\[ypYP]([\da-fA-F]|\{\w*?\})/i" region="op"/>
        <regexp match="/\\x[\da-fA-F]{2}/" region="EscapeSeq"/>
        <regexp match="/\\[^&amp;&lt;]/" region="EscapeSeq"/>
        <regexp match="/\%%xml:Name;\;/" region="Entity"/>
        <inherit scheme="xml:Reference"/>
      </scheme>

      <scheme name="REstring-content">
        <!-- These calls doesn't take into account their call
        context (element or attribute content).
        These situations must have a different logic
        -->
        <block start="/(\/)/" end="/(\/([igsx]*))/" scheme="RE-String"
               region00="BracketStart" region01="PairStart"
               region10="BracketEnd" region11="PairEnd" region12="op"/>
      </scheme>
      <scheme name="QName-content">
        <regexp match="/~(%xml:NCName;(\:))?%xml:NCName; \b/ix" region2="Attribute.nsprefix"/>
      </scheme>
    </type>
  </custom-type>

</custom>
