]>
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; |
990ec868 | 25 | } ; |
92c4a786 | 26 | |
990ec868 | 27 | abst_typedef struct _constraintTerm *constraintTerm; |
92c4a786 | 28 | |
2934b455 | 29 | extern constraintTermType constraintTerm_getKind (constraintTerm) ; |
30 | extern /*@exposed@*/ sRef constraintTerm_getSRef (constraintTerm) ; | |
92c4a786 | 31 | |
d46ce6a4 | 32 | void constraintTerm_free (/*@only@*/ constraintTerm term); |
a8e557d3 | 33 | |
6e88de2d | 34 | constraintTerm constraintTerm_simplify (/*@returned@*/ constraintTerm term) /*@modifies term@*/ ; |
361091cc | 35 | |
28bf4b0b | 36 | /*@only@*/ constraintTerm constraintTerm_makeExprNode (/*@dependent@*/ exprNode e) /*@*/; |
361091cc | 37 | |
6e88de2d | 38 | constraintTerm constraintTerm_copy (constraintTerm term) /*@*/; |
361091cc | 39 | |
6e88de2d | 40 | bool constraintTerm_similar (constraintTerm term1, constraintTerm term2) /*@*/; |
361091cc | 41 | |
6e88de2d | 42 | bool constraintTerm_canGetValue (constraintTerm term)/*@*/; |
43 | int constraintTerm_getValue (constraintTerm term) /*@*/; | |
361091cc | 44 | |
6e88de2d | 45 | fileloc constraintTerm_getFileloc (constraintTerm t) /*@*/; |
361091cc | 46 | |
ef2aa32a | 47 | |
6e88de2d | 48 | bool constraintTerm_isIntLiteral (constraintTerm term) /*@*/; |
dc92450f | 49 | |
6e88de2d | 50 | cstring constraintTerm_print (constraintTerm term) /*@*/; |
ef2aa32a | 51 | |
28bf4b0b | 52 | constraintTerm constraintTerm_makesRef (/*@temp@*/ /*@observer@*/ sRef s) /*@*/; |
ef2aa32a | 53 | |
bb25bea6 | 54 | /*@unused@*/ bool constraintTerm_probSame (constraintTerm term1, constraintTerm term2) /*@*/; |
ef2aa32a | 55 | |
6e88de2d | 56 | constraintTerm constraintTerm_setFileloc (/*@returned@*/ constraintTerm term, fileloc loc) /*@modifies term@*/; |
92c4a786 | 57 | |
6e88de2d | 58 | constraintTerm constraintTerm_makeIntLiteral (int i) /*@*/; |
92c4a786 | 59 | |
6e88de2d | 60 | bool constraintTerm_isStringLiteral (constraintTerm c) /*@*/; |
61 | cstring constraintTerm_getStringLiteral (constraintTerm c) /*@*/; | |
92c4a786 | 62 | |
a8e557d3 | 63 | |
bb25bea6 | 64 | constraintTerm constraintTerm_doSRefFixBaseParam (/*@returned@*/ constraintTerm term, exprNodeList arglist) /*@modifies term@*/; |
92c4a786 | 65 | |
920a3797 | 66 | void constraintTerm_dump ( /*@observer@*/ constraintTerm t, FILE *f); |
67 | ||
68 | /*@only@*/ constraintTerm constraintTerm_undump ( FILE *f); | |
69 | ||
28bf4b0b | 70 | /*@=namechecks@*/ |
71 | ||
6e88de2d | 72 | #else |
92c4a786 | 73 | |
6e88de2d | 74 | #error Multiple Include |
361091cc | 75 | |
6e88de2d | 76 | #endif |