]> git.saurik.com Git - bison.git/blob - src/reader.h
43985965c4c41e893889c9731d04775e57d0969b
[bison.git] / src / reader.h
1 /* Input parser for Bison
2
3 Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006 Free Software
4 Foundation, Inc.
5
6 This file is part of Bison, the GNU Compiler Compiler.
7
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)
11 any later version.
12
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.
17
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. */
22
23 #ifndef READER_H_
24 # define READER_H_
25
26 # include "location.h"
27 # include "symlist.h"
28
29 # include "parse-gram.h"
30
31 typedef struct merger_list
32 {
33 struct merger_list* next;
34 uniqstr name;
35 uniqstr type;
36 location type_declaration_location;
37 } merger_list;
38
39 /* From the parser. */
40 extern int gram_debug;
41 int gram_parse (void);
42 char const *token_name (int type);
43
44
45 /* From reader.c. */
46 void grammar_start_symbol_set (symbol *sym, location loc);
47 void prologue_augment (const char *prologue, location loc, bool post);
48 void grammar_current_rule_begin (symbol *lhs, location loc);
49 void grammar_current_rule_end (location loc);
50 void grammar_midrule_action (void);
51 void grammar_current_rule_prec_set (symbol *precsym, location loc);
52 void grammar_current_rule_dprec_set (int dprec, location loc);
53 void grammar_current_rule_merge_set (uniqstr name, location loc);
54 void grammar_current_rule_symbol_append (symbol *sym, location loc);
55 void grammar_current_rule_action_append (const char *action, location loc);
56 void reader (void);
57 void free_merger_functions (void);
58
59 extern merger_list *merge_functions;
60
61 /* Was %union seen? */
62 extern bool union_seen;
63
64 /* Was a tag seen? */
65 extern bool tag_seen;
66
67 /* Should rules have a default precedence? */
68 extern bool default_prec;
69
70 #endif /* !READER_H_ */