<?xml version="1.0" encoding="Windows-1251"?>
<!--
    Atlantis 1.5 Syntax by Vladimir Fonarev <vol@quorum.ru>
                                            [2:5020/2160]
-->

<hrc version="take5">
  
  <type name="atl" access="public">

    <region name="AtlWord"      parent="def:Keyword"/>
    <region name="AtlDlgWord"   parent="def:Keyword"/>
    <region name="AtlCmdWord"   parent="def:KeywordStrong"/>
    <region name="AtlStdWord"   parent="def:KeywordStrong"/>
    <region name="AtlTypeWord"  parent="def:TypeKeyword"/>
    <region name="AtlBool"      parent="def:BooleanConstant"/>

    <region name="InterfaceOutline" parent="def:Outlined"/>
    <region name="DialogOutline" parent="def:Outlined"/>
    <region name="WindowOutline"    parent="def:Outlined"/>
    <region name="BrowseOutline"    parent="def:Outlined"/>
    <region name="FunctionOutline"  parent="def:Outlined"/>
    <region name="StringsOutline"   parent="def:Outlined"/>

    <region name="QrmPreproc" parent="def:Directive"/>
    <region name="QrmPreprocWord" parent="def:Keyword"/>

    <scheme name="qrmPairedBlock">
      <block start="/(\{|\bbegin\b)/i" end="/(\}|\bend\b)/i" scheme="qrmPairedBlock" region00="def:PairStart" region01="def:Symbol" region10="def:PairEnd" region11="def:Symbol"/>
    </scheme>

    <scheme name="qrmPairedBrackets">
      <inherit scheme="qrmPairedBlock">
        <virtual scheme="qrmPairedBlock" subst-scheme="qrmPairedBrackets"/>
      </inherit>
<!-- paired block -->
      <block start="/\(\*/" end="/\*\)/" scheme="def:Comment" region="def:Comment" region00="def:PairStart" region10="def:PairEnd"/>
      <block start="/(\()/" end="/(\))/" scheme="qrmPairedBrackets" region00="def:Symbol" region01="def:PairStart" region10="def:Symbol" region11="def:PairEnd"/>
      <block start="/(\[)/" end="/(\])/" scheme="qrmPairedBrackets" region00="def:Symbol" region01="def:PairStart" region10="def:Symbol" region11="def:PairEnd"/>
    </scheme>

    <scheme name="qrmBase">
<!-- linear comments -->
      <regexp match="/(^!.*$)/" region0="def:Comment"/>
      <block start="/\/\//" end="/$/" scheme="def:Comment" region="def:Comment"/>
      <block start="/\/\*/" end="/\*\//" scheme="def:Comment" region="def:Comment" region00="def:PairStart" region10="def:PairEnd"/>
      <block start="/\(\*/" end="/\*\)/" scheme="def:Comment" region="def:Comment" region00="def:PairStart" region10="def:PairEnd"/>
<!-- strings -->
      <regexp match='/(".*?")/' region0="def:String"/>
      <regexp match="/('.*?')/" region0="def:String"/>
      <regexp match="/\#\d+?\b/" region0="def:String"/>
      <regexp match="/\#\$[\dA-Fa-f]+?\b/" region0="def:String"/>
<!-- Numbers -->
      <regexp match="/\c(\$[\da-fA-F]+)\b/" region0="def:Number"/>
      <regexp match="/\c(\$[\da-fA-F]*?([^\s\W\da-fA-F]).*?)\b/" region0="def:ErrorText"/>
      <inherit scheme="def:FloatNumber"/>
      <inherit scheme="def:DecNumber"/>
<!-- Symbols -->
      <keywords region="def:Symbol">
        <symb name="="/><symb name="^"/><symb name="+"/><symb name="&lt;"/>
        <symb name="-"/><symb name="*"/><symb name="/"/><symb name=".."/>
        <symb name=":"/><symb name="("/><symb name="."/><symb name="&gt;"/>
        <symb name="#"/><symb name=")"/><symb name="["/><symb name="]"/>
        <symb name=","/><symb name="|"/>
        <symb name="@" region="def:SymbolStrong"/>
        <symb name=";" region="def:SymbolStrong"/>
      </keywords>
    </scheme>

    <scheme name="qrmPrePro">
<!-- Atl preprocessor -->
      <block start="/^\s*#\b(ifdef|ifndef|define|undefine|endif|else|include|use|set)\b/i" end="/$/" scheme="qrmPrePro" region="QrmPreproc" region00="QrmPreprocWord"/>
      <keywords ignorecase="yes" region="QrmPreprocWord">
        <word name="project"/>
        <word name="commands"/>
        <word name="statuses"/>
        <word name="helps"/>
        <word name="start"/>
      </keywords>
    </scheme>

    <scheme name="AtlCore">
      <inherit scheme="qrmBase"/>
      <regexp match="/(\bimport\b)?#6(\s+\b[^\s\;]+\b)/i" region1="AtlWord" region2="QrmPreproc"/>
      <keywords ignorecase="yes" region="AtlWord">
        <word name="CASE"/>
        <word name="HANDLEEVENT"/>
        <word name="COMMONEVENT"/>
        <word name="IF"/>
        <word name="ELSE"/>
        <word name="DO"/>
        <word name="WHILE"/>
        <word name="FOR"/>
        <word name="BREAK"/>
        <word name="CURRENTVIEW"/>
        <word name="RUNWINDOW"/>
        <word name="RUNWINDOWMODAL"/>
        <word name="SETFORMAT"/>
        <word name="SETTITLE"/>
        <word name="SETWINDOWTITLE"/>
        <word name="TABLE"/>
        <word name="PROTECT"/>
        <word name="SKIP"/>
        <word name="NOPROTECT"/>
        <word name="SHOW"/>
        <word name="AT"/>
        <word name="SELECT"/>
        <word name="CREATE"/>
        <word name="LOCAL"/>
        <word name="VIEW"/>
        <word name="AS"/>
        <word name="WHERE"/>
        <word name="FROM"/>
        <word name="VAR"/>
        <word name="PROCEDURE"/>
        <word name="FUNCTION"/>
        <word name="PUBLIC"/>
        <word name="MENU"/>
        <word name="DEFAULT"/>
        <word name="EXTERNAL"/>
        <word name="FIELDS"/>
        <word name="BUTTONS"/>
        <word name="CENTERED"/>
        <word name="ESCCLOSE"/>
        <word name="CYAN"/>
        <word name="LOADONCALL"/>
        <word name="PRELOAD"/>
        <word name="CACHE"/>
        <word name="PERMANENT"/>
        <word name="ALONE"/>
        <word name="FORMAT"/>
        <word name="SYNONYM"/>
        <word name="READONLY"/>
        <word name="MEMORY"/>
        <word name="NOTOPEN"/>
        <word name="BUILD"/>
        <word name="PARAMETERS"/>
        <word name="STATUSCTX"/>
        <word name="STATUSLINE"/>
        <word name="HELPLINE"/>
      </keywords>
      <keywords ignorecase="yes" region="AtlDlgWord">
        <word name="ABSOLUTE"/>
        <word name="LOADDATA"/>
        <word name="STOREDATA"/>
      </keywords>
      <keywords ignorecase="yes" region="AtlCmdWord">
        <word name="ECOMMAND"/>
        <word name="EINFOWORD"/>
        <word name="EINFOPTR"/>
        <word name="EVCOMMAND"/>
        <word name="EVMESSAGE"/>
        <word name="EVKEYDOWN"/>
        <word name="AND"/>
        <word name="OR"/>
        <word name="NOT"/>
      </keywords>
      <keywords ignorecase="yes" region="AtlTypeWord">
        <word name="STRING"/>
        <word name="POINTER"/>
        <word name="LONGINT"/>
        <word name="DOUBLE"/>
        <word name="WORD"/>
        <word name="INTEGER"/>
        <word name="BYTE"/>
        <word name="SINGLE"/>
        <word name="ASTRING"/>
        <word name="LVAR"/>
        <word name="DATE"/>
        <word name="TIME"/>
        <word name="CHAR"/>
        <word name="EXTENDED"/>
        <word name="BOOLEAN"/>
        <word name="TRUE" region="AtlBool"/>
        <word name="FALSE" region="AtlBool"/>
      </keywords>
      <keywords ignorecase="yes" region="AtlStdWord">
        <word name="UPDATETABLE"/>
        <word name="SUBSTR"/>
        <word name="UPPER"/>
        <word name="DAY"/>
        <word name="MONTH"/>
        <word name="YEAR"/>
        <word name="RETURN"/>
        <word name="PFIELD"/>
        <word name="TBL"/>
        <word name="LNK"/>
        <word name="GO"/>
        <word name="NORECORDS"/>
        <word name="FORWARD"/>
        <word name="BACKWARD"/>
        <word name="GETFIRSTIN"/>
        <word name="GETNEXTIN"/>
        <word name="GETPREVIN"/>
        <word name="GETLASTIN"/>
        <word name="REINITLINK"/>
        <word name="STRMESSAGE"/>
        <word name="ABORT"/>
        <word name="STOP"/>
        <word name="MAININTERFACE"/>
        <word name="MESSAGE"/>
        <word name="CREATEEVENT"/>
        <word name="BOUNDS"/>
        <word name="PUSHBOUNDS"/>
        <word name="POPBOUNDS"/>
        <word name="CONDITION"/>
        <word name="PUSHLEAFCOND"/>
        <word name="POPLEAFCOND"/>
        <word name="RESCANPANEL"/>
      </keywords>
    </scheme>

    <scheme name="atl">

      <inherit scheme="qrmPrePro">
        <virtual scheme="qrmPrePro" subst-scheme="atl"/>
      </inherit>
<!-- paired block -->
      <inherit scheme="qrmPairedBrackets">
        <virtual scheme="qrmPairedBrackets" subst-scheme="atl"/>
      </inherit>
<!-- objects -->
      <regexp match="/^\s*\M((interface|process)(\s*$|\s+\w*))/i" region1="InterfaceOutline"/>
      <regexp match="/^\s*\M((dialog)(\s*$|\s+\w*))/i" region1="DialogOutline"/>
      <regexp match="/^\s*\M((window)(\s*$|\s+\w*))/i" region1="WindowOutline"/>
      <regexp match="/^\s*\M((browse|screen)(\s*$|\s+\w*))/i" region1="BrowseOutline"/>
      <regexp match="/^\s*\M((menu|procedure|function)(\s*$|\s+\w*))/i" region1="FunctionOutline"/>
      <regexp match="/^\s*\M((strings)(\s*$|\s+\w*))/i" region1="StringsOutline"/>
<!-- paired -->
      <block start="/\b(begin|window|browse|screen|interface|dialog|process|strings)\b\M(\s*$|\s+)/i" end="/\b(end)\b/i" scheme="atl" region00="AtlWord" region10="AtlWord" region01="def:PairStart" region11="def:PairEnd"/>

      <inherit scheme="AtlCore"/>
    </scheme>

  </type>

</hrc>
