]>
Commit | Line | Data |
---|---|---|
a70083a3 | 1 | /* Input parser for bison |
0aa32d51 | 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 | ||
0aa32d51 | 24 | # include "location.h" |
56c47203 | 25 | # include "symlist.h" |
5b2dd224 | 26 | |
e9955c83 AD |
27 | # include "parse-gram.h" |
28 | ||
676385e2 PH |
29 | typedef struct merger_list |
30 | { | |
31 | struct merger_list* next; | |
5b2dd224 PE |
32 | uniqstr name; |
33 | uniqstr type; | |
34 | } merger_list; | |
676385e2 | 35 | |
e9955c83 AD |
36 | /* From the scanner. */ |
37 | extern FILE *gram_in; | |
38 | extern int gram__flex_debug; | |
0aa32d51 | 39 | extern boundary scanner_cursor; |
d33cb3ae PE |
40 | void scanner_initialize (void); |
41 | void scanner_free (void); | |
7ec2d4cd | 42 | void scanner_last_string_free (void); |
e9955c83 | 43 | |
5b2dd224 | 44 | # define YY_DECL int gram_lex (yystype *val, location *loc) |
e9955c83 AD |
45 | YY_DECL; |
46 | ||
47 | ||
48 | /* From the parser. */ | |
49 | extern int gram_debug; | |
f6d03984 | 50 | int gram_parse (void); |
e9955c83 | 51 | |
9280d3ef | 52 | /* The sort of braced code we are in. */ |
5b2dd224 | 53 | typedef enum |
9280d3ef AD |
54 | { |
55 | action_braced_code, | |
366eea36 AD |
56 | destructor_braced_code, |
57 | printer_braced_code | |
5b2dd224 | 58 | } braced_code; |
9280d3ef AD |
59 | /* FIXME: This is really a dirty hack which demonstrates that we |
60 | should probably not try to parse the actions now. */ | |
5b2dd224 | 61 | extern braced_code current_braced_code; |
9280d3ef | 62 | |
e9955c83 AD |
63 | |
64 | /* From reader.c. */ | |
5b2dd224 PE |
65 | void grammar_start_symbol_set (symbol *s, location loc); |
66 | void prologue_augment (const char *prologue, location loc); | |
67 | void epilogue_augment (const char *epilogue, location loc); | |
68 | void grammar_symbol_append (symbol *s, location loc); | |
69 | void grammar_rule_begin (symbol *lhs, location loc); | |
70 | void grammar_rule_end (location loc); | |
d33cb3ae | 71 | void grammar_midrule_action (void); |
5b2dd224 PE |
72 | void grammar_current_rule_prec_set (symbol *precsym, location loc); |
73 | void grammar_current_rule_dprec_set (int dprec, location loc); | |
74 | void grammar_current_rule_merge_set (uniqstr name, location loc); | |
d33cb3ae | 75 | |
5b2dd224 PE |
76 | void grammar_current_rule_symbol_append (symbol *sym, location loc); |
77 | void grammar_current_rule_action_append (const char *action, location loc); | |
78 | extern symbol_list *current_rule; | |
d33cb3ae PE |
79 | void reader (void); |
80 | void free_merger_functions (void); | |
676385e2 PH |
81 | |
82 | extern merger_list *merge_functions; | |
83 | ||
9280d3ef | 84 | extern int typed; |
a70083a3 AD |
85 | |
86 | #endif /* !READER_H_ */ |