]> git.saurik.com Git - bison.git/blob - src/reader.h
(gram_error): Remove decl.
[bison.git] / src / reader.h
1 /* Input parser for bison
2 Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
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
24 # include "symlist.h"
25 # include "parse-gram.h"
26
27 typedef struct merger_list
28 {
29 struct merger_list* next;
30 struniq_t name;
31 struniq_t type;
32 }
33 merger_list;
34
35 /* From the scanner. */
36 extern FILE *gram_in;
37 extern int gram__flex_debug;
38 void scanner_initialize (void);
39 void scanner_free (void);
40 void scanner_last_string_free (void);
41
42 # define YY_DECL int gram_lex (yystype *val, location_t *loc)
43 YY_DECL;
44
45
46 /* From the parser. */
47 extern int gram_debug;
48 int gram_parse (void);
49
50 /* The sort of braced code we are in. */
51 typedef enum braced_code_e
52 {
53 action_braced_code,
54 destructor_braced_code,
55 printer_braced_code
56 } braced_code_t;
57 /* FIXME: This is really a dirty hack which demonstrates that we
58 should probably not try to parse the actions now. */
59 extern braced_code_t current_braced_code;
60
61
62 /* From reader.c. */
63 void grammar_start_symbol_set (symbol_t *s, location_t l);
64 void prologue_augment (const char *prologue, location_t location);
65 void epilogue_augment (const char *epilogue, location_t location);
66 void grammar_symbol_append (symbol_t *s, location_t l);
67 void grammar_rule_begin (symbol_t *lhs, location_t l);
68 void grammar_rule_end (location_t l);
69 void grammar_midrule_action (void);
70 void grammar_current_rule_prec_set (symbol_t *precsym, location_t l);
71 void grammar_current_rule_dprec_set (int dprec, location_t l);
72 void grammar_current_rule_merge_set (struniq_t name, location_t l);
73
74 void grammar_current_rule_symbol_append (symbol_t *symbol, location_t l);
75 void grammar_current_rule_action_append (const char *action, location_t l);
76 extern symbol_list_t *current_rule;
77 void reader (void);
78 void free_merger_functions (void);
79
80 extern merger_list *merge_functions;
81
82 extern int typed;
83
84 #endif /* !READER_H_ */