2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
9 abst_typedef /*@null@*/ struct
14 /*@reldef@*/ /*@relnull@*/ o_ltoken *elements;
17 /*@iter ltokenList_elements (sef ltokenList x, yield exposed ltoken el); @*/
18 # define ltokenList_elements(x, m_el) \
19 { if (ltokenList_isDefined(x)) { \
20 int m_ind; ltoken *m_elements = &((x)->elements[0]); \
21 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
22 { ltoken m_el; m_el = *m_elements; m_elements++;
24 # define end_ltokenList_elements }}}
27 ** ltokenList_elements is split up to avoid compiler bugs
28 ** and incompatibilities in older C compilers. This has caused problems
29 ** on both RS/AIX and SGI IRIX machines.
32 /*@constant null ltokenList ltokenList_undefined;@*/
33 # define ltokenList_undefined NULL
35 extern /*@falsenull@*/ bool ltokenList_isDefined (ltokenList p_s) /*@*/ ;
36 # define ltokenList_isDefined(s) ((s) != ltokenList_undefined)
38 extern /*@truenull@*/ bool ltokenList_isUndefined (ltokenList p_s) /*@*/ ;
39 # define ltokenList_isUndefined(s) ((s) == ltokenList_undefined)
41 extern int ltokenList_size (/*@sef@*/ ltokenList p_s) /*@*/ ;
42 extern bool ltokenList_empty (/*@sef@*/ ltokenList p_s) /*@*/ ;
43 extern /*@unused@*/ bool ltokenList_isEmpty (/*@sef@*/ ltokenList p_s) /*@*/ ;
45 # define ltokenList_size(s) (ltokenList_isUndefined(s) ? 0 : (s)->nelements)
46 # define ltokenList_empty(s) (ltokenList_isUndefined(s) || ltokenList_size(s) == 0)
47 # define ltokenList_isEmpty(s) (ltokenList_empty(s))
49 extern /*@only@*/ /*@notnull@*/ ltokenList ltokenList_new (void) /*@*/ ;
50 extern void ltokenList_addh (ltokenList p_s, /*@only@*/ ltoken p_el) /*@modifies p_s@*/ ;
52 extern void ltokenList_reset (ltokenList p_s) /*@modifies p_s@*/ ;
53 extern void ltokenList_advance (ltokenList p_s) /*@modifies p_s@*/ ;
55 extern /*@only@*/ cstring ltokenList_unparse (ltokenList p_s) /*@*/ ;
56 extern void ltokenList_free (/*@only@*/ ltokenList p_s) ;
58 extern /*@observer@*/ ltoken ltokenList_head (ltokenList p_s) /*@*/ ;
59 extern /*@observer@*/ ltoken ltokenList_current (ltokenList p_s) /*@*/ ;
61 extern /*@only@*/ ltokenList ltokenList_copy (ltokenList p_s) /*@*/ ;
62 extern /*@only@*/ /*@notnull@*/ ltokenList ltokenList_singleton (/*@only@*/ ltoken p_l);
63 extern ltokenList ltokenList_push (/*@returned@*/ ltokenList p_s, /*@only@*/ ltoken p_el);
64 extern bool ltokenList_equal (ltokenList p_s1, ltokenList p_s2) /*@*/ ;
65 extern bool ltokenList_isFinished (ltokenList p_s) /*@*/ ;
66 extern void ltokenList_removeCurrent (ltokenList p_s) /*@modifies p_s@*/ ;
68 /*@constant int ltokenListBASESIZE;@*/
69 # define ltokenListBASESIZE SMALLBASESIZE
72 # error "Multiple include"