Natools

Check-in [2ee5aec7e2]
Login
Overview
Comment:s_expressions-interpreters: add inspection functions Has_Command and Is_Empty
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2ee5aec7e254d3d82b4583db2439fe31434e9e9f
User & Date: nat on 2014-03-15 20:20:48
Other Links: manifest | tags
Context
2014-03-16
13:03
s_expressions-interpreter_tests: add a test for new inspection functions check-in: 24ac878eae user: nat tags: trunk
2014-03-15
20:20
s_expressions-interpreters: add inspection functions Has_Command and Is_Empty check-in: 2ee5aec7e2 user: nat tags: trunk
2014-03-14
20:58
s_expressions-interpreter_tests: fully-covering test suite for interpreter package check-in: 67ed4dd9af user: nat tags: trunk
Changes

Modified src/natools-s_expressions-interpreters.adb from [db1846c47e] to [26f466f297].

37
38
39
40
41
42
43












44
45
46
47
48
49
50
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62







+
+
+
+
+
+
+
+
+
+
+
+







      Name : in Atom;
      Cmd : in Command'Class) is
   begin
      Self.Commands.Insert (Name, Cmd);
      Self.Max_Length := Count'Max (Self.Max_Length, Name'Length);
   end Add_Command;


   function Has_Command (Self : Interpreter; Name : Atom) return Boolean is
   begin
      return Self.Commands.Contains (Name);
   end Has_Command;


   function Is_Empty (Self : Interpreter) return Boolean is
   begin
      return Self.Commands.Is_Empty;
   end Is_Empty;


   procedure Set_Fallback
     (Self : in out Interpreter;
      Name : in Atom)
   is
      function Create return Atom;

Modified src/natools-s_expressions-interpreters.ads from [36f18e7166] to [5caad76e31].

61
62
63
64
65
66
67




68
69
70
71
72
73
74
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78







+
+
+
+








   type Interpreter is new Command with private;

   procedure Add_Command
     (Self : in out Interpreter;
      Name : in Atom;
      Cmd : in Command'Class);

   function Has_Command (Self : Interpreter; Name : Atom) return Boolean;

   function Is_Empty (Self : Interpreter) return Boolean;

   procedure Set_Fallback
     (Self : in out Interpreter;
      Name : in Atom);

   procedure Reset_Fallback (Self : in out Interpreter);