]> git.saurik.com Git - bison.git/blame_incremental - src/reader.h
Generalize the display of semantic values and locations in traces.
[bison.git] / src / reader.h
... / ...
CommitLineData
1/* Input parser for Bison
2
3 Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
4
5 This file is part of Bison, the GNU Compiler Compiler.
6
7 Bison is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 Bison is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Bison; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
21
22#ifndef READER_H_
23# define READER_H_
24
25# include "location.h"
26# include "symlist.h"
27
28# include "parse-gram.h"
29
30typedef struct merger_list
31{
32 struct merger_list* next;
33 uniqstr name;
34 uniqstr type;
35} merger_list;
36
37/* From the scanner. */
38extern FILE *gram_in;
39extern int gram__flex_debug;
40extern boundary scanner_cursor;
41extern int max_left_semantic_context;
42void scanner_initialize (void);
43void scanner_free (void);
44void scanner_last_string_free (void);
45
46/* These are declared by the scanner, but not used. We put them here
47 to pacify "make syntax-check". */
48extern FILE *gram_out;
49extern int gram_lineno;
50
51# define YY_DECL int gram_lex (YYSTYPE *val, location *loc)
52YY_DECL;
53
54
55/* From the parser. */
56extern int gram_debug;
57int gram_parse (void);
58char const *token_name (int);
59
60
61/* From reader.c. */
62void grammar_start_symbol_set (symbol *sym, location loc);
63void prologue_augment (const char *prologue, location loc);
64void grammar_symbol_append (symbol *sym, location loc);
65void grammar_rule_begin (symbol *lhs, location loc);
66void grammar_rule_end (location loc);
67void grammar_midrule_action (void);
68void grammar_current_rule_prec_set (symbol *precsym, location loc);
69void grammar_current_rule_dprec_set (int dprec, location loc);
70void grammar_current_rule_merge_set (uniqstr name, location loc);
71
72void grammar_current_rule_symbol_append (symbol *sym, location loc);
73void grammar_current_rule_action_append (const char *action, location loc);
74extern symbol_list *current_rule;
75void reader (void);
76void free_merger_functions (void);
77
78extern merger_list *merge_functions;
79
80extern bool typed;
81extern bool default_prec;
82
83#endif /* !READER_H_ */