Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | /* A Bison parser, made by GNU Bison 3.0.4. */ |
2 | |||
3 | /* Bison implementation for Yacc-like parsers in C |
||
4 | |||
5 | Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. |
||
6 | |||
7 | This program 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 3 of the License, or |
||
10 | (at your option) any later version. |
||
11 | |||
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. |
||
16 | |||
17 | You should have received a copy of the GNU General Public License |
||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
||
19 | |||
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. |
||
29 | |||
30 | This special exception was added by the Free Software Foundation in |
||
31 | version 2.2 of Bison. */ |
||
32 | |||
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
||
34 | simplifying the original so-called "semantic" parser. */ |
||
35 | |||
36 | /* All symbols defined below should begin with yy or YY, to avoid |
||
37 | infringing on user name space. This should be done even for local |
||
38 | variables, as they might otherwise be expanded by user macros. |
||
39 | There are some unavoidable exceptions within include files to |
||
40 | define necessary library symbols; they are noted "INFRINGES ON |
||
41 | USER NAME SPACE" below. */ |
||
42 | |||
43 | /* Identify Bison output. */ |
||
44 | #define YYBISON 1 |
||
45 | |||
46 | /* Bison version. */ |
||
47 | #define YYBISON_VERSION "3.0.4" |
||
48 | |||
49 | /* Skeleton name. */ |
||
50 | #define YYSKELETON_NAME "yacc.c" |
||
51 | |||
52 | /* Pure parsers. */ |
||
53 | #define YYPURE 0 |
||
54 | |||
55 | /* Push parsers. */ |
||
56 | #define YYPUSH 0 |
||
57 | |||
58 | /* Pull parsers. */ |
||
59 | #define YYPULL 1 |
||
60 | |||
61 | /* Copy the first part of user declarations. */ |
||
62 | #line 2 "parser.y" /* yacc.c:339 */ |
||
63 | |||
64 | #include <stdio.h> |
||
65 | |||
66 | #line 70 "parser.tab.c" /* yacc.c:339 */ |
||
67 | |||
68 | #ifndef YY_NULLPTR |
||
69 | #if defined __cplusplus && 201103L <= __cplusplus |
||
70 | #define YY_NULLPTR nullptr |
||
71 | #else |
||
72 | #define YY_NULLPTR 0 |
||
73 | #endif |
||
74 | #endif |
||
75 | |||
76 | /* Enabling verbose error messages. */ |
||
77 | #ifdef YYERROR_VERBOSE |
||
78 | #undef YYERROR_VERBOSE |
||
79 | #define YYERROR_VERBOSE 1 |
||
80 | #else |
||
81 | #define YYERROR_VERBOSE 0 |
||
82 | #endif |
||
83 | |||
84 | /* In a future release of Bison, this section will be replaced |
||
85 | by #include "parser.tab.h". */ |
||
86 | #ifndef YY_YY_PARSER_TAB_H_INCLUDED |
||
87 | #define YY_YY_PARSER_TAB_H_INCLUDED |
||
88 | /* Debug traces. */ |
||
89 | #ifndef YYDEBUG |
||
90 | #define YYDEBUG 0 |
||
91 | #endif |
||
92 | #if YYDEBUG |
||
93 | extern int yydebug; |
||
94 | #endif |
||
95 | |||
96 | /* Token type. */ |
||
97 | #ifndef YYTOKENTYPE |
||
98 | #define YYTOKENTYPE |
||
99 | enum yytokentype |
||
100 | { |
||
101 | IDENTIFIER = 258, |
||
102 | PROCEDURE = 259, |
||
103 | BLOCK = 260, |
||
104 | ENDBLOCK = 261 |
||
105 | }; |
||
106 | #endif |
||
107 | |||
108 | /* Value type. */ |
||
109 | #if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED |
||
110 | |||
111 | union YYSTYPE |
||
112 | { |
||
113 | #line 8 "parser.y" /* yacc.c:355 */ |
||
114 | |||
115 | char *sval; |
||
116 | |||
117 | #line 121 "parser.tab.c" /* yacc.c:355 */ |
||
118 | }; |
||
119 | |||
120 | typedef union YYSTYPE YYSTYPE; |
||
121 | #define YYSTYPE_IS_TRIVIAL 1 |
||
122 | #define YYSTYPE_IS_DECLARED 1 |
||
123 | #endif |
||
124 | |||
125 | extern YYSTYPE yylval; |
||
126 | |||
127 | int yyparse (void); |
||
128 | |||
129 | #endif /* !YY_YY_PARSER_TAB_H_INCLUDED */ |
||
130 | |||
131 | /* Copy the second part of user declarations. */ |
||
132 | |||
133 | #line 138 "parser.tab.c" /* yacc.c:358 */ |
||
134 | |||
135 | #ifdef short |
||
136 | #undef short |
||
137 | #endif |
||
138 | |||
139 | #ifdef YYTYPE_UINT8 |
||
140 | typedef YYTYPE_UINT8 yytype_uint8; |
||
141 | #else |
||
142 | typedef unsigned char yytype_uint8; |
||
143 | #endif |
||
144 | |||
145 | #ifdef YYTYPE_INT8 |
||
146 | typedef YYTYPE_INT8 yytype_int8; |
||
147 | #else |
||
148 | typedef signed char yytype_int8; |
||
149 | #endif |
||
150 | |||
151 | #ifdef YYTYPE_UINT16 |
||
152 | typedef YYTYPE_UINT16 yytype_uint16; |
||
153 | #else |
||
154 | typedef unsigned short int yytype_uint16; |
||
155 | #endif |
||
156 | |||
157 | #ifdef YYTYPE_INT16 |
||
158 | typedef YYTYPE_INT16 yytype_int16; |
||
159 | #else |
||
160 | typedef short int yytype_int16; |
||
161 | #endif |
||
162 | |||
163 | #ifndef YYSIZE_T |
||
164 | #ifdef __SIZE_TYPE__ |
||
165 | #define YYSIZE_T __SIZE_TYPE__ |
||
166 | #elif defined size_t |
||
167 | #define YYSIZE_T size_t |
||
168 | #elif !defined YYSIZE_T |
||
169 | #include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
||
170 | #define YYSIZE_T size_t |
||
171 | #else |
||
172 | #define YYSIZE_T unsigned int |
||
173 | #endif |
||
174 | #endif |
||
175 | |||
176 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
||
177 | |||
178 | #ifndef YY_ |
||
179 | #if defined YYENABLE_NLS && YYENABLE_NLS |
||
180 | #if ENABLE_NLS |
||
181 | #include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
||
182 | #define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
||
183 | #endif |
||
184 | #endif |
||
185 | #ifndef YY_ |
||
186 | #define YY_(Msgid) Msgid |
||
187 | #endif |
||
188 | #endif |
||
189 | |||
190 | #ifndef YY_ATTRIBUTE |
||
191 | #if (defined __GNUC__ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) || \ |
||
192 | defined __SUNPRO_C && 0x5110 <= __SUNPRO_C |
||
193 | #define YY_ATTRIBUTE(Spec) __attribute__ (Spec) |
||
194 | #else |
||
195 | #define YY_ATTRIBUTE(Spec) /* empty */ |
||
196 | #endif |
||
197 | #endif |
||
198 | |||
199 | #ifndef YY_ATTRIBUTE_PURE |
||
200 | #define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) |
||
201 | #endif |
||
202 | |||
203 | #ifndef YY_ATTRIBUTE_UNUSED |
||
204 | #define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) |
||
205 | #endif |
||
206 | |||
207 | #if !defined _Noreturn && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) |
||
208 | #if defined _MSC_VER && 1200 <= _MSC_VER |
||
209 | #define _Noreturn __declspec(noreturn) |
||
210 | #else |
||
211 | #define _Noreturn YY_ATTRIBUTE((__noreturn__)) |
||
212 | #endif |
||
213 | #endif |
||
214 | |||
215 | /* Suppress unused-variable warnings by "using" E. */ |
||
216 | #if !defined lint || defined __GNUC__ |
||
217 | #define YYUSE(E) ((void) (E)) |
||
218 | #else |
||
219 | #define YYUSE(E) /* empty */ |
||
220 | #endif |
||
221 | |||
222 | #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
||
223 | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
||
224 | #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
||
225 | _Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic ignored " \ |
||
226 | "\"-Wuninitialized\"") \ |
||
227 | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
||
228 | #define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma ("GCC diagnostic pop") |
||
229 | #else |
||
230 | #define YY_INITIAL_VALUE(Value) Value |
||
231 | #endif |
||
232 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
233 | #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
234 | #define YY_IGNORE_MAYBE_UNINITIALIZED_END |
||
235 | #endif |
||
236 | #ifndef YY_INITIAL_VALUE |
||
237 | #define YY_INITIAL_VALUE(Value) /* Nothing. */ |
||
238 | #endif |
||
239 | |||
240 | #if !defined yyoverflow || YYERROR_VERBOSE |
||
241 | |||
242 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
||
243 | |||
244 | #ifdef YYSTACK_USE_ALLOCA |
||
245 | #if YYSTACK_USE_ALLOCA |
||
246 | #ifdef __GNUC__ |
||
247 | #define YYSTACK_ALLOC __builtin_alloca |
||
248 | #elif defined __BUILTIN_VA_ARG_INCR |
||
249 | #include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
||
250 | #elif defined _AIX |
||
251 | #define YYSTACK_ALLOC __alloca |
||
252 | #elif defined _MSC_VER |
||
253 | #include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
||
254 | #define alloca _alloca |
||
255 | #else |
||
256 | #define YYSTACK_ALLOC alloca |
||
257 | #if !defined _ALLOCA_H && !defined EXIT_SUCCESS |
||
258 | #include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
||
259 | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
||
260 | #ifndef EXIT_SUCCESS |
||
261 | #define EXIT_SUCCESS 0 |
||
262 | #endif |
||
263 | #endif |
||
264 | #endif |
||
265 | #endif |
||
266 | #endif |
||
267 | |||
268 | #ifdef YYSTACK_ALLOC |
||
269 | /* Pacify GCC's 'empty if-body' warning. */ |
||
270 | #define YYSTACK_FREE(Ptr) \ |
||
271 | do \ |
||
272 | { /* empty */ \ |
||
273 | ; \ |
||
274 | } while (0) |
||
275 | #ifndef YYSTACK_ALLOC_MAXIMUM |
||
276 | /* The OS might guarantee only one guard page at the bottom of the stack, |
||
277 | and a page size can be as small as 4096 bytes. So we cannot safely |
||
278 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
||
279 | to allow for a few compiler-allocated temporary stack slots. */ |
||
280 | #define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
||
281 | #endif |
||
282 | #else |
||
283 | #define YYSTACK_ALLOC YYMALLOC |
||
284 | #define YYSTACK_FREE YYFREE |
||
285 | #ifndef YYSTACK_ALLOC_MAXIMUM |
||
286 | #define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
||
287 | #endif |
||
288 | #if ( \ |
||
289 | defined __cplusplus && !defined EXIT_SUCCESS && \ |
||
290 | !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free))) |
||
291 | #include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
||
292 | #ifndef EXIT_SUCCESS |
||
293 | #define EXIT_SUCCESS 0 |
||
294 | #endif |
||
295 | #endif |
||
296 | #ifndef YYMALLOC |
||
297 | #define YYMALLOC malloc |
||
298 | #if !defined malloc && !defined EXIT_SUCCESS |
||
299 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
||
300 | #endif |
||
301 | #endif |
||
302 | #ifndef YYFREE |
||
303 | #define YYFREE free |
||
304 | #if !defined free && !defined EXIT_SUCCESS |
||
305 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
||
306 | #endif |
||
307 | #endif |
||
308 | #endif |
||
309 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
||
310 | |||
311 | #if ( \ |
||
312 | !defined yyoverflow && \ |
||
313 | (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
||
314 | |||
315 | /* A type that is properly aligned for any stack member. */ |
||
316 | union yyalloc |
||
317 | { |
||
318 | yytype_int16 yyss_alloc; |
||
319 | YYSTYPE yyvs_alloc; |
||
320 | }; |
||
321 | |||
322 | /* The size of the maximum gap between one aligned stack and the next. */ |
||
323 | #define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
||
324 | |||
325 | /* The size of an array large to enough to hold all stacks, each with |
||
326 | N elements. */ |
||
327 | #define YYSTACK_BYTES(N) \ |
||
328 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) + YYSTACK_GAP_MAXIMUM) |
||
329 | |||
330 | #define YYCOPY_NEEDED 1 |
||
331 | |||
332 | /* Relocate STACK from its old location to the new one. The |
||
333 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
||
334 | elements in the stack, and YYPTR gives the new location of the |
||
335 | stack. Advance YYPTR to a properly aligned location for the next |
||
336 | stack. */ |
||
337 | #define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
||
338 | do \ |
||
339 | { \ |
||
340 | YYSIZE_T yynewbytes; \ |
||
341 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
||
342 | Stack = &yyptr->Stack_alloc; \ |
||
343 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
||
344 | yyptr += yynewbytes / sizeof (*yyptr); \ |
||
345 | } while (0) |
||
346 | |||
347 | #endif |
||
348 | |||
349 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
||
350 | /* Copy COUNT objects from SRC to DST. The source and destination do |
||
351 | not overlap. */ |
||
352 | #ifndef YYCOPY |
||
353 | #if defined __GNUC__ && 1 < __GNUC__ |
||
354 | #define YYCOPY(Dst, Src, Count) __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) |
||
355 | #else |
||
356 | #define YYCOPY(Dst, Src, Count) \ |
||
357 | do \ |
||
358 | { \ |
||
359 | YYSIZE_T yyi; \ |
||
360 | for (yyi = 0; yyi < (Count); yyi++) \ |
||
361 | (Dst)[yyi] = (Src)[yyi]; \ |
||
362 | } while (0) |
||
363 | #endif |
||
364 | #endif |
||
365 | #endif /* !YYCOPY_NEEDED */ |
||
366 | |||
367 | /* YYFINAL -- State number of the termination state. */ |
||
368 | #define YYFINAL 4 |
||
369 | /* YYLAST -- Last index in YYTABLE. */ |
||
370 | #define YYLAST 8 |
||
371 | |||
372 | /* YYNTOKENS -- Number of terminals. */ |
||
373 | #define YYNTOKENS 7 |
||
374 | /* YYNNTS -- Number of nonterminals. */ |
||
375 | #define YYNNTS 8 |
||
376 | /* YYNRULES -- Number of rules. */ |
||
377 | #define YYNRULES 10 |
||
378 | /* YYNSTATES -- Number of states. */ |
||
379 | #define YYNSTATES 17 |
||
380 | |||
381 | /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned |
||
382 | by yylex, with out-of-bounds checking. */ |
||
383 | #define YYUNDEFTOK 2 |
||
384 | #define YYMAXUTOK 261 |
||
385 | |||
386 | #define YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
||
387 | |||
388 | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
||
389 | as returned by yylex, without out-of-bounds checking. */ |
||
390 | static const yytype_uint8 yytranslate[] = { |
||
391 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
392 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
393 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
394 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
395 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
396 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
397 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
398 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
399 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6}; |
||
400 | |||
401 | #if YYDEBUG |
||
402 | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
||
403 | static const yytype_uint8 yyrline[] = {0, 20, 20, 20, 25, 27, 31, 31, 36, 38, 42}; |
||
404 | #endif |
||
405 | |||
406 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
||
407 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
||
408 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
||
409 | static const char *const yytname[] = {"$end", |
||
410 | "error", |
||
411 | "$undefined", |
||
412 | "IDENTIFIER", |
||
413 | "PROCEDURE", |
||
414 | "BLOCK", |
||
415 | "ENDBLOCK", |
||
416 | "$accept", |
||
417 | "Procedure", |
||
418 | "$@1", |
||
419 | "Parts", |
||
420 | "Part", |
||
421 | "$@2", |
||
422 | "Keywords", |
||
423 | "Keyword", |
||
424 | YY_NULLPTR}; |
||
425 | #endif |
||
426 | |||
427 | #ifdef YYPRINT |
||
428 | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
||
429 | (internal) symbol number NUM (which must be that of a token). */ |
||
430 | static const yytype_uint16 yytoknum[] = {0, 256, 257, 258, 259, 260, 261}; |
||
431 | #endif |
||
432 | |||
433 | #define YYPACT_NINF -4 |
||
434 | |||
435 | #define yypact_value_is_default(Yystate) (!!((Yystate) == (-4))) |
||
436 | |||
437 | #define YYTABLE_NINF -1 |
||
438 | |||
439 | #define yytable_value_is_error(Yytable_value) 0 |
||
440 | |||
441 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
||
442 | STATE-NUM. */ |
||
443 | static const yytype_int8 yypact[] = { |
||
444 | 1, -1, 6, 2, -4, -4, -4, -3, 3, -4, -4, -4, -4, -2, -4, -4, -4}; |
||
445 | |||
446 | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
||
447 | Performed when YYTABLE does not specify something else to do. Zero |
||
448 | means the default is an error. */ |
||
449 | static const yytype_uint8 yydefact[] = {0, 0, 0, 0, 1, 2, 4, 0, 0, 3, 5, 6, 8, 0, 10, 7, 9}; |
||
450 | |||
451 | /* YYPGOTO[NTERM-NUM]. */ |
||
452 | static const yytype_int8 yypgoto[] = {-4, -4, -4, -4, -4, -4, -4, -4}; |
||
453 | |||
454 | /* YYDEFGOTO[NTERM-NUM]. */ |
||
455 | static const yytype_int8 yydefgoto[] = {-1, 2, 6, 7, 10, 12, 13, 16}; |
||
456 | |||
457 | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
||
458 | positive, shift that token. If negative, reduce the rule whose |
||
459 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
||
460 | static const yytype_uint8 yytable[] = {8, 14, 3, 9, 15, 1, 4, 5, 11}; |
||
461 | |||
462 | static const yytype_uint8 yycheck[] = {3, 3, 3, 6, 6, 4, 0, 5, 5}; |
||
463 | |||
464 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
||
465 | symbol of state STATE-NUM. */ |
||
466 | static const yytype_uint8 yystos[] = {0, 4, 8, 3, 0, 5, 9, 10, 3, 6, 11, 5, 12, 13, 3, 6, 14}; |
||
467 | |||
468 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
||
469 | static const yytype_uint8 yyr1[] = {0, 7, 9, 8, 10, 10, 12, 11, 13, 13, 14}; |
||
470 | |||
471 | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
||
472 | static const yytype_uint8 yyr2[] = {0, 2, 0, 6, 0, 2, 0, 5, 0, 2, 1}; |
||
473 | |||
474 | #define yyerrok (yyerrstatus = 0) |
||
475 | #define yyclearin (yychar = YYEMPTY) |
||
476 | #define YYEMPTY (-2) |
||
477 | #define YYEOF 0 |
||
478 | |||
479 | #define YYACCEPT goto yyacceptlab |
||
480 | #define YYABORT goto yyabortlab |
||
481 | #define YYERROR goto yyerrorlab |
||
482 | |||
483 | #define YYRECOVERING() (!!yyerrstatus) |
||
484 | |||
485 | #define YYBACKUP(Token, Value) \ |
||
486 | do \ |
||
487 | if (yychar == YYEMPTY) \ |
||
488 | { \ |
||
489 | yychar = (Token); \ |
||
490 | yylval = (Value); \ |
||
491 | YYPOPSTACK (yylen); \ |
||
492 | yystate = *yyssp; \ |
||
493 | goto yybackup; \ |
||
494 | } \ |
||
495 | else \ |
||
496 | { \ |
||
497 | yyerror (YY_ ("syntax error: cannot back up")); \ |
||
498 | YYERROR; \ |
||
499 | } \ |
||
500 | while (0) |
||
501 | |||
502 | /* Error token number */ |
||
503 | #define YYTERROR 1 |
||
504 | #define YYERRCODE 256 |
||
505 | |||
506 | /* Enable debugging if requested. */ |
||
507 | #if YYDEBUG |
||
508 | |||
509 | #ifndef YYFPRINTF |
||
510 | #include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
||
511 | #define YYFPRINTF fprintf |
||
512 | #endif |
||
513 | |||
514 | #define YYDPRINTF(Args) \ |
||
515 | do \ |
||
516 | { \ |
||
517 | if (yydebug) \ |
||
518 | YYFPRINTF Args; \ |
||
519 | } while (0) |
||
520 | |||
521 | /* This macro is provided for backward compatibility. */ |
||
522 | #ifndef YY_LOCATION_PRINT |
||
523 | #define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
||
524 | #endif |
||
525 | |||
526 | #define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
||
527 | do \ |
||
528 | { \ |
||
529 | if (yydebug) \ |
||
530 | { \ |
||
531 | YYFPRINTF (stderr, "%s ", Title); \ |
||
532 | yy_symbol_print (stderr, Type, Value); \ |
||
533 | YYFPRINTF (stderr, "\n"); \ |
||
534 | } \ |
||
535 | } while (0) |
||
536 | |||
537 | /*----------------------------------------. |
||
538 | | Print this symbol's value on YYOUTPUT. | |
||
539 | `----------------------------------------*/ |
||
540 | |||
541 | static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep) |
||
542 | { |
||
543 | FILE *yyo = yyoutput; |
||
544 | YYUSE (yyo); |
||
545 | if (!yyvaluep) |
||
546 | return; |
||
547 | #ifdef YYPRINT |
||
548 | if (yytype < YYNTOKENS) |
||
549 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
||
550 | #endif |
||
551 | YYUSE (yytype); |
||
552 | } |
||
553 | |||
554 | /*--------------------------------. |
||
555 | | Print this symbol on YYOUTPUT. | |
||
556 | `--------------------------------*/ |
||
557 | |||
558 | static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep) |
||
559 | { |
||
560 | YYFPRINTF ( |
||
561 | yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); |
||
562 | |||
563 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
||
564 | YYFPRINTF (yyoutput, ")"); |
||
565 | } |
||
566 | |||
567 | /*------------------------------------------------------------------. |
||
568 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
||
569 | | TOP (included). | |
||
570 | `------------------------------------------------------------------*/ |
||
571 | |||
572 | static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
||
573 | { |
||
574 | YYFPRINTF (stderr, "Stack now"); |
||
575 | for (; yybottom <= yytop; yybottom++) |
||
576 | { |
||
577 | int yybot = *yybottom; |
||
578 | YYFPRINTF (stderr, " %d", yybot); |
||
579 | } |
||
580 | YYFPRINTF (stderr, "\n"); |
||
581 | } |
||
582 | |||
583 | #define YY_STACK_PRINT(Bottom, Top) \ |
||
584 | do \ |
||
585 | { \ |
||
586 | if (yydebug) \ |
||
587 | yy_stack_print ((Bottom), (Top)); \ |
||
588 | } while (0) |
||
589 | |||
590 | /*------------------------------------------------. |
||
591 | | Report that the YYRULE is going to be reduced. | |
||
592 | `------------------------------------------------*/ |
||
593 | |||
594 | static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) |
||
595 | { |
||
596 | unsigned long int yylno = yyrline[yyrule]; |
||
597 | int yynrhs = yyr2[yyrule]; |
||
598 | int yyi; |
||
599 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); |
||
600 | /* The symbols being reduced. */ |
||
601 | for (yyi = 0; yyi < yynrhs; yyi++) |
||
602 | { |
||
603 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
||
604 | yy_symbol_print ( |
||
605 | stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)])); |
||
606 | YYFPRINTF (stderr, "\n"); |
||
607 | } |
||
608 | } |
||
609 | |||
610 | #define YY_REDUCE_PRINT(Rule) \ |
||
611 | do \ |
||
612 | { \ |
||
613 | if (yydebug) \ |
||
614 | yy_reduce_print (yyssp, yyvsp, Rule); \ |
||
615 | } while (0) |
||
616 | |||
617 | /* Nonzero means print parse trace. It is left uninitialized so that |
||
618 | multiple parsers can coexist. */ |
||
619 | int yydebug; |
||
620 | #else /* !YYDEBUG */ |
||
621 | #define YYDPRINTF(Args) |
||
622 | #define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
||
623 | #define YY_STACK_PRINT(Bottom, Top) |
||
624 | #define YY_REDUCE_PRINT(Rule) |
||
625 | #endif /* !YYDEBUG */ |
||
626 | |||
627 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
||
628 | #ifndef YYINITDEPTH |
||
629 | #define YYINITDEPTH 200 |
||
630 | #endif |
||
631 | |||
632 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
||
633 | if the built-in stack extension method is used). |
||
634 | |||
635 | Do not make this value too large; the results are undefined if |
||
636 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
||
637 | evaluated with infinite-precision integer arithmetic. */ |
||
638 | |||
639 | #ifndef YYMAXDEPTH |
||
640 | #define YYMAXDEPTH 10000 |
||
641 | #endif |
||
642 | |||
643 | #if YYERROR_VERBOSE |
||
644 | |||
645 | #ifndef yystrlen |
||
646 | #if defined __GLIBC__ && defined _STRING_H |
||
647 | #define yystrlen strlen |
||
648 | #else |
||
649 | /* Return the length of YYSTR. */ |
||
650 | static YYSIZE_T yystrlen (const char *yystr) |
||
651 | { |
||
652 | YYSIZE_T yylen; |
||
653 | for (yylen = 0; yystr[yylen]; yylen++) |
||
654 | continue; |
||
655 | return yylen; |
||
656 | } |
||
657 | #endif |
||
658 | #endif |
||
659 | |||
660 | #ifndef yystpcpy |
||
661 | #if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
||
662 | #define yystpcpy stpcpy |
||
663 | #else |
||
664 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
||
665 | YYDEST. */ |
||
666 | static char *yystpcpy (char *yydest, const char *yysrc) |
||
667 | { |
||
668 | char *yyd = yydest; |
||
669 | const char *yys = yysrc; |
||
670 | |||
671 | while ((*yyd++ = *yys++) != '\0') |
||
672 | continue; |
||
673 | |||
674 | return yyd - 1; |
||
675 | } |
||
676 | #endif |
||
677 | #endif |
||
678 | |||
679 | #ifndef yytnamerr |
||
680 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
||
681 | quotes and backslashes, so that it's suitable for yyerror. The |
||
682 | heuristic is that double-quoting is unnecessary unless the string |
||
683 | contains an apostrophe, a comma, or backslash (other than |
||
684 | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
||
685 | null, do not copy; instead, return the length of what the result |
||
686 | would have been. */ |
||
687 | static YYSIZE_T yytnamerr (char *yyres, const char *yystr) |
||
688 | { |
||
689 | if (*yystr == '"') |
||
690 | { |
||
691 | YYSIZE_T yyn = 0; |
||
692 | char const *yyp = yystr; |
||
693 | |||
694 | for (;;) |
||
695 | switch (*++yyp) |
||
696 | { |
||
697 | case '\'': |
||
698 | case ',': |
||
699 | goto do_not_strip_quotes; |
||
700 | |||
701 | case '\\': |
||
702 | if (*++yyp != '\\') |
||
703 | goto do_not_strip_quotes; |
||
704 | /* Fall through. */ |
||
705 | default: |
||
706 | if (yyres) |
||
707 | yyres[yyn] = *yyp; |
||
708 | yyn++; |
||
709 | break; |
||
710 | |||
711 | case '"': |
||
712 | if (yyres) |
||
713 | yyres[yyn] = '\0'; |
||
714 | return yyn; |
||
715 | } |
||
716 | do_not_strip_quotes:; |
||
717 | } |
||
718 | |||
719 | if (!yyres) |
||
720 | return yystrlen (yystr); |
||
721 | |||
722 | return yystpcpy (yyres, yystr) - yyres; |
||
723 | } |
||
724 | #endif |
||
725 | |||
726 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
||
727 | about the unexpected token YYTOKEN for the state stack whose top is |
||
728 | YYSSP. |
||
729 | |||
730 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
||
731 | not large enough to hold the message. In that case, also set |
||
732 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
||
733 | required number of bytes is too large to store. */ |
||
734 | static int |
||
735 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) |
||
736 | { |
||
737 | YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); |
||
738 | YYSIZE_T yysize = yysize0; |
||
739 | enum |
||
740 | { |
||
741 | YYERROR_VERBOSE_ARGS_MAXIMUM = 5 |
||
742 | }; |
||
743 | /* Internationalized format string. */ |
||
744 | const char *yyformat = YY_NULLPTR; |
||
745 | /* Arguments of yyformat. */ |
||
746 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
||
747 | /* Number of reported tokens (one for the "unexpected", one per |
||
748 | "expected"). */ |
||
749 | int yycount = 0; |
||
750 | |||
751 | /* There are many possibilities here to consider: |
||
752 | - If this state is a consistent state with a default action, then |
||
753 | the only way this function was invoked is if the default action |
||
754 | is an error action. In that case, don't check for expected |
||
755 | tokens because there are none. |
||
756 | - The only way there can be no lookahead present (in yychar) is if |
||
757 | this state is a consistent state with a default action. Thus, |
||
758 | detecting the absence of a lookahead is sufficient to determine |
||
759 | that there is no unexpected or expected token to report. In that |
||
760 | case, just report a simple "syntax error". |
||
761 | - Don't assume there isn't a lookahead just because this state is a |
||
762 | consistent state with a default action. There might have been a |
||
763 | previous inconsistent state, consistent state with a non-default |
||
764 | action, or user semantic action that manipulated yychar. |
||
765 | - Of course, the expected token list depends on states to have |
||
766 | correct lookahead information, and it depends on the parser not |
||
767 | to perform extra reductions after fetching a lookahead from the |
||
768 | scanner and before detecting a syntax error. Thus, state merging |
||
769 | (from LALR or IELR) and default reductions corrupt the expected |
||
770 | token list. However, the list is correct for canonical LR with |
||
771 | one exception: it will still contain any token that will not be |
||
772 | accepted due to an error action in a later state. |
||
773 | */ |
||
774 | if (yytoken != YYEMPTY) |
||
775 | { |
||
776 | int yyn = yypact[*yyssp]; |
||
777 | yyarg[yycount++] = yytname[yytoken]; |
||
778 | if (!yypact_value_is_default (yyn)) |
||
779 | { |
||
780 | /* Start YYX at -YYN if negative to avoid negative indexes in |
||
781 | YYCHECK. In other words, skip the first -YYN actions for |
||
782 | this state because they are default actions. */ |
||
783 | int yyxbegin = yyn < 0 ? -yyn : 0; |
||
784 | /* Stay within bounds of both yycheck and yytname. */ |
||
785 | int yychecklim = YYLAST - yyn + 1; |
||
786 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
||
787 | int yyx; |
||
788 | |||
789 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
||
790 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && |
||
791 | !yytable_value_is_error (yytable[yyx + yyn])) |
||
792 | { |
||
793 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
||
794 | { |
||
795 | yycount = 1; |
||
796 | yysize = yysize0; |
||
797 | break; |
||
798 | } |
||
799 | yyarg[yycount++] = yytname[yyx]; |
||
800 | { |
||
801 | YYSIZE_T yysize1 = |
||
802 | yysize + |
||
803 | yytnamerr (YY_NULLPTR, yytname[yyx]); |
||
804 | if (!(yysize <= yysize1 && |
||
805 | yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
||
806 | return 2; |
||
807 | yysize = yysize1; |
||
808 | } |
||
809 | } |
||
810 | } |
||
811 | } |
||
812 | |||
813 | switch (yycount) |
||
814 | { |
||
815 | #define YYCASE_(N, S) \ |
||
816 | case N: \ |
||
817 | yyformat = S; \ |
||
818 | break |
||
819 | YYCASE_ (0, YY_ ("syntax error")); |
||
820 | YYCASE_ (1, YY_ ("syntax error, unexpected %s")); |
||
821 | YYCASE_ (2, YY_ ("syntax error, unexpected %s, expecting %s")); |
||
822 | YYCASE_ (3, YY_ ("syntax error, unexpected %s, expecting %s or %s")); |
||
823 | YYCASE_ (4, YY_ ("syntax error, unexpected %s, expecting %s or %s or %s")); |
||
824 | YYCASE_ ( |
||
825 | 5, YY_ ("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
||
826 | #undef YYCASE_ |
||
827 | } |
||
828 | |||
829 | { |
||
830 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
||
831 | if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
||
832 | return 2; |
||
833 | yysize = yysize1; |
||
834 | } |
||
835 | |||
836 | if (*yymsg_alloc < yysize) |
||
837 | { |
||
838 | *yymsg_alloc = 2 * yysize; |
||
839 | if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
||
840 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
||
841 | return 1; |
||
842 | } |
||
843 | |||
844 | /* Avoid sprintf, as that infringes on the user's name space. |
||
845 | Don't have undefined behavior even if the translation |
||
846 | produced a string with the wrong number of "%s"s. */ |
||
847 | { |
||
848 | char *yyp = *yymsg; |
||
849 | int yyi = 0; |
||
850 | while ((*yyp = *yyformat) != '\0') |
||
851 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
||
852 | { |
||
853 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
||
854 | yyformat += 2; |
||
855 | } |
||
856 | else |
||
857 | { |
||
858 | yyp++; |
||
859 | yyformat++; |
||
860 | } |
||
861 | } |
||
862 | return 0; |
||
863 | } |
||
864 | #endif /* YYERROR_VERBOSE */ |
||
865 | |||
866 | /*-----------------------------------------------. |
||
867 | | Release the memory associated to this symbol. | |
||
868 | `-----------------------------------------------*/ |
||
869 | |||
870 | static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
||
871 | { |
||
872 | YYUSE (yyvaluep); |
||
873 | if (!yymsg) |
||
874 | yymsg = "Deleting"; |
||
875 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
||
876 | |||
877 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
878 | YYUSE (yytype); |
||
879 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
||
880 | } |
||
881 | |||
882 | /* The lookahead symbol. */ |
||
883 | int yychar; |
||
884 | |||
885 | /* The semantic value of the lookahead symbol. */ |
||
886 | YYSTYPE yylval; |
||
887 | /* Number of syntax errors so far. */ |
||
888 | int yynerrs; |
||
889 | |||
890 | /*----------. |
||
891 | | yyparse. | |
||
892 | `----------*/ |
||
893 | |||
894 | int yyparse (void) |
||
895 | { |
||
896 | int yystate; |
||
897 | /* Number of tokens to shift before error messages enabled. */ |
||
898 | int yyerrstatus; |
||
899 | |||
900 | /* The stacks and their tools: |
||
901 | 'yyss': related to states. |
||
902 | 'yyvs': related to semantic values. |
||
903 | |||
904 | Refer to the stacks through separate pointers, to allow yyoverflow |
||
905 | to reallocate them elsewhere. */ |
||
906 | |||
907 | /* The state stack. */ |
||
908 | yytype_int16 yyssa[YYINITDEPTH]; |
||
909 | yytype_int16 *yyss; |
||
910 | yytype_int16 *yyssp; |
||
911 | |||
912 | /* The semantic value stack. */ |
||
913 | YYSTYPE yyvsa[YYINITDEPTH]; |
||
914 | YYSTYPE *yyvs; |
||
915 | YYSTYPE *yyvsp; |
||
916 | |||
917 | YYSIZE_T yystacksize; |
||
918 | |||
919 | int yyn; |
||
920 | int yyresult; |
||
921 | /* Lookahead token as an internal (translated) token number. */ |
||
922 | int yytoken = 0; |
||
923 | /* The variables used to return semantic value and location from the |
||
924 | action routines. */ |
||
925 | YYSTYPE yyval; |
||
926 | |||
927 | #if YYERROR_VERBOSE |
||
928 | /* Buffer for error messages, and its allocated size. */ |
||
929 | char yymsgbuf[128]; |
||
930 | char *yymsg = yymsgbuf; |
||
931 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
||
932 | #endif |
||
933 | |||
934 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
||
935 | |||
936 | /* The number of symbols on the RHS of the reduced rule. |
||
937 | Keep to zero when no symbol should be popped. */ |
||
938 | int yylen = 0; |
||
939 | |||
940 | yyssp = yyss = yyssa; |
||
941 | yyvsp = yyvs = yyvsa; |
||
942 | yystacksize = YYINITDEPTH; |
||
943 | |||
944 | YYDPRINTF ((stderr, "Starting parse\n")); |
||
945 | |||
946 | yystate = 0; |
||
947 | yyerrstatus = 0; |
||
948 | yynerrs = 0; |
||
949 | yychar = YYEMPTY; /* Cause a token to be read. */ |
||
950 | goto yysetstate; |
||
951 | |||
952 | /*------------------------------------------------------------. |
||
953 | | yynewstate -- Push a new state, which is found in yystate. | |
||
954 | `------------------------------------------------------------*/ |
||
955 | yynewstate: |
||
956 | /* In all cases, when you get here, the value and location stacks |
||
957 | have just been pushed. So pushing a state here evens the stacks. */ |
||
958 | yyssp++; |
||
959 | |||
960 | yysetstate: |
||
961 | *yyssp = yystate; |
||
962 | |||
963 | if (yyss + yystacksize - 1 <= yyssp) |
||
964 | { |
||
965 | /* Get the current used size of the three stacks, in elements. */ |
||
966 | YYSIZE_T yysize = yyssp - yyss + 1; |
||
967 | |||
968 | #ifdef yyoverflow |
||
969 | { |
||
970 | /* Give user a chance to reallocate the stack. Use copies of |
||
971 | these so that the &'s don't force the real ones into |
||
972 | memory. */ |
||
973 | YYSTYPE *yyvs1 = yyvs; |
||
974 | yytype_int16 *yyss1 = yyss; |
||
975 | |||
976 | /* Each stack pointer address is followed by the size of the |
||
977 | data in use in that stack, in bytes. This used to be a |
||
978 | conditional around just the two extra args, but that might |
||
979 | be undefined if yyoverflow is a macro. */ |
||
980 | yyoverflow ( |
||
981 | YY_ ("memory exhausted"), |
||
982 | &yyss1, |
||
983 | yysize * sizeof (*yyssp), |
||
984 | &yyvs1, |
||
985 | yysize * sizeof (*yyvsp), |
||
986 | &yystacksize); |
||
987 | |||
988 | yyss = yyss1; |
||
989 | yyvs = yyvs1; |
||
990 | } |
||
991 | #else /* no yyoverflow */ |
||
992 | #ifndef YYSTACK_RELOCATE |
||
993 | goto yyexhaustedlab; |
||
994 | #else |
||
995 | /* Extend the stack our own way. */ |
||
996 | if (YYMAXDEPTH <= yystacksize) |
||
997 | goto yyexhaustedlab; |
||
998 | yystacksize *= 2; |
||
999 | if (YYMAXDEPTH < yystacksize) |
||
1000 | yystacksize = YYMAXDEPTH; |
||
1001 | |||
1002 | { |
||
1003 | yytype_int16 *yyss1 = yyss; |
||
1004 | union yyalloc *yyptr = |
||
1005 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
||
1006 | if (!yyptr) |
||
1007 | goto yyexhaustedlab; |
||
1008 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
||
1009 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
||
1010 | #undef YYSTACK_RELOCATE |
||
1011 | if (yyss1 != yyssa) |
||
1012 | YYSTACK_FREE (yyss1); |
||
1013 | } |
||
1014 | #endif |
||
1015 | #endif /* no yyoverflow */ |
||
1016 | |||
1017 | yyssp = yyss + yysize - 1; |
||
1018 | yyvsp = yyvs + yysize - 1; |
||
1019 | |||
1020 | YYDPRINTF (( |
||
1021 | stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); |
||
1022 | |||
1023 | if (yyss + yystacksize - 1 <= yyssp) |
||
1024 | YYABORT; |
||
1025 | } |
||
1026 | |||
1027 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
||
1028 | |||
1029 | if (yystate == YYFINAL) |
||
1030 | YYACCEPT; |
||
1031 | |||
1032 | goto yybackup; |
||
1033 | |||
1034 | /*-----------. |
||
1035 | | yybackup. | |
||
1036 | `-----------*/ |
||
1037 | yybackup: |
||
1038 | |||
1039 | /* Do appropriate processing given the current state. Read a |
||
1040 | lookahead token if we need one and don't already have one. */ |
||
1041 | |||
1042 | /* First try to decide what to do without reference to lookahead token. */ |
||
1043 | yyn = yypact[yystate]; |
||
1044 | if (yypact_value_is_default (yyn)) |
||
1045 | goto yydefault; |
||
1046 | |||
1047 | /* Not known => get a lookahead token if don't already have one. */ |
||
1048 | |||
1049 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
||
1050 | if (yychar == YYEMPTY) |
||
1051 | { |
||
1052 | YYDPRINTF ((stderr, "Reading a token: ")); |
||
1053 | yychar = yylex (); |
||
1054 | } |
||
1055 | |||
1056 | if (yychar <= YYEOF) |
||
1057 | { |
||
1058 | yychar = yytoken = YYEOF; |
||
1059 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
||
1060 | } |
||
1061 | else |
||
1062 | { |
||
1063 | yytoken = YYTRANSLATE (yychar); |
||
1064 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
||
1065 | } |
||
1066 | |||
1067 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
||
1068 | detect an error, take that action. */ |
||
1069 | yyn += yytoken; |
||
1070 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
||
1071 | goto yydefault; |
||
1072 | yyn = yytable[yyn]; |
||
1073 | if (yyn <= 0) |
||
1074 | { |
||
1075 | if (yytable_value_is_error (yyn)) |
||
1076 | goto yyerrlab; |
||
1077 | yyn = -yyn; |
||
1078 | goto yyreduce; |
||
1079 | } |
||
1080 | |||
1081 | /* Count tokens shifted since error; after three, turn off error |
||
1082 | status. */ |
||
1083 | if (yyerrstatus) |
||
1084 | yyerrstatus--; |
||
1085 | |||
1086 | /* Shift the lookahead token. */ |
||
1087 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
||
1088 | |||
1089 | /* Discard the shifted token. */ |
||
1090 | yychar = YYEMPTY; |
||
1091 | |||
1092 | yystate = yyn; |
||
1093 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
1094 | *++yyvsp = yylval; |
||
1095 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
||
1096 | |||
1097 | goto yynewstate; |
||
1098 | |||
1099 | /*-----------------------------------------------------------. |
||
1100 | | yydefault -- do the default action for the current state. | |
||
1101 | `-----------------------------------------------------------*/ |
||
1102 | yydefault: |
||
1103 | yyn = yydefact[yystate]; |
||
1104 | if (yyn == 0) |
||
1105 | goto yyerrlab; |
||
1106 | goto yyreduce; |
||
1107 | |||
1108 | /*-----------------------------. |
||
1109 | | yyreduce -- Do a reduction. | |
||
1110 | `-----------------------------*/ |
||
1111 | yyreduce: |
||
1112 | /* yyn is the number of a rule to reduce with. */ |
||
1113 | yylen = yyr2[yyn]; |
||
1114 | |||
1115 | /* If YYLEN is nonzero, implement the default value of the action: |
||
1116 | '$$ = $1'. |
||
1117 | |||
1118 | Otherwise, the following line sets YYVAL to garbage. |
||
1119 | This behavior is undocumented and Bison |
||
1120 | users should not rely upon it. Assigning to YYVAL |
||
1121 | unconditionally makes the parser a bit smaller, and it avoids a |
||
1122 | GCC warning that YYVAL may be used uninitialized. */ |
||
1123 | yyval = yyvsp[1 - yylen]; |
||
1124 | |||
1125 | YY_REDUCE_PRINT (yyn); |
||
1126 | switch (yyn) |
||
1127 | { |
||
1128 | case 2: |
||
1129 | #line 20 "parser.y" /* yacc.c:1646 */ |
||
1130 | { |
||
1131 | printf ("Procedure : %s\n", (yyvsp[-1].sval)); |
||
1132 | } |
||
1133 | #line 1211 "parser.tab.c" /* yacc.c:1646 */ |
||
1134 | break; |
||
1135 | |||
1136 | case 6: |
||
1137 | #line 31 "parser.y" /* yacc.c:1646 */ |
||
1138 | { |
||
1139 | printf ("\tPart : %s\n", (yyvsp[-1].sval)); |
||
1140 | } |
||
1141 | #line 1217 "parser.tab.c" /* yacc.c:1646 */ |
||
1142 | break; |
||
1143 | |||
1144 | case 10: |
||
1145 | #line 42 "parser.y" /* yacc.c:1646 */ |
||
1146 | { |
||
1147 | printf ("\t\tKeyword : %s\n", (yyvsp[0].sval)); |
||
1148 | } |
||
1149 | #line 1223 "parser.tab.c" /* yacc.c:1646 */ |
||
1150 | break; |
||
1151 | |||
1152 | #line 1227 "parser.tab.c" /* yacc.c:1646 */ |
||
1153 | default: |
||
1154 | break; |
||
1155 | } |
||
1156 | /* User semantic actions sometimes alter yychar, and that requires |
||
1157 | that yytoken be updated with the new translation. We take the |
||
1158 | approach of translating immediately before every use of yytoken. |
||
1159 | One alternative is translating here after every semantic action, |
||
1160 | but that translation would be missed if the semantic action invokes |
||
1161 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
||
1162 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
||
1163 | incorrect destructor might then be invoked immediately. In the |
||
1164 | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
||
1165 | to an incorrect destructor call or verbose syntax error message |
||
1166 | before the lookahead is translated. */ |
||
1167 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
||
1168 | |||
1169 | YYPOPSTACK (yylen); |
||
1170 | yylen = 0; |
||
1171 | YY_STACK_PRINT (yyss, yyssp); |
||
1172 | |||
1173 | *++yyvsp = yyval; |
||
1174 | |||
1175 | /* Now 'shift' the result of the reduction. Determine what state |
||
1176 | that goes to, based on the state we popped back to and the rule |
||
1177 | number reduced by. */ |
||
1178 | |||
1179 | yyn = yyr1[yyn]; |
||
1180 | |||
1181 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
||
1182 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
||
1183 | yystate = yytable[yystate]; |
||
1184 | else |
||
1185 | yystate = yydefgoto[yyn - YYNTOKENS]; |
||
1186 | |||
1187 | goto yynewstate; |
||
1188 | |||
1189 | /*--------------------------------------. |
||
1190 | | yyerrlab -- here on detecting error. | |
||
1191 | `--------------------------------------*/ |
||
1192 | yyerrlab: |
||
1193 | /* Make sure we have latest lookahead translation. See comments at |
||
1194 | user semantic actions for why this is necessary. */ |
||
1195 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
||
1196 | |||
1197 | /* If not already recovering from an error, report this error. */ |
||
1198 | if (!yyerrstatus) |
||
1199 | { |
||
1200 | ++yynerrs; |
||
1201 | #if !YYERROR_VERBOSE |
||
1202 | yyerror (YY_ ("syntax error")); |
||
1203 | #else |
||
1204 | #define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, yyssp, yytoken) |
||
1205 | { |
||
1206 | char const *yymsgp = YY_ ("syntax error"); |
||
1207 | int yysyntax_error_status; |
||
1208 | yysyntax_error_status = YYSYNTAX_ERROR; |
||
1209 | if (yysyntax_error_status == 0) |
||
1210 | yymsgp = yymsg; |
||
1211 | else if (yysyntax_error_status == 1) |
||
1212 | { |
||
1213 | if (yymsg != yymsgbuf) |
||
1214 | YYSTACK_FREE (yymsg); |
||
1215 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
||
1216 | if (!yymsg) |
||
1217 | { |
||
1218 | yymsg = yymsgbuf; |
||
1219 | yymsg_alloc = sizeof yymsgbuf; |
||
1220 | yysyntax_error_status = 2; |
||
1221 | } |
||
1222 | else |
||
1223 | { |
||
1224 | yysyntax_error_status = YYSYNTAX_ERROR; |
||
1225 | yymsgp = yymsg; |
||
1226 | } |
||
1227 | } |
||
1228 | yyerror (yymsgp); |
||
1229 | if (yysyntax_error_status == 2) |
||
1230 | goto yyexhaustedlab; |
||
1231 | } |
||
1232 | #undef YYSYNTAX_ERROR |
||
1233 | #endif |
||
1234 | } |
||
1235 | |||
1236 | if (yyerrstatus == 3) |
||
1237 | { |
||
1238 | /* If just tried and failed to reuse lookahead token after an |
||
1239 | error, discard it. */ |
||
1240 | |||
1241 | if (yychar <= YYEOF) |
||
1242 | { |
||
1243 | /* Return failure if at end of input. */ |
||
1244 | if (yychar == YYEOF) |
||
1245 | YYABORT; |
||
1246 | } |
||
1247 | else |
||
1248 | { |
||
1249 | yydestruct ("Error: discarding", yytoken, &yylval); |
||
1250 | yychar = YYEMPTY; |
||
1251 | } |
||
1252 | } |
||
1253 | |||
1254 | /* Else will try to reuse lookahead token after shifting the error |
||
1255 | token. */ |
||
1256 | goto yyerrlab1; |
||
1257 | |||
1258 | /*---------------------------------------------------. |
||
1259 | | yyerrorlab -- error raised explicitly by YYERROR. | |
||
1260 | `---------------------------------------------------*/ |
||
1261 | yyerrorlab: |
||
1262 | |||
1263 | /* Pacify compilers like GCC when the user code never invokes |
||
1264 | YYERROR and the label yyerrorlab therefore never appears in user |
||
1265 | code. */ |
||
1266 | if (/*CONSTCOND*/ 0) |
||
1267 | goto yyerrorlab; |
||
1268 | |||
1269 | /* Do not reclaim the symbols of the rule whose action triggered |
||
1270 | this YYERROR. */ |
||
1271 | YYPOPSTACK (yylen); |
||
1272 | yylen = 0; |
||
1273 | YY_STACK_PRINT (yyss, yyssp); |
||
1274 | yystate = *yyssp; |
||
1275 | goto yyerrlab1; |
||
1276 | |||
1277 | /*-------------------------------------------------------------. |
||
1278 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
||
1279 | `-------------------------------------------------------------*/ |
||
1280 | yyerrlab1: |
||
1281 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
||
1282 | |||
1283 | for (;;) |
||
1284 | { |
||
1285 | yyn = yypact[yystate]; |
||
1286 | if (!yypact_value_is_default (yyn)) |
||
1287 | { |
||
1288 | yyn += YYTERROR; |
||
1289 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
||
1290 | { |
||
1291 | yyn = yytable[yyn]; |
||
1292 | if (0 < yyn) |
||
1293 | break; |
||
1294 | } |
||
1295 | } |
||
1296 | |||
1297 | /* Pop the current state because it cannot handle the error token. */ |
||
1298 | if (yyssp == yyss) |
||
1299 | YYABORT; |
||
1300 | |||
1301 | yydestruct ("Error: popping", yystos[yystate], yyvsp); |
||
1302 | YYPOPSTACK (1); |
||
1303 | yystate = *yyssp; |
||
1304 | YY_STACK_PRINT (yyss, yyssp); |
||
1305 | } |
||
1306 | |||
1307 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
1308 | *++yyvsp = yylval; |
||
1309 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
||
1310 | |||
1311 | /* Shift the error token. */ |
||
1312 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
||
1313 | |||
1314 | yystate = yyn; |
||
1315 | goto yynewstate; |
||
1316 | |||
1317 | /*-------------------------------------. |
||
1318 | | yyacceptlab -- YYACCEPT comes here. | |
||
1319 | `-------------------------------------*/ |
||
1320 | yyacceptlab: |
||
1321 | yyresult = 0; |
||
1322 | goto yyreturn; |
||
1323 | |||
1324 | /*-----------------------------------. |
||
1325 | | yyabortlab -- YYABORT comes here. | |
||
1326 | `-----------------------------------*/ |
||
1327 | yyabortlab: |
||
1328 | yyresult = 1; |
||
1329 | goto yyreturn; |
||
1330 | |||
1331 | #if !defined yyoverflow || YYERROR_VERBOSE |
||
1332 | /*-------------------------------------------------. |
||
1333 | | yyexhaustedlab -- memory exhaustion comes here. | |
||
1334 | `-------------------------------------------------*/ |
||
1335 | yyexhaustedlab: |
||
1336 | yyerror (YY_ ("memory exhausted")); |
||
1337 | yyresult = 2; |
||
1338 | /* Fall through. */ |
||
1339 | #endif |
||
1340 | |||
1341 | yyreturn: |
||
1342 | if (yychar != YYEMPTY) |
||
1343 | { |
||
1344 | /* Make sure we have latest lookahead translation. See comments at |
||
1345 | user semantic actions for why this is necessary. */ |
||
1346 | yytoken = YYTRANSLATE (yychar); |
||
1347 | yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); |
||
1348 | } |
||
1349 | /* Do not reclaim the symbols of the rule whose action triggered |
||
1350 | this YYABORT or YYACCEPT. */ |
||
1351 | YYPOPSTACK (yylen); |
||
1352 | YY_STACK_PRINT (yyss, yyssp); |
||
1353 | while (yyssp != yyss) |
||
1354 | { |
||
1355 | yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); |
||
1356 | YYPOPSTACK (1); |
||
1357 | } |
||
1358 | #ifndef yyoverflow |
||
1359 | if (yyss != yyssa) |
||
1360 | YYSTACK_FREE (yyss); |
||
1361 | #endif |
||
1362 | #if YYERROR_VERBOSE |
||
1363 | if (yymsg != yymsgbuf) |
||
1364 | YYSTACK_FREE (yymsg); |
||
1365 | #endif |
||
1366 | return yyresult; |
||
1367 | } |
||
1368 | #line 44 "parser.y" /* yacc.c:1906 */ |
||
1369 | |||
1370 | int yyerror (char *s) |
||
1371 | { |
||
1372 | printf ("yyerror : %s\n", s); |
||
1373 | } |
||
1374 | |||
1375 | int main (void) |
||
1376 | { |
||
1377 | yyparse (); |
||
1378 | } |