<?xml version="1.0" ?>
<!--  This file provides support for Ada and GNAT:
      The switches are no more defined here, but in ada_support.py. Only tools
      names are defined so that they appear before other tools in the editor
      (this module is loaded first).
      This also includes predefined search patterns.
      And finally a number of predefined text aliases are defined.
-->

<GPS>
   <tool name="Gnatmake" package="Builder" index="ada">
      <language>Ada</language>
      <initial-cmd-line></initial-cmd-line>
      <switches columns="2">
         <title column="1" line="1" >Dependencies</title>
         <title column="2" line="1" >Compilation</title>
         <check label="Recompile if switches changed" switch="-s"
                tip="Recompile if compiler switches have changed since last compilation" />
         <check label="Minimal recompilation" switch="-m"
                tip="Specifies that the minimum necessary amount of recompilation be performed. In this mode, gnatmake ignores time stamp differences when the only modification to a source file consist in adding or removing comments, empty lines, spaces or tabs" />

         <spin label="Multiprocessing" switch="-j" min="0" max="100" default="1"
               column="2"
               tip="Use N processes to carry out the compilations. On a multiprocessor machine compilations will occur in parallel" />
         <check label="Keep going" switch="-k" column="2"
                tip="Continue as much as possible after a compilation error" />
         <check label="Debug information" switch="-g" column="2"
                tip="Add debugging information. This forces the corresponding switch for the compiler, binder and linker" />
         <check label="Use mapping file" switch="-C" column="2"
                tip="Use a mapping file. A mapping file is a way to communicate to the compiler two mappings: from unit name to file names, and from file names to path names. This will generally improve the compilation time" />
      </switches>
   </tool>

   <tool name="Ada" package="Compiler" index="ada" override="true">
      <language>Ada</language>
      <initial-cmd-line>-g -gnatQ</initial-cmd-line>
      <switches lines="3" columns="2"/>
   </tool>

   <tool name="Binder" package="Binder" index="ada">
      <language>Ada</language>
      <switches lines="1">
         <check label="Store call stack in exceptions" switch="-E"
                tip="Store tracebacks in exception occurrences when the target supports it" />
         <check label="List possible restrictions" switch="-r" />
         <check label="Shared GNAT run time" switch="-shared" />
      </switches>
   </tool>

   <tool name="Ada Linker" package="Linker" index="ada">
      <language>Ada</language>
      <initial-cmd-line>-g</initial-cmd-line>
      <switches lines="1">
         <check label="Strip symbols" switch="-s" />
         <check label="Debug information" switch="-g" />
         <dependency master-page="Gnatmake" slave-page="Linker"
                     master-switch="-g" slave-switch="-g"
                     master-status="on" slave-status="on" />

         <check label="Code coverage" switch="-fprofile-generate"
                tip="Create data files for the gcov code-coverage utility" />
         <dependency master-page="Ada" slave-page="Ada Linker"
                     master-switch="-ftest-coverage"
                     slave-switch="-fprofile-generate"
                     master-status="on" slave-status="on" />
         <check label="Remove unused sections (GNU ld only)"
                switch="-Wl,--gc-sections"
                tip="Remove all unused sections from the link output. This is a GNU ld switch. See also -ffunction-sections and -fdata-sections compiler flags" />
      </switches>
   </tool>

   <vsearch-pattern>
     <name>Ada: type NAME is array (...)</name>
     <regexp>\btype\s+(\w+)\s+is\s+array\s+\((.*?)\)\s+of\s+\w+\s*;</regexp>
   </vsearch-pattern>

   <vsearch-pattern>
     <name>Ada: when CHOICE =></name>
     <regexp>\bwhen\s+((\w+)\s+:\s+)?[\w\s|]+\s*=></regexp>
   </vsearch-pattern>

   <vsearch-pattern>
     <name>Ada: (sub)type NAME is</name>
     <regexp>\b((sub)?type\s+(\w+)|type\s+(\w+)\s+(\(.*?\))?)\s+is\b</regexp>
   </vsearch-pattern>

   <vsearch-pattern>
     <name>Ada: type NAME (...) is</name>
     <regexp>\btype\s+(\w+)\s+\((.*?)\)\s+is\b</regexp>
   </vsearch-pattern>

   <vsearch-pattern>
     <name>Ada: for VAR in ... loop</name>
     <regexp>\bfor\s+(\w+)\s+in\s+(reverse\s+)?(.+?)(\s+range\s+(.*?))?\s+loop\b</regexp>
   </vsearch-pattern>

   <vsearch-pattern>
     <name>Ada: assignment</name>
     <regexp>\b(\w+)\s*:=</regexp>
   </vsearch-pattern>

  <alias name="procedure is" >
    <param name="name"  />
    <param name="params"  />
    <text>procedure %(name) (%(params)) is
begin
   %_
end %(name);</text>
  </alias>
  <alias name="task body" >
    <param name="name"  />
    <text>task body %(name) is
begin
   %_
end %(name);</text>
  </alias>
  <alias name="select" >
    <param name="entry2"  />
    <param name="entry"  />
    <text>select
   accept %(entry) do
      %_
   end %(entry);
or
   accept %(entry2) do
      null;
   end %(entry2);
end select;</text>
  </alias>
  <alias name="function is" >
    <param name="name"  />
    <param name="params"  />
    <param name="return_type"  />
    <text>function %(name) (%(params)) return %(return_type) is
begin
   return %_
end %(name);</text>
  </alias>
  <alias name="declare" >
    <text>declare
   %_
begin
   null;
end;</text>
  </alias>
  <alias name="for" >
    <param name="range"  />
    <param name="index"  />
    <text>for %(index) in %(range) loop
   %_
end loop;</text>
  </alias>
  <alias name="procedure" >
    <param name="name"  />
    <text>procedure %(name)%_;</text>
  </alias>
  <alias name="package body" >
    <param name="name"  />
    <text>package body %(name) is

   %_

end %(name);</text>
  </alias>
  <alias name="task" >
    <param name="name"  />
    <text>task %(name) is
   %_
end %(name);</text>
  </alias>
  <alias name="loop" >
    <param name="exit_condition"  />
    <text>loop
   %_
   exit when %(exit_condition);
end loop;</text>
  </alias>
  <alias name="case" >
    <param name="choice"  />
    <param name="expression"  />
    <text>case %(expression) is
   when %(choice) =&gt;
      %_
end case;</text>
  </alias>
  <alias name="while" >
    <param name="condition"  />
    <text>while %(condition) loop
   %_
end loop;</text>
  </alias>
  <alias name="package" >
    <param name="name"  />
    <text>package %(name) is

   %_

end %(name);</text>
  </alias>
  <alias name="if" >
    <param name="condition"  />
    <text>if %(condition) then
   %_
end if;</text>
  </alias>
  <alias name="function" >
    <param name="name"  />
    <param name="params"  />
    <text>function %(name) (%(params)) return %_;</text>
  </alias>
  <alias name="array" >
    <param name="range"  />
    <text>array (%(range)) of %_;</text>
  </alias>
  <alias name="exception" >
    <param name="error"  />
    <text>exception
   when %(error) =&gt;
      %_</text>
  </alias>
  <alias name="begin" >
    <text>begin
   %_
end;</text>
  </alias>
</GPS>
