2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
6 # ifndef termNodeLIST_H
7 # define termNodeLIST_H
9 typedef /*@only@*/ termNode o_termNode;
17 /*@dependent@*/ /*@reldef@*/ /*@relnull@*/ o_termNode *elements;
18 /*@only@*/ /*@reldef@*/ /*@relnull@*/ o_termNode *elementsroot;
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++);
27 # define end_termNodeList_elements }}
29 extern int termNodeList_size (/*@sef@*/ termNodeList);
30 # define termNodeList_size(s) (termNodeList_isDefined (s) ? (s)->nelements : 0)
32 extern bool termNodeList_empty (/*@sef@*/ termNodeList);
33 # define termNodeList_empty(s) (termNodeList_size(s) == 0)
35 extern /*@falsenull@*/ bool termNodeList_isDefined (termNodeList p_t);
36 # define termNodeList_isDefined(s) ((s) != (termNodeList) 0)
38 extern /*@only@*/ termNodeList termNodeList_new(void);
39 extern termNodeList termNodeList_push (/*@returned@*/ termNodeList p_s,
40 /*@keep@*/ termNode p_el) ;
42 extern void termNodeList_addh (termNodeList p_s, /*@keep@*/ termNode p_el) ;
43 extern void termNodeList_addl (termNodeList p_s, /*@keep@*/ termNode p_el) ;
45 extern void termNodeList_reset (termNodeList p_s)
47 extern void termNodeList_finish (termNodeList p_s)
49 extern void termNodeList_advance (termNodeList p_s)
52 extern /*@exposed@*/ termNode termNodeList_getN (termNodeList p_s, int p_n) /*@*/ ;
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);
59 extern void termNodeList_free (/*@only@*/ termNodeList p_s) ;
61 extern /*@exposed@*/ termNode termNodeList_head (termNodeList p_s) ;
62 extern /*@exposed@*/ termNode termNodeList_current (termNodeList p_s) ;
64 extern /*@only@*/ termNodeList termNodeList_copy (termNodeList p_s) ;
66 /*@constant int termNodeListGROWLOW;@*/
67 # define termNodeListGROWLOW 4 /* addl used in abstract.c */
69 /*@constant int termNodeListGROWHI;@*/
70 # define termNodeListGROWHI 4
72 /*@constant int termNodeListBASESIZE;@*/
73 # define termNodeListBASESIZE (termNodeListGROWLOW + termNodeListGROWHI)
76 # error "Multiple include"