2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
8 ** A record that keeps information on a user-defined state including:
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)
21 struct s_metaStateInfo
{
22 /*@only@*/ cstring name
;
24 /* metaStateKind type; */
25 cstringList valueNames
;
26 stateCombinationTable sctable
;
27 stateCombinationTable mergetable
;
30 int defaultValue
[MTC_NUMCONTEXTS
];
33 mtContextNode context
;
36 /* in forwardTypes: abst_typedef null struct _metaStateInfo *metaStateInfo; */
38 /*@constant null metaStateInfo metaStateInfo_undefined; @*/
39 # define metaStateInfo_undefined ((metaStateInfo) NULL)
41 extern /*@falsewhennull@*/ bool metaStateInfo_isDefined (metaStateInfo
) /*@*/ ;
42 # define metaStateInfo_isDefined(p_info) ((p_info) != NULL)
44 extern /*@nullwhentrue@*/ bool metaStateInfo_isUndefined (metaStateInfo
) /*@*/ ;
45 # define metaStateInfo_isUndefined(p_info) ((p_info) == NULL)
47 extern /*@notnull@*/ metaStateInfo
48 metaStateInfo_create (/*@only@*/ cstring p_name
,
49 /*@only@*/ cstringList p_valueNames
,
50 /*@only@*/ mtContextNode p_context
,
51 /*@only@*/ stateCombinationTable p_sctable
,
52 /*@only@*/ stateCombinationTable p_mergetable
,
53 /*@only@*/ fileloc p_loc
) ;
55 extern bool metaStateInfo_equal (metaStateInfo p_m1
, metaStateInfo p_m2
) /*@*/ ;
56 # define metaStateInfo_equal(m1,m2) ((m1) == (m2))
58 extern int metaStateInfo_getDefaultValueContext (metaStateInfo p_info
, mtContextKind p_context
) /*@*/ ;
59 extern void metaStateInfo_setDefaultValueContext (metaStateInfo p_info
, mtContextKind p_context
, int p_val
) /*@modifies p_info@*/ ;
61 extern void metaStateInfo_setDefaultRefValue (metaStateInfo p_info
, int p_val
)
62 /*@modifies p_info@*/ ;
64 extern int metaStateInfo_getDefaultValue (metaStateInfo p_info
, sRef p_s
) /*@*/ ;
66 extern int metaStateInfo_getDefaultRefValue (metaStateInfo p_info
) /*@*/ ;
67 extern int metaStateInfo_getDefaultGlobalValue (metaStateInfo p_info
) /*@*/ ;
69 extern /*@observer@*/ mtContextNode
metaStateInfo_getContext (metaStateInfo p_info
) /*@*/ ;
70 extern /*@observer@*/ cstring
metaStateInfo_getName (metaStateInfo p_info
) /*@*/ ;
71 extern /*@observer@*/ fileloc
metaStateInfo_getLoc (metaStateInfo p_info
) /*@*/ ;
73 extern /*@exposed@*/ stateCombinationTable
metaStateInfo_getTransferTable (metaStateInfo p_info
) /*@*/ ;
75 extern /*@exposed@*/ stateCombinationTable
metaStateInfo_getMergeTable (metaStateInfo p_info
) /*@*/ ;
77 extern /*@only@*/ cstring
metaStateInfo_unparse (metaStateInfo p_info
) /*@*/ ;
79 extern /*@observer@*/ cstring
metaStateInfo_unparseValue (metaStateInfo p_info
, int p_value
) /*@*/ ;
81 extern void metaStateInfo_free (/*@only@*/ metaStateInfo
) ;
84 # error "Multiple include"