<?xml version="1.0" encoding="windows-1251"?>
<!--
Verilog
    Aliaksei <Aliaksei@neotec.com.tw>
-->
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN" "../hrc.dtd">
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc">
   <type name="verilog" access="public">

      <import type="def"/>

      <region name="verWord" parent="Keyword"/>
      <region name="verSymb" parent="Symbol"/>
      <region name="verBad" parent="ErrorText"/>
      <region name="verString" parent="String"/>
      <region name="verComment" parent="Comment"/>
      <region name="verNumb" parent="Number"/>
      <region name="verExpr" parent="Directive"/>
      <region name="verTask" parent="String"/>


      <scheme name="verComment">
<!-- Linear Comments -->
         <regexp match="/\/\/.*$/" region0="Comment"/>
         <block start="/\/\*/" end="/\*\//" scheme="Comment" region="verComment" region00="PairStart" region10="PairEnd"/>
      </scheme>

      <scheme name="verNumbers">
         <regexp match="/\[\`\w+\-1\:0\]/" region0="verNumb" region2="KeywordStrong"/>
         <regexp match="/\[\w+\]/" region0="verNumb" region2="KeywordStrong"/>
         <regexp match="/\b\d+\'h[\da-fA-F]+\b/i" region0="verNumb" region1="verNumb"/>
         <regexp match="/\b\d+\'o[0-7]+\b/" region0="verNumb"/>
         <regexp match="/\b\d+\'b[01\?xz]+\b/" region0="verNumb"/>
         <regexp match="/\b\d+\b/" region0="verNumb"/>
      </scheme>

      <scheme name="verSymbols">
         <keywords region="verSymb">
            <symb name="{"/>
            <symb name="}"/>
            <symb name="["/>
            <symb name="]"/>
            <symb name="&lt;"/>
            <symb name="&gt;"/>
<!--symb name="("><symb name=")"-->
            <symb name=","/>
            <symb name="."/>
            <symb name=":"/>
            <symb name=";"/>
            <symb name="~"/>
            <symb name="|"/>
            <symb name="="/>
            <symb name="&amp;"/>
            <symb name="?"/>
            <symb name="^"/>
            <symb name="-"/>
            <symb name="+"/>
         </keywords>
      </scheme>

      <scheme name="verilog2">
         <inherit scheme="verComment"/>
         <inherit scheme="verNumbers"/>
         <inherit scheme="PairedBrackets">
            <virtual scheme="PairedBrackets" subst-scheme="verilog2"/>
         </inherit>
         <inherit scheme="verSymbols"/>
<!--
	<regexp match="/\b\d+\'x[\da-fA-F]+\b/" region0="verNumb"/>
	<regexp match="/\b[\d\.]+([eE][\-+]?\d+)?\b/" region0="verNumb"/>
	Strings
	<regexp match='/"((\\.)|[^\\"])*?"/' region0="verString"/>
	<regexp match="/'..??'/" region0="verString"/>
-->
      </scheme>

      <scheme name="verCase">
         <inherit scheme="verComment"/>
         <inherit scheme="verNumbers"/>
         <keywords region="verWord">
            <word name="&lt;="/>
            <word name="default"/>
         </keywords>
         <keywords region="verWord">
            <symb name="("/>
            <symb name=")"/>
            <symb name="{"/>
            <symb name="}"/>
            <symb name=","/>
            <symb name=":"/>
            <symb name=";"/>
         </keywords>
      </scheme>

      <scheme name="verBegin">
         <block start="/\b (begin) \b/x" end="/\b (end) \b/x" scheme="verBeginCore" region00="Keyword" region10="Keyword" region01="PairStart" region11="PairEnd"/>
      </scheme>

      <scheme name="verBeginCore">
         <inherit scheme="verComment"/>
         <inherit scheme="verBegin"/>
         <inherit scheme="verNumbers"/>
         <block start="/\b (case) \b/x" end="/\b (endcase) \b/x" scheme="verCase" region00="Keyword" region10="Keyword" region01="PairStart" region11="PairEnd"/>
         <keywords region="verWord">
            <word name="if"/>
            <word name="else"/>
         </keywords>
         <inherit scheme="verSymbols"/>
      </scheme>

      <scheme name="verModule">
         <inherit scheme="verComment"/>
         <inherit scheme="verNumbers"/>
         <inherit scheme="verBegin"/>
<!--block start="/ \b always \s* \@ \s* \((.*)\) \s+ if \s* \((.*)\) /" end="/\;/"-->
         <regexp match="/\b (always) \s* \@ \s* (\()(.*)(\)) /x" region1="verWord" region3="verString" region2="PairStart" region4="PairEnd"/>
         <inherit scheme="PairedBrackets">
            <virtual scheme="PairedBrackets" subst-scheme="verModule"/>
         </inherit>
         <block start="/\b (task) \s+ (\w+)/x" end="/\b (endtask) \b/x" scheme="verBeginCore" region00="verWord" region01="PairStart" region02="Function" region10="verWord" region11="PairEnd"/>
         <block start="/\b(parameter|wire|reg|assign)/" end="/\;/" scheme="verilog2" region00="Keyword" region10="Keyword"/>
         <block start="/\b(input|output|inout)/" end="/\;/" scheme="verilog2" region00="Keyword" region10="Keyword"/>
         <inherit scheme="verSymbols"/>
<!--block start="/\bdefparam/" end="/\;/" scheme="verilog2"
		region00="Keyword" region10="Keyword"/-->
      </scheme>

      <scheme name="verBad">
         <regexp match="/\S+/" region0="Error" priority="low"/>
      </scheme>

      <scheme name="verilog">
         <inherit scheme="verComment"/>
         <block start="/\b (module)\s+ (\w+) /x" end="/\b (endmodule) \b/x" scheme="verModule" region00="verWord" region01="PairStart" region02="Function" region10="verWord" region11="PairEnd"/>
         <inherit scheme="verBad"/>
      </scheme>

   </type>
</hrc>
