File: values.ads

package info (click to toggle)
gnat-gps 18-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 45,716 kB
  • sloc: ada: 362,679; python: 31,031; xml: 9,597; makefile: 1,030; ansic: 917; sh: 264; java: 17
file content (39 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (8)
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
35
36
37
38
39
--  Values (such as integers, reals, complex numbers, strings, etc.)
--  manipulated by SDC.

with Matrix_Binding; use Matrix_Binding;

package Values is

   type Value is private;
   --  The actual value type.

   function To_String (V : Value) return String;
   --  Returns a String representation of the Value.

   function Read (Word : String) return Value;
   --  If Word contains a value, the value is returned, otherwise
   --  Except.User_Error is raised.

   procedure Process (V : Value);
   --  Processes a Value.

private

   --  For now integer and matrices are the only data type available in SDC.

   type Value_Kind is (Int, Matrix);

   type Value_Info (Kind : Value_Kind) is record
      case Kind is
         when Int =>
            E : Integer;

         when Matrix =>
            M : Matrix_Type;
      end case;
   end record;

   type Value is access Value_Info;

end Values;