67 #define YYBISON_VERSION "2.4.1" 70 #define YYSKELETON_NAME "yacc.c" 82 #define YYLSP_NEEDED 0 95 extern int yylex(
void);
96 extern int yyerror(
const char *);
98 extern cmd_t *cmds[MAX_CMDS];
107 char *quote_char(
char c);
108 cmd_t *make_cmd(
unsigned int scancode,
unsigned int upoint,
char *val);
109 void set_cmds(
unsigned int scancode,
struct cmd_list *cl);
112 void add_define(
char *str,
int n);
113 int lookup_define(
char *str);
124 #ifdef YYERROR_VERBOSE 125 #undef YYERROR_VERBOSE 126 #define YYERROR_VERBOSE 1 128 #define YYERROR_VERBOSE 0 132 #ifndef YYTOKEN_TABLE 133 #define YYTOKEN_TABLE 0 153 CTRL_SHIFT_ALT = 268,
156 CTRL_SHIFT_ALTGR = 271,
177 #define CTRL_SHIFT 265 178 #define SHIFT_ALT 266 180 #define CTRL_SHIFT_ALT 268 181 #define SHIFT_ALTGR 269 182 #define CTRL_ALTGR 270 183 #define CTRL_SHIFT_ALTGR 271 184 #define SET_COMBINE 272 189 #define QUOTED_CHAR 277 190 #define CODE_POINT 278 195 #if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED 210 #define YYSTYPE_IS_TRIVIAL 1 211 #define yystype YYSTYPE 212 #define YYSTYPE_IS_DECLARED 1 225 typedef YYTYPE_UINT8 yytype_uint8;
227 typedef unsigned char yytype_uint8;
231 typedef YYTYPE_INT8 yytype_int8;
233 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 235 typedef signed char yytype_int8;
237 typedef short int yytype_int8;
241 typedef YYTYPE_UINT16 yytype_uint16;
243 typedef unsigned short int yytype_uint16;
247 typedef YYTYPE_INT16 yytype_int16;
249 typedef short int yytype_int16;
254 #define YYSIZE_T __SIZE_TYPE__ 256 #define YYSIZE_T size_t 257 #elif !defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ || \ 258 defined __cplusplus || defined _MSC_VER) 260 #define YYSIZE_T size_t 262 #define YYSIZE_T unsigned int 266 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 272 #define YY_(msgid) dgettext("bison-runtime", msgid) 276 #define YY_(msgid) msgid 281 #if !defined lint || defined __GNUC__ 282 #define YYUSE(e) ((void) (e)) 292 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 294 static int YYID(
int yyi)
296 static int YYID(yyi)
int yyi;
303 #if !defined yyoverflow || YYERROR_VERBOSE 307 #ifdef YYSTACK_USE_ALLOCA 308 #if YYSTACK_USE_ALLOCA 310 #define YYSTACK_ALLOC __builtin_alloca 311 #elif defined __BUILTIN_VA_ARG_INCR 314 #define YYSTACK_ALLOC __alloca 315 #elif defined _MSC_VER 317 #define alloca _alloca 319 #define YYSTACK_ALLOC alloca 320 #if !defined _ALLOCA_H && !defined _STDLIB_H && \ 321 (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 334 #define YYSTACK_FREE(Ptr) \ 339 #ifndef YYSTACK_ALLOC_MAXIMUM 344 #define YYSTACK_ALLOC_MAXIMUM 4032 347 #define YYSTACK_ALLOC YYMALLOC 348 #define YYSTACK_FREE YYFREE 349 #ifndef YYSTACK_ALLOC_MAXIMUM 350 #define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 353 defined __cplusplus && !defined _STDLIB_H && \ 354 !((defined YYMALLOC || defined malloc) && \ 355 (defined YYFREE || defined free))) 362 #define YYMALLOC malloc 363 #if !defined malloc && !defined _STDLIB_H && \ 364 (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 366 void *malloc(YYSIZE_T);
371 #if !defined free && !defined _STDLIB_H && \ 372 (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 381 !defined yyoverflow && \ 382 (!defined __cplusplus || \ 383 (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 388 yytype_int16 yyss_alloc;
393 #define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1) 397 #define YYSTACK_BYTES(N) \ 398 ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM) 403 #if defined __GNUC__ && 1 < __GNUC__ 404 #define YYCOPY(To, From, Count) \ 405 __builtin_memcpy(To, From, (Count) * sizeof(*(From))) 407 #define YYCOPY(To, From, Count) \ 411 for (yyi = 0; yyi < (Count); yyi++) \ 412 (To)[yyi] = (From)[yyi]; \ 422 #define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 425 YYSIZE_T yynewbytes; \ 426 YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \ 427 Stack = &yyptr->Stack_alloc; \ 428 yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \ 429 yyptr += yynewbytes / sizeof(*yyptr); \ 450 #define YYMAXUTOK 281 452 #define YYTRANSLATE(YYX) \ 453 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 456 static const yytype_uint8 yytranslate[] = {
457 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
471 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
476 static const yytype_uint8 yyprhs[] = {
477 0, 0, 3, 7, 10, 12, 16, 20, 23, 24, 27, 29, 32, 35, 38, 41, 44, 47,
478 50, 53, 56, 59, 62, 64, 66, 72, 78, 80, 82, 84, 92, 100, 104, 105, 108};
481 static const yytype_int8 yyrhs[] = {
482 28, 0, -1, 29, 3, 28, -1, 3, 28, -1, 26, -1, 21, 5, 24, -1, 21, 5, 23,
483 -1, 24, 30, -1, -1, 31, 30, -1, 32, -1, 6, 32, -1, 7, 32, -1, 10, 32, -1,
484 8, 32, -1, 9, 32, -1, 12, 32, -1, 11, 32, -1, 13, 32, -1, 15, 32, -1, 14,
485 32, -1, 16, 32, -1, 33, -1, 34, -1, 18, 19, 24, 20, 33, -1, 18, 19, 5, 20,
486 33, -1, 23, -1, 35, -1, 5, -1, 17, 19, 24, 20, 19, 23, 20, -1, 17, 19, 5,
487 20, 19, 23, 20, -1, 4, 36, 4, -1, -1, 5, 36, -1, 22, 36, -1};
490 static const yytype_uint8 yyrline[] = {
491 0, 51, 51, 52, 53, 56, 57, 58, 61, 62, 65, 66, 67, 68, 69, 70, 71, 72,
492 73, 74, 75, 76, 79, 80, 81, 82, 85, 86, 87, 90, 91, 94, 97, 98, 99};
495 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 498 static const char *
const yytname[] = {
"$end",
541 static const yytype_uint16 yytoknum[] = {
542 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
543 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281};
547 static const yytype_uint8 yyr1[] = {
548 0, 27, 28, 28, 28, 29, 29, 29, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31,
549 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 34, 34, 35, 36, 36, 36};
552 static const yytype_uint8 yyr2[] = {0, 2, 3, 2, 1, 3, 3, 2, 0, 2, 1, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1,
554 5, 5, 1, 1, 1, 7, 7, 3, 0, 2, 2};
559 static const yytype_uint8 yydefact[] = {
560 0, 0, 0, 8, 4, 0, 0, 3, 0, 32, 28, 0, 0, 0, 0, 0, 0, 0,
561 0, 0, 0, 0, 0, 0, 26, 7, 8, 10, 22, 23, 27, 1, 0, 6, 5, 32,
562 32, 0, 11, 12, 14, 15, 13, 17, 16, 18, 20, 19, 21, 0, 0, 9, 2, 33,
563 34, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 24, 0, 0, 30, 29};
566 static const yytype_int8 yydefgoto[] = {-1, 5, 6, 25, 26, 27, 28, 29, 30, 37};
570 #define YYPACT_NINF -34 571 static const yytype_int8 yypact[] = {
572 -2, -2, 30, 0, -34, 38, 37, -34, -21, 27, -34, 16, 16, 16, 16,
573 16, 16, 16, 16, 16, 16, 16, 24, 26, -34, -34, 0, -34, -34, -34,
574 -34, -34, -2, -34, -34, 27, 27, 44, -34, -34, -34, -34, -34, -34, -34,
575 -34, -34, -34, -34, 22, 23, -34, -34, -34, -34, -34, 41, 42, 43, 45,
576 47, 48, 21, 21, 18, 19, -34, -34, 49, 50, -34, -34};
579 static const yytype_int8 yypgoto[] = {-34, -1, -34, 46, -34,
580 39, -33, -34, -34, 1};
586 #define YYTABLE_NINF -1 587 static const yytype_uint8 yytable[] = {
588 7, 1, 33, 34, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
589 2, 9, 10, 3, 24, 4, 9, 10, 56, 58, 66, 67, 52, 35, 22, 23, 8, 53, 54,
590 31, 24, 32, 68, 69, 49, 24, 50, 57, 59, 55, 36, 38, 39, 40, 41, 42, 43, 44,
591 45, 46, 47, 48, 60, 61, 62, 0, 63, 64, 65, 0, 70, 71, 0, 51};
593 static const yytype_int8 yycheck[] = {
594 1, 3, 23, 24, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
595 21, 4, 5, 24, 23, 26, 4, 5, 5, 5, 62, 63, 32, 5, 17, 18, 5, 35, 36,
596 0, 23, 3, 23, 23, 19, 23, 19, 24, 24, 4, 22, 11, 12, 13, 14, 15, 16, 17,
597 18, 19, 20, 21, 20, 20, 20, -1, 20, 19, 19, -1, 20, 20, -1, 26};
601 static const yytype_uint8 yystos[] = {
602 0, 3, 21, 24, 26, 28, 29, 28, 5, 4, 5, 6, 7, 8, 9, 10, 11, 12,
603 13, 14, 15, 16, 17, 18, 23, 30, 31, 32, 33, 34, 35, 0, 3, 23, 24, 5,
604 22, 36, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 19, 19, 30, 28, 36,
605 36, 4, 5, 24, 5, 24, 20, 20, 20, 20, 19, 19, 33, 33, 23, 23, 20, 20};
607 #define yyerrok (yyerrstatus = 0) 608 #define yyclearin (yychar = YYEMPTY) 612 #define YYACCEPT goto yyacceptlab 613 #define YYABORT goto yyabortlab 614 #define YYERROR goto yyerrorlab 620 #define YYFAIL goto yyerrlab 622 #define YYRECOVERING() (!!yyerrstatus) 624 #define YYBACKUP(Token, Value) \ 626 if (yychar == YYEMPTY && yylen == 1) \ 630 yytoken = YYTRANSLATE(yychar); \ 636 yyerror(YY_("syntax error: cannot back up")); \ 642 #define YYERRCODE 256 648 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 649 #ifndef YYLLOC_DEFAULT 650 #define YYLLOC_DEFAULT(Current, Rhs, N) \ 654 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ 655 (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \ 656 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ 657 (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ 661 (Current).first_line = (Current).last_line = \ 662 YYRHSLOC(Rhs, 0).last_line; \ 663 (Current).first_column = (Current).last_column = \ 664 YYRHSLOC(Rhs, 0).last_column; \ 673 #ifndef YY_LOCATION_PRINT 674 #if YYLTYPE_IS_TRIVIAL 675 #define YY_LOCATION_PRINT(File, Loc) \ 677 File, "%d.%d-%d.%d", (Loc).first_line, (Loc).first_column, \ 678 (Loc).last_line, (Loc).last_column) 680 #define YY_LOCATION_PRINT(File, Loc) ((void) 0) 687 #define YYLEX yylex(YYLEX_PARAM) 689 #define YYLEX yylex() 697 #define YYFPRINTF fprintf 700 #define YYDPRINTF(Args) \ 707 #define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 712 YYFPRINTF(stderr, "%s ", Title); \ 713 yy_symbol_print(stderr, Type, Value); \ 714 YYFPRINTF(stderr, "\n"); \ 724 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 727 yy_symbol_value_print(
FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep)
729 static void yy_symbol_value_print(yyoutput, yytype, yyvaluep)
FILE *yyoutput;
737 if (yytype < YYNTOKENS)
738 YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep);
754 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 757 yy_symbol_print(
FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep)
759 static void yy_symbol_print(yyoutput, yytype, yyvaluep)
FILE *yyoutput;
764 if (yytype < YYNTOKENS)
765 YYFPRINTF(yyoutput,
"token %s (", yytname[yytype]);
767 YYFPRINTF(yyoutput,
"nterm %s (", yytname[yytype]);
769 yy_symbol_value_print(yyoutput, yytype, yyvaluep);
770 YYFPRINTF(yyoutput,
")");
779 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 781 static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
783 static void yy_stack_print(yybottom, yytop) yytype_int16 *yybottom;
787 YYFPRINTF(stderr,
"Stack now");
788 for (; yybottom <= yytop; yybottom++)
790 int yybot = *yybottom;
791 YYFPRINTF(stderr,
" %d", yybot);
793 YYFPRINTF(stderr,
"\n");
796 #define YY_STACK_PRINT(Bottom, Top) \ 800 yy_stack_print((Bottom), (Top)); \ 808 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 810 static void yy_reduce_print(
YYSTYPE *yyvsp,
int yyrule)
812 static void yy_reduce_print(yyvsp, yyrule)
YYSTYPE *yyvsp;
816 int yynrhs = yyr2[yyrule];
818 unsigned long int yylno = yyrline[yyrule];
820 stderr,
"Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno);
822 for (yyi = 0; yyi < yynrhs; yyi++)
824 YYFPRINTF(stderr,
" $%d = ", yyi + 1);
826 stderr, yyrhs[yyprhs[yyrule] + yyi],
827 &(yyvsp[(yyi + 1) - (yynrhs)]));
828 YYFPRINTF(stderr,
"\n");
832 #define YY_REDUCE_PRINT(Rule) \ 836 yy_reduce_print(yyvsp, Rule); \ 843 #define YYDPRINTF(Args) 844 #define YY_SYMBOL_PRINT(Title, Type, Value, Location) 845 #define YY_STACK_PRINT(Bottom, Top) 846 #define YY_REDUCE_PRINT(Rule) 851 #define YYINITDEPTH 200 862 #define YYMAXDEPTH 10000 868 #if defined __GLIBC__ && defined _STRING_H 869 #define yystrlen strlen 873 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 875 static YYSIZE_T yystrlen(
const char *yystr)
877 static YYSIZE_T yystrlen(yystr)
const char *yystr;
881 for (yylen = 0; yystr[yylen]; yylen++)
889 #if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 890 #define yystpcpy stpcpy 895 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 897 static char *yystpcpy(
char *yydest,
const char *yysrc)
899 static char *yystpcpy(yydest, yysrc)
char *yydest;
904 const char *yys = yysrc;
906 while ((*yyd++ = *yys++) !=
'\0')
922 static YYSIZE_T yytnamerr(
char *yyres,
const char *yystr)
927 char const *yyp = yystr;
934 goto do_not_strip_quotes;
938 goto do_not_strip_quotes;
951 do_not_strip_quotes:;
955 return yystrlen(yystr);
957 return yystpcpy(yyres, yystr) - yyres;
968 static YYSIZE_T yysyntax_error(
char *yyresult,
int yystate,
int yychar)
970 int yyn = yypact[yystate];
972 if (!(YYPACT_NINF < yyn && yyn <= YYLAST))
976 int yytype = YYTRANSLATE(yychar);
977 YYSIZE_T yysize0 = yytnamerr(0, yytname[yytype]);
978 YYSIZE_T yysize = yysize0;
980 int yysize_overflow = 0;
983 YYERROR_VERBOSE_ARGS_MAXIMUM = 5
985 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
991 YY_(
"syntax error, unexpected %s");
992 YY_(
"syntax error, unexpected %s, expecting %s");
993 YY_(
"syntax error, unexpected %s, expecting %s or %s");
994 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s");
995 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s");
999 static char const yyunexpected[] =
"syntax error, unexpected %s";
1000 static char const yyexpecting[] =
", expecting %s";
1001 static char const yyor[] =
" or %s";
1003 [
sizeof yyunexpected +
sizeof yyexpecting - 1 +
1004 ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (
sizeof yyor - 1))];
1005 char const *yyprefix = yyexpecting;
1009 int yyxbegin = yyn < 0 ? -yyn : 0;
1012 int yychecklim = YYLAST - yyn + 1;
1013 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1016 yyarg[0] = yytname[yytype];
1017 yyfmt = yystpcpy(yyformat, yyunexpected);
1019 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1020 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1022 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1026 yyformat[
sizeof yyunexpected - 1] =
'\0';
1029 yyarg[yycount++] = yytname[yyx];
1030 yysize1 = yysize + yytnamerr(0, yytname[yyx]);
1031 yysize_overflow |= (yysize1 < yysize);
1033 yyfmt = yystpcpy(yyfmt, yyprefix);
1037 yyf = YY_(yyformat);
1038 yysize1 = yysize + yystrlen(yyf);
1039 yysize_overflow |= (yysize1 < yysize);
1042 if (yysize_overflow)
1043 return YYSIZE_MAXIMUM;
1050 char *yyp = yyresult;
1052 while ((*yyp = *yyf) !=
'\0')
1054 if (*yyp ==
'%' && yyf[1] ==
's' && yyi < yycount)
1056 yyp += yytnamerr(yyp, yyarg[yyi++]);
1077 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 1079 static void yydestruct(
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep)
1081 static void yydestruct(yymsg, yytype, yyvaluep)
const char *yymsg;
1090 YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
1100 #ifdef YYPARSE_PARAM 1101 #if defined __STDC__ || defined __cplusplus 1102 int yyparse(
void *YYPARSE_PARAM);
1107 #if defined __STDC__ || defined __cplusplus 1127 #ifdef YYPARSE_PARAM 1129 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 1131 int yyparse(
void *YYPARSE_PARAM)
1133 int yyparse(YYPARSE_PARAM)
void *YYPARSE_PARAM;
1137 defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || \ 1158 yytype_int16 yyssa[YYINITDEPTH];
1160 yytype_int16 *yyssp;
1167 YYSIZE_T yystacksize;
1180 char *yymsg = yymsgbuf;
1181 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1184 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1193 yystacksize = YYINITDEPTH;
1195 YYDPRINTF((stderr,
"Starting parse\n"));
1222 if (yyss + yystacksize - 1 <= yyssp)
1225 YYSIZE_T yysize = yyssp - yyss + 1;
1233 yytype_int16 *yyss1 = yyss;
1240 YY_(
"memory exhausted"), &yyss1, yysize *
sizeof(*yyssp),
1241 &yyvs1, yysize *
sizeof(*yyvsp), &yystacksize);
1247 #ifndef YYSTACK_RELOCATE 1248 goto yyexhaustedlab;
1251 if (YYMAXDEPTH <= yystacksize)
1252 goto yyexhaustedlab;
1254 if (YYMAXDEPTH < yystacksize)
1255 yystacksize = YYMAXDEPTH;
1258 yytype_int16 *yyss1 = yyss;
1260 (
union yyalloc *) YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
1262 goto yyexhaustedlab;
1263 YYSTACK_RELOCATE(yyss_alloc, yyss);
1264 YYSTACK_RELOCATE(yyvs_alloc, yyvs);
1265 #undef YYSTACK_RELOCATE 1267 YYSTACK_FREE(yyss1);
1272 yyssp = yyss + yysize - 1;
1273 yyvsp = yyvs + yysize - 1;
1276 (stderr,
"Stack size increased to %lu\n",
1277 (
unsigned long int) yystacksize));
1279 if (yyss + yystacksize - 1 <= yyssp)
1283 YYDPRINTF((stderr,
"Entering state %d\n", yystate));
1285 if (yystate == YYFINAL)
1299 yyn = yypact[yystate];
1300 if (yyn == YYPACT_NINF)
1306 if (yychar == YYEMPTY)
1308 YYDPRINTF((stderr,
"Reading a token: "));
1312 if (yychar <= YYEOF)
1314 yychar = yytoken = YYEOF;
1315 YYDPRINTF((stderr,
"Now at end of input.\n"));
1319 yytoken = YYTRANSLATE(yychar);
1320 YY_SYMBOL_PRINT(
"Next token is", yytoken, &yylval, &yylloc);
1326 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1331 if (yyn == 0 || yyn == YYTABLE_NINF)
1343 YY_SYMBOL_PRINT(
"Shifting", yytoken, &yylval, &yylloc);
1357 yyn = yydefact[yystate];
1377 yyval = yyvsp[1 - yylen];
1379 YY_REDUCE_PRINT(yyn);
1404 (yyval.cmd_list) = 0;
1405 add_define((yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].n));
1414 (yyval.cmd_list) = 0;
1415 add_define((yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].n));
1424 (yyval.cmd_list) = (yyvsp[(2) - (2)].
cmd_list);
1425 set_cmds((yyvsp[(1) - (2)].n), (yyval.cmd_list));
1434 (yyval.cmd_list) = 0;
1443 (yyval.cmd_list) = add_to_cmd_list(
1444 (yyvsp[(2) - (2)].
cmd_list), (yyvsp[(1) - (2)].cmd));
1453 (yyval.cmd) = (yyvsp[(1) - (1)].
cmd);
1462 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1463 (yyval.cmd)->modifiers = CTRL_I;
1472 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1473 (yyval.cmd)->modifiers = SHIFT_I;
1482 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1483 (yyval.cmd)->modifiers = CTRL_I | SHIFT_I;
1492 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1493 (yyval.cmd)->modifiers = ALT_I;
1502 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1503 (yyval.cmd)->modifiers = ALTGR_I;
1512 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1513 (yyval.cmd)->modifiers = CTRL_I | ALT_I;
1522 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1523 (yyval.cmd)->modifiers = SHIFT_I | ALT_I;
1532 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1533 (yyval.cmd)->modifiers = CTRL_I | SHIFT_I | ALT_I;
1542 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1543 (yyval.cmd)->modifiers = CTRL_I | ALTGR_I;
1552 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1553 (yyval.cmd)->modifiers = SHIFT_I | ALTGR_I;
1562 (yyval.cmd) = (yyvsp[(2) - (2)].
cmd);
1563 (yyval.cmd)->modifiers = CTRL_I | SHIFT_I | ALTGR_I;
1572 (yyval.cmd) = (yyvsp[(1) - (1)].
cmd);
1581 (yyval.cmd) = (yyvsp[(1) - (1)].
cmd);
1590 (yyval.cmd) = (yyvsp[(5) - (5)].
cmd);
1591 (yyval.cmd)->combinators = (yyvsp[(3) - (5)].n);
1600 (yyval.cmd) = (yyvsp[(5) - (5)].
cmd);
1601 (yyval.cmd)->combinators = lookup_define((yyvsp[(3) - (5)].str));
1610 (yyval.cmd) = make_cmd(0, (yyvsp[(1) - (1)].n), (
char *)
"");
1619 (yyval.cmd) = make_cmd(0, 0, (yyvsp[(1) - (1)].str));
1629 make_cmd(0, lookup_define((yyvsp[(1) - (1)].str)), (
char *)
"");
1638 (yyval.cmd) = make_cmd(0, (yyvsp[(6) - (7)].n), (
char *)
"");
1639 (yyval.cmd)->set_modifiers = (yyvsp[(3) - (7)].n);
1648 (yyval.cmd) = make_cmd(0, (yyvsp[(6) - (7)].n), (
char *)
"");
1649 (yyval.cmd)->set_modifiers = lookup_define((yyvsp[(3) - (7)].str));
1658 strcpy((yyval.str), (yyvsp[(2) - (3)].str));
1667 strcpy((yyval.str),
"");
1676 strcpy((yyval.str), (yyvsp[(1) - (2)].str));
1677 strcat((yyval.str), (yyvsp[(2) - (2)].str));
1686 strcpy((yyval.str), quote_char((yyvsp[(1) - (2)].c)));
1687 strcat((yyval.str), (yyvsp[(2) - (2)].str));
1692 #line 1682 "parser.c" 1696 YY_SYMBOL_PRINT(
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
1700 YY_STACK_PRINT(yyss, yyssp);
1710 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1711 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1712 yystate = yytable[yystate];
1714 yystate = yydefgoto[yyn - YYNTOKENS];
1726 #if !YYERROR_VERBOSE 1727 yyerror(YY_(
"syntax error"));
1730 YYSIZE_T yysize = yysyntax_error(0, yystate, yychar);
1731 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1733 YYSIZE_T
yyalloc = 2 * yysize;
1734 if (!(yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1735 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1736 if (yymsg != yymsgbuf)
1737 YYSTACK_FREE(yymsg);
1738 yymsg = (
char *) YYSTACK_ALLOC(yyalloc);
1740 yymsg_alloc = yyalloc;
1744 yymsg_alloc =
sizeof yymsgbuf;
1748 if (0 < yysize && yysize <= yymsg_alloc)
1750 (void) yysyntax_error(yymsg, yystate, yychar);
1755 yyerror(YY_(
"syntax error"));
1757 goto yyexhaustedlab;
1763 if (yyerrstatus == 3)
1768 if (yychar <= YYEOF)
1771 if (yychar == YYEOF)
1776 yydestruct(
"Error: discarding", yytoken, &yylval);
1800 YY_STACK_PRINT(yyss, yyssp);
1812 yyn = yypact[yystate];
1813 if (yyn != YYPACT_NINF)
1816 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1828 yydestruct(
"Error: popping", yystos[yystate], yyvsp);
1831 YY_STACK_PRINT(yyss, yyssp);
1837 YY_SYMBOL_PRINT(
"Shifting", yystos[yyn], yyvsp, yylsp);
1856 #if !defined(yyoverflow) || YYERROR_VERBOSE 1861 yyerror(YY_(
"memory exhausted"));
1867 if (yychar != YYEMPTY)
1868 yydestruct(
"Cleanup: discarding lookahead", yytoken, &yylval);
1872 YY_STACK_PRINT(yyss, yyssp);
1873 while (yyssp != yyss)
1875 yydestruct(
"Cleanup: popping", yystos[*yyssp], yyvsp);
1883 if (yymsg != yymsgbuf)
1884 YYSTACK_FREE(yymsg);
1887 return YYID(yyresult);
1891 #line 102 "parser.y" 1893 char *quote_char(
char c)
1898 return (
char *)
"\e";
1900 return (
char *)
"?";
1922 cmd_t *make_cmd(
unsigned int scancode,
unsigned int unicode_point,
char *val)
1925 c->scancode = scancode;
1926 c->unicode_point = unicode_point;
1928 c->val = strdup(val);
1937 void set_cmds(
unsigned int scancode,
struct cmd_list *cl)
1941 cl->cmd->scancode = scancode;
1953 void add_define(
char *str,
int n)
1955 memset(defines[ndefines].str, 0, 32);
1956 strcpy(defines[ndefines].str, str);
1957 defines[ndefines++].n = n;
1960 int lookup_define(
char *str)
1963 for (i = 0; i < ndefines; i++)
1965 if (!strcmp(defines[i].str, str))
1966 return defines[i].n;
1968 fprintf(stderr,
"Error: define `%s' not found.\n", str);