Overview
Comment: | static_hash_maps-s_expressions: add S-expression bindings for the test child function generation |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
0d8d6300c9cc1131bb9a88c08898713b |
User & Date: | nat on 2014-05-28 17:28:09 |
Other Links: | manifest | tags |
Context
2014-05-29
| ||
18:36 | static_hash_maps-s_expressions-tests: new test around generated function for S-expression interpreter check-in: e3eb7b3d2d user: nat tags: trunk | |
2014-05-28
| ||
17:28 | static_hash_maps-s_expressions: add S-expression bindings for the test child function generation check-in: 0d8d6300c9 user: nat tags: trunk | |
2014-05-27
| ||
20:22 | static_hash_maps: add support for generation of hash function test check-in: 65c085f000 user: nat tags: trunk | |
Changes
Modified src/natools-static_hash_maps-s_expressions-command_maps.adb from [52ad3398c6] to [1ef76473e0].
| 1 2 3 4 5 6 7 8 | - + |
|
︙ |
Modified src/natools-static_hash_maps-s_expressions-command_maps.ads from [16dfdd3612] to [bc5c35a3a3].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | - + - - - + + + + + + - - - - + + + + + + + + + + |
|
︙ |
Modified src/natools-static_hash_maps-s_expressions-command_pkg.adb from [5994920bee] to [1d93d9989e].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - - + + - - + + - - + + - - + + - - + + - + | with Interfaces; use Interfaces; package body Natools.Static_Hash_Maps.S_Expressions.Command_Pkg is |
Modified src/natools-static_hash_maps-s_expressions-hash_maps.sx from [6b065695c1] to [15b9a7e32e].
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | + - + + | (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 (Extra_Declarations extra-declarations extra-decl) (Private_Child private) |
Modified src/natools-static_hash_maps-s_expressions.adb from [a8863b17f1] to [c1e705c3e6].
︙ | |||
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | + + + + + + - + | Context : in Meaningless_Type; Name : in Sx.Atom; Arguments : in out Sx.Lockable.Descriptor'Class); procedure Update_Package (Pkg : in out Map_Package; Context : in Meaningless_Type; Name : in Sx.Atom; Arguments : in out Sx.Lockable.Descriptor'Class); procedure Update_Package (Pkg : in out Map_Package; Context : in Meaningless_Type; Name : in Sx.Atom); procedure Map_Interpreter is new Sx.Interpreter_Loop (Map_Description, Meaningless_Type, Update_Map); procedure Node_Interpreter is new Sx.Interpreter_Loop (Map_Description, Meaningless_Type, Update_Nodes); procedure Package_Generator is new Sx.Interpreter_Loop (Map_Package, String, Generate_Package); procedure Package_Interpreter is new Sx.Interpreter_Loop |
︙ | |||
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | Value_Interpreter (Arguments, Map, Sx.To_String (Name)); end Update_Nodes; procedure Update_Package (Pkg : in out Map_Package; Context : in Meaningless_Type; Name : in Sx.Atom; Arguments : in out Sx.Lockable.Descriptor'Class) is pragma Unreferenced (Context); use type Sx.Events.Event; use type Sx.Octet; Is_Command : Boolean := False; begin for I in Name'Range loop if Name (I) = Character'Pos ('-') then Is_Command := True; exit; end if; end loop; if not Is_Command then Add_Map (Pkg, Meaningless_Value, Name, Arguments); return; end if; 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 => if Arguments.Current_Event = Sx.Events.Add_Atom then Set_Extra_Declarations (Pkg, Sx.To_String (Arguments.Current_Atom)); end if; when Test_Function => if Arguments.Current_Event = Sx.Events.Add_Atom then declare Child_Name : constant String := Sx.To_String (Arguments.Current_Atom); Parent_Name : constant String := To_String (Pkg.Name); begin if Child_Name'Length > Parent_Name'Length and then Child_Name (Child_Name'First .. Child_Name'First + Parent_Name'Length - 1) = Parent_Name then Set_Test_Child (Pkg, Child_Name (Child_Name'First + Parent_Name'Length .. Child_Name'Last)); else Set_Test_Child (Pkg, Child_Name); end if; end; else Set_Test_Child (Pkg, ""); end if; end case; end Update_Package; procedure Update_Package (Pkg : in out Map_Package; Context : in Meaningless_Type; Name : in Sx.Atom) is 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)); when Test_Function => null; end case; end Update_Package; ----------------------- -- Public Generators -- |
︙ |
Modified src/natools-static_hash_maps-s_expressions.ads from [7856d8d27a] to [e10b5a68ba].
︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | + | -- Generate the package described by Input private type Package_Command is (Private_Child, Public_Child, Test_Function, Extra_Declarations); type Map_Command is (Hash_Package, Nodes, Function_Name, Not_Found); end Natools.Static_Hash_Maps.S_Expressions; |