]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
c0de361f | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003. |
885824d3 | 3 | ** See ../LICENSE for license information. |
4 | */ | |
5 | ||
6 | # ifndef termNodeLIST_H | |
7 | # define termNodeLIST_H | |
8 | ||
9 | typedef /*@only@*/ termNode o_termNode; | |
10 | ||
28bf4b0b | 11 | struct s_termNodeList |
885824d3 | 12 | { |
13 | int nelements; | |
14 | int nspacehigh; | |
15 | int nspacelow; | |
16 | int current; | |
17 | /*@dependent@*/ /*@reldef@*/ /*@relnull@*/ o_termNode *elements; | |
18 | /*@only@*/ /*@reldef@*/ /*@relnull@*/ o_termNode *elementsroot; | |
19 | } ; | |
20 | ||
21 | /*@iter termNodeList_elements (sef termNodeList x, yield exposed termNode el); @*/ | |
22 | # define termNodeList_elements(x, m_el) \ | |
23 | { int m_ind; termNode *m_elements = &((x)->elements[0]); \ | |
24 | for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \ | |
25 | { termNode m_el = *(m_elements++); | |
26 | ||
27 | # define end_termNodeList_elements }} | |
28 | ||
29 | extern int termNodeList_size (/*@sef@*/ termNodeList); | |
30 | # define termNodeList_size(s) (termNodeList_isDefined (s) ? (s)->nelements : 0) | |
31 | ||
32 | extern bool termNodeList_empty (/*@sef@*/ termNodeList); | |
33 | # define termNodeList_empty(s) (termNodeList_size(s) == 0) | |
34 | ||
0e41eb0e | 35 | extern /*@falsewhennull@*/ bool termNodeList_isDefined (termNodeList p_t); |
885824d3 | 36 | # define termNodeList_isDefined(s) ((s) != (termNodeList) 0) |
37 | ||
38 | extern /*@only@*/ termNodeList termNodeList_new(void); | |
39 | extern termNodeList termNodeList_push (/*@returned@*/ termNodeList p_s, | |
40 | /*@keep@*/ termNode p_el) ; | |
41 | ||
42 | extern void termNodeList_addh (termNodeList p_s, /*@keep@*/ termNode p_el) ; | |
43 | extern void termNodeList_addl (termNodeList p_s, /*@keep@*/ termNode p_el) ; | |
44 | ||
45 | extern void termNodeList_reset (termNodeList p_s) | |
46 | /*@modifies p_s@*/ ; | |
47 | extern void termNodeList_finish (termNodeList p_s) | |
48 | /*@modifies p_s@*/ ; | |
49 | extern void termNodeList_advance (termNodeList p_s) | |
50 | /*@modifies p_s@*/ ; | |
51 | ||
52 | extern /*@exposed@*/ termNode termNodeList_getN (termNodeList p_s, int p_n) /*@*/ ; | |
53 | ||
54 | extern /*@only@*/ cstring termNodeList_unparse (termNodeList p_s) ; | |
55 | extern /*@only@*/ cstring termNodeList_unparseTail (termNodeList p_s); | |
56 | extern /*@only@*/ cstring termNodeList_unparseToCurrent (termNodeList p_s); | |
57 | extern /*@only@*/ cstring termNodeList_unparseSecondToCurrent (termNodeList p_s); | |
58 | ||
59 | extern void termNodeList_free (/*@only@*/ termNodeList p_s) ; | |
60 | ||
61 | extern /*@exposed@*/ termNode termNodeList_head (termNodeList p_s) ; | |
62 | extern /*@exposed@*/ termNode termNodeList_current (termNodeList p_s) ; | |
63 | ||
64 | extern /*@only@*/ termNodeList termNodeList_copy (termNodeList p_s) ; | |
65 | ||
66 | /*@constant int termNodeListGROWLOW;@*/ | |
67 | # define termNodeListGROWLOW 4 /* addl used in abstract.c */ | |
68 | ||
69 | /*@constant int termNodeListGROWHI;@*/ | |
70 | # define termNodeListGROWHI 4 | |
71 | ||
72 | /*@constant int termNodeListBASESIZE;@*/ | |
73 | # define termNodeListBASESIZE (termNodeListGROWLOW + termNodeListGROWHI) | |
74 | ||
75 | # else | |
76 | # error "Multiple include" | |
77 | # endif | |
78 | ||
79 | ||
80 | ||
81 |