1 /* Input parser for Bison
3 Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006 Free Software
6 This file is part of Bison, the GNU Compiler Compiler.
8 Bison is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 Bison is distributed in the hope that it will be useful,
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.
18 You should have received a copy of the GNU General Public License
19 along with Bison; see the file COPYING. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
26 # include "location.h"
29 # include "parse-gram.h"
31 typedef struct merger_list
33 struct merger_list
* next
;
38 /* From the scanner. */
40 extern int gram__flex_debug
;
41 extern boundary scanner_cursor
;
42 extern char *last_string
;
43 extern location last_braced_code_loc
;
44 extern int max_left_semantic_context
;
45 void scanner_initialize (void);
46 void scanner_free (void);
47 void scanner_last_string_free (void);
49 /* These are declared by the scanner, but not used. We put them here
50 to pacify "make syntax-check". */
51 extern FILE *gram_out
;
52 extern int gram_lineno
;
54 # define YY_DECL int gram_lex (YYSTYPE *val, location *loc)
58 /* From the parser. */
59 extern int gram_debug
;
60 int gram_parse (void);
61 char const *token_name (int);
65 void grammar_start_symbol_set (symbol
*sym
, location loc
);
66 void prologue_augment (const char *prologue
, location loc
);
67 void grammar_current_rule_begin (symbol
*lhs
, location loc
);
68 void grammar_current_rule_end (location loc
);
69 void grammar_midrule_action (void);
70 void grammar_current_rule_prec_set (symbol
*precsym
, location loc
);
71 void grammar_current_rule_dprec_set (int dprec
, location loc
);
72 void grammar_current_rule_merge_set (uniqstr name
, location loc
);
73 void grammar_current_rule_symbol_append (symbol
*sym
, location loc
);
74 void grammar_current_rule_action_append (const char *action
, location loc
);
75 extern symbol_list
*current_rule
;
77 void free_merger_functions (void);
79 extern merger_list
*merge_functions
;
81 /* Was %union seen? */
84 /* Should rules have a default precedence? */
85 extern bool default_prec
;
87 #endif /* !READER_H_ */