]>
Commit | Line | Data |
---|---|---|
ef4479de PE |
1 | /* Input parser for Bison |
2 | ||
c932d613 | 3 | Copyright (C) 2000-2003, 2005-2007, 2009-2012 Free Software |
ea0a7676 | 4 | Foundation, Inc. |
a70083a3 AD |
5 | |
6 | This file is part of Bison, the GNU Compiler Compiler. | |
7 | ||
f16b0819 | 8 | This program is free software: you can redistribute it and/or modify |
a70083a3 | 9 | it under the terms of the GNU General Public License as published by |
f16b0819 PE |
10 | the Free Software Foundation, either version 3 of the License, or |
11 | (at your option) any later version. | |
a70083a3 | 12 | |
f16b0819 | 13 | This program is distributed in the hope that it will be useful, |
a70083a3 AD |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
f16b0819 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
a70083a3 AD |
20 | |
21 | #ifndef READER_H_ | |
22 | # define READER_H_ | |
23 | ||
0aa32d51 | 24 | # include "location.h" |
56c47203 | 25 | # include "symlist.h" |
7685e2f7 | 26 | # include "named-ref.h" |
5b2dd224 | 27 | |
e9955c83 AD |
28 | # include "parse-gram.h" |
29 | ||
676385e2 PH |
30 | typedef struct merger_list |
31 | { | |
32 | struct merger_list* next; | |
5b2dd224 PE |
33 | uniqstr name; |
34 | uniqstr type; | |
8ee5b538 | 35 | location type_declaration_location; |
5b2dd224 | 36 | } merger_list; |
676385e2 | 37 | |
e9955c83 AD |
38 | /* From the parser. */ |
39 | extern int gram_debug; | |
f6d03984 | 40 | int gram_parse (void); |
6e0f8287 | 41 | char const *token_name (int type); |
9280d3ef | 42 | |
e9955c83 AD |
43 | |
44 | /* From reader.c. */ | |
a737b216 | 45 | void grammar_start_symbol_set (symbol *sym, location loc); |
7685e2f7 AR |
46 | void grammar_current_rule_begin (symbol *lhs, location loc, |
47 | named_ref *lhs_named_ref); | |
8f3596a6 | 48 | void grammar_current_rule_end (location loc); |
6b702268 | 49 | void grammar_midrule_action (void); |
5b2dd224 PE |
50 | void grammar_current_rule_prec_set (symbol *precsym, location loc); |
51 | void grammar_current_rule_dprec_set (int dprec, location loc); | |
52 | void grammar_current_rule_merge_set (uniqstr name, location loc); | |
7685e2f7 | 53 | void grammar_current_rule_symbol_append (symbol *sym, location loc, |
e0992e54 | 54 | named_ref *nref); |
7685e2f7 | 55 | void grammar_current_rule_action_append (const char *action, location loc, |
e0992e54 | 56 | named_ref *nref); |
d33cb3ae PE |
57 | void reader (void); |
58 | void free_merger_functions (void); | |
676385e2 PH |
59 | |
60 | extern merger_list *merge_functions; | |
61 | ||
34f98f46 | 62 | /* Was %union seen? */ |
ddc8ede1 PE |
63 | extern bool union_seen; |
64 | ||
65 | /* Was a tag seen? */ | |
66 | extern bool tag_seen; | |
affac613 AD |
67 | |
68 | /* Should rules have a default precedence? */ | |
39a06c25 | 69 | extern bool default_prec; |
a70083a3 AD |
70 | |
71 | #endif /* !READER_H_ */ |