]>
Commit | Line | Data |
---|---|---|
a70083a3 | 1 | /* Input parser for bison |
76514394 | 2 | Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. |
a70083a3 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 READER_H_ | |
22 | # define READER_H_ | |
23 | ||
56c47203 | 24 | # include "symlist.h" |
e9955c83 AD |
25 | # include "parse-gram.h" |
26 | ||
e9955c83 AD |
27 | typedef struct gram_control_s |
28 | { | |
29 | int errcode; | |
30 | } gram_control_t; | |
31 | ||
32 | /* From the scanner. */ | |
33 | extern FILE *gram_in; | |
34 | extern int gram__flex_debug; | |
4cdb01db | 35 | void scanner_last_string_free PARAMS ((void)); |
1d6412ad | 36 | void scanner_initialize PARAMS ((void)); |
4cdb01db | 37 | void scanner_free PARAMS ((void)); |
e9955c83 AD |
38 | |
39 | # define YY_DECL \ | |
0c15323d | 40 | int gram_lex (yystype *yylval, location_t *yylloc, \ |
e9955c83 AD |
41 | gram_control_t *yycontrol) |
42 | YY_DECL; | |
43 | ||
44 | ||
45 | /* From the parser. */ | |
46 | extern int gram_debug; | |
47 | void gram_error (gram_control_t *control, | |
0c15323d | 48 | location_t *loc, const char *msg); |
e9955c83 AD |
49 | int gram_parse (void *control); |
50 | ||
9280d3ef AD |
51 | /* The sort of braced code we are in. */ |
52 | typedef enum braced_code_e | |
53 | { | |
54 | action_braced_code, | |
366eea36 AD |
55 | destructor_braced_code, |
56 | printer_braced_code | |
9280d3ef AD |
57 | } braced_code_t; |
58 | /* FIXME: This is really a dirty hack which demonstrates that we | |
59 | should probably not try to parse the actions now. */ | |
60 | extern braced_code_t current_braced_code; | |
61 | ||
e9955c83 AD |
62 | |
63 | /* From reader.c. */ | |
8efe435c | 64 | void grammar_start_symbol_set PARAMS ((symbol_t *s, location_t l)); |
e9955c83 AD |
65 | void prologue_augment PARAMS ((const char *prologue, location_t location)); |
66 | void epilogue_set PARAMS ((const char *epilogue, location_t location)); | |
8efe435c AD |
67 | void grammar_symbol_append PARAMS ((symbol_t *s, location_t l)); |
68 | void grammar_rule_begin PARAMS ((symbol_t *lhs, location_t l)); | |
69 | void grammar_rule_end PARAMS ((location_t l)); | |
e9955c83 AD |
70 | void grammar_midrule_action PARAMS ((void)); |
71 | void grammar_current_rule_prec_set PARAMS ((symbol_t *precsym)); | |
8efe435c AD |
72 | void grammar_current_rule_symbol_append PARAMS ((symbol_t *symbol, |
73 | location_t l)); | |
e9955c83 | 74 | void grammar_current_rule_action_append PARAMS ((const char *action, |
8efe435c | 75 | location_t l)); |
56c47203 | 76 | extern symbol_list_t *current_rule; |
e9955c83 | 77 | void reader PARAMS ((void)); |
9280d3ef | 78 | extern int typed; |
a70083a3 AD |
79 | |
80 | #endif /* !READER_H_ */ |