]>
Commit | Line | Data |
---|---|---|
28bf4b0b | 1 | /* |
2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. | |
3 | ** See ../LICENSE for license information. | |
4 | ** | |
5 | */ | |
6 | /* | |
7 | ** mttok.h | |
8 | */ | |
9 | ||
10 | # ifndef MTTOK_H | |
11 | # define MTTOK_H | |
12 | ||
13 | struct s_mttok | |
14 | { | |
15 | int tok; | |
16 | cstring text; | |
17 | fileloc loc; | |
18 | } ; | |
19 | ||
20 | /* in forwardTypes.h: abst_typedef struct _mttok *mttok; */ | |
21 | ||
22 | extern mttok mttok_create (int p_tok, | |
23 | /*@only@*/ cstring p_text, | |
24 | /*@only@*/ fileloc p_loc) /*@modifies nothing@*/ ; | |
25 | extern /*@only@*/ cstring mttok_unparse (mttok p_tok) /*@*/ ; | |
26 | ||
27 | extern void mttok_free (/*@only@*/ mttok p_t) ; | |
28 | ||
29 | extern int mttok_getTok (mttok p_t) /*@*/ ; | |
30 | # define mttok_getTok(t) ((t)->tok) | |
31 | ||
32 | extern /*@dependent@*/ /*@exposed@*/ fileloc mttok_getLoc (mttok p_t) /*@*/ ; | |
33 | # define mttok_getLoc(t) ((t)->loc) | |
34 | ||
35 | extern /*@only@*/ fileloc mttok_stealLoc (mttok p_t) /*@modifies p_t@*/ ; | |
36 | ||
37 | extern /*@only@*/ cstring mttok_getText (mttok p_t) /*@*/ ; | |
38 | # define mttok_getText(t) (cstring_copy ((t)->text)) | |
39 | ||
40 | extern /*@observer@*/ cstring mttok_observeText (mttok p_t) /*@*/ ; | |
41 | # define mttok_observeText(t) ((t)->text) | |
42 | ||
43 | extern bool mttok_isIdentifier (mttok p_t) /*@*/ ; | |
b072092f | 44 | extern bool mttok_isError (mttok p_t) /*@*/ ; |
28bf4b0b | 45 | |
46 | # else | |
47 | # error "Multiple include" | |
48 | # endif |