]> git.saurik.com Git - bison.git/blame - src/lex.h
Add.
[bison.git] / src / lex.h
CommitLineData
f7d4d87a 1/* Token type definitions for bison's input reader,
aa7815f5 2 Copyright 1984, 1989, 1992, 2000 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
25typedef enum token_e
26 {
27 tok_eof,
28 tok_identifier,
29 tok_comma,
30 tok_colon,
31 tok_semicolon,
32 tok_bar,
33 tok_left_curly,
34 tok_two_percents,
35 tok_percent_left_curly,
36 tok_token,
37 tok_nterm,
38 tok_guard,
39 tok_type,
40 tok_union,
41 tok_start,
42 tok_left,
43 tok_right,
44 tok_nonassoc,
45 tok_prec,
46 tok_typename,
47 tok_number,
48 tok_expect,
49 tok_thong,
50 tok_noop,
51 tok_setopt,
52 tok_illegal
53 } token_t;
abadc117 54
340ef489 55extern char *token_buffer;
0d6508ef
AD
56extern bucket *symval;
57extern int numval;
340ef489
AD
58
59void init_lex PARAMS ((void));
abadc117
AD
60int skip_white_space PARAMS ((void));
61void unlex PARAMS ((int));
f282676b 62void read_type_name PARAMS ((FILE *fin));
abadc117
AD
63
64/* Return one of the token-type codes. When an identifier is seen,
65 the code IDENTIFIER is returned and the name is looked up in the
66 symbol table using symtab.c; symval is set to a pointer to the
67 entry found. */
68
511e79b3 69token_t lex PARAMS ((void));
abadc117
AD
70
71int parse_percent_token PARAMS ((void));
72
abadc117 73#endif /* !LEX_H_ */