]> git.saurik.com Git - bison.git/blame - src/lex.h
* src/files.c (strsuffix): New.
[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. */
25# define ENDFILE 0
26# define IDENTIFIER 1
27# define COMMA 2
28# define COLON 3
29# define SEMICOLON 4
30# define BAR 5
31# define LEFT_CURLY 6
32# define TWO_PERCENTS 7
33# define PERCENT_LEFT_CURLY 8
34# define TOKEN 9
35# define NTERM 10
36# define GUARD 11
37# define TYPE 12
38# define UNION 13
39# define START 14
40# define LEFT 15
41# define RIGHT 16
42# define NONASSOC 17
43# define PREC 18
44# define SEMANTIC_PARSER 19
45# define PURE_PARSER 20
46# define TYPENAME 21
47# define NUMBER 22
48# define EXPECT 23
49# define THONG 24
50# define NOOP 25
51# define SETOPT 26
52# define ILLEGAL 27
53
54# define MAXTOKEN 1024
55
340ef489
AD
56
57/* Allocated size of token_buffer, not including space for terminator. */
58extern int maxtoken;
59extern char *token_buffer;
abadc117 60char *grow_token_buffer PARAMS ((char *));
340ef489
AD
61
62void init_lex PARAMS ((void));
abadc117
AD
63int skip_white_space PARAMS ((void));
64void unlex PARAMS ((int));
f282676b 65void read_type_name PARAMS ((FILE *fin));
abadc117
AD
66
67/* Return one of the token-type codes. When an identifier is seen,
68 the code IDENTIFIER is returned and the name is looked up in the
69 symbol table using symtab.c; symval is set to a pointer to the
70 entry found. */
71
72int lex PARAMS ((void));
73
74int parse_percent_token PARAMS ((void));
75
340ef489
AD
76extern bucket *symval;
77extern int numval;
abadc117
AD
78
79#endif /* !LEX_H_ */