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