]>
Commit | Line | Data |
---|---|---|
ef4479de PE |
1 | /* Input parser for Bison |
2 | ||
57beea57 | 3 | Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. |
a70083a3 AD |
4 | |
5 | This file is part of Bison, the GNU Compiler Compiler. | |
6 | ||
7 | Bison is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2, or (at your option) | |
10 | any later version. | |
11 | ||
12 | Bison is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with Bison; see the file COPYING. If not, write to | |
0fb669f9 PE |
19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 | Boston, MA 02110-1301, USA. */ | |
a70083a3 AD |
21 | |
22 | #ifndef READER_H_ | |
23 | # define READER_H_ | |
24 | ||
0aa32d51 | 25 | # include "location.h" |
56c47203 | 26 | # include "symlist.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; | |
35 | } merger_list; | |
676385e2 | 36 | |
e9955c83 AD |
37 | /* From the scanner. */ |
38 | extern FILE *gram_in; | |
39 | extern int gram__flex_debug; | |
0aa32d51 | 40 | extern boundary scanner_cursor; |
25005f6a | 41 | extern int max_left_semantic_context; |
d33cb3ae PE |
42 | void scanner_initialize (void); |
43 | void scanner_free (void); | |
7ec2d4cd | 44 | void scanner_last_string_free (void); |
e9955c83 | 45 | |
04098407 PE |
46 | /* These are declared by the scanner, but not used. We put them here |
47 | to pacify "make syntax-check". */ | |
48 | extern FILE *gram_out; | |
49 | extern int gram_lineno; | |
50 | ||
5b25cd7c | 51 | # define YY_DECL int gram_lex (YYSTYPE *val, location *loc) |
e9955c83 AD |
52 | YY_DECL; |
53 | ||
54 | ||
55 | /* From the parser. */ | |
56 | extern int gram_debug; | |
f6d03984 | 57 | int gram_parse (void); |
ef4479de | 58 | char const *token_name (int); |
9280d3ef | 59 | |
e9955c83 AD |
60 | |
61 | /* From reader.c. */ | |
a737b216 | 62 | void grammar_start_symbol_set (symbol *sym, location loc); |
5b2dd224 | 63 | void prologue_augment (const char *prologue, location loc); |
8f3596a6 AD |
64 | void grammar_current_rule_begin (symbol *lhs, location loc); |
65 | void grammar_current_rule_end (location loc); | |
5b2dd224 PE |
66 | void grammar_current_rule_prec_set (symbol *precsym, location loc); |
67 | void grammar_current_rule_dprec_set (int dprec, location loc); | |
68 | void grammar_current_rule_merge_set (uniqstr name, location loc); | |
5b2dd224 PE |
69 | void grammar_current_rule_symbol_append (symbol *sym, location loc); |
70 | void grammar_current_rule_action_append (const char *action, location loc); | |
71 | extern symbol_list *current_rule; | |
d33cb3ae PE |
72 | void reader (void); |
73 | void free_merger_functions (void); | |
676385e2 PH |
74 | |
75 | extern merger_list *merge_functions; | |
76 | ||
affac613 | 77 | /* Was %union seen? */ |
d0829076 | 78 | extern bool typed; |
affac613 AD |
79 | |
80 | /* Should rules have a default precedence? */ | |
39a06c25 | 81 | extern bool default_prec; |
a70083a3 AD |
82 | |
83 | #endif /* !READER_H_ */ |