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