]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
28bf4b0b | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. |
885824d3 | 3 | ** See ../LICENSE for license information. |
4 | ** | |
5 | */ | |
6 | # ifndef EKIND_H | |
7 | # define EKIND_H | |
8 | ||
9 | /* need to maintain compatibility with libraries */ | |
10 | ||
11 | immut_typedef enum { | |
12 | KINVALID = -1, | |
13 | KDATATYPE = 0, /* must dump datatypes first, so ctypes are ok */ | |
14 | KCONST, KENUMCONST, | |
15 | KVAR, KFCN, KITER, KENDITER, | |
16 | KSTRUCTTAG, KUNIONTAG, KENUMTAG, | |
17 | KELIPSMARKER | |
18 | } ekind; | |
19 | ||
20 | /*@constant ekind KELAST;@*/ | |
21 | # define KELAST KELIPSMARKER | |
22 | ||
28bf4b0b | 23 | /*@constant int KGLOBALMARKER;@*/ |
24 | # define KGLOBALMARKER ((int) KELAST + 1) | |
25 | ||
885824d3 | 26 | extern bool ekind_equal (ekind, ekind) /*@*/ ; |
27 | # define ekind_equal(e1, e2) ((e1) == (e2)) | |
28 | ||
29 | extern ekind ekind_fromInt (int p_i) /*@*/ ; | |
30 | extern int ekind_toInt (ekind p_k) /*@*/ ; | |
31 | ||
32 | extern bool ekind_isFunction (ekind p_k) /*@*/ ; | |
33 | # define ekind_isFunction(k) ((k) == KFCN) | |
34 | ||
35 | extern /*@unused@*/ bool ekind_isVariable (ekind p_k) /*@*/ ; | |
36 | # define ekind_isVariable(k) ((k) == KVAR) | |
37 | ||
38 | extern bool ekind_isElipsis (ekind p_k) /*@*/ ; | |
39 | # define ekind_isElipsis(k) ((k) == KELIPSMARKER) | |
40 | ||
41 | extern bool ekind_isConst (ekind p_k) /*@*/ ; | |
42 | # define ekind_isConst(k) ((k) == KCONST) | |
43 | ||
44 | extern bool ekind_isEnumConst (ekind p_k) /*@*/ ; | |
45 | # define ekind_isEnumConst(k) ((k) == KENUMCONST) | |
46 | ||
47 | # define ekind_toInt(k) ((int)(k)) | |
48 | ||
49 | /*@constant ekind ekind_variable; @*/ | |
50 | # define ekind_variable ((ekind)KVAR) | |
51 | ||
52 | /*@constant ekind ekind_function; @*/ | |
53 | # define ekind_function ((ekind)KFCN) | |
54 | ||
55 | extern /*@observer@*/ cstring ekind_capName (ekind p_k) /*@*/ ; | |
56 | extern /*@observer@*/ cstring ekind_unparse (ekind p_k) /*@*/ ; | |
57 | extern /*@observer@*/ cstring ekind_unparseLong (ekind p_k) /*@*/ ; | |
58 | ||
59 | # else | |
60 | # error "Multiple include" | |
61 | # endif |