<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE language SYSTEM "language.dtd">

<language id="bennugd" _name="BennuGD" version="2.0" _section="Sources">



  <metadata>

         <property name="mimetypes">text/x-bennugd-prg</property>

	 <property name="globs">*.prg</property>

         <property name="line-comment-start">//</property>

         <property name="block-comment-start">/*</property>

         <property name="block-comment-end">*/</property>

  </metadata>



    <styles>
        <style id="comment"           _name="Comment"             map-to="def:comment"/>
        <style id="error"             _name="Error"               map-to="def:error"/>
        <style id="preprocessor"      _name="Preprocessor"        map-to="def:preprocessor"/>
        <style id="identifier"        _name="Identifier"          map-to="def:identifier"/>
        <style id="operator"          _name="Operator"            map-to="def:operator"/>
        <style id="keywords"          _name="Keyword"             map-to="def:keyword"/>
        <style id="types"             _name="Data Type"           map-to="def:type"/>
        <style id="escaped-character" _name="Escaped Character"   map-to="def:special-char"/>
        <style id="floating-point"    _name="Floating point number" map-to="def:floating-point"/>
        <style id="decimal"           _name="Decimal number"      map-to="def:decimal"/>
        <style id="hexadecimal"       _name="Hexadecimal number"  map-to="def:base-n-integer"/>
        <style id="boolean"           _name="Boolean value"       map-to="def:boolean"/>
        <style id="string"            _name="String"              map-to="def:string"/>
        <style id="char"              _name="Character"           map-to="def:character"/>
    </styles>
       

    <default-regex-options case-sensitive="false" />



  <definitions>

        <define-regex id="escaped-character" extended="true">
              \\(                   # leading backslash
              [\\\"\'nrbtfav\?] |   # escaped character
              [0-7]{1,3} |          # one, two, or three octal digits
              x[0-9A-Fa-f]+         # 'x' followed by hex digits
              )
       </define-regex>


        <context id="bennugd">

            <include>


            <!--Comments -->

            <context id="comment" style-ref="comment" end-at-line-end="true">
                    <start>//</start>
                    <include>
                      <context ref="def:in-line-comment"/>
                    </include>
            </context>
            <context id="comment-multiline" style-ref="comment">
                    <start>/\*</start>
                    <end>\*/</end>
                    <include>
                        <context ref="def:in-comment"/>
                    </include>
            </context>
            <context id="close-comment-outside-comment" style-ref="error">
                    <match>\*/(?!\*)</match>
            </context>

            <!--Preprocessor -->

            <define-regex id="preproc-start">^\s*#\s*</define-regex>
            <context id="preprocessor" style-ref="preprocessor" end-at-line-end="true">
                    <start extended="true">
                            \%{preproc-start}
                            (define|if(n?def)?|else|elsif|endif)
                            \b
                    </start>
                    <include>
                        <context ref="def:line-continue" ignore-style="true"/>
                        <context ref="string" ignore-style="true"/>
                        <context ref="comment"/>
                        <context ref="comment-multiline"/>
                    </include>
                </context>
                   
          <!-- Different data-types -->
          <context id="string" style-ref="string" end-at-line-end="true">
                    <start>L?"</start>
                    <end>"</end>
                    <include>
                        <context id="escaped-character" style-ref="escaped-character">
                            <match>\%{escaped-character}</match>
                        </context>
                        <context ref="def:line-continue"/>
                    </include>
          </context>
          <context id="char" style-ref="char">
                    <match>L?'(\%{escaped-character}|.)'</match>
          </context>
          <context id="boolean" style-ref="boolean">

                  <keyword>false</keyword>

                  <keyword>true</keyword>

          </context>

          <context id="float" style-ref="floating-point">

                  <match extended="true">

                      (?&lt;![\w\.])

                      ([0-9]+[Ee][+-]?[0-9]+ |

                      ([0-9]*\.[0-9]+ | [0-9]+\.[0-9]*)([Ee][+-]?[0-9]+)?)

                      (?![\w\.])

                  </match>

         </context>

         <context id="decimal-number" style-ref="decimal">

                  <match extended="true">

                       (?&lt;![\w\.])

                       [+-]?([1-9][0-9]*|0)

                       (?![\w\.])

                 </match>

        </context>

         <context id="hexadecimal-number" style-ref="hexadecimal">

                 <match extended="true">

                       (?&lt;![\w\.])

                       [+-]?0x[0-9a-fA-F]+

                       (?![\w\.])

                 </match>

        </context>
        <context id="array-operators" style-ref="identifier">

                     <match>(\[|\])</match>

        </context>



          

            <!--Keywords --> 

            <context id="keywords" style-ref="keywords">

                        <keyword>begin</keyword>

			<keyword>break</keyword>

			<keyword>call</keyword> 

			<keyword>case</keyword>

			<keyword>clone</keyword> 

			<keyword>const</keyword> 

			<keyword>continue</keyword>

			<keyword>debug</keyword> 

			<keyword>declare</keyword> 

			<keyword>default</keyword> 

			<keyword>dup</keyword> 

			<keyword>elif</keyword> 

			<keyword>else</keyword> 

			<keyword>elseif</keyword> 

			<keyword>elsif</keyword> 

			<keyword>end</keyword> 

			<keyword>error</keyword> 

			<keyword>exit</keyword>

			<keyword>for</keyword> 

			<keyword>frame</keyword> 

			<keyword>from</keyword> 

			<keyword>function</keyword>

			<keyword>global</keyword> 

			<keyword>goto</keyword>

			<keyword>if</keyword> 

			<keyword>import</keyword> 

			<keyword>include</keyword> 

			<keyword>jmp</keyword>

			<keyword>local</keyword> 

			<keyword>loop</keyword>

			<keyword>mod</keyword> 

			<keyword>mouse</keyword>

			<keyword>next</keyword>

			<keyword>offset</keyword> 

			<keyword>on</keyword> 

			<keyword>onerror</keyword> 

			<keyword>onexit</keyword>

			<keyword>private</keyword> 

			<keyword>process</keyword> 

			<keyword>program</keyword> 

			<keyword>public</keyword>

			<keyword>repeat</keyword> 

			<keyword>resume</keyword> 

			<keyword>return</keyword>

			<keyword>sizeof</keyword> 

			<keyword>step</keyword> 

			<keyword>switch</keyword>

			<keyword>to</keyword>

			<keyword>until</keyword>

			<keyword>while</keyword>

                </context>



		<context id="keywords2" style-ref="keywords">

			<keyword>argc</keyword>

			<keyword>argv</keyword>

			<keyword>bigbro</keyword>

			<keyword>father</keyword>

			<keyword>frame_percent</keyword>

			<keyword>id</keyword>

			<keyword>os_id</keyword>

			<keyword>process_type</keyword>

			<keyword>reserved</keyword>

			<keyword>reserved.frame_percent</keyword>

			<keyword>reserved.process_type</keyword>

			<keyword>reserved.saved_priority</keyword>

			<keyword>reserved.saved_status</keyword>

			<keyword>reserved.status</keyword>

			<keyword>saved_priority</keyword>

			<keyword>saved_status</keyword>

			<keyword>smallbro</keyword>

			<keyword>status</keyword>

			<keyword>son</keyword>

		</context>



               <context id="operators" style-ref="operator" extend-parent="false">

        		<keyword>and</keyword>

			<keyword>band</keyword>

			<keyword>bnot</keyword>

			<keyword>bor</keyword>

			<keyword>bxor</keyword>

			<keyword>mod</keyword>

			<keyword>not</keyword>

			<keyword>or</keyword>

			<keyword>xor</keyword> 

               </context> 



                <context id="types" style-ref="types">

                	<keyword>byte</keyword>

			<keyword>char</keyword> 

			<keyword>dword</keyword>

			<keyword>float</keyword> 

			<keyword>int</keyword>

			<keyword>pointer</keyword> 

			<keyword>short</keyword> 

			<keyword>signed</keyword> 

			<keyword>string</keyword> 

			<keyword>struct</keyword> 

			<keyword>type</keyword>

			<keyword>unsigned</keyword>

			<keyword>word</keyword>	

                </context>

              
		<context id="commonmacros" style-ref="preprocessor">

			<keyword>COMPILER_VERSION</keyword>

			<keyword>__DATE__</keyword>

			<keyword>__FILE__</keyword>

			<keyword>__LINE__</keyword>

			<keyword>max_byte</keyword>

			<keyword>max_dword</keyword>

			<keyword>max_int</keyword>

			<keyword>max_sbyte</keyword>

			<keyword>max_short</keyword>

			<keyword>max_word</keyword>

			<keyword>min_byte</keyword>

			<keyword>min_dword</keyword>

			<keyword>min_int</keyword>

			<keyword>min_sbyte</keyword>

			<keyword>min_short</keyword>

			<keyword>min_word</keyword>

			<keyword>null</keyword>

			<keyword>os_beos</keyword>

			<keyword>os_bsd</keyword>

			<keyword>os_dc</keyword>

			<keyword>os_gp32</keyword>

			<keyword>os_linux</keyword>

			<keyword>os_macos</keyword>

			<keyword>os_win32</keyword>

			<keyword>status_dead</keyword>

			<keyword>status_frozen</keyword>

			<keyword>status_killed</keyword>

			<keyword>status_running</keyword>

			<keyword>status_sleeping</keyword>

			<keyword>status_waiting</keyword>

			<keyword>__TIME__ </keyword>

			<keyword>__VERSION__</keyword>

		</context>

                 

           </include>

        </context>

    </definitions>

	

<!--

/Function String = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]+([^p*&, ^t^[^]a-zA-Z_0-9.!]++)[;]++"

/Function String 1 = "%[a-zA-Z_0-9*]*::^([a-zA-Z_0-9^~]+^)[ ^t^p]++([^p*&, ^t^[^]/*=:&a-zA-Z_0-9./(!]++)[;]++"

/Function String 2 = "%[a-zA-Z_0-9^][a-zA-Z_0-9^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&, ^t^[^]a-zA-Z_0-9./(!]++)[;]++"

/Function String 3 = "%[a-zA-Z_0-9*&$^[^]*]+[ ^t]+[a-zA-Z_0-9*&$^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&, ^t^[^]a-zA-Z_0-9./(!]++)[;]++"

/Function String 4 = "%[a-z_0-9^[^]*]++ [a-z_0-9*^[^]]+[ ^t]++[a-z_0-9*^[^]]+[ ^t]++^([*a-z_0-9]+^)[ ^t]++([^p*&, ^t^[^]a-z_0-9./(!]++)[;]++"

/Function String 5 = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]++([^p*&, ^t^[^]a-zA-Z_0-9./()!]++)[;]++"

-->

</language>

