]>
Commit | Line | Data |
---|---|---|
f7d4d87a | 1 | /* Token type definitions for bison's input reader, |
62ab6972 | 2 | Copyright 1984, 1989, 1992, 2000, 2001 Free Software Foundation, Inc. |
abadc117 AD |
3 | |
4 | This file is part of Bison, the GNU Compiler Compiler. | |
5 | ||
6 | Bison is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2, or (at your option) | |
9 | any later version. | |
10 | ||
11 | Bison is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with Bison; see the file COPYING. If not, write to | |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
19 | Boston, MA 02111-1307, USA. */ | |
20 | ||
21 | #ifndef LEX_H_ | |
22 | # define LEX_H_ | |
23 | ||
24 | /* Token-type codes. */ | |
511e79b3 AD |
25 | typedef enum token_e |
26 | { | |
342b8b6e | 27 | tok_undef, /* Not defined. Used to initial token_t vars. */ |
511e79b3 AD |
28 | tok_eof, |
29 | tok_identifier, | |
30 | tok_comma, | |
31 | tok_colon, | |
32 | tok_semicolon, | |
33 | tok_bar, | |
34 | tok_left_curly, | |
35 | tok_two_percents, | |
36 | tok_percent_left_curly, | |
37 | tok_token, | |
38 | tok_nterm, | |
39 | tok_guard, | |
40 | tok_type, | |
41 | tok_union, | |
42 | tok_start, | |
43 | tok_left, | |
44 | tok_right, | |
45 | tok_nonassoc, | |
46 | tok_prec, | |
47 | tok_typename, | |
48 | tok_number, | |
49 | tok_expect, | |
50 | tok_thong, | |
dd3127cf | 51 | tok_define, |
2ba3b73c | 52 | tok_skel, |
511e79b3 | 53 | tok_noop, |
951366c1 AD |
54 | tok_intopt, |
55 | tok_stropt, | |
62ab6972 AD |
56 | tok_illegal, |
57 | tok_obsolete | |
511e79b3 | 58 | } token_t; |
abadc117 | 59 | |
951366c1 | 60 | extern char *token_buffer; |
0d6508ef AD |
61 | extern bucket *symval; |
62 | extern int numval; | |
340ef489 | 63 | |
342b8b6e AD |
64 | void lex_init PARAMS ((void)); |
65 | void lex_free PARAMS ((void)); | |
abadc117 | 66 | int skip_white_space PARAMS ((void)); |
342b8b6e | 67 | void unlex PARAMS ((token_t)); |
f282676b | 68 | void read_type_name PARAMS ((FILE *fin)); |
abadc117 AD |
69 | |
70 | /* Return one of the token-type codes. When an identifier is seen, | |
71 | the code IDENTIFIER is returned and the name is looked up in the | |
72 | symbol table using symtab.c; symval is set to a pointer to the | |
73 | entry found. */ | |
74 | ||
511e79b3 | 75 | token_t lex PARAMS ((void)); |
abadc117 | 76 | |
342b8b6e | 77 | token_t parse_percent_token PARAMS ((void)); |
abadc117 | 78 | |
abadc117 | 79 | #endif /* !LEX_H_ */ |