]> git.saurik.com Git - bison.git/blame - src/parse-gram.h
tests: minor refactoring
[bison.git] / src / parse-gram.h
CommitLineData
3f4bc2c1 1/* A Bison parser, made by GNU Bison 2.7.1016-4862c. */
1c7b7e1d 2
3c9b20ff 3/* Bison interface for Yacc-like parsers in C
086fd113 4
3f4bc2c1 5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
086fd113 6
f16b0819 7 This program is free software: you can redistribute it and/or modify
04b6e11e 8 it under the terms of the GNU General Public License as published by
f16b0819
PE
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
086fd113 11
04b6e11e
PE
12 This program 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.
086fd113 16
04b6e11e 17 You should have received a copy of the GNU General Public License
f16b0819 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
04b6e11e 19
04c12cb8
PE
20/* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
086fd113 29
04c12cb8
PE
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
dda2c1ad 32
bb8e56ff
TR
33#ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
34# define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
0a9042a6 35/* Debug traces. */
8d9cffff
AD
36#ifndef GRAM_DEBUG
37# if defined YYDEBUG
dda2c1ad 38#if YYDEBUG
8d9cffff
AD
39# define GRAM_DEBUG 1
40# else
41# define GRAM_DEBUG 0
42# endif
43# else /* ! defined YYDEBUG */
44# define GRAM_DEBUG 1
45# endif /* ! defined YYDEBUG */
46#endif /* ! defined GRAM_DEBUG */
47#if GRAM_DEBUG
dda2c1ad
AD
48extern int gram_debug;
49#endif
b18cdd91 50/* "%code requires" blocks. */
3f4bc2c1 51#line 223 "src/parse-gram.y" /* yacc.c:1931 */
b18cdd91
AD
52
53# ifndef PARAM_TYPE
54# define PARAM_TYPE
55 typedef enum
56 {
dd875058 57 param_none = 0,
b18cdd91
AD
58 param_lex = 1 << 0,
59 param_parse = 1 << 1,
60 param_both = param_lex | param_parse
61 } param_type;
62# endif
63
64
3f4bc2c1 65#line 66 "src/parse-gram.h" /* yacc.c:1931 */
04b6e11e 66
0a9042a6 67/* Token type. */
8d9cffff
AD
68#ifndef GRAM_TOKENTYPE
69# define GRAM_TOKENTYPE
8d9cffff 70 enum gram_tokentype
a9439670
AD
71 {
72 GRAM_EOF = 0,
73 STRING = 258,
74 INT = 259,
75 PERCENT_TOKEN = 260,
76 PERCENT_NTERM = 261,
77 PERCENT_TYPE = 262,
78 PERCENT_DESTRUCTOR = 263,
79 PERCENT_PRINTER = 264,
80 PERCENT_LEFT = 265,
81 PERCENT_RIGHT = 266,
82 PERCENT_NONASSOC = 267,
83 PERCENT_PRECEDENCE = 268,
84 PERCENT_PREC = 269,
85 PERCENT_DPREC = 270,
86 PERCENT_MERGE = 271,
87 PERCENT_CODE = 272,
88 PERCENT_DEFAULT_PREC = 273,
89 PERCENT_DEFINE = 274,
90 PERCENT_DEFINES = 275,
91 PERCENT_ERROR_VERBOSE = 276,
92 PERCENT_EXPECT = 277,
93 PERCENT_EXPECT_RR = 278,
94 PERCENT_FLAG = 279,
95 PERCENT_FILE_PREFIX = 280,
96 PERCENT_GLR_PARSER = 281,
97 PERCENT_INITIAL_ACTION = 282,
98 PERCENT_LANGUAGE = 283,
99 PERCENT_NAME_PREFIX = 284,
100 PERCENT_NO_DEFAULT_PREC = 285,
101 PERCENT_NO_LINES = 286,
102 PERCENT_NONDETERMINISTIC_PARSER = 287,
103 PERCENT_OUTPUT = 288,
104 PERCENT_REQUIRE = 289,
105 PERCENT_SKELETON = 290,
106 PERCENT_START = 291,
107 PERCENT_TOKEN_TABLE = 292,
108 PERCENT_VERBOSE = 293,
109 PERCENT_YACC = 294,
110 BRACED_CODE = 295,
111 BRACED_PREDICATE = 296,
112 BRACKETED_ID = 297,
113 CHAR = 298,
114 EPILOGUE = 299,
115 EQUAL = 300,
116 ID = 301,
117 ID_COLON = 302,
118 PERCENT_PERCENT = 303,
119 PIPE = 304,
120 PROLOGUE = 305,
121 SEMICOLON = 306,
122 TAG = 307,
123 TAG_ANY = 308,
124 TAG_NONE = 309,
125 PERCENT_PARAM = 310,
126 PERCENT_UNION = 311
127 };
ae7453f2 128#endif
8f7ebfc8
JD
129/* Tokens. */
130#define GRAM_EOF 0
131#define STRING 258
132#define INT 259
133#define PERCENT_TOKEN 260
134#define PERCENT_NTERM 261
135#define PERCENT_TYPE 262
136#define PERCENT_DESTRUCTOR 263
137#define PERCENT_PRINTER 264
138#define PERCENT_LEFT 265
139#define PERCENT_RIGHT 266
140#define PERCENT_NONASSOC 267
f7398526
AD
141#define PERCENT_PRECEDENCE 268
142#define PERCENT_PREC 269
143#define PERCENT_DPREC 270
144#define PERCENT_MERGE 271
145#define PERCENT_CODE 272
86cfae0a
AD
146#define PERCENT_DEFAULT_PREC 273
147#define PERCENT_DEFINE 274
148#define PERCENT_DEFINES 275
2f5b478e
AD
149#define PERCENT_ERROR_VERBOSE 276
150#define PERCENT_EXPECT 277
151#define PERCENT_EXPECT_RR 278
152#define PERCENT_FLAG 279
153#define PERCENT_FILE_PREFIX 280
154#define PERCENT_GLR_PARSER 281
155#define PERCENT_INITIAL_ACTION 282
156#define PERCENT_LANGUAGE 283
b18cdd91
AD
157#define PERCENT_NAME_PREFIX 284
158#define PERCENT_NO_DEFAULT_PREC 285
159#define PERCENT_NO_LINES 286
160#define PERCENT_NONDETERMINISTIC_PARSER 287
161#define PERCENT_OUTPUT 288
162#define PERCENT_REQUIRE 289
163#define PERCENT_SKELETON 290
164#define PERCENT_START 291
165#define PERCENT_TOKEN_TABLE 292
166#define PERCENT_VERBOSE 293
167#define PERCENT_YACC 294
168#define BRACED_CODE 295
ca2a6d15
PH
169#define BRACED_PREDICATE 296
170#define BRACKETED_ID 297
171#define CHAR 298
172#define EPILOGUE 299
173#define EQUAL 300
174#define ID 301
175#define ID_COLON 302
176#define PERCENT_PERCENT 303
177#define PIPE 304
178#define PROLOGUE 305
179#define SEMICOLON 306
180#define TAG 307
181#define TAG_ANY 308
182#define TAG_NONE 309
183#define PERCENT_PARAM 310
184#define PERCENT_UNION 311
8f7ebfc8 185
0a9042a6 186/* Value type. */
8d9cffff 187#if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
0a9042a6
AD
188typedef union GRAM_STYPE GRAM_STYPE;
189union GRAM_STYPE
136a0f76 190{
3f4bc2c1 191#line 109 "src/parse-gram.y" /* yacc.c:1931 */
50a33993 192
b18cdd91
AD
193 assoc assoc;
194 char *code;
195 char const *chars;
196 int integer;
197 named_ref *named_ref;
05d18c24
PE
198 symbol *symbol;
199 symbol_list *list;
05d18c24 200 uniqstr uniqstr;
58d7a1a1 201 unsigned char character;
b18cdd91 202
3f4bc2c1 203#line 247 "src/parse-gram.y" /* yacc.c:1931 */
b18cdd91
AD
204
205 param_type param;
136a0f76 206
3f4bc2c1 207#line 423 "src/parse-gram.y" /* yacc.c:1931 */
0294b130 208code_props_type code_type;
7ecec4dd 209
3f4bc2c1 210#line 211 "src/parse-gram.h" /* yacc.c:1931 */
0a9042a6 211};
8d9cffff
AD
212# define GRAM_STYPE_IS_TRIVIAL 1
213# define GRAM_STYPE_IS_DECLARED 1
e9955c83
AD
214#endif
215
0a9042a6 216/* Location type. */
8d9cffff 217#if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
0a9042a6
AD
218typedef struct GRAM_LTYPE GRAM_LTYPE;
219struct GRAM_LTYPE
e9955c83
AD
220{
221 int first_line;
222 int first_column;
223 int last_line;
224 int last_column;
0a9042a6 225};
8d9cffff
AD
226# define GRAM_LTYPE_IS_DECLARED 1
227# define GRAM_LTYPE_IS_TRIVIAL 1
e9955c83
AD
228#endif
229
415b8823 230
0a9042a6 231
dda2c1ad 232int gram_parse (void);
e9955c83 233
bb8e56ff 234#endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */