1 | /* A Bison parser, made by GNU Bison 3.4.2. */ |
2 | |
3 | /* Bison interface for Yacc-like parsers in C |
4 | |
5 | Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, |
6 | Inc. |
7 | |
8 | This program is free software: you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation, either version 3 of the License, or |
11 | (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
20 | |
21 | /* As a special exception, you may create a larger work that contains |
22 | part or all of the Bison parser skeleton and distribute that work |
23 | under terms of your choice, so long as that work isn't itself a |
24 | parser generator using the skeleton or a modified version thereof |
25 | as a parser skeleton. Alternatively, if you modify or redistribute |
26 | the parser skeleton itself, you may (at your option) remove this |
27 | special exception, which will cause the skeleton and the resulting |
28 | Bison output files to be licensed under the GNU General Public |
29 | License without this special exception. |
30 | |
31 | This special exception was added by the Free Software Foundation in |
32 | version 2.2 of Bison. */ |
33 | |
34 | /* Undocumented macros, especially those whose name start with YY_, |
35 | are private implementation details. Do not rely on them. */ |
36 | |
37 | #ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED |
38 | # define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED |
39 | /* Debug traces. */ |
40 | #ifndef GRAM_DEBUG |
41 | # if defined YYDEBUG |
42 | #if YYDEBUG |
43 | # define GRAM_DEBUG 1 |
44 | # else |
45 | # define GRAM_DEBUG 0 |
46 | # endif |
47 | # else /* ! defined YYDEBUG */ |
48 | # define GRAM_DEBUG 1 |
49 | # endif /* ! defined YYDEBUG */ |
50 | #endif /* ! defined GRAM_DEBUG */ |
51 | #if GRAM_DEBUG |
52 | extern int gram_debug; |
53 | #endif |
54 | /* "%code requires" blocks. */ |
55 | #line 21 "src/parse-gram.y" |
56 | |
57 | #include "symlist.h" |
58 | #include "symtab.h" |
59 | #line 252 "src/parse-gram.y" |
60 | |
61 | typedef enum |
62 | { |
63 | param_none = 0, |
64 | param_lex = 1 << 0, |
65 | param_parse = 1 << 1, |
66 | param_both = param_lex | param_parse |
67 | } param_type; |
68 | #line 696 "src/parse-gram.y" |
69 | |
70 | #include "muscle-tab.h" |
71 | typedef struct |
72 | { |
73 | char const *chars; |
74 | muscle_kind kind; |
75 | } value_type; |
76 | |
77 | #line 78 "src/parse-gram.h" |
78 | |
79 | /* Token type. */ |
80 | #ifndef GRAM_TOKENTYPE |
81 | # define GRAM_TOKENTYPE |
82 | enum gram_tokentype |
83 | { |
84 | GRAM_EOF = 0, |
85 | STRING = 258, |
86 | PERCENT_TOKEN = 259, |
87 | PERCENT_NTERM = 260, |
88 | PERCENT_TYPE = 261, |
89 | PERCENT_DESTRUCTOR = 262, |
90 | PERCENT_PRINTER = 263, |
91 | PERCENT_LEFT = 264, |
92 | PERCENT_RIGHT = 265, |
93 | PERCENT_NONASSOC = 266, |
94 | PERCENT_PRECEDENCE = 267, |
95 | PERCENT_PREC = 268, |
96 | PERCENT_DPREC = 269, |
97 | PERCENT_MERGE = 270, |
98 | PERCENT_CODE = 271, |
99 | PERCENT_DEFAULT_PREC = 272, |
100 | PERCENT_DEFINE = 273, |
101 | PERCENT_DEFINES = 274, |
102 | PERCENT_ERROR_VERBOSE = 275, |
103 | PERCENT_EXPECT = 276, |
104 | PERCENT_EXPECT_RR = 277, |
105 | PERCENT_FLAG = 278, |
106 | PERCENT_FILE_PREFIX = 279, |
107 | PERCENT_GLR_PARSER = 280, |
108 | PERCENT_INITIAL_ACTION = 281, |
109 | PERCENT_LANGUAGE = 282, |
110 | PERCENT_NAME_PREFIX = 283, |
111 | PERCENT_NO_DEFAULT_PREC = 284, |
112 | PERCENT_NO_LINES = 285, |
113 | PERCENT_NONDETERMINISTIC_PARSER = 286, |
114 | PERCENT_OUTPUT = 287, |
115 | PERCENT_PURE_PARSER = 288, |
116 | PERCENT_REQUIRE = 289, |
117 | PERCENT_SKELETON = 290, |
118 | PERCENT_START = 291, |
119 | PERCENT_TOKEN_TABLE = 292, |
120 | PERCENT_VERBOSE = 293, |
121 | PERCENT_YACC = 294, |
122 | BRACED_CODE = 295, |
123 | BRACED_PREDICATE = 296, |
124 | BRACKETED_ID = 297, |
125 | CHAR = 298, |
126 | COLON = 299, |
127 | EPILOGUE = 300, |
128 | EQUAL = 301, |
129 | ID = 302, |
130 | ID_COLON = 303, |
131 | PERCENT_PERCENT = 304, |
132 | PIPE = 305, |
133 | PROLOGUE = 306, |
134 | SEMICOLON = 307, |
135 | TAG = 308, |
136 | TAG_ANY = 309, |
137 | TAG_NONE = 310, |
138 | INT = 311, |
139 | PERCENT_PARAM = 312, |
140 | PERCENT_UNION = 313, |
141 | PERCENT_EMPTY = 314 |
142 | }; |
143 | #endif |
144 | |
145 | /* Value type. */ |
146 | #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED |
147 | union GRAM_STYPE |
148 | { |
149 | |
150 | /* precedence_declarator */ |
151 | assoc precedence_declarator; |
152 | /* "string" */ |
153 | char* STRING; |
154 | /* "{...}" */ |
155 | char* BRACED_CODE; |
156 | /* "%?{...}" */ |
157 | char* BRACED_PREDICATE; |
158 | /* "epilogue" */ |
159 | char* EPILOGUE; |
160 | /* "%{...%}" */ |
161 | char* PROLOGUE; |
162 | /* code_props_type */ |
163 | code_props_type code_props_type; |
164 | /* "integer" */ |
165 | int INT; |
166 | /* int.opt */ |
167 | int yytype_81; |
168 | /* named_ref.opt */ |
169 | named_ref* yytype_93; |
170 | /* "%param" */ |
171 | param_type PERCENT_PARAM; |
172 | /* token_decl */ |
173 | symbol* token_decl; |
174 | /* token_decl_for_prec */ |
175 | symbol* token_decl_for_prec; |
176 | /* id */ |
177 | symbol* id; |
178 | /* id_colon */ |
179 | symbol* id_colon; |
180 | /* symbol */ |
181 | symbol* symbol; |
182 | /* string_as_id */ |
183 | symbol* string_as_id; |
184 | /* string_as_id.opt */ |
185 | symbol* yytype_100; |
186 | /* generic_symlist */ |
187 | symbol_list* generic_symlist; |
188 | /* generic_symlist_item */ |
189 | symbol_list* generic_symlist_item; |
190 | /* nterm_decls */ |
191 | symbol_list* nterm_decls; |
192 | /* token_decls */ |
193 | symbol_list* token_decls; |
194 | /* token_decl.1 */ |
195 | symbol_list* yytype_79; |
196 | /* token_decls_for_prec */ |
197 | symbol_list* token_decls_for_prec; |
198 | /* token_decl_for_prec.1 */ |
199 | symbol_list* yytype_83; |
200 | /* symbol_decls */ |
201 | symbol_list* symbol_decls; |
202 | /* symbol_decl.1 */ |
203 | symbol_list* yytype_86; |
204 | /* "%error-verbose" */ |
205 | uniqstr PERCENT_ERROR_VERBOSE; |
206 | /* "%<flag>" */ |
207 | uniqstr PERCENT_FLAG; |
208 | /* "%file-prefix" */ |
209 | uniqstr PERCENT_FILE_PREFIX; |
210 | /* "%name-prefix" */ |
211 | uniqstr PERCENT_NAME_PREFIX; |
212 | /* "%pure-parser" */ |
213 | uniqstr PERCENT_PURE_PARSER; |
214 | /* "%yacc" */ |
215 | uniqstr PERCENT_YACC; |
216 | /* "[identifier]" */ |
217 | uniqstr BRACKETED_ID; |
218 | /* "identifier" */ |
219 | uniqstr ID; |
220 | /* "identifier:" */ |
221 | uniqstr ID_COLON; |
222 | /* "<tag>" */ |
223 | uniqstr TAG; |
224 | /* tag.opt */ |
225 | uniqstr yytype_73; |
226 | /* tag */ |
227 | uniqstr tag; |
228 | /* variable */ |
229 | uniqstr variable; |
230 | /* "char" */ |
231 | unsigned char CHAR; |
232 | /* value */ |
233 | value_type value; |
234 | #line 235 "src/parse-gram.h" |
235 | |
236 | }; |
237 | typedef union GRAM_STYPE GRAM_STYPE; |
238 | # define GRAM_STYPE_IS_TRIVIAL 1 |
239 | # define GRAM_STYPE_IS_DECLARED 1 |
240 | #endif |
241 | |
242 | /* Location type. */ |
243 | #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED |
244 | typedef struct GRAM_LTYPE GRAM_LTYPE; |
245 | struct GRAM_LTYPE |
246 | { |
247 | int first_line; |
248 | int first_column; |
249 | int last_line; |
250 | int last_column; |
251 | }; |
252 | # define GRAM_LTYPE_IS_DECLARED 1 |
253 | # define GRAM_LTYPE_IS_TRIVIAL 1 |
254 | #endif |
255 | |
256 | |
257 | |
258 | int gram_parse (void); |
259 | |
260 | #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */ |
261 | |