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

 Author: Yevgen Muntyan <muntyan@math.tamu.edu>
 Copyright (C) 2007 Yevgen Muntyan <muntyan@math.tamu.edu>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Library General Public
 License as published by the Free Software Foundation; either
 version 2 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Library General Public License for more details.

 You should have received a copy of the GNU Library General Public
 License along with this library; if not, write to the
 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.

-->
<language id="objc" _name="Objective-C" version="2.0" _section="Sources">
  <metadata>
    <property name="mimetypes">text/x-objcsrc</property>
    <property name="globs">*.m</property>
    <property name="line-comment-start">//</property>
    <property name="block-comment-start">/*</property>
    <property name="block-comment-end">*/</property>
  </metadata>

  <styles>
    <style id="keyword" _name="Keyword" map-to="c:keyword"/>
    <style id="type" _name="Data Type" map-to="c:type"/>
    <style id="common-defines" _name="Common Defines" map-to="c:common-defines"/>
    <style id="string" _name="String" map-to="c:string"/>
  </styles>

  <definitions>
    <!-- ObjC-specific stuff (i.e. stuff which is not C) -->
    <context id="objc-header">
      <include>
        <context id="keywords" style-ref="keyword">
          <prefix>\@</prefix>
          <keyword>interface</keyword>
          <keyword>protocol</keyword>
          <keyword>implementation</keyword>
          <keyword>end</keyword>
          <keyword>class</keyword>
          <keyword>selector</keyword>
          <keyword>encode</keyword>
          <keyword>defs</keyword>
          <keyword>synchronized</keyword>
          <keyword>private</keyword>
          <keyword>protected</keyword>
          <keyword>public</keyword>
          <keyword>try</keyword>
          <keyword>throw</keyword>
          <keyword>catch</keyword>
          <keyword>finally</keyword>
        </context>

        <context id="types" style-ref="type">
          <keyword>BOOL</keyword>
        </context>

        <context id="objc-string-literal" style-ref="string" end-at-line-end="true">
          <start>\@"</start>
          <end>"</end>
          <include>
            <context ref="c:string:*"/>
          </include>
        </context>
      </include>
    </context>

    <!-- ObjC-specific stuff (i.e. stuff which is not C), which isn't
         good to highlight in C headers -->
    <context id="objc-source">
      <include>
        <context id="objc-keywords" style-ref="keyword">
          <keyword>self</keyword>
          <keyword>super</keyword>
        </context>

        <context id="objc-types" style-ref="type">
          <keyword>apply_t</keyword>
          <keyword>Class</keyword>
          <keyword>id</keyword>
          <keyword>IMP</keyword>
          <keyword>MetaClass</keyword>
          <keyword>Object</keyword>
          <keyword>Protocol</keyword>
          <keyword>retval_t</keyword>
          <keyword>SEL</keyword>
          <keyword>STR</keyword>
          <keyword>TypedStream</keyword>
        </context>

        <context id="objc-common-defines" style-ref="common-defines">
          <keyword>METHOD_NULL</keyword>
          <keyword>nil</keyword>
          <keyword>Nil</keyword>
          <keyword>NO</keyword>
          <keyword>YES</keyword>
        </context>
      </include>
    </context>

    <!-- actual language definition: ObjC-specific stuff plus everything from C -->
    <context id="objc">
      <include>
        <context ref="objc-source"/>
        <context ref="objc-header"/>
        <context ref="c:c"/>
      </include>
    </context>
  </definitions>
</language>
