]>
Commit | Line | Data |
---|---|---|
92c4a786 | 1 | #ifndef __constraintTerm_h__ |
2 | ||
3 | #define __constraintTerm_h__ | |
4 | ||
6e88de2d | 5 | typedef union |
6 | { | |
4ab867d6 | 7 | /*@exposed@*/ exprNode expr; |
8 | /*@exposed@*/ sRef sref; | |
6e88de2d | 9 | int intlit; |
10 | } constraintTermValue; | |
dc92450f | 11 | |
6e88de2d | 12 | void constraintTermValue_copy (/*@out@*/ constraintTermValue src, constraintTermValue dst); |
92c4a786 | 13 | |
84c9ffbf | 14 | /*@-macroassign*/ |
15 | ||
6e88de2d | 16 | #define constraintTermValue_copy(dst, src) ((dst) = (src)) |
92c4a786 | 17 | |
84c9ffbf | 18 | /*@=macroassign*/ |
19 | ||
6e88de2d | 20 | typedef enum |
21 | { | |
22 | ERRORBADCONSTRAINTTERMTYPE, | |
23 | EXPRNODE, SREF, | |
24 | INTLITERAL | |
25 | } constraintTermType; | |
361091cc | 26 | |
6e88de2d | 27 | struct _constraintTerm { |
4ab867d6 | 28 | /*@only@*/ fileloc loc; |
920a3797 | 29 | constraintTermValue value; |
6e88de2d | 30 | constraintTermType kind; |
31 | }; | |
92c4a786 | 32 | |
33 | ||
6e88de2d | 34 | abst_typedef struct _constraintTerm * constraintTerm; |
92c4a786 | 35 | |
2934b455 | 36 | extern constraintTermType constraintTerm_getKind (constraintTerm) ; |
37 | extern /*@exposed@*/ sRef constraintTerm_getSRef (constraintTerm) ; | |
92c4a786 | 38 | |
a8e557d3 | 39 | extern /*@falsenull@*/ bool constraintTerm_isDefined (constraintTerm p_e) /*@*/; |
40 | extern /*@unused@*/ /*@truenull@*/ bool constraintTerm_isUndefined (constraintTerm p_e) /*@*/ ; | |
84c9ffbf | 41 | extern /*@unused@*/ /*@truenull@*/ bool constraintTerm_isError (constraintTerm p_e) /*@*/ ; |
a8e557d3 | 42 | |
84c9ffbf | 43 | /*@constant null constraintTerm constraintTerm_undefined; @*/ |
a8e557d3 | 44 | |
45 | # define constraintTerm_undefined ((constraintTerm)NULL) | |
46 | ||
47 | # define constraintTerm_isDefined(e) ((e) != constraintTerm_undefined) | |
48 | # define constraintTerm_isUndefined(e) ((e) == constraintTerm_undefined) | |
49 | # define constraintTerm_isError(e) ((e) == constraintTerm_undefined) | |
50 | ||
51 | ||
52 | ||
d46ce6a4 | 53 | void constraintTerm_free (/*@only@*/ constraintTerm term); |
a8e557d3 | 54 | |
6e88de2d | 55 | constraintTerm constraintTerm_simplify (/*@returned@*/ constraintTerm term) /*@modifies term@*/ ; |
361091cc | 56 | |
4ab867d6 | 57 | /*@only@*/ constraintTerm constraintTerm_makeExprNode (/*@exposed@*/ exprNode e) /*@*/; |
361091cc | 58 | |
6e88de2d | 59 | constraintTerm constraintTerm_copy (constraintTerm term) /*@*/; |
361091cc | 60 | |
361091cc | 61 | |
920a3797 | 62 | /*@i1*/ //bool constraintTerm_same (constraintTerm term1, constraintTerm term2) /*@*/; |
361091cc | 63 | |
6e88de2d | 64 | bool constraintTerm_similar (constraintTerm term1, constraintTerm term2) /*@*/; |
361091cc | 65 | |
6e88de2d | 66 | bool constraintTerm_canGetValue (constraintTerm term)/*@*/; |
67 | int constraintTerm_getValue (constraintTerm term) /*@*/; | |
361091cc | 68 | |
6e88de2d | 69 | fileloc constraintTerm_getFileloc (constraintTerm t) /*@*/; |
361091cc | 70 | |
ef2aa32a | 71 | |
6e88de2d | 72 | bool constraintTerm_isIntLiteral (constraintTerm term) /*@*/; |
dc92450f | 73 | |
6e88de2d | 74 | cstring constraintTerm_print (constraintTerm term) /*@*/; |
ef2aa32a | 75 | |
4ab867d6 | 76 | constraintTerm constraintTerm_makesRef (/*@exposed@*/ sRef s) /*@*/; |
ef2aa32a | 77 | |
bb25bea6 | 78 | /*@unused@*/ bool constraintTerm_probSame (constraintTerm term1, constraintTerm term2) /*@*/; |
ef2aa32a | 79 | |
6e88de2d | 80 | constraintTerm constraintTerm_setFileloc (/*@returned@*/ constraintTerm term, fileloc loc) /*@modifies term@*/; |
92c4a786 | 81 | |
6e88de2d | 82 | constraintTerm constraintTerm_makeIntLiteral (int i) /*@*/; |
92c4a786 | 83 | |
6e88de2d | 84 | bool constraintTerm_isStringLiteral (constraintTerm c) /*@*/; |
85 | cstring constraintTerm_getStringLiteral (constraintTerm c) /*@*/; | |
92c4a786 | 86 | |
a8e557d3 | 87 | |
bb25bea6 | 88 | constraintTerm constraintTerm_doSRefFixBaseParam (/*@returned@*/ constraintTerm term, exprNodeList arglist) /*@modifies term@*/; |
92c4a786 | 89 | |
920a3797 | 90 | void constraintTerm_dump ( /*@observer@*/ constraintTerm t, FILE *f); |
91 | ||
92 | /*@only@*/ constraintTerm constraintTerm_undump ( FILE *f); | |
93 | ||
6e88de2d | 94 | #else |
92c4a786 | 95 | |
6e88de2d | 96 | #error Multiple Include |
361091cc | 97 | |
6e88de2d | 98 | #endif |