]>
Commit | Line | Data |
---|---|---|
28bf4b0b | 1 | /* |
c0de361f | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003. |
28bf4b0b | 3 | ** See ../LICENSE for license information. |
4 | */ | |
5 | /* | |
6 | ** metaStateInfo.h | |
7 | ** | |
8 | ** A record that keeps information on a user-defined state including: | |
9 | ** | |
10 | ** o A name | |
11 | ** o State Type (what kinds of things have this state value) | |
12 | ** o Number of values, and their mnemonics | |
13 | ** o A combination table (stateCombinationTable) for how different states combine as l/rvalues | |
14 | ** o Annotations (and map between annotation and value) | |
15 | ** o Context information (where can annotations be used) | |
16 | */ | |
17 | ||
18 | # ifndef MSINFO_H | |
19 | # define MSINFO_H | |
20 | ||
21 | /*@constant int metaState_error@*/ | |
22 | # define metaState_error -1 | |
23 | ||
24 | struct s_metaStateInfo { | |
25 | /*@only@*/ cstring name; | |
26 | fileloc loc; | |
27 | /* metaStateKind type; */ | |
28 | cstringList valueNames; | |
29 | stateCombinationTable sctable; | |
30 | stateCombinationTable mergetable; | |
31 | ||
32 | /* Default values */ | |
12f2ffe9 | 33 | int defaultValue [MTC_NUMCONTEXTS]; |
28bf4b0b | 34 | |
35 | /* context */ | |
36 | mtContextNode context; | |
37 | } ; | |
38 | ||
39 | /* in forwardTypes: abst_typedef null struct _metaStateInfo *metaStateInfo; */ | |
40 | ||
41 | /*@constant null metaStateInfo metaStateInfo_undefined; @*/ | |
42 | # define metaStateInfo_undefined ((metaStateInfo) NULL) | |
43 | ||
0e41eb0e | 44 | extern /*@falsewhennull@*/ bool metaStateInfo_isDefined (metaStateInfo) /*@*/ ; |
28bf4b0b | 45 | # define metaStateInfo_isDefined(p_info) ((p_info) != NULL) |
46 | ||
0e41eb0e | 47 | extern /*@nullwhentrue@*/ bool metaStateInfo_isUndefined (metaStateInfo) /*@*/ ; |
28bf4b0b | 48 | # define metaStateInfo_isUndefined(p_info) ((p_info) == NULL) |
49 | ||
50 | extern /*@notnull@*/ metaStateInfo | |
51 | metaStateInfo_create (/*@only@*/ cstring p_name, | |
52 | /*@only@*/ cstringList p_valueNames, | |
53 | /*@only@*/ mtContextNode p_context, | |
54 | /*@only@*/ stateCombinationTable p_sctable, | |
55 | /*@only@*/ stateCombinationTable p_mergetable, | |
56 | /*@only@*/ fileloc p_loc) ; | |
57 | ||
3120b462 | 58 | extern bool metaStateInfo_equal (metaStateInfo p_m1, metaStateInfo p_m2) /*@*/ ; |
59 | # define metaStateInfo_equal(m1,m2) ((m1) == (m2)) | |
60 | ||
12f2ffe9 | 61 | extern int metaStateInfo_getDefaultValueContext (metaStateInfo p_info, mtContextKind p_context) /*@*/ ; |
62 | extern void metaStateInfo_setDefaultValueContext (metaStateInfo p_info, mtContextKind p_context, int p_val) /*@modifies p_info@*/ ; | |
63 | ||
28bf4b0b | 64 | extern void metaStateInfo_setDefaultRefValue (metaStateInfo p_info, int p_val) |
65 | /*@modifies p_info@*/ ; | |
66 | ||
67 | extern void metaStateInfo_setDefaultParamValue (metaStateInfo p_info, int p_val) | |
68 | /*@modifies p_info@*/ ; | |
69 | ||
b072092f | 70 | extern void metaStateInfo_setDefaultResultValue (metaStateInfo p_info, int p_val) |
71 | /*@modifies p_info@*/ ; | |
72 | ||
28bf4b0b | 73 | extern int metaStateInfo_getDefaultValue (metaStateInfo p_info, sRef p_s) /*@*/ ; |
74 | ||
75 | extern int metaStateInfo_getDefaultRefValue (metaStateInfo p_info) /*@*/ ; | |
76 | extern int metaStateInfo_getDefaultParamValue (metaStateInfo p_info) /*@*/ ; | |
b072092f | 77 | extern int metaStateInfo_getDefaultResultValue (metaStateInfo p_info) /*@*/ ; |
28bf4b0b | 78 | extern int metaStateInfo_getDefaultGlobalValue (metaStateInfo p_info) /*@*/ ; |
79 | ||
80 | extern /*@observer@*/ mtContextNode metaStateInfo_getContext (metaStateInfo p_info) /*@*/ ; | |
81 | extern /*@observer@*/ cstring metaStateInfo_getName (metaStateInfo p_info) /*@*/ ; | |
82 | extern /*@observer@*/ fileloc metaStateInfo_getLoc (metaStateInfo p_info) /*@*/ ; | |
83 | ||
84 | extern /*@exposed@*/ stateCombinationTable metaStateInfo_getTransferTable (metaStateInfo p_info) /*@*/ ; | |
85 | ||
86 | extern /*@exposed@*/ stateCombinationTable metaStateInfo_getMergeTable (metaStateInfo p_info) /*@*/ ; | |
87 | ||
88 | extern /*@only@*/ cstring metaStateInfo_unparse (metaStateInfo p_info) /*@*/ ; | |
89 | ||
90 | extern /*@observer@*/ cstring metaStateInfo_unparseValue (metaStateInfo p_info, int p_value) /*@*/ ; | |
91 | ||
92 | extern void metaStateInfo_free (/*@only@*/ metaStateInfo) ; | |
93 | ||
94 | # else | |
95 | # error "Multiple include" | |
96 | # endif | |
97 | ||
98 | ||
99 | ||
100 |