ADDED generated/natools-static_hash_maps-s_expressions-command_map.adb Index: generated/natools-static_hash_maps-s_expressions-command_map.adb ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_map.adb +++ generated/natools-static_hash_maps-s_expressions-command_map.adb @@ -0,0 +1,32 @@ +with Interfaces; use Interfaces; + +package body Natools.Static_Hash_Maps.S_Expressions.Command_Map is + + P : constant array (0 .. 0) of Natural := + (0 .. 0 => 3); + + T1 : constant array (0 .. 0) of Unsigned_8 := + (0 .. 0 => 8); + + T2 : constant array (0 .. 0) of Unsigned_8 := + (0 .. 0 => 5); + + G : constant array (0 .. 8) of Unsigned_8 := + (0, 0, 0, 0, 3, 1, 0, 2, 0); + + function Hash (S : String) return Natural is + F : constant Natural := S'First - 1; + L : constant Natural := S'Length; + F1, F2 : Natural := 0; + J : Natural; + begin + for K in P'Range loop + exit when L < P (K); + J := Character'Pos (S (P (K) + F)); + F1 := (F1 + Natural (T1 (K)) * J) mod 9; + F2 := (F2 + Natural (T2 (K)) * J) mod 9; + end loop; + return (Natural (G (F1)) + Natural (G (F2))) mod 4; + end Hash; + +end Natools.Static_Hash_Maps.S_Expressions.Command_Map; ADDED generated/natools-static_hash_maps-s_expressions-command_map.ads Index: generated/natools-static_hash_maps-s_expressions-command_map.ads ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_map.ads +++ generated/natools-static_hash_maps-s_expressions-command_map.ads @@ -0,0 +1,3 @@ +package Natools.Static_Hash_Maps.S_Expressions.Command_Map is + function Hash (S : String) return Natural; +end Natools.Static_Hash_Maps.S_Expressions.Command_Map; ADDED generated/natools-static_hash_maps-s_expressions-command_maps-test.adb Index: generated/natools-static_hash_maps-s_expressions-command_maps-test.adb ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_maps-test.adb +++ generated/natools-static_hash_maps-s_expressions-command_maps-test.adb @@ -0,0 +1,26 @@ +-- Generated at 2014-05-31 15:03:28 +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; +function Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test + return Boolean is +begin + for I in Map_1_Keys'Range loop + if Natools.Static_Hash_Maps.S_Expressions.Command_Pkg.Hash + (Map_1_Keys (I).all) /= I + then + return False; + end if; + end loop; + + for I in Map_2_Keys'Range loop + if Natools.Static_Hash_Maps.S_Expressions.Command_Map.Hash + (Map_2_Keys (I).all) /= I + then + return False; + end if; + end loop; + + return True; +end Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test; ADDED generated/natools-static_hash_maps-s_expressions-command_maps-test.ads Index: generated/natools-static_hash_maps-s_expressions-command_maps-test.ads ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_maps-test.ads +++ generated/natools-static_hash_maps-s_expressions-command_maps-test.ads @@ -0,0 +1,5 @@ +-- Generated at 2014-05-31 15:03:28 +0000 by Natools.Static_Hash_Maps +-- from natools-static_hash_maps-s_expressions-hash_maps.sx + +function Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test + return Boolean; ADDED generated/natools-static_hash_maps-s_expressions-command_maps.adb Index: generated/natools-static_hash_maps-s_expressions-command_maps.adb ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_maps.adb +++ generated/natools-static_hash_maps-s_expressions-command_maps.adb @@ -0,0 +1,32 @@ +-- Generated at 2014-05-31 15:03:28 +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 + 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); + begin + if Map_2_Keys (N).all = Key then + return Map_2_Elements (N); + else + raise Constraint_Error with "Key """ & Key & """ not in map"; + end if; + end To_Map_Command; + +end Natools.Static_Hash_Maps.S_Expressions.Command_Maps; ADDED generated/natools-static_hash_maps-s_expressions-command_maps.ads Index: generated/natools-static_hash_maps-s_expressions-command_maps.ads ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_maps.ads +++ generated/natools-static_hash_maps-s_expressions-command_maps.ads @@ -0,0 +1,50 @@ +-- Generated at 2014-05-31 15:03:28 +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; + +private + + Map_1_Key_0 : aliased constant String := "extra-declarations"; + Map_1_Key_1 : aliased constant String := "extra-decl"; + Map_1_Key_2 : aliased constant String := "private"; + Map_1_Key_3 : aliased constant String := "public"; + Map_1_Key_4 : aliased constant String := "pure"; + Map_1_Key_5 : aliased constant String := "preelaborate"; + Map_1_Key_6 : aliased constant String := "test-function"; + Map_1_Keys : constant array (0 .. 6) of access constant String + := (Map_1_Key_0'Access, + Map_1_Key_1'Access, + Map_1_Key_2'Access, + Map_1_Key_3'Access, + Map_1_Key_4'Access, + Map_1_Key_5'Access, + Map_1_Key_6'Access); + Map_1_Elements : constant array (0 .. 6) of Package_Command + := (Extra_Declarations, + Extra_Declarations, + Private_Child, + Public_Child, + Pure_Package, + Preelaborate_Package, + Test_Function); + + Map_2_Key_0 : aliased constant String := "hash-package"; + Map_2_Key_1 : aliased constant String := "nodes"; + Map_2_Key_2 : aliased constant String := "function"; + Map_2_Key_3 : aliased constant String := "not-found"; + Map_2_Keys : constant array (0 .. 3) of access constant String + := (Map_2_Key_0'Access, + Map_2_Key_1'Access, + Map_2_Key_2'Access, + Map_2_Key_3'Access); + Map_2_Elements : constant array (0 .. 3) of Map_Command + := (Hash_Package, + Nodes, + Function_Name, + Not_Found); + +end Natools.Static_Hash_Maps.S_Expressions.Command_Maps; ADDED generated/natools-static_hash_maps-s_expressions-command_pkg.adb Index: generated/natools-static_hash_maps-s_expressions-command_pkg.adb ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_pkg.adb +++ generated/natools-static_hash_maps-s_expressions-command_pkg.adb @@ -0,0 +1,32 @@ +with Interfaces; use Interfaces; + +package body Natools.Static_Hash_Maps.S_Expressions.Command_Pkg is + + P : constant array (0 .. 1) of Natural := + (3, 11); + + T1 : constant array (0 .. 1) of Unsigned_8 := + (0, 1); + + T2 : constant array (0 .. 1) of Unsigned_8 := + (6, 12); + + G : constant array (0 .. 16) of Unsigned_8 := + (0, 2, 0, 6, 4, 0, 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 1); + + function Hash (S : String) return Natural is + F : constant Natural := S'First - 1; + L : constant Natural := S'Length; + F1, F2 : Natural := 0; + J : Natural; + begin + for K in P'Range loop + exit when L < P (K); + J := Character'Pos (S (P (K) + F)); + F1 := (F1 + Natural (T1 (K)) * J) mod 17; + F2 := (F2 + Natural (T2 (K)) * J) mod 17; + end loop; + return (Natural (G (F1)) + Natural (G (F2))) mod 7; + end Hash; + +end Natools.Static_Hash_Maps.S_Expressions.Command_Pkg; ADDED generated/natools-static_hash_maps-s_expressions-command_pkg.ads Index: generated/natools-static_hash_maps-s_expressions-command_pkg.ads ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_pkg.ads +++ generated/natools-static_hash_maps-s_expressions-command_pkg.ads @@ -0,0 +1,3 @@ +package Natools.Static_Hash_Maps.S_Expressions.Command_Pkg is + function Hash (S : String) return Natural; +end Natools.Static_Hash_Maps.S_Expressions.Command_Pkg; Index: natools.gpr ================================================================== --- natools.gpr +++ natools.gpr @@ -11,11 +11,11 @@ when "Coverage" => Prefix := "coverage/"; end case; -- Source_Dirs is left to default "." - for Source_Dirs use ("src"); + for Source_Dirs use ("src", "generated"); for Object_Dir use Prefix & "obj"; for Exec_Dir use Prefix & "bin"; case Mode is when "Release" => DELETED src/natools-static_hash_maps-s_expressions-command_map.adb Index: src/natools-static_hash_maps-s_expressions-command_map.adb ================================================================== --- src/natools-static_hash_maps-s_expressions-command_map.adb +++ src/natools-static_hash_maps-s_expressions-command_map.adb @@ -1,32 +0,0 @@ -with Interfaces; use Interfaces; - -package body Natools.Static_Hash_Maps.S_Expressions.Command_Map is - - P : constant array (0 .. 0) of Natural := - (0 .. 0 => 3); - - T1 : constant array (0 .. 0) of Unsigned_8 := - (0 .. 0 => 8); - - T2 : constant array (0 .. 0) of Unsigned_8 := - (0 .. 0 => 5); - - G : constant array (0 .. 8) of Unsigned_8 := - (0, 0, 0, 0, 3, 1, 0, 2, 0); - - function Hash (S : String) return Natural is - F : constant Natural := S'First - 1; - L : constant Natural := S'Length; - F1, F2 : Natural := 0; - J : Natural; - begin - for K in P'Range loop - exit when L < P (K); - J := Character'Pos (S (P (K) + F)); - F1 := (F1 + Natural (T1 (K)) * J) mod 9; - F2 := (F2 + Natural (T2 (K)) * J) mod 9; - end loop; - return (Natural (G (F1)) + Natural (G (F2))) mod 4; - end Hash; - -end Natools.Static_Hash_Maps.S_Expressions.Command_Map; DELETED src/natools-static_hash_maps-s_expressions-command_map.ads Index: src/natools-static_hash_maps-s_expressions-command_map.ads ================================================================== --- src/natools-static_hash_maps-s_expressions-command_map.ads +++ src/natools-static_hash_maps-s_expressions-command_map.ads @@ -1,3 +0,0 @@ -package Natools.Static_Hash_Maps.S_Expressions.Command_Map is - function Hash (S : String) return Natural; -end Natools.Static_Hash_Maps.S_Expressions.Command_Map; DELETED src/natools-static_hash_maps-s_expressions-command_maps-test.adb Index: src/natools-static_hash_maps-s_expressions-command_maps-test.adb ================================================================== --- src/natools-static_hash_maps-s_expressions-command_maps-test.adb +++ src/natools-static_hash_maps-s_expressions-command_maps-test.adb @@ -1,26 +0,0 @@ --- Generated at 2014-05-31 15:03:28 +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; -function Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test - return Boolean is -begin - for I in Map_1_Keys'Range loop - if Natools.Static_Hash_Maps.S_Expressions.Command_Pkg.Hash - (Map_1_Keys (I).all) /= I - then - return False; - end if; - end loop; - - for I in Map_2_Keys'Range loop - if Natools.Static_Hash_Maps.S_Expressions.Command_Map.Hash - (Map_2_Keys (I).all) /= I - then - return False; - end if; - end loop; - - return True; -end Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test; DELETED src/natools-static_hash_maps-s_expressions-command_maps-test.ads Index: src/natools-static_hash_maps-s_expressions-command_maps-test.ads ================================================================== --- src/natools-static_hash_maps-s_expressions-command_maps-test.ads +++ src/natools-static_hash_maps-s_expressions-command_maps-test.ads @@ -1,5 +0,0 @@ --- Generated at 2014-05-31 15:03:28 +0000 by Natools.Static_Hash_Maps --- from natools-static_hash_maps-s_expressions-hash_maps.sx - -function Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test - return Boolean; DELETED src/natools-static_hash_maps-s_expressions-command_maps.adb Index: src/natools-static_hash_maps-s_expressions-command_maps.adb ================================================================== --- src/natools-static_hash_maps-s_expressions-command_maps.adb +++ src/natools-static_hash_maps-s_expressions-command_maps.adb @@ -1,32 +0,0 @@ --- Generated at 2014-05-31 15:03:28 +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 - 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); - begin - if Map_2_Keys (N).all = Key then - return Map_2_Elements (N); - else - raise Constraint_Error with "Key """ & Key & """ not in map"; - end if; - end To_Map_Command; - -end Natools.Static_Hash_Maps.S_Expressions.Command_Maps; DELETED src/natools-static_hash_maps-s_expressions-command_maps.ads Index: src/natools-static_hash_maps-s_expressions-command_maps.ads ================================================================== --- src/natools-static_hash_maps-s_expressions-command_maps.ads +++ src/natools-static_hash_maps-s_expressions-command_maps.ads @@ -1,50 +0,0 @@ --- Generated at 2014-05-31 15:03:28 +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; - -private - - Map_1_Key_0 : aliased constant String := "extra-declarations"; - Map_1_Key_1 : aliased constant String := "extra-decl"; - Map_1_Key_2 : aliased constant String := "private"; - Map_1_Key_3 : aliased constant String := "public"; - Map_1_Key_4 : aliased constant String := "pure"; - Map_1_Key_5 : aliased constant String := "preelaborate"; - Map_1_Key_6 : aliased constant String := "test-function"; - Map_1_Keys : constant array (0 .. 6) of access constant String - := (Map_1_Key_0'Access, - Map_1_Key_1'Access, - Map_1_Key_2'Access, - Map_1_Key_3'Access, - Map_1_Key_4'Access, - Map_1_Key_5'Access, - Map_1_Key_6'Access); - Map_1_Elements : constant array (0 .. 6) of Package_Command - := (Extra_Declarations, - Extra_Declarations, - Private_Child, - Public_Child, - Pure_Package, - Preelaborate_Package, - Test_Function); - - Map_2_Key_0 : aliased constant String := "hash-package"; - Map_2_Key_1 : aliased constant String := "nodes"; - Map_2_Key_2 : aliased constant String := "function"; - Map_2_Key_3 : aliased constant String := "not-found"; - Map_2_Keys : constant array (0 .. 3) of access constant String - := (Map_2_Key_0'Access, - Map_2_Key_1'Access, - Map_2_Key_2'Access, - Map_2_Key_3'Access); - Map_2_Elements : constant array (0 .. 3) of Map_Command - := (Hash_Package, - Nodes, - Function_Name, - Not_Found); - -end Natools.Static_Hash_Maps.S_Expressions.Command_Maps; DELETED src/natools-static_hash_maps-s_expressions-command_pkg.adb Index: src/natools-static_hash_maps-s_expressions-command_pkg.adb ================================================================== --- src/natools-static_hash_maps-s_expressions-command_pkg.adb +++ src/natools-static_hash_maps-s_expressions-command_pkg.adb @@ -1,32 +0,0 @@ -with Interfaces; use Interfaces; - -package body Natools.Static_Hash_Maps.S_Expressions.Command_Pkg is - - P : constant array (0 .. 1) of Natural := - (3, 11); - - T1 : constant array (0 .. 1) of Unsigned_8 := - (0, 1); - - T2 : constant array (0 .. 1) of Unsigned_8 := - (6, 12); - - G : constant array (0 .. 16) of Unsigned_8 := - (0, 2, 0, 6, 4, 0, 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 1); - - function Hash (S : String) return Natural is - F : constant Natural := S'First - 1; - L : constant Natural := S'Length; - F1, F2 : Natural := 0; - J : Natural; - begin - for K in P'Range loop - exit when L < P (K); - J := Character'Pos (S (P (K) + F)); - F1 := (F1 + Natural (T1 (K)) * J) mod 17; - F2 := (F2 + Natural (T2 (K)) * J) mod 17; - end loop; - return (Natural (G (F1)) + Natural (G (F2))) mod 7; - end Hash; - -end Natools.Static_Hash_Maps.S_Expressions.Command_Pkg; DELETED src/natools-static_hash_maps-s_expressions-command_pkg.ads Index: src/natools-static_hash_maps-s_expressions-command_pkg.ads ================================================================== --- src/natools-static_hash_maps-s_expressions-command_pkg.ads +++ src/natools-static_hash_maps-s_expressions-command_pkg.ads @@ -1,3 +0,0 @@ -package Natools.Static_Hash_Maps.S_Expressions.Command_Pkg is - function Hash (S : String) return Natural; -end Natools.Static_Hash_Maps.S_Expressions.Command_Pkg;