Differences From Artifact [db1846c47e]:
- File src/natools-s_expressions-interpreters.adb — part of check-in [6e4b5836c5] at 2014-03-12 21:26:44 on branch trunk — s_expression-interpreters: new package providing a S-expression interpreter which dispatch to client-provided commands (user: nat size: 8670)
To Artifact [26f466f297]:
- File src/natools-s_expressions-interpreters.adb — part of check-in [2ee5aec7e2] at 2014-03-15 20:20:48 on branch trunk — s_expressions-interpreters: add inspection functions Has_Command and Is_Empty (user: nat size: 8946)
| ︙ | |||
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;
|
| ︙ |