47 #define YYBISON_VERSION "2.7.12-4996"
50 #define YYSKELETON_NAME "yacc.c"
66 #line 37 "jsgf_parser.y"
68 #define YYERROR_VERBOSE
78 #include "jsgf_parser.h"
79 #include "jsgf_scanner.h"
83 #pragma warning(disable: 4273)
86 void yyerror(yyscan_t lex,
jsgf_t *jsgf,
const char *s);
90 #line 91 "jsgf_parser.c"
93 # if defined __cplusplus && 201103L <= __cplusplus
94 # define YY_NULL nullptr
101 #ifdef YYERROR_VERBOSE
102 # undef YYERROR_VERBOSE
103 # define YYERROR_VERBOSE 1
105 # define YYERROR_VERBOSE 0
110 #ifndef YY_YY_Y_TAB_H_INCLUDED
111 # define YY_YY_Y_TAB_H_INCLUDED
148 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
152 #line 65 "jsgf_parser.y"
162 #line 163 "jsgf_parser.c"
164 # define YYSTYPE_IS_TRIVIAL 1
165 # define yystype YYSTYPE
166 # define YYSTYPE_IS_DECLARED 1
171 #if defined __STDC__ || defined __cplusplus
172 int yyparse (
void *YYPARSE_PARAM);
177 #if defined __STDC__ || defined __cplusplus
178 int yyparse (
void* yyscanner,
jsgf_t *jsgf);
189 #line 190 "jsgf_parser.c"
196 typedef YYTYPE_UINT8 yytype_uint8;
198 typedef unsigned char yytype_uint8;
202 typedef YYTYPE_INT8 yytype_int8;
203 #elif (defined __STDC__ || defined __C99__FUNC__ \
204 || defined __cplusplus || defined _MSC_VER)
205 typedef signed char yytype_int8;
207 typedef short int yytype_int8;
211 typedef YYTYPE_UINT16 yytype_uint16;
213 typedef unsigned short int yytype_uint16;
217 typedef YYTYPE_INT16 yytype_int16;
219 typedef short int yytype_int16;
223 # ifdef __SIZE_TYPE__
224 # define YYSIZE_T __SIZE_TYPE__
225 # elif defined size_t
226 # define YYSIZE_T size_t
227 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
228 || defined __cplusplus || defined _MSC_VER)
230 # define YYSIZE_T size_t
232 # define YYSIZE_T unsigned int
236 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
239 # if defined YYENABLE_NLS && YYENABLE_NLS
241 # include <libintl.h>
242 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
246 # define YY_(Msgid) Msgid
250 #ifndef __attribute__
252 # if (! defined __GNUC__ || __GNUC__ < 2 \
253 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
254 # define __attribute__(Spec)
259 #if ! defined lint || defined __GNUC__
260 # define YYUSE(E) ((void) (E))
270 #if (defined __STDC__ || defined __C99__FUNC__ \
271 || defined __cplusplus || defined _MSC_VER)
284 #if ! defined yyoverflow || YYERROR_VERBOSE
288 # ifdef YYSTACK_USE_ALLOCA
289 # if YYSTACK_USE_ALLOCA
291 # define YYSTACK_ALLOC __builtin_alloca
292 # elif defined __BUILTIN_VA_ARG_INCR
295 # define YYSTACK_ALLOC __alloca
296 # elif defined _MSC_VER
298 # define alloca _alloca
300 # define YYSTACK_ALLOC alloca
301 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
302 || defined __cplusplus || defined _MSC_VER)
305 # ifndef EXIT_SUCCESS
306 # define EXIT_SUCCESS 0
313 # ifdef YYSTACK_ALLOC
315 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
316 # ifndef YYSTACK_ALLOC_MAXIMUM
321 # define YYSTACK_ALLOC_MAXIMUM 4032
324 # define YYSTACK_ALLOC YYMALLOC
325 # define YYSTACK_FREE YYFREE
326 # ifndef YYSTACK_ALLOC_MAXIMUM
327 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
329 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
330 && ! ((defined YYMALLOC || defined malloc) \
331 && (defined YYFREE || defined free)))
333 # ifndef EXIT_SUCCESS
334 # define EXIT_SUCCESS 0
338 # define YYMALLOC malloc
339 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
340 || defined __cplusplus || defined _MSC_VER)
341 void *malloc (YYSIZE_T);
346 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
347 || defined __cplusplus || defined _MSC_VER)
355 #if (! defined yyoverflow \
356 && (! defined __cplusplus \
357 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
362 yytype_int16 yyss_alloc;
367 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
371 # define YYSTACK_BYTES(N) \
372 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
373 + YYSTACK_GAP_MAXIMUM)
375 # define YYCOPY_NEEDED 1
382 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
385 YYSIZE_T yynewbytes; \
386 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
387 Stack = &yyptr->Stack_alloc; \
388 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
389 yyptr += yynewbytes / sizeof (*yyptr); \
395 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
399 # if defined __GNUC__ && 1 < __GNUC__
400 # define YYCOPY(Dst, Src, Count) \
401 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
403 # define YYCOPY(Dst, Src, Count) \
407 for (yyi = 0; yyi < (Count); yyi++) \
408 (Dst)[yyi] = (Src)[yyi]; \
431 #define YYMAXUTOK 265
433 #define YYTRANSLATE(YYX) \
434 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
437 static const yytype_uint8 yytranslate[] =
439 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 14, 15, 18, 19, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 11,
445 2, 12, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 16, 2, 17, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 13, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
471 static const yytype_uint8 yyprhs[] =
473 0, 0, 3, 5, 8, 12, 15, 18, 22, 27,
474 33, 37, 39, 42, 46, 48, 51, 56, 62, 64,
475 68, 70, 73, 75, 78, 80, 83, 87, 91, 93,
480 static const yytype_int8 yyrhs[] =
482 21, 0, -1, 22, -1, 22, 27, -1, 22, 25,
483 27, -1, 23, 24, -1, 3, 11, -1, 3, 7,
484 11, -1, 3, 7, 7, 11, -1, 3, 7, 7,
485 7, 11, -1, 4, 7, 11, -1, 26, -1, 25,
486 26, -1, 5, 8, 11, -1, 28, -1, 27, 28,
487 -1, 8, 12, 29, 11, -1, 6, 8, 12, 29,
488 11, -1, 30, -1, 29, 13, 30, -1, 31, -1,
489 30, 31, -1, 32, -1, 31, 9, -1, 35, -1,
490 10, 35, -1, 14, 29, 15, -1, 16, 29, 17,
491 -1, 7, -1, 8, -1, 33, -1, 34, -1, 35,
496 static const yytype_uint8 yyrline[] =
498 0, 82, 82, 83, 84, 87, 90, 91, 92, 93,
499 97, 100, 101, 104, 107, 108, 111, 112, 115, 116,
500 121, 123, 127, 128, 132, 133, 136, 139, 142, 143,
505 #if YYDEBUG || YYERROR_VERBOSE || 0
508 static const char *
const yytname[] =
510 "$end",
"error",
"$undefined",
"HEADER",
"GRAMMAR",
"IMPORT",
"PUBLIC",
511 "TOKEN",
"RULENAME",
"TAG",
"WEIGHT",
"';'",
"'='",
"'|'",
"'('",
"')'",
512 "'['",
"']'",
"'*'",
"'+'",
"$accept",
"grammar",
"header",
513 "jsgf_header",
"grammar_header",
"import_header",
"import_statement",
514 "rule_list",
"rule",
"alternate_list",
"rule_expansion",
515 "tagged_rule_item",
"rule_item",
"rule_group",
"rule_optional",
523 static const yytype_uint16 yytoknum[] =
525 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
526 265, 59, 61, 124, 40, 41, 91, 93, 42, 43
531 static const yytype_uint8 yyr1[] =
533 0, 20, 21, 21, 21, 22, 23, 23, 23, 23,
534 24, 25, 25, 26, 27, 27, 28, 28, 29, 29,
535 30, 30, 31, 31, 32, 32, 33, 34, 35, 35,
540 static const yytype_uint8 yyr2[] =
542 0, 2, 1, 2, 3, 2, 2, 3, 4, 5,
543 3, 1, 2, 3, 1, 2, 4, 5, 1, 3,
544 1, 2, 1, 2, 1, 2, 3, 3, 1, 1,
551 static const yytype_uint8 yydefact[] =
553 0, 0, 0, 2, 0, 0, 6, 1, 0, 0,
554 0, 0, 11, 3, 14, 0, 5, 0, 7, 0,
555 0, 0, 12, 4, 15, 0, 0, 8, 13, 0,
556 28, 29, 0, 0, 0, 0, 18, 20, 22, 30,
557 31, 24, 10, 9, 0, 25, 0, 0, 16, 0,
558 21, 23, 32, 33, 17, 26, 27, 19
562 static const yytype_int8 yydefgoto[] =
564 -1, 2, 3, 4, 16, 11, 12, 13, 14, 35,
565 36, 37, 38, 39, 40, 41
570 #define YYPACT_NINF -37
571 static const yytype_int8 yypact[] =
573 -1, -2, 36, 22, 35, 8, -37, -37, 32, 33,
574 30, 22, -37, 17, -37, 37, -37, 13, -37, 34,
575 31, -4, -37, 17, -37, 38, 39, -37, -37, -4,
576 -37, -37, 0, -4, -4, 18, -4, 42, -37, -37,
577 -37, 19, -37, -37, 21, 19, 20, 9, -37, -4,
578 42, -37, -37, -37, -37, -37, -37, -4
582 static const yytype_int8 yypgoto[] =
584 -37, -37, -37, -37, -37, -37, 41, 43, -12, -16,
585 -3, -36, -37, -37, -37, 15
591 #define YYTABLE_NINF -1
592 static const yytype_uint8 yytable[] =
594 50, 24, 1, 30, 31, 5, 32, 30, 31, 6,
595 33, 24, 34, 44, 33, 17, 34, 46, 47, 18,
596 26, 50, 49, 9, 27, 10, 56, 8, 9, 48,
597 10, 49, 54, 49, 49, 55, 7, 52, 53, 15,
598 19, 20, 21, 29, 25, 28, 57, 45, 0, 42,
602 #define yypact_value_is_default(Yystate) \
603 (!!((Yystate) == (-37)))
605 #define yytable_value_is_error(Yytable_value) \
608 static const yytype_int8 yycheck[] =
610 36, 13, 3, 7, 8, 7, 10, 7, 8, 11,
611 14, 23, 16, 29, 14, 7, 16, 33, 34, 11,
612 7, 57, 13, 6, 11, 8, 17, 5, 6, 11,
613 8, 13, 11, 13, 13, 15, 0, 18, 19, 4,
614 8, 8, 12, 12, 7, 11, 49, 32, -1, 11,
620 static const yytype_uint8 yystos[] =
622 0, 3, 21, 22, 23, 7, 11, 0, 5, 6,
623 8, 25, 26, 27, 28, 4, 24, 7, 11, 8,
624 8, 12, 26, 27, 28, 7, 7, 11, 11, 12,
625 7, 8, 10, 14, 16, 29, 30, 31, 32, 33,
626 34, 35, 11, 11, 29, 35, 29, 29, 11, 13,
627 31, 9, 18, 19, 11, 15, 17, 30
630 #define yyerrok (yyerrstatus = 0)
631 #define yyclearin (yychar = YYEMPTY)
635 #define YYACCEPT goto yyacceptlab
636 #define YYABORT goto yyabortlab
637 #define YYERROR goto yyerrorlab
647 #define YYFAIL goto yyerrlab
655 #define YYRECOVERING() (!!yyerrstatus)
657 #define YYBACKUP(Token, Value) \
659 if (yychar == YYEMPTY) \
663 YYPOPSTACK (yylen); \
669 yyerror (yyscanner, jsgf, YY_("syntax error: cannot back up")); \
676 #define YYERRCODE 256
680 #ifndef YY_LOCATION_PRINT
681 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
687 # define YYLEX yylex (&yylval, YYLEX_PARAM)
689 # define YYLEX yylex (&yylval, yyscanner)
697 # define YYFPRINTF fprintf
700 # define YYDPRINTF(Args) \
706 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
710 YYFPRINTF (stderr, "%s ", Title); \
711 yy_symbol_print (stderr, \
712 Type, Value, yyscanner, jsgf); \
713 YYFPRINTF (stderr, "\n"); \
723 #if (defined __STDC__ || defined __C99__FUNC__ \
724 || defined __cplusplus || defined _MSC_VER)
726 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void* yyscanner,
jsgf_t *jsgf)
729 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner, jsgf)
732 YYSTYPE const * const yyvaluep;
737 FILE *yyo = yyoutput;
744 if (yytype < YYNTOKENS)
745 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
757 #if (defined __STDC__ || defined __C99__FUNC__ \
758 || defined __cplusplus || defined _MSC_VER)
760 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void* yyscanner,
jsgf_t *jsgf)
763 yy_symbol_print (yyoutput, yytype, yyvaluep, yyscanner, jsgf)
766 YYSTYPE const * const yyvaluep;
771 if (yytype < YYNTOKENS)
772 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
774 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
776 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner, jsgf);
777 YYFPRINTF (yyoutput,
")");
785 #if (defined __STDC__ || defined __C99__FUNC__ \
786 || defined __cplusplus || defined _MSC_VER)
788 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
791 yy_stack_print (yybottom, yytop)
792 yytype_int16 *yybottom;
796 YYFPRINTF (stderr,
"Stack now");
797 for (; yybottom <= yytop; yybottom++)
799 int yybot = *yybottom;
800 YYFPRINTF (stderr,
" %d", yybot);
802 YYFPRINTF (stderr,
"\n");
805 # define YY_STACK_PRINT(Bottom, Top) \
808 yy_stack_print ((Bottom), (Top)); \
816 #if (defined __STDC__ || defined __C99__FUNC__ \
817 || defined __cplusplus || defined _MSC_VER)
819 yy_reduce_print (
YYSTYPE *yyvsp,
int yyrule,
void* yyscanner,
jsgf_t *jsgf)
822 yy_reduce_print (yyvsp, yyrule, yyscanner, jsgf)
829 int yynrhs = yyr2[yyrule];
831 unsigned long int yylno = yyrline[yyrule];
832 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
835 for (yyi = 0; yyi < yynrhs; yyi++)
837 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
838 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
839 &(yyvsp[(yyi + 1) - (yynrhs)])
841 YYFPRINTF (stderr,
"\n");
845 # define YY_REDUCE_PRINT(Rule) \
848 yy_reduce_print (yyvsp, Rule, yyscanner, jsgf); \
855 # define YYDPRINTF(Args)
856 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
857 # define YY_STACK_PRINT(Bottom, Top)
858 # define YY_REDUCE_PRINT(Rule)
864 # define YYINITDEPTH 200
875 # define YYMAXDEPTH 10000
882 # if defined __GLIBC__ && defined _STRING_H
883 # define yystrlen strlen
886 #if (defined __STDC__ || defined __C99__FUNC__ \
887 || defined __cplusplus || defined _MSC_VER)
889 yystrlen (
const char *yystr)
897 for (yylen = 0; yystr[yylen]; yylen++)
905 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
906 # define yystpcpy stpcpy
910 #if (defined __STDC__ || defined __C99__FUNC__ \
911 || defined __cplusplus || defined _MSC_VER)
913 yystpcpy (
char *yydest,
const char *yysrc)
916 yystpcpy (yydest, yysrc)
922 const char *yys = yysrc;
924 while ((*yyd++ = *yys++) !=
'\0')
941 yytnamerr (
char *yyres,
const char *yystr)
946 char const *yyp = yystr;
953 goto do_not_strip_quotes;
957 goto do_not_strip_quotes;
970 do_not_strip_quotes: ;
974 return yystrlen (yystr);
976 return yystpcpy (yyres, yystr) - yyres;
989 yysyntax_error (YYSIZE_T *yymsg_alloc,
char **yymsg,
990 yytype_int16 *yyssp,
int yytoken)
992 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
993 YYSIZE_T yysize = yysize0;
994 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
996 const char *yyformat = YY_NULL;
998 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1030 if (yytoken != YYEMPTY)
1032 int yyn = yypact[*yyssp];
1033 yyarg[yycount++] = yytname[yytoken];
1034 if (!yypact_value_is_default (yyn))
1039 int yyxbegin = yyn < 0 ? -yyn : 0;
1041 int yychecklim = YYLAST - yyn + 1;
1042 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1045 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1046 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1047 && !yytable_value_is_error (yytable[yyx + yyn]))
1049 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1055 yyarg[yycount++] = yytname[yyx];
1057 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1058 if (! (yysize <= yysize1
1059 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1069 # define YYCASE_(N, S) \
1073 YYCASE_(0, YY_(
"syntax error"));
1074 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1075 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1076 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1077 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1078 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1083 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1084 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1089 if (*yymsg_alloc < yysize)
1091 *yymsg_alloc = 2 * yysize;
1092 if (! (yysize <= *yymsg_alloc
1093 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1094 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1104 while ((*yyp = *yyformat) !=
'\0')
1105 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1107 yyp += yytnamerr (yyp, yyarg[yyi++]);
1125 #if (defined __STDC__ || defined __C99__FUNC__ \
1126 || defined __cplusplus || defined _MSC_VER)
1128 yydestruct (
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep,
void* yyscanner,
jsgf_t *jsgf)
1131 yydestruct (yymsg, yytype, yyvaluep, yyscanner, jsgf)
1145 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1157 #ifdef YYPARSE_PARAM
1158 #if (defined __STDC__ || defined __C99__FUNC__ \
1159 || defined __cplusplus || defined _MSC_VER)
1161 yyparse (
void *YYPARSE_PARAM)
1164 yyparse (YYPARSE_PARAM)
1165 void *YYPARSE_PARAM;
1168 #if (defined __STDC__ || defined __C99__FUNC__ \
1169 || defined __cplusplus || defined _MSC_VER)
1171 yyparse (
void* yyscanner,
jsgf_t *jsgf)
1174 yyparse (yyscanner, jsgf)
1184 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1186 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1187 _Pragma ("GCC diagnostic push") \
1188 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1189 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1190 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1191 _Pragma ("GCC diagnostic pop")
1196 # define YY_INITIAL_VALUE(Value) = Value
1198 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1199 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1200 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1202 #ifndef YY_INITIAL_VALUE
1203 # define YY_INITIAL_VALUE(Value)
1207 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1224 yytype_int16 yyssa[YYINITDEPTH];
1226 yytype_int16 *yyssp;
1233 YYSIZE_T yystacksize;
1246 char *yymsg = yymsgbuf;
1247 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1250 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1256 yyssp = yyss = yyssa;
1257 yyvsp = yyvs = yyvsa;
1258 yystacksize = YYINITDEPTH;
1260 YYDPRINTF ((stderr,
"Starting parse\n"));
1279 if (yyss + yystacksize - 1 <= yyssp)
1282 YYSIZE_T yysize = yyssp - yyss + 1;
1290 yytype_int16 *yyss1 = yyss;
1296 yyoverflow (YY_(
"memory exhausted"),
1297 &yyss1, yysize *
sizeof (*yyssp),
1298 &yyvs1, yysize *
sizeof (*yyvsp),
1305 # ifndef YYSTACK_RELOCATE
1306 goto yyexhaustedlab;
1309 if (YYMAXDEPTH <= yystacksize)
1310 goto yyexhaustedlab;
1312 if (YYMAXDEPTH < yystacksize)
1313 yystacksize = YYMAXDEPTH;
1316 yytype_int16 *yyss1 = yyss;
1318 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1320 goto yyexhaustedlab;
1321 YYSTACK_RELOCATE (yyss_alloc, yyss);
1322 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1323 # undef YYSTACK_RELOCATE
1325 YYSTACK_FREE (yyss1);
1330 yyssp = yyss + yysize - 1;
1331 yyvsp = yyvs + yysize - 1;
1333 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1334 (
unsigned long int) yystacksize));
1336 if (yyss + yystacksize - 1 <= yyssp)
1340 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1342 if (yystate == YYFINAL)
1356 yyn = yypact[yystate];
1357 if (yypact_value_is_default (yyn))
1363 if (yychar == YYEMPTY)
1365 YYDPRINTF ((stderr,
"Reading a token: "));
1369 if (yychar <= YYEOF)
1371 yychar = yytoken = YYEOF;
1372 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1376 yytoken = YYTRANSLATE (yychar);
1377 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1383 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1388 if (yytable_value_is_error (yyn))
1400 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1406 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1408 YY_IGNORE_MAYBE_UNINITIALIZED_END
1417 yyn = yydefact[yystate];
1438 yyval = yyvsp[1-yylen];
1441 YY_REDUCE_PRINT (yyn);
1446 #line 87 "jsgf_parser.y"
1447 { jsgf->
name = (yyvsp[(2) - (2)].name); }
1452 #line 91 "jsgf_parser.y"
1453 { jsgf->
version = (yyvsp[(2) - (3)].name); }
1458 #line 92 "jsgf_parser.y"
1459 { jsgf->
version = (yyvsp[(2) - (4)].name); jsgf->
charset = (yyvsp[(3) - (4)].name); }
1464 #line 93 "jsgf_parser.y"
1465 { jsgf->
version = (yyvsp[(2) - (5)].name); jsgf->
charset = (yyvsp[(3) - (5)].name);
1466 jsgf->
locale = (yyvsp[(4) - (5)].name); }
1471 #line 97 "jsgf_parser.y"
1472 { (yyval.name) = (yyvsp[(2) - (3)].name); }
1477 #line 104 "jsgf_parser.y"
1478 { jsgf_import_rule(jsgf, (yyvsp[(2) - (3)].name));
ckd_free((yyvsp[(2) - (3)].name)); }
1483 #line 111 "jsgf_parser.y"
1484 { jsgf_define_rule(jsgf, (yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].rhs), 0);
ckd_free((yyvsp[(1) - (4)].name)); }
1489 #line 112 "jsgf_parser.y"
1490 { jsgf_define_rule(jsgf, (yyvsp[(2) - (5)].name), (yyvsp[(4) - (5)].rhs), 1);
ckd_free((yyvsp[(2) - (5)].name)); }
1495 #line 115 "jsgf_parser.y"
1496 { (yyval.rhs) = (yyvsp[(1) - (1)].rhs); (yyval.rhs)->atoms =
glist_reverse((yyval.rhs)->atoms); }
1501 #line 116 "jsgf_parser.y"
1502 { (yyval.rhs) = (yyvsp[(3) - (3)].rhs);
1504 (yyval.rhs)->alt = (yyvsp[(1) - (3)].rhs); }
1509 #line 121 "jsgf_parser.y"
1510 { (yyval.rhs) =
ckd_calloc(1,
sizeof(*(yyval.rhs)));
1511 (yyval.rhs)->atoms =
glist_add_ptr((yyval.rhs)->atoms, (yyvsp[(1) - (1)].atom)); }
1516 #line 123 "jsgf_parser.y"
1517 { (yyval.rhs) = (yyvsp[(1) - (2)].rhs);
1518 (yyval.rhs)->atoms =
glist_add_ptr((yyval.rhs)->atoms, (yyvsp[(2) - (2)].atom)); }
1523 #line 128 "jsgf_parser.y"
1524 { (yyval.atom) = (yyvsp[(1) - (2)].atom);
1525 (yyval.atom)->tags =
glist_add_ptr((yyval.atom)->tags, (yyvsp[(2) - (2)].name)); }
1530 #line 133 "jsgf_parser.y"
1531 { (yyval.atom) = (yyvsp[(2) - (2)].atom); (yyval.atom)->weight = (yyvsp[(1) - (2)].weight); }
1536 #line 136 "jsgf_parser.y"
1537 { (yyval.rule) = jsgf_define_rule(jsgf, NULL, (yyvsp[(2) - (3)].rhs), 0); }
1542 #line 139 "jsgf_parser.y"
1543 { (yyval.rule) = jsgf_optional_new(jsgf, (yyvsp[(2) - (3)].rhs)); }
1548 #line 142 "jsgf_parser.y"
1549 { (yyval.atom) = jsgf_atom_new((yyvsp[(1) - (1)].name), 1.0);
ckd_free((yyvsp[(1) - (1)].name)); }
1554 #line 143 "jsgf_parser.y"
1555 { (yyval.atom) = jsgf_atom_new((yyvsp[(1) - (1)].name), 1.0);
ckd_free((yyvsp[(1) - (1)].name)); }
1560 #line 144 "jsgf_parser.y"
1561 { (yyval.atom) = jsgf_atom_new((yyvsp[(1) - (1)].rule)->name, 1.0); }
1566 #line 145 "jsgf_parser.y"
1567 { (yyval.atom) = jsgf_atom_new((yyvsp[(1) - (1)].rule)->name, 1.0); }
1572 #line 146 "jsgf_parser.y"
1573 { (yyval.atom) = jsgf_kleene_new(jsgf, (yyvsp[(1) - (2)].atom), 0); }
1578 #line 147 "jsgf_parser.y"
1579 { (yyval.atom) = jsgf_kleene_new(jsgf, (yyvsp[(1) - (2)].atom), 1); }
1584 #line 1585 "jsgf_parser.c"
1598 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
1602 YY_STACK_PRINT (yyss, yyssp);
1612 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1613 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1614 yystate = yytable[yystate];
1616 yystate = yydefgoto[yyn - YYNTOKENS];
1627 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1633 #if ! YYERROR_VERBOSE
1634 yyerror (yyscanner, jsgf, YY_(
"syntax error"));
1636 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1639 char const *yymsgp = YY_(
"syntax error");
1640 int yysyntax_error_status;
1641 yysyntax_error_status = YYSYNTAX_ERROR;
1642 if (yysyntax_error_status == 0)
1644 else if (yysyntax_error_status == 1)
1646 if (yymsg != yymsgbuf)
1647 YYSTACK_FREE (yymsg);
1648 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
1652 yymsg_alloc =
sizeof yymsgbuf;
1653 yysyntax_error_status = 2;
1657 yysyntax_error_status = YYSYNTAX_ERROR;
1661 yyerror (yyscanner, jsgf, yymsgp);
1662 if (yysyntax_error_status == 2)
1663 goto yyexhaustedlab;
1665 # undef YYSYNTAX_ERROR
1671 if (yyerrstatus == 3)
1676 if (yychar <= YYEOF)
1679 if (yychar == YYEOF)
1684 yydestruct (
"Error: discarding",
1685 yytoken, &yylval, yyscanner, jsgf);
1710 YY_STACK_PRINT (yyss, yyssp);
1723 yyn = yypact[yystate];
1724 if (!yypact_value_is_default (yyn))
1727 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1740 yydestruct (
"Error: popping",
1741 yystos[yystate], yyvsp, yyscanner, jsgf);
1744 YY_STACK_PRINT (yyss, yyssp);
1747 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1749 YY_IGNORE_MAYBE_UNINITIALIZED_END
1753 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
1773 #if !defined yyoverflow || YYERROR_VERBOSE
1778 yyerror (yyscanner, jsgf, YY_(
"memory exhausted"));
1784 if (yychar != YYEMPTY)
1788 yytoken = YYTRANSLATE (yychar);
1789 yydestruct (
"Cleanup: discarding lookahead",
1790 yytoken, &yylval, yyscanner, jsgf);
1795 YY_STACK_PRINT (yyss, yyssp);
1796 while (yyssp != yyss)
1798 yydestruct (
"Cleanup: popping",
1799 yystos[*yyssp], yyvsp, yyscanner, jsgf);
1804 YYSTACK_FREE (yyss);
1807 if (yymsg != yymsgbuf)
1808 YYSTACK_FREE (yymsg);
1811 return YYID (yyresult);
1816 #line 150 "jsgf_parser.y"
1820 yyerror(yyscan_t lex,
jsgf_t *jsgf,
const char *s)
1822 E_ERROR(
"%s at line %d current token '%s'\n", s, yyget_lineno(lex), yyget_text(lex));