4.1.2. GNATCOLL.Any_Types

package GNATCOLL.Any_Types is

   --------------
   -- Any_Type --
   --------------

   --  This type provides an Ada encapsulation of certain types

   type Types is (No_Type,
                  Integer_Type,
                  String_Type,
                  Tuple_Type,
                  List_Type);

   type Any_Type;
   type Any_Type_Access is access Any_Type;

   type Any_Type_Array is array (Natural range <>) of Any_Type_Access;

   type Any_Type (T : Types; Length : Natural) is record
      case T is
         when No_Type =>
            null;
         when Integer_Type =>
            Int : Interfaces.C.long;
         when String_Type =>
            Str : String (1 .. Length);
         when Tuple_Type =>
            Tuple : Any_Type_Array (1 .. Length);
         when List_Type =>
            List  : Any_Type_Array (1 .. Length);
      end case;
   end record;

   procedure Free (X : in out Any_Type);
   --  Free memory associated to X

   Empty_Any_Type : constant Any_Type := (No_Type, 0);

end GNATCOLL.Any_Types;