Natools

Check-in [fcc23fc780]
Login
Overview
Comment:static_hash_maps-s_expressions: add binding for extra declarations in generated spec
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fcc23fc78040dfd547cb9dc2f942a28827fb6939
User & Date: nat on 2014-05-26 20:25:48
Other Links: manifest | tags
Context
2014-05-27
20:22
static_hash_maps: add support for generation of hash function test check-in: 65c085f000 user: nat tags: trunk
2014-05-26
20:25
static_hash_maps-s_expressions: add binding for extra declarations in generated spec check-in: fcc23fc780 user: nat tags: trunk
2014-05-25
08:51
static_hash_maps: add support for custom declarations at the beginning of the generated spec file check-in: 0ab4a630bf user: nat tags: trunk
Changes

Modified src/natools-static_hash_maps-s_expressions-command_maps.adb from [51c1c623eb] to [52ad3398c6].

1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

16
17
18
19
20
21
22
23
-
+














-
+







--  Generated at 2014-05-21 20:03:41 +0000 by Natools.Static_Hash_Maps
--  Generated at 2014-05-26 20:24:08 +0000 by Natools.Static_Hash_Maps
--  from natools-static_hash_maps-s_expressions-hash_maps.sx

with Natools.Static_Hash_Maps.S_Expressions.Command_Pkg;
with Natools.Static_Hash_Maps.S_Expressions.Command_Map;

package body Natools.Static_Hash_Maps.S_Expressions.Command_Maps is

   function To_Package_Command (Key : String) return Package_Command is
      N : constant Natural
        := Natools.Static_Hash_Maps.S_Expressions.Command_Pkg.Hash (Key);
   begin
      if Map_1_Keys (N).all = Key then
         return Map_1_Elements (N);
      else
         raise Constraint_Error with "Key """ & Key & """ not in map";
         return Extra_Declarations;
      end if;
   end To_Package_Command;


   function To_Map_Command (Key : String) return Map_Command is
      N : constant Natural
        := Natools.Static_Hash_Maps.S_Expressions.Command_Map.Hash (Key);

Modified src/natools-static_hash_maps-s_expressions-command_maps.ads from [1daffcd302] to [16dfdd3612].

1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







--  Generated at 2014-05-21 20:03:41 +0000 by Natools.Static_Hash_Maps
--  Generated at 2014-05-26 20:24:08 +0000 by Natools.Static_Hash_Maps
--  from natools-static_hash_maps-s_expressions-hash_maps.sx

private package Natools.Static_Hash_Maps.S_Expressions.Command_Maps is

   function To_Package_Command (Key : String) return Package_Command;
   function To_Map_Command (Key : String) return Map_Command;

Modified src/natools-static_hash_maps-s_expressions-hash_maps.sx from [0d990b8dfd] to [6b065695c1].

1
2
3
4
5

6
7
8
9
10
11
12
13
14
15
16
17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18





+












(Natools.Static_Hash_Maps.S_Expressions.Command_Maps
   private
   (Package_Command
      (hash-package Natools.Static_Hash_Maps.S_Expressions.Command_Pkg)
      (function To_Package_Command)
      (not-found Extra_Declarations)
      (nodes
         (Private_Child private)
         (Public_Child public)))
   (Map_Command
      (hash-package Natools.Static_Hash_Maps.S_Expressions.Command_Map)
      (function To_Map_Command)
      (nodes
         (Hash_Package hash-package)
         (Nodes nodes)
         (Function_Name function)
         (Not_Found not-found))))

Modified src/natools-static_hash_maps-s_expressions.adb from [b4bb055a3f] to [a8863b17f1].

173
174
175
176
177
178
179


180
181
182
183
184
185
186
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188







+
+







      pragma Unreferenced (Context);
   begin
      case Command_Maps.To_Package_Command (Sx.To_String (Name)) is
         when Private_Child =>
            Set_Private_Child (Pkg, True);
         when Public_Child =>
            Set_Private_Child (Pkg, False);
         when Extra_Declarations =>
            Set_Extra_Declarations (Pkg, Sx.To_String (Name));
      end case;
   end Update_Package;



   -----------------------
   -- Public Generators --

Modified src/natools-static_hash_maps-s_expressions.ads from [d116c33d8f] to [7856d8d27a].

36
37
38
39
40
41
42
43


44
45
46
47
48
49
50
51
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50
51
52







-
+
+








      Description : in String := "");
      --  Generate the package described by Input

private

   type Package_Command is
     (Private_Child,
      Public_Child);
      Public_Child,
      Extra_Declarations);

   type Map_Command is
     (Hash_Package,
      Nodes,
      Function_Name,
      Not_Found);

end Natools.Static_Hash_Maps.S_Expressions;