]>
Commit | Line | Data |
---|---|---|
d0e5b01f | 1 | typedef enum |
2 | { | |
3 | LT, LTE, GT, GTE, EQ, NONNEGATIVE, POSITIVE | |
4 | } | |
5 | arithType; | |
6 | ||
7 | typedef enum | |
8 | { | |
9 | BUFFSIZE, STRINGLEN, VALUE | |
10 | } | |
11 | constraintType; | |
12 | ||
13 | typedef struct constraint { | |
14 | exprNode expr1; | |
15 | exprNode expr2; | |
16 | arithType restriction; | |
17 | constraintType kind; | |
18 | } constraint; | |
19 | ||
20 | ||
21 | #define max_constraints 10 | |
22 | ||
23 | struct _constraintList { | |
24 | constraint constraints[max_constraints]; | |
25 | int numconstraints; | |
26 | } ; | |
27 | ||
28 | typedef struct _constraintList *constraintList; | |
29 | typedef struct _constraintList constraintList_; | |
30 | ||
31 | /*@constant null constraintList constraintList_undefined; @*/ | |
32 | # define constraintList_undefined ((constraintList) NULL) | |
33 | # define constraintList_isDefined(s) ((s) != constraintList_undefined) | |
34 | # define constraintList_isUndefined(s) ((s) == constraintList_undefined) | |
35 | //# define constraintList_isEmpty(s) (constraint_size(s) == 0) | |
36 | ||
37 | constraintList constraintList_new (); | |
38 | constraintList constraintList_init (constraintList); | |
39 | constraintList constraintList_add (constraintList, constraint); | |
40 | constraintList constraintList_merge (constraintList, constraintList); | |
41 | constraintList constraintList_exprNodemerge (exprNode, exprNode); | |
42 | ||
43 | void constraintList_print (constraintList); | |
44 | ||
45 | constraint constraint_create (exprNode e1, exprNode e2, arithType restriction, constraintType kind); | |
46 | extern cstring exprNode_generateConstraints (exprNode e); |