]>
Commit | Line | Data |
---|---|---|
28bf4b0b | 1 | /* |
c0de361f | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003. |
28bf4b0b | 3 | ** See ../LICENSE for license information. |
4 | ** | |
5 | */ | |
6 | /* | |
7 | ** mtContextNode.h | |
8 | */ | |
9 | ||
10 | # ifndef MTCONTEXTNODE_H | |
11 | # define MTCONTEXTNODE_H | |
12 | ||
13 | typedef enum | |
14 | { | |
b7e84605 | 15 | MTC_ANY = 0, MTC_PARAM, MTC_RESULT, MTC_REFERENCE, MTC_CLAUSE, MTC_LITERAL, MTC_NULL |
28bf4b0b | 16 | } mtContextKind ; |
17 | ||
12f2ffe9 | 18 | /*@constant int MTC_NUMCONTEXTS@*/ |
19 | /*@+enumint@*/ | |
20 | # define MTC_NUMCONTEXTS (MTC_NULL + 1) | |
21 | /*@=enumint@*/ | |
22 | ||
28bf4b0b | 23 | struct s_mtContextNode { |
24 | mtContextKind context; | |
25 | ctype type; /* This state only applies to types matching. */ | |
26 | } ; | |
27 | ||
28 | /*@constant null mtContextNode mtContextNode_undefined@*/ | |
29 | # define mtContextNode_undefined ((mtContextNode) 0) | |
30 | ||
0e41eb0e | 31 | extern /*@falsewhennull@*/ bool mtContextNode_isDefined (mtContextNode p_s) /*@*/ ; |
28bf4b0b | 32 | # define mtContextNode_isDefined(s) ((s) != mtContextNode_undefined) |
33 | ||
34 | extern cstring mtContextNode_unparse (mtContextNode) /*@*/ ; | |
35 | ||
36 | extern mtContextNode mtContextNode_createAny (void) /*@*/ ; | |
37 | extern mtContextNode mtContextNode_createParameter (ctype) /*@*/ ; | |
38 | extern mtContextNode mtContextNode_createReference (ctype) /*@*/ ; | |
b072092f | 39 | extern mtContextNode mtContextNode_createResult (ctype) /*@*/ ; |
28bf4b0b | 40 | extern mtContextNode mtContextNode_createClause (ctype) /*@*/ ; |
12f2ffe9 | 41 | extern mtContextNode mtContextNode_createNull (ctype) /*@*/ ; |
42 | extern mtContextNode mtContextNode_createLiteral (ctype) /*@*/ ; | |
28bf4b0b | 43 | |
44 | extern void mtContextNode_free (/*@only@*/ mtContextNode) ; | |
45 | ||
b072092f | 46 | extern bool mtContextNode_isReference (mtContextNode) /*@*/; |
47 | extern bool mtContextNode_isResult (mtContextNode) /*@*/; | |
28bf4b0b | 48 | extern bool mtContextNode_isParameter (mtContextNode) /*@*/; |
49 | extern bool mtContextNode_isClause (mtContextNode) /*@*/; | |
12f2ffe9 | 50 | extern bool mtContextNode_isLiteral (mtContextNode) /*@*/; |
51 | extern bool mtContextNode_isNull (mtContextNode) /*@*/; | |
28bf4b0b | 52 | |
53 | extern bool mtContextNode_matchesEntry (mtContextNode, uentry) /*@*/ ; | |
54 | extern bool mtContextNode_matchesRef (mtContextNode, sRef) /*@*/ ; | |
55 | ||
56 | extern bool mtContextNode_matchesRefStrict (mtContextNode, sRef) /*@*/ ; | |
57 | /* Doesn't allow matches with unknown type. */ | |
58 | ||
b7e84605 | 59 | extern void mtContextNode_showRefError (mtContextNode, sRef) ; |
60 | ||
28bf4b0b | 61 | # else |
62 | # error "Multiple include" | |
63 | # endif |