]>
Commit | Line | Data |
---|---|---|
28bf4b0b | 1 | /* |
2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. | |
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 */ | |
33 | int default_ref; | |
34 | int default_parameter; | |
35 | ||
36 | /* context */ | |
37 | mtContextNode context; | |
38 | } ; | |
39 | ||
40 | /* in forwardTypes: abst_typedef null struct _metaStateInfo *metaStateInfo; */ | |
41 | ||
42 | /*@constant null metaStateInfo metaStateInfo_undefined; @*/ | |
43 | # define metaStateInfo_undefined ((metaStateInfo) NULL) | |
44 | ||
45 | extern /*@falsenull@*/ bool metaStateInfo_isDefined (metaStateInfo) /*@*/ ; | |
46 | # define metaStateInfo_isDefined(p_info) ((p_info) != NULL) | |
47 | ||
48 | extern /*@truenull@*/ bool metaStateInfo_isUndefined (metaStateInfo) /*@*/ ; | |
49 | # define metaStateInfo_isUndefined(p_info) ((p_info) == NULL) | |
50 | ||
51 | extern /*@notnull@*/ metaStateInfo | |
52 | metaStateInfo_create (/*@only@*/ cstring p_name, | |
53 | /*@only@*/ cstringList p_valueNames, | |
54 | /*@only@*/ mtContextNode p_context, | |
55 | /*@only@*/ stateCombinationTable p_sctable, | |
56 | /*@only@*/ stateCombinationTable p_mergetable, | |
57 | /*@only@*/ fileloc p_loc) ; | |
58 | ||
3120b462 | 59 | extern bool metaStateInfo_equal (metaStateInfo p_m1, metaStateInfo p_m2) /*@*/ ; |
60 | # define metaStateInfo_equal(m1,m2) ((m1) == (m2)) | |
61 | ||
28bf4b0b | 62 | extern void metaStateInfo_setDefaultRefValue (metaStateInfo p_info, int p_val) |
63 | /*@modifies p_info@*/ ; | |
64 | ||
65 | extern void metaStateInfo_setDefaultParamValue (metaStateInfo p_info, int p_val) | |
66 | /*@modifies p_info@*/ ; | |
67 | ||
68 | extern int metaStateInfo_getDefaultValue (metaStateInfo p_info, sRef p_s) /*@*/ ; | |
69 | ||
70 | extern int metaStateInfo_getDefaultRefValue (metaStateInfo p_info) /*@*/ ; | |
71 | extern int metaStateInfo_getDefaultParamValue (metaStateInfo p_info) /*@*/ ; | |
72 | extern int metaStateInfo_getDefaultGlobalValue (metaStateInfo p_info) /*@*/ ; | |
73 | ||
74 | extern /*@observer@*/ mtContextNode metaStateInfo_getContext (metaStateInfo p_info) /*@*/ ; | |
75 | extern /*@observer@*/ cstring metaStateInfo_getName (metaStateInfo p_info) /*@*/ ; | |
76 | extern /*@observer@*/ fileloc metaStateInfo_getLoc (metaStateInfo p_info) /*@*/ ; | |
77 | ||
78 | extern /*@exposed@*/ stateCombinationTable metaStateInfo_getTransferTable (metaStateInfo p_info) /*@*/ ; | |
79 | ||
80 | extern /*@exposed@*/ stateCombinationTable metaStateInfo_getMergeTable (metaStateInfo p_info) /*@*/ ; | |
81 | ||
82 | extern /*@only@*/ cstring metaStateInfo_unparse (metaStateInfo p_info) /*@*/ ; | |
83 | ||
84 | extern /*@observer@*/ cstring metaStateInfo_unparseValue (metaStateInfo p_info, int p_value) /*@*/ ; | |
85 | ||
86 | extern void metaStateInfo_free (/*@only@*/ metaStateInfo) ; | |
87 | ||
88 | # else | |
89 | # error "Multiple include" | |
90 | # endif | |
91 | ||
92 | ||
93 | ||
94 |