47 #define YYBISON_VERSION "2.7" 50 #define YYSKELETON_NAME "yacc.c" 66 #line 1 "./extensions/hostemu/cmdparse.ypp" 140 #line 141 "cmdparse.cpp" 143 # if defined __cplusplus && 201103L <= __cplusplus 144 # define YY_NULL nullptr 151 #ifdef YYERROR_VERBOSE 152 # undef YYERROR_VERBOSE 153 # define YYERROR_VERBOSE 1 155 # define YYERROR_VERBOSE 0 203 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 207 #line 74 "./extensions/hostemu/cmdparse.ypp" 214 #line 215 "cmdparse.cpp" 216 # define YYSTYPE_IS_TRIVIAL 1 217 # define yystype YYSTYPE 218 # define YYSTYPE_IS_DECLARED 1 224 #if defined __STDC__ || defined __cplusplus 225 int yyparse (
void *YYPARSE_PARAM);
230 #if defined __STDC__ || defined __cplusplus 242 #line 243 "cmdparse.cpp" 256 #elif (defined __STDC__ || defined __C99__FUNC__ \ 257 || defined __cplusplus || defined _MSC_VER) 276 # ifdef __SIZE_TYPE__ 277 # define YYSIZE_T __SIZE_TYPE__ 278 # elif defined size_t 279 # define YYSIZE_T size_t 280 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 281 || defined __cplusplus || defined _MSC_VER) 283 # define YYSIZE_T size_t 285 # define YYSIZE_T unsigned int 289 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 292 # if defined YYENABLE_NLS && YYENABLE_NLS 294 # include <libintl.h> 295 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 299 # define YY_(Msgid) Msgid 304 #if ! defined lint || defined __GNUC__ 305 # define YYUSE(E) ((void) (E)) 314 #if (defined __STDC__ || defined __C99__FUNC__ \ 315 || defined __cplusplus || defined _MSC_VER) 328 #if ! defined yyoverflow || YYERROR_VERBOSE 332 # ifdef YYSTACK_USE_ALLOCA 333 # if YYSTACK_USE_ALLOCA 335 # define YYSTACK_ALLOC __builtin_alloca 336 # elif defined __BUILTIN_VA_ARG_INCR 339 # define YYSTACK_ALLOC __alloca 340 # elif defined _MSC_VER 342 # define alloca _alloca 344 # define YYSTACK_ALLOC alloca 345 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 346 || defined __cplusplus || defined _MSC_VER) 349 # ifndef EXIT_SUCCESS 350 # define EXIT_SUCCESS 0 357 # ifdef YYSTACK_ALLOC 359 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0)) 360 # ifndef YYSTACK_ALLOC_MAXIMUM 365 # define YYSTACK_ALLOC_MAXIMUM 4032 368 # define YYSTACK_ALLOC YYMALLOC 369 # define YYSTACK_FREE YYFREE 370 # ifndef YYSTACK_ALLOC_MAXIMUM 371 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 373 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 374 && ! ((defined YYMALLOC || defined malloc) \ 375 && (defined YYFREE || defined free))) 377 # ifndef EXIT_SUCCESS 378 # define EXIT_SUCCESS 0 382 # define YYMALLOC malloc 383 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 384 || defined __cplusplus || defined _MSC_VER) 390 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 391 || defined __cplusplus || defined _MSC_VER) 399 #if (! defined yyoverflow \ 400 && (! defined __cplusplus \ 401 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 411 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 415 # define YYSTACK_BYTES(N) \ 416 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 417 + YYSTACK_GAP_MAXIMUM) 419 # define YYCOPY_NEEDED 1 426 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 429 YYSIZE_T yynewbytes; \ 430 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 431 Stack = &yyptr->Stack_alloc; \ 432 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 433 yyptr += yynewbytes / sizeof (*yyptr); \ 439 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 443 # if defined __GNUC__ && 1 < __GNUC__ 444 # define YYCOPY(Dst, Src, Count) \ 445 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 447 # define YYCOPY(Dst, Src, Count) \ 451 for (yyi = 0; yyi < (Count); yyi++) \ 452 (Dst)[yyi] = (Src)[yyi]; \ 475 #define YYMAXUTOK 269 477 #define YYTRANSLATE(YYX) \ 478 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 483 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 16, 2, 15, 2, 2, 2, 2, 2, 2, 2,
488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
509 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
517 0, 0, 3, 7, 11, 13, 15, 17, 21, 25,
518 30, 33, 34, 36, 39, 42, 45, 48, 52, 56,
519 57, 60, 61, 63, 66, 70, 74
525 18, 0, -1, 3, 7, 19, -1, 3, 15, 19,
526 -1, 4, -1, 5, -1, 6, -1, 8, 7, 22,
527 -1, 9, 7, 20, -1, 9, 7, 7, 20, -1,
528 16, 21, -1, -1, 11, -1, 11, 13, -1, 11,
529 12, -1, 11, 14, -1, 10, 7, -1, 10, 7,
530 11, -1, 11, 10, 7, -1, -1, 16, 23, -1,
531 -1, 11, -1, 10, 7, -1, 10, 7, 11, -1,
538 0, 95, 95, 105, 111, 115, 119, 125, 130, 135,
539 147, 148, 151, 155, 159, 164, 169, 173, 178, 183,
540 186, 187, 190, 194, 198, 203, 208
544 #if YYDEBUG || YYERROR_VERBOSE || 0 547 static const char *
const yytname[] =
549 "$end",
"error",
"$undefined",
"EXECIO",
"HI",
"TE",
"TS",
"CONSTANT",
550 "DISKW",
"DISKR",
"STEM",
"FINIS",
"LIFO",
"FIFO",
"SKIP",
"'*'",
"'('",
551 "$accept",
"stmt",
"disk_clause",
"diskr_option",
"diskr_options",
552 "diskw_option",
"diskw_options",
YY_NULL 561 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
562 265, 266, 267, 268, 269, 42, 40
569 0, 17, 18, 18, 18, 18, 18, 19, 19, 19,
570 20, 20, 21, 21, 21, 21, 21, 21, 21, 21,
571 22, 22, 23, 23, 23, 23, 23
577 0, 2, 3, 3, 1, 1, 1, 3, 3, 4,
578 2, 0, 1, 2, 2, 2, 2, 3, 3, 0,
587 0, 0, 4, 5, 6, 0, 0, 0, 1, 0,
588 0, 2, 3, 21, 11, 26, 7, 11, 19, 8,
589 0, 22, 20, 9, 0, 12, 10, 23, 0, 16,
590 0, 14, 13, 15, 24, 25, 17, 18
596 -1, 5, 11, 19, 26, 16, 22
601 #define YYPACT_NINF -10 604 8, -5, -10, -10, -10, 19, -2, -2, -10, 1,
605 13, -10, -10, 6, -7, 5, -10, 9, 7, -10,
606 14, 16, -10, -10, 17, -9, -10, 12, 20, 18,
607 21, -10, -10, -10, -10, -10, -10, -10
613 -10, -10, 23, 15, -10, -10, -10
619 #define YYTABLE_NINF -1 622 17, 30, 6, 31, 32, 33, 9, 10, 13, 18,
623 7, 1, 2, 3, 4, 20, 21, 24, 25, 8,
624 14, 27, 15, 34, 29, 18, 28, 35, 37, 36,
628 #define yypact_value_is_default(Yystate) \ 629 (!!((Yystate) == (-10))) 631 #define yytable_value_is_error(Yytable_value) \ 636 7, 10, 7, 12, 13, 14, 8, 9, 7, 16,
637 15, 3, 4, 5, 6, 10, 11, 10, 11, 0,
638 7, 7, 16, 11, 7, 16, 10, 7, 7, 11,
646 0, 3, 4, 5, 6, 18, 7, 15, 0, 8,
647 9, 19, 19, 7, 7, 16, 22, 7, 16, 20,
648 10, 11, 23, 20, 10, 11, 21, 7, 10, 7,
649 10, 12, 13, 14, 11, 7, 11, 7
652 #define yyerrok (yyerrstatus = 0) 653 #define yyclearin (yychar = YYEMPTY) 657 #define YYACCEPT goto yyacceptlab 658 #define YYABORT goto yyabortlab 659 #define YYERROR goto yyerrorlab 669 #define YYFAIL goto yyerrlab 677 #define YYRECOVERING() (!!yyerrstatus) 679 #define YYBACKUP(Token, Value) \ 681 if (yychar == YYEMPTY) \ 685 YYPOPSTACK (yylen); \ 691 yyerror (YY_("syntax error: cannot back up")); \ 698 #define YYERRCODE 256 702 #ifndef YY_LOCATION_PRINT 703 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 709 # define YYLEX yylex (YYLEX_PARAM) 711 # define YYLEX yylex () 719 # define YYFPRINTF fprintf 722 # define YYDPRINTF(Args) \ 728 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 732 YYFPRINTF (stderr, "%s ", Title); \ 733 yy_symbol_print (stderr, \ 735 YYFPRINTF (stderr, "\n"); \ 745 #if (defined __STDC__ || defined __C99__FUNC__ \ 746 || defined __cplusplus || defined _MSC_VER) 757 FILE *yyo = yyoutput;
779 #if (defined __STDC__ || defined __C99__FUNC__ \ 780 || defined __cplusplus || defined _MSC_VER) 792 YYFPRINTF (yyoutput,
"token %s (", yytname[
yytype]);
794 YYFPRINTF (yyoutput,
"nterm %s (", yytname[
yytype]);
797 YYFPRINTF (yyoutput,
")");
805 #if (defined __STDC__ || defined __C99__FUNC__ \ 806 || defined __cplusplus || defined _MSC_VER) 811 yy_stack_print (yybottom, yytop)
816 YYFPRINTF (stderr,
"Stack now");
817 for (; yybottom <= yytop; yybottom++)
819 int yybot = *yybottom;
820 YYFPRINTF (stderr,
" %d", yybot);
822 YYFPRINTF (stderr,
"\n");
825 # define YY_STACK_PRINT(Bottom, Top) \ 828 yy_stack_print ((Bottom), (Top)); \ 836 #if (defined __STDC__ || defined __C99__FUNC__ \ 837 || defined __cplusplus || defined _MSC_VER) 839 yy_reduce_print (
YYSTYPE *yyvsp,
int yyrule)
842 yy_reduce_print (yyvsp, yyrule)
847 int yynrhs =
yyr2[yyrule];
849 unsigned long int yylno = yyrline[yyrule];
850 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
853 for (yyi = 0; yyi < yynrhs; yyi++)
855 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
856 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
857 &(yyvsp[(yyi + 1) - (yynrhs)])
859 YYFPRINTF (stderr,
"\n");
863 # define YY_REDUCE_PRINT(Rule) \ 866 yy_reduce_print (yyvsp, Rule); \ 873 # define YYDPRINTF(Args) 874 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 875 # define YY_STACK_PRINT(Bottom, Top) 876 # define YY_REDUCE_PRINT(Rule) 882 # define YYINITDEPTH 200 893 # define YYMAXDEPTH 10000 900 # if defined __GLIBC__ && defined _STRING_H 901 # define yystrlen strlen 904 #if (defined __STDC__ || defined __C99__FUNC__ \ 905 || defined __cplusplus || defined _MSC_VER) 907 yystrlen (
const char *yystr)
915 for (yylen = 0; yystr[yylen]; yylen++)
923 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 924 # define yystpcpy stpcpy 928 #if (defined __STDC__ || defined __C99__FUNC__ \ 929 || defined __cplusplus || defined _MSC_VER) 931 yystpcpy (
char *yydest,
const char *yysrc)
934 yystpcpy (yydest, yysrc)
940 const char *yys = yysrc;
942 while ((*yyd++ = *yys++) !=
'\0')
959 yytnamerr (
char *yyres,
const char *yystr)
964 char const *yyp = yystr;
971 goto do_not_strip_quotes;
975 goto do_not_strip_quotes;
988 do_not_strip_quotes: ;
992 return yystrlen (yystr);
994 return yystpcpy (yyres, yystr) - yyres;
1007 yysyntax_error (
YYSIZE_T *yymsg_alloc,
char **yymsg,
1012 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1014 const char *yyformat =
YY_NULL;
1016 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1050 int yyn =
yypact[*yyssp];
1051 yyarg[yycount++] = yytname[yytoken];
1057 int yyxbegin = yyn < 0 ? -yyn : 0;
1059 int yychecklim =
YYLAST - yyn + 1;
1063 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1067 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1073 yyarg[yycount++] = yytname[yyx];
1076 if (! (yysize <= yysize1
1087 # define YYCASE_(N, S) \ 1091 YYCASE_(0,
YY_(
"syntax error"));
1092 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1093 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1094 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1095 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1096 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1101 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1107 if (*yymsg_alloc < yysize)
1109 *yymsg_alloc = 2 * yysize;
1110 if (! (yysize <= *yymsg_alloc
1122 while ((*yyp = *yyformat) !=
'\0')
1123 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1125 yyp += yytnamerr (yyp, yyarg[yyi++]);
1143 #if (defined __STDC__ || defined __C99__FUNC__ \ 1144 || defined __cplusplus || defined _MSC_VER) 1176 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1177 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1178 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 1180 #ifndef YY_INITIAL_VALUE 1181 # define YY_INITIAL_VALUE(Value) 1195 #ifdef YYPARSE_PARAM 1196 #if (defined __STDC__ || defined __C99__FUNC__ \ 1197 || defined __cplusplus || defined _MSC_VER) 1203 void *YYPARSE_PARAM;
1206 #if (defined __STDC__ || defined __C99__FUNC__ \ 1207 || defined __cplusplus || defined _MSC_VER) 1251 char *yymsg = yymsgbuf;
1252 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1255 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1261 yyssp = yyss = yyssa;
1262 yyvsp = yyvs = yyvsa;
1265 YYDPRINTF ((stderr,
"Starting parse\n"));
1284 if (yyss + yystacksize - 1 <= yyssp)
1287 YYSIZE_T yysize = yyssp - yyss + 1;
1301 yyoverflow (
YY_(
"memory exhausted"),
1302 &yyss1, yysize *
sizeof (*yyssp),
1303 &yyvs1, yysize *
sizeof (*yyvsp),
1310 # ifndef YYSTACK_RELOCATE 1311 goto yyexhaustedlab;
1315 goto yyexhaustedlab;
1325 goto yyexhaustedlab;
1328 # undef YYSTACK_RELOCATE 1335 yyssp = yyss + yysize - 1;
1336 yyvsp = yyvs + yysize - 1;
1338 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1339 (
unsigned long int) yystacksize));
1341 if (yyss + yystacksize - 1 <= yyssp)
1345 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1370 YYDPRINTF ((stderr,
"Reading a token: "));
1377 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1443 yyval = yyvsp[1-yylen];
1451 #line 96 "./extensions/hostemu/cmdparse.ypp" 1456 if (
isnumeric ((yyvsp[(2) - (3)].strval)))
1465 #line 106 "./extensions/hostemu/cmdparse.ypp" 1475 #line 112 "./extensions/hostemu/cmdparse.ypp" 1483 #line 116 "./extensions/hostemu/cmdparse.ypp" 1491 #line 120 "./extensions/hostemu/cmdparse.ypp" 1499 #line 126 "./extensions/hostemu/cmdparse.ypp" 1508 #line 131 "./extensions/hostemu/cmdparse.ypp" 1517 #line 136 "./extensions/hostemu/cmdparse.ypp" 1522 if (
isnumeric ((yyvsp[(3) - (4)].strval)))
1531 #line 152 "./extensions/hostemu/cmdparse.ypp" 1539 #line 156 "./extensions/hostemu/cmdparse.ypp" 1547 #line 160 "./extensions/hostemu/cmdparse.ypp" 1556 #line 165 "./extensions/hostemu/cmdparse.ypp" 1565 #line 170 "./extensions/hostemu/cmdparse.ypp" 1573 #line 174 "./extensions/hostemu/cmdparse.ypp" 1582 #line 179 "./extensions/hostemu/cmdparse.ypp" 1591 #line 191 "./extensions/hostemu/cmdparse.ypp" 1599 #line 195 "./extensions/hostemu/cmdparse.ypp" 1607 #line 199 "./extensions/hostemu/cmdparse.ypp" 1616 #line 204 "./extensions/hostemu/cmdparse.ypp" 1625 #line 1626 "cmdparse.cpp" 1654 if (0 <= yystate && yystate <=
YYLAST &&
yycheck[yystate] == *yyssp)
1674 #if ! YYERROR_VERBOSE 1677 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1680 char const *yymsgp =
YY_(
"syntax error");
1681 int yysyntax_error_status;
1682 yysyntax_error_status = YYSYNTAX_ERROR;
1683 if (yysyntax_error_status == 0)
1685 else if (yysyntax_error_status == 1)
1687 if (yymsg != yymsgbuf)
1693 yymsg_alloc =
sizeof yymsgbuf;
1694 yysyntax_error_status = 2;
1698 yysyntax_error_status = YYSYNTAX_ERROR;
1703 if (yysyntax_error_status == 2)
1704 goto yyexhaustedlab;
1706 # undef YYSYNTAX_ERROR 1712 if (yyerrstatus == 3)
1814 #if !defined yyoverflow || YYERROR_VERBOSE 1837 while (yyssp != yyss)
1848 if (yymsg != yymsgbuf)
1852 return YYID (yyresult);
1857 #line 210 "./extensions/hostemu/cmdparse.ypp" 1872 int tktype, idx = 0;
1873 static char token [1024];
1951 fprintf (stderr,
"Token \"%s\"\n", token);
1994 char *utoken, *uutoken;
1996 utoken = strdup(token);
1998 while (*uutoken !=
'\0')
2000 *uutoken = toupper(*uutoken);
2003 for (i = 0;
kwtable[i].type != EOF; i++)
2027 for (i = 0; i < strlen (token); i++)
2028 if (!isdigit(*(token + i)))