Debian Codegraph @

texk/gregorio/gregorio-src/src/vowel/vowel-rules-y.c

raw
1 /* A Bison parser, made by GNU Bison 3.8.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 <https://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 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41 /* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48 /* Identify Bison output, and Bison version. */
49 #define YYBISON 30802
50
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
53
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56
57 /* Pure parsers. */
58 #define YYPURE 0
59
60 /* Push parsers. */
61 #define YYPUSH 0
62
63 /* Pull parsers. */
64 #define YYPULL 1
65
66
67 /* Substitute the variable and function names. */
68 #define yyparse gregorio_vowel_rulefile_parse
69 #define yylex gregorio_vowel_rulefile_lex
70 #define yyerror gregorio_vowel_rulefile_error
71 #define yydebug gregorio_vowel_rulefile_debug
72 #define yynerrs gregorio_vowel_rulefile_nerrs
73 #define yylval gregorio_vowel_rulefile_lval
74 #define yychar gregorio_vowel_rulefile_char
75
76 /* First part of user prologue. */
77 #line 1 "vowel/vowel-rules.y"
78
79 /*
80 * Gregorio is a program that translates gabc files to GregorioTeX
81 * This file implements the vowel rule parser.
82 *
83 * Copyright (C) 2015-2025 The Gregorio Project (see CONTRIBUTORS.md)
84 *
85 * This program is free software: you can redistribute it and/or modify it
86 * under the terms of the GNU General Public License as published by the Free
87 * Software Foundation, either version 3 of the License, or (at your option)
88 * any later version.
89 *
90 * This program is distributed in the hope that it will be useful, but WITHOUT
91 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
92 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
93 * more details.
94 *
95 * You should have received a copy of the GNU General Public License along with
96 * this program. If not, see <http://www.gnu.org/licenses/>.
97 */
98
99 #include "config.h"
100 #include <stdio.h>
101 #include <stdlib.h>
102 #include <assert.h>
103 #include "bool.h"
104 #include "struct.h"
105 #include "unicode.h"
106 #include "messages.h"
107
108 #include "vowel.h"
109
110 #include "vowel-rules.h"
111 #include "vowel-rules-l.h"
112
113 /* NOTE: This parser might allocate a new value for language; this value MUST
114 * BE FREED after the parser returns (if the value of the language pointer
115 * changes, then free the pointer). This parser DOES free the language
116 * pointer before changing it, if status points to RFPS_ALIASED. */
117
118 /* uncomment it if you want to have an interactive shell to understand the
119 * details on how bison works for a certain input */
120 /*int gregorio_vowel_rulefile_debug=1;*/
121
122 static void gregorio_vowel_rulefile_error(const char *const filename,
123 char **const language __attribute__((__unused__)),
124 rulefile_parse_status *const status __attribute__((__unused__)),
125 const char *const error_str)
126 {
127 gregorio_messagef("gregorio_vowel_rulefile_parse", VERBOSITY_ERROR, 0,
128 _("%s: %s"), filename, error_str);
129 }
130
131 /* this returns false until the language *after* the desired language */
132 static __inline bool match_language(char **language,
133 rulefile_parse_status *status, char *const name)
134 {
135 if (*status == RFPS_FOUND) {
136 free(name);
137 return true;
138 }
139
140 if (strcmp(*language, name) == 0) {
141 *status = RFPS_FOUND;
142 }
143
144 free(name);
145 return false;
146 }
147
148 static __inline void alias(char **const language,
149 rulefile_parse_status *const status, char *const name,
150 char *const target)
151 {
152 if (strcmp(*language, name) == 0) {
153 gregorio_messagef("alias", VERBOSITY_INFO, 0, _("Aliasing %s to %s"),
154 name, target);
155 if (*status == RFPS_ALIASED) {
156 free(*language);
157 }
158 *language = target;
159 *status = RFPS_ALIASED;
160 } else {
161 free(target);
162 }
163 free(name);
164 }
165
166 static __inline void add(const rulefile_parse_status *const status,
167 void (*const fn)(const char *), char *const value)
168 {
169 if (*status == RFPS_FOUND) {
170 fn(value);
171 }
172 free(value);
173 }
174
175 #define _MATCH(NAME) if (match_language(language, status, NAME)) YYACCEPT
176 #define _ALIAS(NAME, TARGET) alias(language, status, NAME, TARGET)
177 #define _ADD(TABLE, CHARS) add(status, gregorio_##TABLE##_table_add, CHARS)
178
179
180 #line 181 "vowel/vowel-rules-y.c"
181
182 # ifndef YY_CAST
183 # ifdef __cplusplus
184 # define YY_CAST(Type, Val) static_cast<Type> (Val)
185 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
186 # else
187 # define YY_CAST(Type, Val) ((Type) (Val))
188 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
189 # endif
190 # endif
191 # ifndef YY_NULLPTR
192 # if defined __cplusplus
193 # if 201103L <= __cplusplus
194 # define YY_NULLPTR nullptr
195 # else
196 # define YY_NULLPTR 0
197 # endif
198 # else
199 # define YY_NULLPTR ((void*)0)
200 # endif
201 # endif
202
203 #include "vowel-rules-y.h"
204 /* Symbol kind. */
205 enum yysymbol_kind_t
206 {
207 YYSYMBOL_YYEMPTY = -2,
208 YYSYMBOL_YYEOF = 0, /* "end of file" */
209 YYSYMBOL_YYerror = 1, /* error */
210 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
211 YYSYMBOL_LANGUAGE = 3, /* LANGUAGE */
212 YYSYMBOL_VOWEL = 4, /* VOWEL */
213 YYSYMBOL_PREFIX = 5, /* PREFIX */
214 YYSYMBOL_SUFFIX = 6, /* SUFFIX */
215 YYSYMBOL_SECONDARY = 7, /* SECONDARY */
216 YYSYMBOL_ALIAS = 8, /* ALIAS */
217 YYSYMBOL_SEMICOLON = 9, /* SEMICOLON */
218 YYSYMBOL_TO = 10, /* TO */
219 YYSYMBOL_NAME = 11, /* NAME */
220 YYSYMBOL_CHARACTERS = 12, /* CHARACTERS */
221 YYSYMBOL_INVALID = 13, /* INVALID */
222 YYSYMBOL_YYACCEPT = 14, /* $accept */
223 YYSYMBOL_rules = 15, /* rules */
224 YYSYMBOL_rule = 16, /* rule */
225 YYSYMBOL_vowels = 17, /* vowels */
226 YYSYMBOL_prefixes = 18, /* prefixes */
227 YYSYMBOL_suffixes = 19, /* suffixes */
228 YYSYMBOL_secondaries = 20 /* secondaries */
229 };
230 typedef enum yysymbol_kind_t yysymbol_kind_t;
231
232
233
234
235 #ifdef short
236 # undef short
237 #endif
238
239 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
240 <limits.h> and (if available) <stdint.h> are included
241 so that the code can choose integer types of a good width. */
242
243 #ifndef __PTRDIFF_MAX__
244 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
245 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
246 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
247 # define YY_STDINT_H
248 # endif
249 #endif
250
251 /* Narrow types that promote to a signed type and that can represent a
252 signed or unsigned integer of at least N bits. In tables they can
253 save space and decrease cache pressure. Promoting to a signed type
254 helps avoid bugs in integer arithmetic. */
255
256 #ifdef __INT_LEAST8_MAX__
257 typedef __INT_LEAST8_TYPE__ yytype_int8;
258 #elif defined YY_STDINT_H
259 typedef int_least8_t yytype_int8;
260 #else
261 typedef signed char yytype_int8;
262 #endif
263
264 #ifdef __INT_LEAST16_MAX__
265 typedef __INT_LEAST16_TYPE__ yytype_int16;
266 #elif defined YY_STDINT_H
267 typedef int_least16_t yytype_int16;
268 #else
269 typedef short yytype_int16;
270 #endif
271
272 /* Work around bug in HP-UX 11.23, which defines these macros
273 incorrectly for preprocessor constants. This workaround can likely
274 be removed in 2023, as HPE has promised support for HP-UX 11.23
275 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
276 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
277 #ifdef __hpux
278 # undef UINT_LEAST8_MAX
279 # undef UINT_LEAST16_MAX
280 # define UINT_LEAST8_MAX 255
281 # define UINT_LEAST16_MAX 65535
282 #endif
283
284 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
285 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
286 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
287 && UINT_LEAST8_MAX <= INT_MAX)
288 typedef uint_least8_t yytype_uint8;
289 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
290 typedef unsigned char yytype_uint8;
291 #else
292 typedef short yytype_uint8;
293 #endif
294
295 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
296 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
297 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
298 && UINT_LEAST16_MAX <= INT_MAX)
299 typedef uint_least16_t yytype_uint16;
300 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
301 typedef unsigned short yytype_uint16;
302 #else
303 typedef int yytype_uint16;
304 #endif
305
306 #ifndef YYPTRDIFF_T
307 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
308 # define YYPTRDIFF_T __PTRDIFF_TYPE__
309 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
310 # elif defined PTRDIFF_MAX
311 # ifndef ptrdiff_t
312 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
313 # endif
314 # define YYPTRDIFF_T ptrdiff_t
315 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
316 # else
317 # define YYPTRDIFF_T long
318 # define YYPTRDIFF_MAXIMUM LONG_MAX
319 # endif
320 #endif
321
322 #ifndef YYSIZE_T
323 # ifdef __SIZE_TYPE__
324 # define YYSIZE_T __SIZE_TYPE__
325 # elif defined size_t
326 # define YYSIZE_T size_t
327 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
328 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
329 # define YYSIZE_T size_t
330 # else
331 # define YYSIZE_T unsigned
332 # endif
333 #endif
334
335 #define YYSIZE_MAXIMUM \
336 YY_CAST (YYPTRDIFF_T, \
337 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
338 ? YYPTRDIFF_MAXIMUM \
339 : YY_CAST (YYSIZE_T, -1)))
340
341 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
342
343
344 /* Stored state numbers (used for stacks). */
345 typedef yytype_int8 yy_state_t;
346
347 /* State numbers in computations. */
348 typedef int yy_state_fast_t;
349
350 #ifndef YY_
351 # if defined YYENABLE_NLS && YYENABLE_NLS
352 # if ENABLE_NLS
353 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
354 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
355 # endif
356 # endif
357 # ifndef YY_
358 # define YY_(Msgid) Msgid
359 # endif
360 #endif
361
362
363 #ifndef YY_ATTRIBUTE_PURE
364 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
365 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
366 # else
367 # define YY_ATTRIBUTE_PURE
368 # endif
369 #endif
370
371 #ifndef YY_ATTRIBUTE_UNUSED
372 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
373 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
374 # else
375 # define YY_ATTRIBUTE_UNUSED
376 # endif
377 #endif
378
379 /* Suppress unused-variable warnings by "using" E. */
380 #if ! defined lint || defined __GNUC__
381 # define YY_USE(E) ((void) (E))
382 #else
383 # define YY_USE(E) /* empty */
384 #endif
385
386 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
387 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
388 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
389 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
390 _Pragma ("GCC diagnostic push") \
391 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
392 # else
393 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
394 _Pragma ("GCC diagnostic push") \
395 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
396 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
397 # endif
398 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
399 _Pragma ("GCC diagnostic pop")
400 #else
401 # define YY_INITIAL_VALUE(Value) Value
402 #endif
403 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
404 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
405 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
406 #endif
407 #ifndef YY_INITIAL_VALUE
408 # define YY_INITIAL_VALUE(Value) /* Nothing. */
409 #endif
410
411 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
412 # define YY_IGNORE_USELESS_CAST_BEGIN \
413 _Pragma ("GCC diagnostic push") \
414 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
415 # define YY_IGNORE_USELESS_CAST_END \
416 _Pragma ("GCC diagnostic pop")
417 #endif
418 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
419 # define YY_IGNORE_USELESS_CAST_BEGIN
420 # define YY_IGNORE_USELESS_CAST_END
421 #endif
422
423
424 #define YY_ASSERT(E) ((void) (0 && (E)))
425
426 #if !defined yyoverflow
427
428 /* The parser invokes alloca or malloc; define the necessary symbols. */
429
430 # ifdef YYSTACK_USE_ALLOCA
431 # if YYSTACK_USE_ALLOCA
432 # ifdef __GNUC__
433 # define YYSTACK_ALLOC __builtin_alloca
434 # elif defined __BUILTIN_VA_ARG_INCR
435 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
436 # elif defined _AIX
437 # define YYSTACK_ALLOC __alloca
438 # elif defined _MSC_VER
439 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
440 # define alloca _alloca
441 # else
442 # define YYSTACK_ALLOC alloca
443 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
444 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
445 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
446 # ifndef EXIT_SUCCESS
447 # define EXIT_SUCCESS 0
448 # endif
449 # endif
450 # endif
451 # endif
452 # endif
453
454 # ifdef YYSTACK_ALLOC
455 /* Pacify GCC's 'empty if-body' warning. */
456 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
457 # ifndef YYSTACK_ALLOC_MAXIMUM
458 /* The OS might guarantee only one guard page at the bottom of the stack,
459 and a page size can be as small as 4096 bytes. So we cannot safely
460 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
461 to allow for a few compiler-allocated temporary stack slots. */
462 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
463 # endif
464 # else
465 # define YYSTACK_ALLOC YYMALLOC
466 # define YYSTACK_FREE YYFREE
467 # ifndef YYSTACK_ALLOC_MAXIMUM
468 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
469 # endif
470 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
471 && ! ((defined YYMALLOC || defined malloc) \
472 && (defined YYFREE || defined free)))
473 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
474 # ifndef EXIT_SUCCESS
475 # define EXIT_SUCCESS 0
476 # endif
477 # endif
478 # ifndef YYMALLOC
479 # define YYMALLOC malloc
480 # if ! defined malloc && ! defined EXIT_SUCCESS
481 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
482 # endif
483 # endif
484 # ifndef YYFREE
485 # define YYFREE free
486 # if ! defined free && ! defined EXIT_SUCCESS
487 void free (void *); /* INFRINGES ON USER NAME SPACE */
488 # endif
489 # endif
490 # endif
491 #endif /* !defined yyoverflow */
492
493 #if (! defined yyoverflow \
494 && (! defined __cplusplus \
495 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
496
497 /* A type that is properly aligned for any stack member. */
498 union yyalloc
499 {
500 yy_state_t yyss_alloc;
501 YYSTYPE yyvs_alloc;
502 };
503
504 /* The size of the maximum gap between one aligned stack and the next. */
505 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
506
507 /* The size of an array large to enough to hold all stacks, each with
508 N elements. */
509 # define YYSTACK_BYTES(N) \
510 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
511 + YYSTACK_GAP_MAXIMUM)
512
513 # define YYCOPY_NEEDED 1
514
515 /* Relocate STACK from its old location to the new one. The
516 local variables YYSIZE and YYSTACKSIZE give the old and new number of
517 elements in the stack, and YYPTR gives the new location of the
518 stack. Advance YYPTR to a properly aligned location for the next
519 stack. */
520 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
521 do \
522 { \
523 YYPTRDIFF_T yynewbytes; \
524 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
525 Stack = &yyptr->Stack_alloc; \
526 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
527 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
528 } \
529 while (0)
530
531 #endif
532
533 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
534 /* Copy COUNT objects from SRC to DST. The source and destination do
535 not overlap. */
536 # ifndef YYCOPY
537 # if defined __GNUC__ && 1 < __GNUC__
538 # define YYCOPY(Dst, Src, Count) \
539 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
540 # else
541 # define YYCOPY(Dst, Src, Count) \
542 do \
543 { \
544 YYPTRDIFF_T yyi; \
545 for (yyi = 0; yyi < (Count); yyi++) \
546 (Dst)[yyi] = (Src)[yyi]; \
547 } \
548 while (0)
549 # endif
550 # endif
551 #endif /* !YYCOPY_NEEDED */
552
553 /* YYFINAL -- State number of the termination state. */
554 #define YYFINAL 2
555 /* YYLAST -- Last index in YYTABLE. */
556 #define YYLAST 21
557
558 /* YYNTOKENS -- Number of terminals. */
559 #define YYNTOKENS 14
560 /* YYNNTS -- Number of nonterminals. */
561 #define YYNNTS 7
562 /* YYNRULES -- Number of rules. */
563 #define YYNRULES 17
564 /* YYNSTATES -- Number of states. */
565 #define YYNSTATES 28
566
567 /* YYMAXUTOK -- Last valid token kind. */
568 #define YYMAXUTOK 268
569
570
571 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
572 as returned by yylex, with out-of-bounds checking. */
573 #define YYTRANSLATE(YYX) \
574 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
575 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
576 : YYSYMBOL_YYUNDEF)
577
578 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
579 as returned by yylex. */
580 static const yytype_int8 yytranslate[] =
581 {
582 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
608 5, 6, 7, 8, 9, 10, 11, 12, 13
609 };
610
611 #if YYDEBUG
612 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
613 static const yytype_uint8 yyrline[] =
614 {
615 0, 115, 115, 116, 120, 121, 122, 123, 124, 125,
616 129, 130, 134, 135, 139, 140, 144, 145
617 };
618 #endif
619
620 /** Accessing symbol of state STATE. */
621 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
622
623 #if YYDEBUG || 0
624 /* The user-facing name of the symbol whose (internal) number is
625 YYSYMBOL. No bounds checking. */
626 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
627
628 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
629 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
630 static const char *const yytname[] =
631 {
632 "\"end of file\"", "error", "\"invalid token\"", "LANGUAGE", "VOWEL",
633 "PREFIX", "SUFFIX", "SECONDARY", "ALIAS", "SEMICOLON", "TO", "NAME",
634 "CHARACTERS", "INVALID", "$accept", "rules", "rule", "vowels",
635 "prefixes", "suffixes", "secondaries", YY_NULLPTR
636 };
637
638 static const char *
639 yysymbol_name (yysymbol_kind_t yysymbol)
640 {
641 return yytname[yysymbol];
642 }
643 #endif
644
645 #define YYPACT_NINF (-11)
646
647 #define yypact_value_is_default(Yyn) \
648 ((Yyn) == YYPACT_NINF)
649
650 #define YYTABLE_NINF (-1)
651
652 #define yytable_value_is_error(Yyn) \
653 0
654
655 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
656 STATE-NUM. */
657 static const yytype_int8 yypact[] =
658 {
659 -11, 0, -11, -10, -11, -11, -11, -11, -9, -11,
660 8, 1, 2, 3, 7, -1, -11, -11, -11, -11,
661 -11, -11, -11, -11, -11, 9, 12, -11
662 };
663
664 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
665 Performed when YYTABLE does not specify something else to do. Zero
666 means the default is an error. */
667 static const yytype_int8 yydefact[] =
668 {
669 2, 0, 1, 0, 10, 12, 14, 16, 0, 3,
670 0, 0, 0, 0, 0, 0, 4, 6, 11, 7,
671 13, 8, 15, 9, 17, 0, 0, 5
672 };
673
674 /* YYPGOTO[NTERM-NUM]. */
675 static const yytype_int8 yypgoto[] =
676 {
677 -11, -11, -11, -11, -11, -11, -11
678 };
679
680 /* YYDEFGOTO[NTERM-NUM]. */
681 static const yytype_int8 yydefgoto[] =
682 {
683 0, 1, 9, 11, 12, 13, 14
684 };
685
686 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
687 positive, shift that token. If negative, reduce the rule whose
688 number is the opposite. If YYTABLE_NINF, syntax error. */
689 static const yytype_int8 yytable[] =
690 {
691 2, 10, 15, 3, 4, 5, 6, 7, 8, 25,
692 17, 19, 21, 18, 20, 22, 23, 16, 0, 24,
693 26, 27
694 };
695
696 static const yytype_int8 yycheck[] =
697 {
698 0, 11, 11, 3, 4, 5, 6, 7, 8, 10,
699 9, 9, 9, 12, 12, 12, 9, 9, -1, 12,
700 11, 9
701 };
702
703 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
704 state STATE-NUM. */
705 static const yytype_int8 yystos[] =
706 {
707 0, 15, 0, 3, 4, 5, 6, 7, 8, 16,
708 11, 17, 18, 19, 20, 11, 9, 9, 12, 9,
709 12, 9, 12, 9, 12, 10, 11, 9
710 };
711
712 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
713 static const yytype_int8 yyr1[] =
714 {
715 0, 14, 15, 15, 16, 16, 16, 16, 16, 16,
716 17, 17, 18, 18, 19, 19, 20, 20
717 };
718
719 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
720 static const yytype_int8 yyr2[] =
721 {
722 0, 2, 0, 2, 3, 5, 3, 3, 3, 3,
723 0, 2, 0, 2, 0, 2, 0, 2
724 };
725
726
727 enum { YYENOMEM = -2 };
728
729 #define yyerrok (yyerrstatus = 0)
730 #define yyclearin (yychar = YYEMPTY)
731
732 #define YYACCEPT goto yyacceptlab
733 #define YYABORT goto yyabortlab
734 #define YYERROR goto yyerrorlab
735 #define YYNOMEM goto yyexhaustedlab
736
737
738 #define YYRECOVERING() (!!yyerrstatus)
739
740 #define YYBACKUP(Token, Value) \
741 do \
742 if (yychar == YYEMPTY) \
743 { \
744 yychar = (Token); \
745 yylval = (Value); \
746 YYPOPSTACK (yylen); \
747 yystate = *yyssp; \
748 goto yybackup; \
749 } \
750 else \
751 { \
752 yyerror (filename, language, status, YY_("syntax error: cannot back up")); \
753 YYERROR; \
754 } \
755 while (0)
756
757 /* Backward compatibility with an undocumented macro.
758 Use YYerror or YYUNDEF. */
759 #define YYERRCODE YYUNDEF
760
761
762 /* Enable debugging if requested. */
763 #if YYDEBUG
764
765 # ifndef YYFPRINTF
766 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
767 # define YYFPRINTF fprintf
768 # endif
769
770 # define YYDPRINTF(Args) \
771 do { \
772 if (yydebug) \
773 YYFPRINTF Args; \
774 } while (0)
775
776
777
778
779 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
780 do { \
781 if (yydebug) \
782 { \
783 YYFPRINTF (stderr, "%s ", Title); \
784 yy_symbol_print (stderr, \
785 Kind, Value, filename, language, status); \
786 YYFPRINTF (stderr, "\n"); \
787 } \
788 } while (0)
789
790
791 /*-----------------------------------.
792 | Print this symbol's value on YYO. |
793 `-----------------------------------*/
794
795 static void
796 yy_symbol_value_print (FILE *yyo,
797 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, const char *const filename, char **language, rulefile_parse_status *const status)
798 {
799 FILE *yyoutput = yyo;
800 YY_USE (yyoutput);
801 YY_USE (filename);
802 YY_USE (language);
803 YY_USE (status);
804 if (!yyvaluep)
805 return;
806 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
807 YY_USE (yykind);
808 YY_IGNORE_MAYBE_UNINITIALIZED_END
809 }
810
811
812 /*---------------------------.
813 | Print this symbol on YYO. |
814 `---------------------------*/
815
816 static void
817 yy_symbol_print (FILE *yyo,
818 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, const char *const filename, char **language, rulefile_parse_status *const status)
819 {
820 YYFPRINTF (yyo, "%s %s (",
821 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
822
823 yy_symbol_value_print (yyo, yykind, yyvaluep, filename, language, status);
824 YYFPRINTF (yyo, ")");
825 }
826
827 /*------------------------------------------------------------------.
828 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
829 | TOP (included). |
830 `------------------------------------------------------------------*/
831
832 static void
833 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
834 {
835 YYFPRINTF (stderr, "Stack now");
836 for (; yybottom <= yytop; yybottom++)
837 {
838 int yybot = *yybottom;
839 YYFPRINTF (stderr, " %d", yybot);
840 }
841 YYFPRINTF (stderr, "\n");
842 }
843
844 # define YY_STACK_PRINT(Bottom, Top) \
845 do { \
846 if (yydebug) \
847 yy_stack_print ((Bottom), (Top)); \
848 } while (0)
849
850
851 /*------------------------------------------------.
852 | Report that the YYRULE is going to be reduced. |
853 `------------------------------------------------*/
854
855 static void
856 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
857 int yyrule, const char *const filename, char **language, rulefile_parse_status *const status)
858 {
859 int yylno = yyrline[yyrule];
860 int yynrhs = yyr2[yyrule];
861 int yyi;
862 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
863 yyrule - 1, yylno);
864 /* The symbols being reduced. */
865 for (yyi = 0; yyi < yynrhs; yyi++)
866 {
867 YYFPRINTF (stderr, " $%d = ", yyi + 1);
868 yy_symbol_print (stderr,
869 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
870 &yyvsp[(yyi + 1) - (yynrhs)], filename, language, status);
871 YYFPRINTF (stderr, "\n");
872 }
873 }
874
875 # define YY_REDUCE_PRINT(Rule) \
876 do { \
877 if (yydebug) \
878 yy_reduce_print (yyssp, yyvsp, Rule, filename, language, status); \
879 } while (0)
880
881 /* Nonzero means print parse trace. It is left uninitialized so that
882 multiple parsers can coexist. */
883 int yydebug;
884 #else /* !YYDEBUG */
885 # define YYDPRINTF(Args) ((void) 0)
886 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
887 # define YY_STACK_PRINT(Bottom, Top)
888 # define YY_REDUCE_PRINT(Rule)
889 #endif /* !YYDEBUG */
890
891
892 /* YYINITDEPTH -- initial size of the parser's stacks. */
893 #ifndef YYINITDEPTH
894 # define YYINITDEPTH 200
895 #endif
896
897 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
898 if the built-in stack extension method is used).
899
900 Do not make this value too large; the results are undefined if
901 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
902 evaluated with infinite-precision integer arithmetic. */
903
904 #ifndef YYMAXDEPTH
905 # define YYMAXDEPTH 10000
906 #endif
907
908
909
910
911
912
913 /*-----------------------------------------------.
914 | Release the memory associated to this symbol. |
915 `-----------------------------------------------*/
916
917 static void
918 yydestruct (const char *yymsg,
919 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, const char *const filename, char **language, rulefile_parse_status *const status)
920 {
921 YY_USE (yyvaluep);
922 YY_USE (filename);
923 YY_USE (language);
924 YY_USE (status);
925 if (!yymsg)
926 yymsg = "Deleting";
927 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
928
929 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
930 YY_USE (yykind);
931 YY_IGNORE_MAYBE_UNINITIALIZED_END
932 }
933
934
935 /* Lookahead token kind. */
936 int yychar;
937
938 /* The semantic value of the lookahead symbol. */
939 YYSTYPE yylval;
940 /* Number of syntax errors so far. */
941 int yynerrs;
942
943
944
945
946 /*----------.
947 | yyparse. |
948 `----------*/
949
950 int
951 yyparse (const char *const filename, char **language, rulefile_parse_status *const status)
952 {
953 yy_state_fast_t yystate = 0;
954 /* Number of tokens to shift before error messages enabled. */
955 int yyerrstatus = 0;
956
957 /* Refer to the stacks through separate pointers, to allow yyoverflow
958 to reallocate them elsewhere. */
959
960 /* Their size. */
961 YYPTRDIFF_T yystacksize = YYINITDEPTH;
962
963 /* The state stack: array, bottom, top. */
964 yy_state_t yyssa[YYINITDEPTH];
965 yy_state_t *yyss = yyssa;
966 yy_state_t *yyssp = yyss;
967
968 /* The semantic value stack: array, bottom, top. */
969 YYSTYPE yyvsa[YYINITDEPTH];
970 YYSTYPE *yyvs = yyvsa;
971 YYSTYPE *yyvsp = yyvs;
972
973 int yyn;
974 /* The return value of yyparse. */
975 int yyresult;
976 /* Lookahead symbol kind. */
977 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
978 /* The variables used to return semantic value and location from the
979 action routines. */
980 YYSTYPE yyval;
981
982
983
984 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
985
986 /* The number of symbols on the RHS of the reduced rule.
987 Keep to zero when no symbol should be popped. */
988 int yylen = 0;
989
990 YYDPRINTF ((stderr, "Starting parse\n"));
991
992 yychar = YYEMPTY; /* Cause a token to be read. */
993
994 goto yysetstate;
995
996
997 /*------------------------------------------------------------.
998 | yynewstate -- push a new state, which is found in yystate. |
999 `------------------------------------------------------------*/
1000 yynewstate:
1001 /* In all cases, when you get here, the value and location stacks
1002 have just been pushed. So pushing a state here evens the stacks. */
1003 yyssp++;
1004
1005
1006 /*--------------------------------------------------------------------.
1007 | yysetstate -- set current state (the top of the stack) to yystate. |
1008 `--------------------------------------------------------------------*/
1009 yysetstate:
1010 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1011 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1012 YY_IGNORE_USELESS_CAST_BEGIN
1013 *yyssp = YY_CAST (yy_state_t, yystate);
1014 YY_IGNORE_USELESS_CAST_END
1015 YY_STACK_PRINT (yyss, yyssp);
1016
1017 if (yyss + yystacksize - 1 <= yyssp)
1018 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1019 YYNOMEM;
1020 #else
1021 {
1022 /* Get the current used size of the three stacks, in elements. */
1023 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1024
1025 # if defined yyoverflow
1026 {
1027 /* Give user a chance to reallocate the stack. Use copies of
1028 these so that the &'s don't force the real ones into
1029 memory. */
1030 yy_state_t *yyss1 = yyss;
1031 YYSTYPE *yyvs1 = yyvs;
1032
1033 /* Each stack pointer address is followed by the size of the
1034 data in use in that stack, in bytes. This used to be a
1035 conditional around just the two extra args, but that might
1036 be undefined if yyoverflow is a macro. */
1037 yyoverflow (YY_("memory exhausted"),
1038 &yyss1, yysize * YYSIZEOF (*yyssp),
1039 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1040 &yystacksize);
1041 yyss = yyss1;
1042 yyvs = yyvs1;
1043 }
1044 # else /* defined YYSTACK_RELOCATE */
1045 /* Extend the stack our own way. */
1046 if (YYMAXDEPTH <= yystacksize)
1047 YYNOMEM;
1048 yystacksize *= 2;
1049 if (YYMAXDEPTH < yystacksize)
1050 yystacksize = YYMAXDEPTH;
1051
1052 {
1053 yy_state_t *yyss1 = yyss;
1054 union yyalloc *yyptr =
1055 YY_CAST (union yyalloc *,
1056 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1057 if (! yyptr)
1058 YYNOMEM;
1059 YYSTACK_RELOCATE (yyss_alloc, yyss);
1060 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1061 # undef YYSTACK_RELOCATE
1062 if (yyss1 != yyssa)
1063 YYSTACK_FREE (yyss1);
1064 }
1065 # endif
1066
1067 yyssp = yyss + yysize - 1;
1068 yyvsp = yyvs + yysize - 1;
1069
1070 YY_IGNORE_USELESS_CAST_BEGIN
1071 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1072 YY_CAST (long, yystacksize)));
1073 YY_IGNORE_USELESS_CAST_END
1074
1075 if (yyss + yystacksize - 1 <= yyssp)
1076 YYABORT;
1077 }
1078 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1079
1080
1081 if (yystate == YYFINAL)
1082 YYACCEPT;
1083
1084 goto yybackup;
1085
1086
1087 /*-----------.
1088 | yybackup. |
1089 `-----------*/
1090 yybackup:
1091 /* Do appropriate processing given the current state. Read a
1092 lookahead token if we need one and don't already have one. */
1093
1094 /* First try to decide what to do without reference to lookahead token. */
1095 yyn = yypact[yystate];
1096 if (yypact_value_is_default (yyn))
1097 goto yydefault;
1098
1099 /* Not known => get a lookahead token if don't already have one. */
1100
1101 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1102 if (yychar == YYEMPTY)
1103 {
1104 YYDPRINTF ((stderr, "Reading a token\n"));
1105 yychar = yylex ();
1106 }
1107
1108 if (yychar <= YYEOF)
1109 {
1110 yychar = YYEOF;
1111 yytoken = YYSYMBOL_YYEOF;
1112 YYDPRINTF ((stderr, "Now at end of input.\n"));
1113 }
1114 else if (yychar == YYerror)
1115 {
1116 /* The scanner already issued an error message, process directly
1117 to error recovery. But do not keep the error token as
1118 lookahead, it is too special and may lead us to an endless
1119 loop in error recovery. */
1120 yychar = YYUNDEF;
1121 yytoken = YYSYMBOL_YYerror;
1122 goto yyerrlab1;
1123 }
1124 else
1125 {
1126 yytoken = YYTRANSLATE (yychar);
1127 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1128 }
1129
1130 /* If the proper action on seeing token YYTOKEN is to reduce or to
1131 detect an error, take that action. */
1132 yyn += yytoken;
1133 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1134 goto yydefault;
1135 yyn = yytable[yyn];
1136 if (yyn <= 0)
1137 {
1138 if (yytable_value_is_error (yyn))
1139 goto yyerrlab;
1140 yyn = -yyn;
1141 goto yyreduce;
1142 }
1143
1144 /* Count tokens shifted since error; after three, turn off error
1145 status. */
1146 if (yyerrstatus)
1147 yyerrstatus--;
1148
1149 /* Shift the lookahead token. */
1150 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1151 yystate = yyn;
1152 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1153 *++yyvsp = yylval;
1154 YY_IGNORE_MAYBE_UNINITIALIZED_END
1155
1156 /* Discard the shifted token. */
1157 yychar = YYEMPTY;
1158 goto yynewstate;
1159
1160
1161 /*-----------------------------------------------------------.
1162 | yydefault -- do the default action for the current state. |
1163 `-----------------------------------------------------------*/
1164 yydefault:
1165 yyn = yydefact[yystate];
1166 if (yyn == 0)
1167 goto yyerrlab;
1168 goto yyreduce;
1169
1170
1171 /*-----------------------------.
1172 | yyreduce -- do a reduction. |
1173 `-----------------------------*/
1174 yyreduce:
1175 /* yyn is the number of a rule to reduce with. */
1176 yylen = yyr2[yyn];
1177
1178 /* If YYLEN is nonzero, implement the default value of the action:
1179 '$$ = $1'.
1180
1181 Otherwise, the following line sets YYVAL to garbage.
1182 This behavior is undocumented and Bison
1183 users should not rely upon it. Assigning to YYVAL
1184 unconditionally makes the parser a bit smaller, and it avoids a
1185 GCC warning that YYVAL may be used uninitialized. */
1186 yyval = yyvsp[1-yylen];
1187
1188
1189 YY_REDUCE_PRINT (yyn);
1190 switch (yyn)
1191 {
1192 case 4: /* rule: LANGUAGE NAME SEMICOLON */
1193 #line 120 "vowel/vowel-rules.y"
1194 { _MATCH(yyvsp[-1]); }
1195 #line 1196 "vowel/vowel-rules-y.c"
1196 break;
1197
1198 case 5: /* rule: ALIAS NAME TO NAME SEMICOLON */
1199 #line 121 "vowel/vowel-rules.y"
1200 { _ALIAS(yyvsp[-3], yyvsp[-1]); }
1201 #line 1202 "vowel/vowel-rules-y.c"
1202 break;
1203
1204 case 11: /* vowels: vowels CHARACTERS */
1205 #line 130 "vowel/vowel-rules.y"
1206 { _ADD(vowel, yyvsp[0]); }
1207 #line 1208 "vowel/vowel-rules-y.c"
1208 break;
1209
1210 case 13: /* prefixes: prefixes CHARACTERS */
1211 #line 135 "vowel/vowel-rules.y"
1212 { _ADD(prefix, yyvsp[0]); }
1213 #line 1214 "vowel/vowel-rules-y.c"
1214 break;
1215
1216 case 15: /* suffixes: suffixes CHARACTERS */
1217 #line 140 "vowel/vowel-rules.y"
1218 { _ADD(suffix, yyvsp[0]); }
1219 #line 1220 "vowel/vowel-rules-y.c"
1220 break;
1221
1222 case 17: /* secondaries: secondaries CHARACTERS */
1223 #line 145 "vowel/vowel-rules.y"
1224 { _ADD(secondary, yyvsp[0]); }
1225 #line 1226 "vowel/vowel-rules-y.c"
1226 break;
1227
1228
1229 #line 1230 "vowel/vowel-rules-y.c"
1230
1231 default: break;
1232 }
1233 /* User semantic actions sometimes alter yychar, and that requires
1234 that yytoken be updated with the new translation. We take the
1235 approach of translating immediately before every use of yytoken.
1236 One alternative is translating here after every semantic action,
1237 but that translation would be missed if the semantic action invokes
1238 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1239 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1240 incorrect destructor might then be invoked immediately. In the
1241 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1242 to an incorrect destructor call or verbose syntax error message
1243 before the lookahead is translated. */
1244 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1245
1246 YYPOPSTACK (yylen);
1247 yylen = 0;
1248
1249 *++yyvsp = yyval;
1250
1251 /* Now 'shift' the result of the reduction. Determine what state
1252 that goes to, based on the state we popped back to and the rule
1253 number reduced by. */
1254 {
1255 const int yylhs = yyr1[yyn] - YYNTOKENS;
1256 const int yyi = yypgoto[yylhs] + *yyssp;
1257 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1258 ? yytable[yyi]
1259 : yydefgoto[yylhs]);
1260 }
1261
1262 goto yynewstate;
1263
1264
1265 /*--------------------------------------.
1266 | yyerrlab -- here on detecting error. |
1267 `--------------------------------------*/
1268 yyerrlab:
1269 /* Make sure we have latest lookahead translation. See comments at
1270 user semantic actions for why this is necessary. */
1271 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1272 /* If not already recovering from an error, report this error. */
1273 if (!yyerrstatus)
1274 {
1275 ++yynerrs;
1276 yyerror (filename, language, status, YY_("syntax error"));
1277 }
1278
1279 if (yyerrstatus == 3)
1280 {
1281 /* If just tried and failed to reuse lookahead token after an
1282 error, discard it. */
1283
1284 if (yychar <= YYEOF)
1285 {
1286 /* Return failure if at end of input. */
1287 if (yychar == YYEOF)
1288 YYABORT;
1289 }
1290 else
1291 {
1292 yydestruct ("Error: discarding",
1293 yytoken, &yylval, filename, language, status);
1294 yychar = YYEMPTY;
1295 }
1296 }
1297
1298 /* Else will try to reuse lookahead token after shifting the error
1299 token. */
1300 goto yyerrlab1;
1301
1302
1303 /*---------------------------------------------------.
1304 | yyerrorlab -- error raised explicitly by YYERROR. |
1305 `---------------------------------------------------*/
1306 yyerrorlab:
1307 /* Pacify compilers when the user code never invokes YYERROR and the
1308 label yyerrorlab therefore never appears in user code. */
1309 if (0)
1310 YYERROR;
1311 ++yynerrs;
1312
1313 /* Do not reclaim the symbols of the rule whose action triggered
1314 this YYERROR. */
1315 YYPOPSTACK (yylen);
1316 yylen = 0;
1317 YY_STACK_PRINT (yyss, yyssp);
1318 yystate = *yyssp;
1319 goto yyerrlab1;
1320
1321
1322 /*-------------------------------------------------------------.
1323 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1324 `-------------------------------------------------------------*/
1325 yyerrlab1:
1326 yyerrstatus = 3; /* Each real token shifted decrements this. */
1327
1328 /* Pop stack until we find a state that shifts the error token. */
1329 for (;;)
1330 {
1331 yyn = yypact[yystate];
1332 if (!yypact_value_is_default (yyn))
1333 {
1334 yyn += YYSYMBOL_YYerror;
1335 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1336 {
1337 yyn = yytable[yyn];
1338 if (0 < yyn)
1339 break;
1340 }
1341 }
1342
1343 /* Pop the current state because it cannot handle the error token. */
1344 if (yyssp == yyss)
1345 YYABORT;
1346
1347
1348 yydestruct ("Error: popping",
1349 YY_ACCESSING_SYMBOL (yystate), yyvsp, filename, language, status);
1350 YYPOPSTACK (1);
1351 yystate = *yyssp;
1352 YY_STACK_PRINT (yyss, yyssp);
1353 }
1354
1355 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1356 *++yyvsp = yylval;
1357 YY_IGNORE_MAYBE_UNINITIALIZED_END
1358
1359
1360 /* Shift the error token. */
1361 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1362
1363 yystate = yyn;
1364 goto yynewstate;
1365
1366
1367 /*-------------------------------------.
1368 | yyacceptlab -- YYACCEPT comes here. |
1369 `-------------------------------------*/
1370 yyacceptlab:
1371 yyresult = 0;
1372 goto yyreturnlab;
1373
1374
1375 /*-----------------------------------.
1376 | yyabortlab -- YYABORT comes here. |
1377 `-----------------------------------*/
1378 yyabortlab:
1379 yyresult = 1;
1380 goto yyreturnlab;
1381
1382
1383 /*-----------------------------------------------------------.
1384 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1385 `-----------------------------------------------------------*/
1386 yyexhaustedlab:
1387 yyerror (filename, language, status, YY_("memory exhausted"));
1388 yyresult = 2;
1389 goto yyreturnlab;
1390
1391
1392 /*----------------------------------------------------------.
1393 | yyreturnlab -- parsing is finished, clean up and return. |
1394 `----------------------------------------------------------*/
1395 yyreturnlab:
1396 if (yychar != YYEMPTY)
1397 {
1398 /* Make sure we have latest lookahead translation. See comments at
1399 user semantic actions for why this is necessary. */
1400 yytoken = YYTRANSLATE (yychar);
1401 yydestruct ("Cleanup: discarding lookahead",
1402 yytoken, &yylval, filename, language, status);
1403 }
1404 /* Do not reclaim the symbols of the rule whose action triggered
1405 this YYABORT or YYACCEPT. */
1406 YYPOPSTACK (yylen);
1407 YY_STACK_PRINT (yyss, yyssp);
1408 while (yyssp != yyss)
1409 {
1410 yydestruct ("Cleanup: popping",
1411 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, filename, language, status);
1412 YYPOPSTACK (1);
1413 }
1414 #ifndef yyoverflow
1415 if (yyss != yyssa)
1416 YYSTACK_FREE (yyss);
1417 #endif
1418
1419 return yyresult;
1420 }
1421