source: trunk/ada-2012/src/api/gela-value_sets.ads@ 374

Last change on this file since 374 was 374, checked in by Maxim Reznik, 6 years ago

Add Is_String function for check static values

File size: 2.0 KB
Line 
1-- This package provides Value_Set interface and its methods.
2with League.Strings;
3
4with Gela.Semantic_Types;
5with Gela.Elements.Defining_Names;
6
7package Gela.Value_Sets is
8 pragma Preelaborate;
9
10 type Value_Set is limited interface;
11 -- Set of all values encountered in compilation units of some context
12 type Value_Set_Access is access all Value_Set'Class;
13 for Value_Set_Access'Storage_Size use 0;
14
15 not overriding procedure String_Literal
16 (Self : in out Value_Set;
17 Image : League.Strings.Universal_String;
18 Value : out Gela.Semantic_Types.Value_Index) is abstract;
19 -- Get string value for given literal.
20
21 not overriding procedure Numeric_Literal
22 (Self : in out Value_Set;
23 Image : League.Strings.Universal_String;
24 Value : out Gela.Semantic_Types.Value_Index) is abstract;
25 -- Get numeric value for given literal.
26
27 not overriding procedure Name
28 (Self : in out Value_Set;
29 Name : Gela.Elements.Defining_Names.Defining_Name_Access;
30 Value : out Gela.Semantic_Types.Value_Index) is abstract;
31 -- Get value corresponding to given defining name
32
33 not overriding procedure List
34 (Self : in out Value_Set;
35 Head : Gela.Semantic_Types.Value_Index;
36 Tail : Gela.Semantic_Types.Value_Index;
37 Value : out Gela.Semantic_Types.Value_Index) is abstract;
38 -- Get list as (Head, Tail)
39
40 not overriding procedure Apply
41 (Self : in out Value_Set;
42 Name : Gela.Semantic_Types.Value_Index;
43 Args : Gela.Semantic_Types.Value_Index;
44 Value : out Gela.Semantic_Types.Value_Index) is abstract;
45 -- Return Name (Args)
46
47 not overriding function Is_String
48 (Self : Value_Set;
49 Value : Gela.Semantic_Types.Value_Index) return Boolean is abstract;
50 -- Check if given value is string
51
52 not overriding function Image
53 (Self : Value_Set;
54 Value : Gela.Semantic_Types.Value_Index)
55 return League.Strings.Universal_String is abstract;
56 -- Get image of given value
57
58end Gela.Value_Sets;
Note: See TracBrowser for help on using the repository browser.