-/* A Bison parser, made by GNU Bison 2.4.3. */
+/* A Bison parser, made by GNU Bison 2.6.2. */
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.3"
+#define YYBISON_VERSION "2.6.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pull parsers. */
#define YYPULL 1
-/* Using locations. */
-#define YYLSP_NEEDED 0
/* Copy the first part of user declarations. */
-
-/* Line 189 of yacc.c */
+/* Line 336 of yacc.c */
#line 6 "loadkeys.y"
#define YY_HEADER_EXPORT_START_CONDITIONS 1
#include "loadkeys.h"
#include "loadkeys.analyze.h"
+/* Line 336 of yacc.c */
+#line 101 "loadkeys.c"
-/* Line 189 of yacc.c */
-#line 106 "loadkeys.c"
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 1
-#endif
+# ifndef YY_NULL
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULL nullptr
+# else
+# define YY_NULL 0
+# endif
+# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+/* In a future release of Bison, this section will be replaced
+ by #include "y.tab.h". */
+#ifndef YY_Y_TAB_H
+# define YY_Y_TAB_H
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+#if YYDEBUG
+extern int yydebug;
#endif
-
/* "%code requires" blocks. */
-
-/* Line 209 of yacc.c */
+/* Line 350 of yacc.c */
#line 39 "loadkeys.y"
#include "loadkeys.keymap.h"
-
-/* Line 209 of yacc.c */
-#line 136 "loadkeys.c"
+/* Line 350 of yacc.c */
+#line 138 "loadkeys.c"
/* Tokens. */
#ifndef YYTOKENTYPE
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
-
-/* Line 214 of yacc.c */
+/* Line 350 of yacc.c */
#line 62 "loadkeys.y"
long long int num;
struct strdata str;
-
-/* Line 214 of yacc.c */
-#line 230 "loadkeys.c"
+/* Line 350 of yacc.c */
+#line 229 "loadkeys.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
#endif
-/* Copy the second part of user declarations. */
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *scanner, struct keymap *kmap);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
-/* Line 264 of yacc.c */
+#endif /* !YY_Y_TAB_H */
+
+/* Copy the second part of user declarations. */
+/* Line 353 of yacc.c */
#line 76 "loadkeys.y"
}
-
-/* Line 264 of yacc.c */
-#line 1109 "loadkeys.c"
+/* Line 353 of yacc.c */
+#line 1122 "loadkeys.c"
#ifdef short
# undef short
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# endif
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
+# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
#endif
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (YYID (0))
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 1
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
"$accept", "keytable", "line", "charsetline", "altismetaline",
"usualstringsline", "usualcomposeline", "keymapline", "range", "range0",
"strline", "compline", "compsym", "singleline", "$@1", "modifiers",
- "modifier", "fullline", "rvalue0", "rvalue1", "rvalue", 0
+ "modifier", "fullline", "rvalue0", "rvalue1", "rvalue", YY_NULL
};
#endif
2, 1, 2
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
+ number is the opposite. If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
static const yytype_uint8 yytable[] =
{
86, 89, 90, 92, 58, 79, 60
};
+#define yypact_value_is_default(yystate) \
+ ((yystate) == (-49))
+
+#define yytable_value_is_error(yytable_value) \
+ YYID (0)
+
static const yytype_uint8 yycheck[] =
{
33, 3, 23, 4, 0, 4, 5, 3, 3, 3,
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
yyerror (scanner, kmap, YY_("syntax error: cannot back up")); \
YYERROR; \
} \
#define YYTERROR 1
#define YYERRCODE 256
-
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
while (YYID (0))
#endif
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+
+
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
+/* This macro is provided for backward compatibility. */
#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, yyscan_t scanner, struct keymap *kmap)
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, struct keymap *kmap)
#else
static void
yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, kmap)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
- yyscan_t scanner;
+ void *scanner;
struct keymap *kmap;
#endif
{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
if (!yyvaluep)
return;
YYUSE (scanner);
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, yyscan_t scanner, struct keymap *kmap)
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, struct keymap *kmap)
#else
static void
yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, kmap)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
- yyscan_t scanner;
+ void *scanner;
struct keymap *kmap;
#endif
{
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, yyscan_t scanner, struct keymap *kmap)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner, struct keymap *kmap)
#else
static void
yy_reduce_print (yyvsp, yyrule, scanner, kmap)
YYSTYPE *yyvsp;
int yyrule;
- yyscan_t scanner;
+ void *scanner;
struct keymap *kmap;
#endif
{
# define YYMAXDEPTH 10000
#endif
-\f
#if YYERROR_VERBOSE
}
# endif
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
- int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
+{
+ YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULL;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - Assume YYFAIL is not used. It's too flawed to consider. See
+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+ for details. YYERROR is fine as it does not invoke this
+ function.
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
{
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+ }
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
+ yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
}
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
}
#endif /* YYERROR_VERBOSE */
-\f
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, yyscan_t scanner, struct keymap *kmap)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, struct keymap *kmap)
#else
static void
yydestruct (yymsg, yytype, yyvaluep, scanner, kmap)
const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
- yyscan_t scanner;
+ void *scanner;
struct keymap *kmap;
#endif
{
}
}
-/* Prevent warnings from -Wmissing-prototypes. */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (yyscan_t scanner, struct keymap *kmap);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-/*-------------------------.
-| yyparse or yypush_parse. |
-`-------------------------*/
+/*----------.
+| yyparse. |
+`----------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
-yyparse (yyscan_t scanner, struct keymap *kmap)
+yyparse (void *scanner, struct keymap *kmap)
#else
int
yyparse (scanner, kmap)
- yyscan_t scanner;
+ void *scanner;
struct keymap *kmap;
#endif
#endif
`yyss': related to states.
`yyvs': related to semantic values.
- Refer to the stacks thru separate pointers, to allow yyoverflow
+ Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
-
goto yysetstate;
/*------------------------------------------------------------.
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yypact_value_is_default (yyn))
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
switch (yyn)
{
case 14:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 958 "loadkeys.y"
{
if (set_charset((char *) (yyvsp[(2) - (3)].str).data))
break;
case 15:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 970 "loadkeys.y"
{
kmap->alt_is_meta = 1;
break;
case 16:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 975 "loadkeys.y"
{
if (strings_as_usual(kmap) == -1)
break;
case 17:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 981 "loadkeys.y"
{
if (compose_as_usual(kmap, (char *) (yyvsp[(5) - (6)].str).data) == -1)
break;
case 18:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 986 "loadkeys.y"
{
if (compose_as_usual(kmap, 0) == -1)
break;
case 19:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 992 "loadkeys.y"
{
kmap->keymaps_line_seen = 1;
break;
case 22:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1000 "loadkeys.y"
{
int i;
break;
case 23:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1008 "loadkeys.y"
{
if (addmap(kmap, (yyvsp[(1) - (1)].num), 1) == -1)
break;
case 24:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1014 "loadkeys.y"
{
struct kbsentry ke;
break;
case 25:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1034 "loadkeys.y"
{
if (compose(kmap, (yyvsp[(2) - (6)].num), (yyvsp[(3) - (6)].num), (yyvsp[(5) - (6)].num)) == -1)
break;
case 26:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1039 "loadkeys.y"
{
if (compose(kmap, (yyvsp[(2) - (6)].num), (yyvsp[(3) - (6)].num), (yyvsp[(5) - (6)].num)) == -1)
break;
case 27:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1044 "loadkeys.y"
{ (yyval.num) = (yyvsp[(1) - (1)].num); }
break;
case 28:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1045 "loadkeys.y"
{ (yyval.num) = (yyvsp[(1) - (1)].num) ^ 0xf000; }
break;
case 29:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1047 "loadkeys.y"
{
kmap->mod = 0;
break;
case 30:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1051 "loadkeys.y"
{
if (addkey(kmap, (yyvsp[(4) - (7)].num), kmap->mod, (yyvsp[(6) - (7)].num)) == -1)
break;
case 31:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1056 "loadkeys.y"
{
if (addkey(kmap, (yyvsp[(3) - (6)].num), 0, (yyvsp[(5) - (6)].num)) == -1)
break;
case 34:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1064 "loadkeys.y"
{ kmap->mod |= M_SHIFT; }
break;
case 35:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1065 "loadkeys.y"
{ kmap->mod |= M_CTRL; }
break;
case 36:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1066 "loadkeys.y"
{ kmap->mod |= M_ALT; }
break;
case 37:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1067 "loadkeys.y"
{ kmap->mod |= M_ALTGR; }
break;
case 38:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1068 "loadkeys.y"
{ kmap->mod |= M_SHIFTL; }
break;
case 39:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1069 "loadkeys.y"
{ kmap->mod |= M_SHIFTR; }
break;
case 40:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1070 "loadkeys.y"
{ kmap->mod |= M_CTRLL; }
break;
case 41:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1071 "loadkeys.y"
{ kmap->mod |= M_CTRLR; }
break;
case 42:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1072 "loadkeys.y"
{ kmap->mod |= M_CAPSSHIFT; }
break;
case 43:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1075 "loadkeys.y"
{
int i, j, keycode;
break;
case 46:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1132 "loadkeys.y"
{
if (kmap->rvalct >= MAX_NR_KEYMAPS) {
break;
case 47:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1140 "loadkeys.y"
{ (yyval.num) = convert_code(kmap->prefer_unicode, (yyvsp[(1) - (1)].num), TO_AUTO); }
break;
case 48:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1141 "loadkeys.y"
{ (yyval.num) = add_capslock(kmap->prefer_unicode, (yyvsp[(2) - (2)].num)); }
break;
case 49:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1142 "loadkeys.y"
{ (yyval.num) = convert_code(kmap->prefer_unicode, (yyvsp[(1) - (1)].num)^0xf000, TO_AUTO); }
break;
case 50:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1143 "loadkeys.y"
{ (yyval.num) = add_capslock(kmap->prefer_unicode, (yyvsp[(2) - (2)].num)^0xf000); }
break;
case 51:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1144 "loadkeys.y"
{ (yyval.num) = (yyvsp[(1) - (1)].num); }
break;
case 52:
-
-/* Line 1464 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1145 "loadkeys.y"
{ (yyval.num) = add_capslock(kmap->prefer_unicode, (yyvsp[(2) - (2)].num)); }
break;
-
-/* Line 1464 of yacc.c */
-#line 2752 "loadkeys.c"
+/* Line 1787 of yacc.c */
+#line 2744 "loadkeys.c"
default: break;
}
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
#if ! YYERROR_VERBOSE
yyerror (scanner, kmap, YY_("syntax error"));
#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
{
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (scanner, kmap, yymsg);
- }
- else
- {
- yyerror (scanner, kmap, YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (scanner, kmap, yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
}
+# undef YYSYNTAX_ERROR
#endif
}
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
+ if (!yypact_value_is_default (yyn))
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyreturn:
if (yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, scanner, kmap);
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, scanner, kmap);
+ }
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
}
-
-/* Line 1684 of yacc.c */
+/* Line 2048 of yacc.c */
#line 1147 "loadkeys.y"
exit(EXIT_SUCCESS);
}
-