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