-----------------------------------------------------------------------
--                   GVD - The GNU Visual Debugger                   --
--                                                                   --
--                      Copyright (C) 2000-2003                      --
--                              ACT-Europe                           --
--                                                                   --
-- GVD is free  software;  you can redistribute it and/or modify  it --
-- under the terms of the GNU General Public License as published by --
-- the Free Software Foundation; either version 2 of the License, or --
-- (at your option) any later version.                               --
--                                                                   --
-- This program 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 --
-- General Public License for more details. You should have received --
-- a copy of the GNU 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.                    --
-----------------------------------------------------------------------

--  This is a generic language that it customized from a XML file.
--  See language.ads for a complete spec.

with Glib.Xml_Int;

package Language.Custom is

   type Custom_Language is new Language_Root with private;
   type Custom_Language_Access is access all Custom_Language'Class;

   procedure Initialize
     (Lang : access Custom_Language'Class;
      Top  : Glib.Xml_Int.Node_Ptr);
   --  Initialize Lang based on the contents of an XML node.

   -------------
   -- Parsing --
   -------------

   function Is_Simple_Type
     (Lang : access Custom_Language; Str : String) return Boolean;

   function Keywords (Lang : access Custom_Language)
     return GNAT.Regpat.Pattern_Matcher;

   function Get_Language_Context
     (Lang : access Custom_Language) return Language_Context;

   --------------
   -- Explorer --
   --------------

   function Explorer_Regexps
     (Lang : access Custom_Language) return Explorer_Categories;

   ------------------------
   -- Naming conventions --
   ------------------------

   function Dereference_Name
     (Lang : access Custom_Language;
      Name : String) return String;

   function Array_Item_Name
     (Lang  : access Custom_Language;
      Name  : String;
      Index : String) return String;

   function Record_Field_Name
     (Lang  : access Custom_Language;
      Name  : String;
      Field : String) return String;

   ---------------------
   -- Project support --
   ---------------------

   function Get_Project_Fields
     (Lang : access Custom_Language) return Project_Field_Array;

   ------------------
   -- Field access --
   ------------------

   function Get_Name (Lang : access Custom_Language) return String;
   --  Return the name associated with Lang.

   function Get_Spec_Suffix (Lang : access Custom_Language) return String;
   --  Return the spec suffix associated with Lang.

   function Get_Body_Suffix (Lang : access Custom_Language) return String;
   --  Return the body suffix associated with Lang.

private

   type Language_Context_Access is access Language_Context;
   type Explorer_Categories_Access is access Explorer_Categories;
   type Pattern_Matcher_Access is access GNAT.Regpat.Pattern_Matcher;
   type Project_Field_Array_Access is access Project_Field_Array;

   type Custom_Language is new Language_Root with record
      Categories  : Explorer_Categories_Access;
      Keywords    : Pattern_Matcher_Access;
      Context     : Language_Context_Access;
      Name        : Glib.String_Ptr;
      Spec_Suffix : Glib.String_Ptr;
      Body_Suffix : Glib.String_Ptr;
      Project_Fields : Project_Field_Array_Access;
   end record;

end Language.Custom;
