cfgparse.c revision a67f45c3
1a67f45c3Smrg/* A Bison parser, made by GNU Bison 3.0.4. */ 276910425Smrg 3a67f45c3Smrg/* Bison implementation for Yacc-like parsers in C 4db17cd6dSmrg 5a67f45c3Smrg Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. 676910425Smrg 7a67f45c3Smrg This program is free software: you can redistribute it and/or modify 876910425Smrg it under the terms of the GNU General Public License as published by 9a67f45c3Smrg the Free Software Foundation, either version 3 of the License, or 10a67f45c3Smrg (at your option) any later version. 1176910425Smrg 1276910425Smrg This program is distributed in the hope that it will be useful, 1376910425Smrg but WITHOUT ANY WARRANTY; without even the implied warranty of 1476910425Smrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1576910425Smrg GNU General Public License for more details. 1676910425Smrg 1776910425Smrg You should have received a copy of the GNU General Public License 18a67f45c3Smrg along with this program. If not, see <http://www.gnu.org/licenses/>. */ 1976910425Smrg 20db17cd6dSmrg/* As a special exception, you may create a larger work that contains 21db17cd6dSmrg part or all of the Bison parser skeleton and distribute that work 22db17cd6dSmrg under terms of your choice, so long as that work isn't itself a 23db17cd6dSmrg parser generator using the skeleton or a modified version thereof 24db17cd6dSmrg as a parser skeleton. Alternatively, if you modify or redistribute 25db17cd6dSmrg the parser skeleton itself, you may (at your option) remove this 26db17cd6dSmrg special exception, which will cause the skeleton and the resulting 27db17cd6dSmrg Bison output files to be licensed under the GNU General Public 28db17cd6dSmrg License without this special exception. 29db17cd6dSmrg 30db17cd6dSmrg This special exception was added by the Free Software Foundation in 31db17cd6dSmrg version 2.2 of Bison. */ 3276910425Smrg 33db17cd6dSmrg/* C LALR(1) parser skeleton written by Richard Stallman, by 34db17cd6dSmrg simplifying the original so-called "semantic" parser. */ 3576910425Smrg 3676910425Smrg/* All symbols defined below should begin with yy or YY, to avoid 3776910425Smrg infringing on user name space. This should be done even for local 3876910425Smrg variables, as they might otherwise be expanded by user macros. 3976910425Smrg There are some unavoidable exceptions within include files to 4076910425Smrg define necessary library symbols; they are noted "INFRINGES ON 4176910425Smrg USER NAME SPACE" below. */ 4276910425Smrg 4376910425Smrg/* Identify Bison output. */ 4476910425Smrg#define YYBISON 1 4576910425Smrg 4676910425Smrg/* Bison version. */ 47a67f45c3Smrg#define YYBISON_VERSION "3.0.4" 4876910425Smrg 4976910425Smrg/* Skeleton name. */ 5076910425Smrg#define YYSKELETON_NAME "yacc.c" 5176910425Smrg 5276910425Smrg/* Pure parsers. */ 5376910425Smrg#define YYPURE 0 5476910425Smrg 55a67f45c3Smrg/* Push parsers. */ 56a67f45c3Smrg#define YYPUSH 0 5776910425Smrg 58a67f45c3Smrg/* Pull parsers. */ 59a67f45c3Smrg#define YYPULL 1 6076910425Smrg 6176910425Smrg 62a67f45c3Smrg 63a67f45c3Smrg 64a67f45c3Smrg/* Copy the first part of user declarations. */ 65a67f45c3Smrg#line 62 "cfgparse.y" /* yacc.c:339 */ 66a67f45c3Smrg 67a67f45c3Smrg#ifdef DEBUG 68a67f45c3Smrg#define YYDEBUG 1 69a67f45c3Smrg#endif 70a67f45c3Smrg#include "xkbevd.h" 71a67f45c3Smrg#include <stdlib.h> 72a67f45c3Smrg 73a67f45c3Smrg#line 74 "cfgparse.c" /* yacc.c:339 */ 74a67f45c3Smrg 75a67f45c3Smrg# ifndef YY_NULLPTR 76a67f45c3Smrg# if defined __cplusplus && 201103L <= __cplusplus 77a67f45c3Smrg# define YY_NULLPTR nullptr 78a67f45c3Smrg# else 79a67f45c3Smrg# define YY_NULLPTR 0 80a67f45c3Smrg# endif 81a67f45c3Smrg# endif 82a67f45c3Smrg 83a67f45c3Smrg/* Enabling verbose error messages. */ 84a67f45c3Smrg#ifdef YYERROR_VERBOSE 85a67f45c3Smrg# undef YYERROR_VERBOSE 86a67f45c3Smrg# define YYERROR_VERBOSE 1 87a67f45c3Smrg#else 88a67f45c3Smrg# define YYERROR_VERBOSE 0 89a67f45c3Smrg#endif 90a67f45c3Smrg 91a67f45c3Smrg 92a67f45c3Smrg/* Debug traces. */ 93a67f45c3Smrg#ifndef YYDEBUG 94a67f45c3Smrg# define YYDEBUG 0 95a67f45c3Smrg#endif 96a67f45c3Smrg#if YYDEBUG 97a67f45c3Smrgextern int yydebug; 98a67f45c3Smrg#endif 99a67f45c3Smrg 100a67f45c3Smrg/* Token type. */ 10176910425Smrg#ifndef YYTOKENTYPE 10276910425Smrg# define YYTOKENTYPE 103a67f45c3Smrg enum yytokentype 104a67f45c3Smrg { 105a67f45c3Smrg END_OF_FILE = 0, 106a67f45c3Smrg ERROR = 255, 107a67f45c3Smrg BELL = 1, 108a67f45c3Smrg ACCESSX = 2, 109a67f45c3Smrg MESSAGE = 3, 110a67f45c3Smrg NONE = 20, 111a67f45c3Smrg IGNORE = 21, 112a67f45c3Smrg ECHO = 22, 113a67f45c3Smrg PRINT_EV = 23, 114a67f45c3Smrg SHELL = 24, 115a67f45c3Smrg SOUND = 25, 116a67f45c3Smrg EQUALS = 40, 117a67f45c3Smrg PLUS = 41, 118a67f45c3Smrg MINUS = 42, 119a67f45c3Smrg DIVIDE = 43, 120a67f45c3Smrg TIMES = 44, 121a67f45c3Smrg OBRACE = 45, 122a67f45c3Smrg CBRACE = 46, 123a67f45c3Smrg OPAREN = 47, 124a67f45c3Smrg CPAREN = 48, 125a67f45c3Smrg OBRACKET = 49, 126a67f45c3Smrg CBRACKET = 50, 127a67f45c3Smrg DOT = 51, 128a67f45c3Smrg COMMA = 52, 129a67f45c3Smrg SEMI = 53, 130a67f45c3Smrg EXCLAM = 54, 131a67f45c3Smrg INVERT = 55, 132a67f45c3Smrg STRING = 60, 133a67f45c3Smrg INTEGER = 61, 134a67f45c3Smrg FLOAT = 62, 135a67f45c3Smrg IDENT = 63, 136a67f45c3Smrg KEYNAME = 64 137a67f45c3Smrg }; 13876910425Smrg#endif 13976910425Smrg/* Tokens. */ 14076910425Smrg#define END_OF_FILE 0 14176910425Smrg#define ERROR 255 14276910425Smrg#define BELL 1 14376910425Smrg#define ACCESSX 2 14476910425Smrg#define MESSAGE 3 14576910425Smrg#define NONE 20 14676910425Smrg#define IGNORE 21 14776910425Smrg#define ECHO 22 14876910425Smrg#define PRINT_EV 23 14976910425Smrg#define SHELL 24 15076910425Smrg#define SOUND 25 15176910425Smrg#define EQUALS 40 15276910425Smrg#define PLUS 41 15376910425Smrg#define MINUS 42 15476910425Smrg#define DIVIDE 43 15576910425Smrg#define TIMES 44 15676910425Smrg#define OBRACE 45 15776910425Smrg#define CBRACE 46 15876910425Smrg#define OPAREN 47 15976910425Smrg#define CPAREN 48 16076910425Smrg#define OBRACKET 49 16176910425Smrg#define CBRACKET 50 16276910425Smrg#define DOT 51 16376910425Smrg#define COMMA 52 16476910425Smrg#define SEMI 53 16576910425Smrg#define EXCLAM 54 16676910425Smrg#define INVERT 55 16776910425Smrg#define STRING 60 16876910425Smrg#define INTEGER 61 16976910425Smrg#define FLOAT 62 17076910425Smrg#define IDENT 63 17176910425Smrg#define KEYNAME 64 17276910425Smrg 173a67f45c3Smrg/* Value type. */ 174db17cd6dSmrg#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 175a67f45c3Smrg 176a67f45c3Smrgunion YYSTYPE 177db17cd6dSmrg{ 178a67f45c3Smrg#line 75 "cfgparse.y" /* yacc.c:355 */ 179a67f45c3Smrg 18076910425Smrg char * str; 18176910425Smrg int ival; 18276910425Smrg CfgEntryPtr entry; 18376910425Smrg ActDefPtr act; 184a67f45c3Smrg 185a67f45c3Smrg#line 186 "cfgparse.c" /* yacc.c:355 */ 186a67f45c3Smrg}; 187a67f45c3Smrg 188a67f45c3Smrgtypedef union YYSTYPE YYSTYPE; 18976910425Smrg# define YYSTYPE_IS_TRIVIAL 1 190a67f45c3Smrg# define YYSTYPE_IS_DECLARED 1 19176910425Smrg#endif 19276910425Smrg 19376910425Smrg 194a67f45c3Smrgextern YYSTYPE yylval; 195a67f45c3Smrg 196a67f45c3Smrgint yyparse (void); 19776910425Smrg 19876910425Smrg 19976910425Smrg 200a67f45c3Smrg/* Copy the second part of user declarations. */ 201a67f45c3Smrg 202a67f45c3Smrg#line 203 "cfgparse.c" /* yacc.c:358 */ 20376910425Smrg 204db17cd6dSmrg#ifdef short 205db17cd6dSmrg# undef short 20676910425Smrg#endif 207db17cd6dSmrg 208db17cd6dSmrg#ifdef YYTYPE_UINT8 209db17cd6dSmrgtypedef YYTYPE_UINT8 yytype_uint8; 210db17cd6dSmrg#else 211db17cd6dSmrgtypedef unsigned char yytype_uint8; 21276910425Smrg#endif 213db17cd6dSmrg 214db17cd6dSmrg#ifdef YYTYPE_INT8 215db17cd6dSmrgtypedef YYTYPE_INT8 yytype_int8; 216db17cd6dSmrg#else 217a67f45c3Smrgtypedef signed char yytype_int8; 218db17cd6dSmrg#endif 219db17cd6dSmrg 220db17cd6dSmrg#ifdef YYTYPE_UINT16 221db17cd6dSmrgtypedef YYTYPE_UINT16 yytype_uint16; 222db17cd6dSmrg#else 223db17cd6dSmrgtypedef unsigned short int yytype_uint16; 224db17cd6dSmrg#endif 225db17cd6dSmrg 226db17cd6dSmrg#ifdef YYTYPE_INT16 227db17cd6dSmrgtypedef YYTYPE_INT16 yytype_int16; 228db17cd6dSmrg#else 229db17cd6dSmrgtypedef short int yytype_int16; 23076910425Smrg#endif 231db17cd6dSmrg 232db17cd6dSmrg#ifndef YYSIZE_T 233db17cd6dSmrg# ifdef __SIZE_TYPE__ 234db17cd6dSmrg# define YYSIZE_T __SIZE_TYPE__ 235db17cd6dSmrg# elif defined size_t 236db17cd6dSmrg# define YYSIZE_T size_t 237a67f45c3Smrg# elif ! defined YYSIZE_T 238db17cd6dSmrg# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 239db17cd6dSmrg# define YYSIZE_T size_t 240db17cd6dSmrg# else 241db17cd6dSmrg# define YYSIZE_T unsigned int 242db17cd6dSmrg# endif 24376910425Smrg#endif 24476910425Smrg 245db17cd6dSmrg#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 246db17cd6dSmrg 24776910425Smrg#ifndef YY_ 248a67f45c3Smrg# if defined YYENABLE_NLS && YYENABLE_NLS 24976910425Smrg# if ENABLE_NLS 25076910425Smrg# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 251a67f45c3Smrg# define YY_(Msgid) dgettext ("bison-runtime", Msgid) 25276910425Smrg# endif 25376910425Smrg# endif 25476910425Smrg# ifndef YY_ 255a67f45c3Smrg# define YY_(Msgid) Msgid 256a67f45c3Smrg# endif 257a67f45c3Smrg#endif 258a67f45c3Smrg 259a67f45c3Smrg#ifndef YY_ATTRIBUTE 260a67f45c3Smrg# if (defined __GNUC__ \ 261a67f45c3Smrg && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 262a67f45c3Smrg || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 263a67f45c3Smrg# define YY_ATTRIBUTE(Spec) __attribute__(Spec) 264a67f45c3Smrg# else 265a67f45c3Smrg# define YY_ATTRIBUTE(Spec) /* empty */ 266a67f45c3Smrg# endif 267a67f45c3Smrg#endif 268a67f45c3Smrg 269a67f45c3Smrg#ifndef YY_ATTRIBUTE_PURE 270a67f45c3Smrg# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 271a67f45c3Smrg#endif 272a67f45c3Smrg 273a67f45c3Smrg#ifndef YY_ATTRIBUTE_UNUSED 274a67f45c3Smrg# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 275a67f45c3Smrg#endif 276a67f45c3Smrg 277a67f45c3Smrg#if !defined _Noreturn \ 278a67f45c3Smrg && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 279a67f45c3Smrg# if defined _MSC_VER && 1200 <= _MSC_VER 280a67f45c3Smrg# define _Noreturn __declspec (noreturn) 281a67f45c3Smrg# else 282a67f45c3Smrg# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 28376910425Smrg# endif 28476910425Smrg#endif 28576910425Smrg 286db17cd6dSmrg/* Suppress unused-variable warnings by "using" E. */ 287db17cd6dSmrg#if ! defined lint || defined __GNUC__ 288a67f45c3Smrg# define YYUSE(E) ((void) (E)) 289db17cd6dSmrg#else 290a67f45c3Smrg# define YYUSE(E) /* empty */ 291db17cd6dSmrg#endif 292db17cd6dSmrg 293a67f45c3Smrg#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 294a67f45c3Smrg/* Suppress an incorrect diagnostic about yylval being uninitialized. */ 295a67f45c3Smrg# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 296a67f45c3Smrg _Pragma ("GCC diagnostic push") \ 297a67f45c3Smrg _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 298a67f45c3Smrg _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 299a67f45c3Smrg# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 300a67f45c3Smrg _Pragma ("GCC diagnostic pop") 301db17cd6dSmrg#else 302a67f45c3Smrg# define YY_INITIAL_VALUE(Value) Value 303db17cd6dSmrg#endif 304a67f45c3Smrg#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 305a67f45c3Smrg# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 306a67f45c3Smrg# define YY_IGNORE_MAYBE_UNINITIALIZED_END 307a67f45c3Smrg#endif 308a67f45c3Smrg#ifndef YY_INITIAL_VALUE 309a67f45c3Smrg# define YY_INITIAL_VALUE(Value) /* Nothing. */ 310db17cd6dSmrg#endif 311db17cd6dSmrg 312a67f45c3Smrg 313db17cd6dSmrg#if ! defined yyoverflow || YYERROR_VERBOSE 31476910425Smrg 31576910425Smrg/* The parser invokes alloca or malloc; define the necessary symbols. */ 31676910425Smrg 31776910425Smrg# ifdef YYSTACK_USE_ALLOCA 31876910425Smrg# if YYSTACK_USE_ALLOCA 31976910425Smrg# ifdef __GNUC__ 32076910425Smrg# define YYSTACK_ALLOC __builtin_alloca 321db17cd6dSmrg# elif defined __BUILTIN_VA_ARG_INCR 322db17cd6dSmrg# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 323db17cd6dSmrg# elif defined _AIX 324db17cd6dSmrg# define YYSTACK_ALLOC __alloca 325db17cd6dSmrg# elif defined _MSC_VER 326db17cd6dSmrg# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 327db17cd6dSmrg# define alloca _alloca 32876910425Smrg# else 32976910425Smrg# define YYSTACK_ALLOC alloca 330a67f45c3Smrg# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 33176910425Smrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 332a67f45c3Smrg /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 333a67f45c3Smrg# ifndef EXIT_SUCCESS 334a67f45c3Smrg# define EXIT_SUCCESS 0 335db17cd6dSmrg# endif 33676910425Smrg# endif 33776910425Smrg# endif 33876910425Smrg# endif 33976910425Smrg# endif 34076910425Smrg 34176910425Smrg# ifdef YYSTACK_ALLOC 342a67f45c3Smrg /* Pacify GCC's 'empty if-body' warning. */ 343a67f45c3Smrg# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 34476910425Smrg# ifndef YYSTACK_ALLOC_MAXIMUM 34576910425Smrg /* The OS might guarantee only one guard page at the bottom of the stack, 34676910425Smrg and a page size can be as small as 4096 bytes. So we cannot safely 34776910425Smrg invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 34876910425Smrg to allow for a few compiler-allocated temporary stack slots. */ 349db17cd6dSmrg# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 35076910425Smrg# endif 35176910425Smrg# else 35276910425Smrg# define YYSTACK_ALLOC YYMALLOC 35376910425Smrg# define YYSTACK_FREE YYFREE 35476910425Smrg# ifndef YYSTACK_ALLOC_MAXIMUM 355db17cd6dSmrg# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 35676910425Smrg# endif 357a67f45c3Smrg# if (defined __cplusplus && ! defined EXIT_SUCCESS \ 358db17cd6dSmrg && ! ((defined YYMALLOC || defined malloc) \ 359a67f45c3Smrg && (defined YYFREE || defined free))) 360db17cd6dSmrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 361a67f45c3Smrg# ifndef EXIT_SUCCESS 362a67f45c3Smrg# define EXIT_SUCCESS 0 363db17cd6dSmrg# endif 36476910425Smrg# endif 36576910425Smrg# ifndef YYMALLOC 36676910425Smrg# define YYMALLOC malloc 367a67f45c3Smrg# if ! defined malloc && ! defined EXIT_SUCCESS 36876910425Smrgvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 36976910425Smrg# endif 37076910425Smrg# endif 37176910425Smrg# ifndef YYFREE 37276910425Smrg# define YYFREE free 373a67f45c3Smrg# if ! defined free && ! defined EXIT_SUCCESS 37476910425Smrgvoid free (void *); /* INFRINGES ON USER NAME SPACE */ 37576910425Smrg# endif 37676910425Smrg# endif 37776910425Smrg# endif 378db17cd6dSmrg#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 37976910425Smrg 38076910425Smrg 381db17cd6dSmrg#if (! defined yyoverflow \ 382db17cd6dSmrg && (! defined __cplusplus \ 383a67f45c3Smrg || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 38476910425Smrg 38576910425Smrg/* A type that is properly aligned for any stack member. */ 38676910425Smrgunion yyalloc 38776910425Smrg{ 388a67f45c3Smrg yytype_int16 yyss_alloc; 389a67f45c3Smrg YYSTYPE yyvs_alloc; 390a67f45c3Smrg}; 39176910425Smrg 39276910425Smrg/* The size of the maximum gap between one aligned stack and the next. */ 39376910425Smrg# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 39476910425Smrg 39576910425Smrg/* The size of an array large to enough to hold all stacks, each with 39676910425Smrg N elements. */ 39776910425Smrg# define YYSTACK_BYTES(N) \ 398db17cd6dSmrg ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 39976910425Smrg + YYSTACK_GAP_MAXIMUM) 40076910425Smrg 401a67f45c3Smrg# define YYCOPY_NEEDED 1 40276910425Smrg 40376910425Smrg/* Relocate STACK from its old location to the new one. The 40476910425Smrg local variables YYSIZE and YYSTACKSIZE give the old and new number of 40576910425Smrg elements in the stack, and YYPTR gives the new location of the 40676910425Smrg stack. Advance YYPTR to a properly aligned location for the next 40776910425Smrg stack. */ 408a67f45c3Smrg# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 409a67f45c3Smrg do \ 410a67f45c3Smrg { \ 411a67f45c3Smrg YYSIZE_T yynewbytes; \ 412a67f45c3Smrg YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 413a67f45c3Smrg Stack = &yyptr->Stack_alloc; \ 414a67f45c3Smrg yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 415a67f45c3Smrg yyptr += yynewbytes / sizeof (*yyptr); \ 416a67f45c3Smrg } \ 417a67f45c3Smrg while (0) 41876910425Smrg 41976910425Smrg#endif 42076910425Smrg 421a67f45c3Smrg#if defined YYCOPY_NEEDED && YYCOPY_NEEDED 422a67f45c3Smrg/* Copy COUNT objects from SRC to DST. The source and destination do 423a67f45c3Smrg not overlap. */ 424a67f45c3Smrg# ifndef YYCOPY 425a67f45c3Smrg# if defined __GNUC__ && 1 < __GNUC__ 426a67f45c3Smrg# define YYCOPY(Dst, Src, Count) \ 427a67f45c3Smrg __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 428a67f45c3Smrg# else 429a67f45c3Smrg# define YYCOPY(Dst, Src, Count) \ 430a67f45c3Smrg do \ 431a67f45c3Smrg { \ 432a67f45c3Smrg YYSIZE_T yyi; \ 433a67f45c3Smrg for (yyi = 0; yyi < (Count); yyi++) \ 434a67f45c3Smrg (Dst)[yyi] = (Src)[yyi]; \ 435a67f45c3Smrg } \ 436a67f45c3Smrg while (0) 437a67f45c3Smrg# endif 438a67f45c3Smrg# endif 439a67f45c3Smrg#endif /* !YYCOPY_NEEDED */ 440a67f45c3Smrg 441db17cd6dSmrg/* YYFINAL -- State number of the termination state. */ 44276910425Smrg#define YYFINAL 12 44376910425Smrg/* YYLAST -- Last index in YYTABLE. */ 44476910425Smrg#define YYLAST 28 44576910425Smrg 446db17cd6dSmrg/* YYNTOKENS -- Number of terminals. */ 44776910425Smrg#define YYNTOKENS 34 448db17cd6dSmrg/* YYNNTS -- Number of nonterminals. */ 44976910425Smrg#define YYNNTS 14 450db17cd6dSmrg/* YYNRULES -- Number of rules. */ 45176910425Smrg#define YYNRULES 27 452a67f45c3Smrg/* YYNSTATES -- Number of states. */ 45376910425Smrg#define YYNSTATES 33 45476910425Smrg 455a67f45c3Smrg/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 456a67f45c3Smrg by yylex, with out-of-bounds checking. */ 45776910425Smrg#define YYUNDEFTOK 2 45876910425Smrg#define YYMAXUTOK 257 45976910425Smrg 460a67f45c3Smrg#define YYTRANSLATE(YYX) \ 46176910425Smrg ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 46276910425Smrg 463a67f45c3Smrg/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 464a67f45c3Smrg as returned by yylex, without out-of-bounds checking. */ 465db17cd6dSmrgstatic const yytype_uint8 yytranslate[] = 46676910425Smrg{ 46776910425Smrg 0, 4, 5, 6, 2, 2, 2, 2, 2, 2, 46876910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 46976910425Smrg 7, 8, 9, 10, 11, 12, 2, 2, 2, 2, 47076910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47176910425Smrg 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 47276910425Smrg 23, 24, 25, 26, 27, 28, 2, 2, 2, 2, 47376910425Smrg 29, 30, 31, 32, 33, 2, 2, 2, 2, 2, 47476910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47576910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47676910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47776910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47876910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47976910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48076910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48176910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48276910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48376910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48476910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48576910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48676910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48776910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48876910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48976910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49076910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49176910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49276910425Smrg 2, 2, 2, 2, 2, 3, 1, 2 49376910425Smrg}; 49476910425Smrg 49576910425Smrg#if YYDEBUG 496a67f45c3Smrg /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 497db17cd6dSmrgstatic const yytype_uint8 yyrline[] = 49876910425Smrg{ 4999ff100acSmrg 0, 86, 86, 90, 102, 105, 113, 116, 133, 150, 5009ff100acSmrg 151, 152, 155, 167, 168, 169, 170, 171, 172, 173, 5019ff100acSmrg 176, 177, 180, 181, 184, 187, 188, 191 50276910425Smrg}; 50376910425Smrg#endif 50476910425Smrg 505a67f45c3Smrg#if YYDEBUG || YYERROR_VERBOSE || 0 50676910425Smrg/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 507db17cd6dSmrg First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 50876910425Smrgstatic const char *const yytname[] = 50976910425Smrg{ 51076910425Smrg "END_OF_FILE", "error", "$undefined", "ERROR", "BELL", "ACCESSX", 51176910425Smrg "MESSAGE", "NONE", "IGNORE", "ECHO", "PRINT_EV", "SHELL", "SOUND", 51276910425Smrg "EQUALS", "PLUS", "MINUS", "DIVIDE", "TIMES", "OBRACE", "CBRACE", 51376910425Smrg "OPAREN", "CPAREN", "OBRACKET", "CBRACKET", "DOT", "COMMA", "SEMI", 51476910425Smrg "EXCLAM", "INVERT", "STRING", "INTEGER", "FLOAT", "IDENT", "KEYNAME", 51576910425Smrg "$accept", "CfgFile", "CfgEntryList", "CfgEntry", "VarDef", "EventDef", 51676910425Smrg "EventType", "ActionDef", "ActionType", "OptNameSpec", "NameSpec", 517a67f45c3Smrg "Ident", "OptString", "String", YY_NULLPTR 51876910425Smrg}; 51976910425Smrg#endif 52076910425Smrg 52176910425Smrg# ifdef YYPRINT 522a67f45c3Smrg/* YYTOKNUM[NUM] -- (External) token number corresponding to the 523a67f45c3Smrg (internal) symbol number NUM (which must be that of a token). */ 524db17cd6dSmrgstatic const yytype_uint16 yytoknum[] = 52576910425Smrg{ 52676910425Smrg 0, 256, 257, 255, 1, 2, 3, 20, 21, 22, 52776910425Smrg 23, 24, 25, 40, 41, 42, 43, 44, 45, 46, 52876910425Smrg 47, 48, 49, 50, 51, 52, 53, 54, 55, 60, 52976910425Smrg 61, 62, 63, 64 53076910425Smrg}; 53176910425Smrg# endif 53276910425Smrg 533a67f45c3Smrg#define YYPACT_NINF -20 53476910425Smrg 535a67f45c3Smrg#define yypact_value_is_default(Yystate) \ 536a67f45c3Smrg (!!((Yystate) == (-20))) 53776910425Smrg 538a67f45c3Smrg#define YYTABLE_NINF -1 53976910425Smrg 540a67f45c3Smrg#define yytable_value_is_error(Yytable_value) \ 541a67f45c3Smrg 0 54276910425Smrg 543a67f45c3Smrg /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 544a67f45c3Smrg STATE-NUM. */ 545db17cd6dSmrgstatic const yytype_int8 yypact[] = 54676910425Smrg{ 54776910425Smrg -4, -20, -20, -20, -20, 3, -4, -20, -20, -3, 54876910425Smrg -6, 2, -20, -20, -20, -20, -20, -20, -20, -20, 54976910425Smrg -20, -13, -19, -19, -20, -20, -20, -2, -20, -20, 55076910425Smrg -20, -20, -20 55176910425Smrg}; 55276910425Smrg 553a67f45c3Smrg /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 554a67f45c3Smrg Performed when YYTABLE does not specify something else to do. Zero 555a67f45c3Smrg means the default is an error. */ 556a67f45c3Smrgstatic const yytype_uint8 yydefact[] = 557a67f45c3Smrg{ 558a67f45c3Smrg 0, 9, 10, 11, 24, 0, 2, 4, 6, 19, 559a67f45c3Smrg 0, 0, 1, 3, 13, 14, 15, 16, 17, 18, 560a67f45c3Smrg 5, 26, 21, 0, 27, 12, 25, 0, 20, 22, 561a67f45c3Smrg 23, 7, 8 562a67f45c3Smrg}; 563a67f45c3Smrg 564a67f45c3Smrg /* YYPGOTO[NTERM-NUM]. */ 565db17cd6dSmrgstatic const yytype_int8 yypgoto[] = 56676910425Smrg{ 56776910425Smrg -20, -20, -20, 11, -20, -20, -20, -20, -20, -20, 56876910425Smrg -5, -11, -20, -1 56976910425Smrg}; 57076910425Smrg 571a67f45c3Smrg /* YYDEFGOTO[NTERM-NUM]. */ 572a67f45c3Smrgstatic const yytype_int8 yydefgoto[] = 573a67f45c3Smrg{ 574a67f45c3Smrg -1, 5, 6, 7, 8, 9, 10, 20, 21, 27, 575a67f45c3Smrg 28, 11, 25, 30 576a67f45c3Smrg}; 577a67f45c3Smrg 578a67f45c3Smrg /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 579a67f45c3Smrg positive, shift that token. If negative, reduce the rule whose 580a67f45c3Smrg number is the opposite. If YYTABLE_NINF, syntax error. */ 581db17cd6dSmrgstatic const yytype_uint8 yytable[] = 58276910425Smrg{ 58376910425Smrg 1, 2, 3, 12, 14, 15, 16, 17, 18, 19, 58476910425Smrg 24, 29, 29, 4, 22, 23, 24, 13, 31, 32, 58576910425Smrg 26, 0, 0, 0, 0, 0, 0, 0, 4 58676910425Smrg}; 58776910425Smrg 588db17cd6dSmrgstatic const yytype_int8 yycheck[] = 58976910425Smrg{ 59076910425Smrg 4, 5, 6, 0, 7, 8, 9, 10, 11, 12, 59176910425Smrg 29, 22, 23, 32, 20, 13, 29, 6, 23, 21, 59276910425Smrg 21, -1, -1, -1, -1, -1, -1, -1, 32 59376910425Smrg}; 59476910425Smrg 595a67f45c3Smrg /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 596a67f45c3Smrg symbol of state STATE-NUM. */ 597db17cd6dSmrgstatic const yytype_uint8 yystos[] = 59876910425Smrg{ 59976910425Smrg 0, 4, 5, 6, 32, 35, 36, 37, 38, 39, 60076910425Smrg 40, 45, 0, 37, 7, 8, 9, 10, 11, 12, 60176910425Smrg 41, 42, 20, 13, 29, 46, 47, 43, 44, 45, 60276910425Smrg 47, 44, 21 60376910425Smrg}; 60476910425Smrg 605a67f45c3Smrg /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 606a67f45c3Smrgstatic const yytype_uint8 yyr1[] = 607a67f45c3Smrg{ 608a67f45c3Smrg 0, 34, 35, 36, 36, 37, 37, 38, 39, 40, 609a67f45c3Smrg 40, 40, 41, 42, 42, 42, 42, 42, 42, 42, 610a67f45c3Smrg 43, 43, 44, 44, 45, 46, 46, 47 611a67f45c3Smrg}; 612a67f45c3Smrg 613a67f45c3Smrg /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ 614a67f45c3Smrgstatic const yytype_uint8 yyr2[] = 615a67f45c3Smrg{ 616a67f45c3Smrg 0, 2, 1, 2, 1, 2, 1, 3, 4, 1, 617a67f45c3Smrg 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 618a67f45c3Smrg 1, 0, 1, 1, 1, 1, 0, 1 619a67f45c3Smrg}; 62076910425Smrg 62176910425Smrg 622a67f45c3Smrg#define yyerrok (yyerrstatus = 0) 623a67f45c3Smrg#define yyclearin (yychar = YYEMPTY) 624a67f45c3Smrg#define YYEMPTY (-2) 625a67f45c3Smrg#define YYEOF 0 62676910425Smrg 627a67f45c3Smrg#define YYACCEPT goto yyacceptlab 628a67f45c3Smrg#define YYABORT goto yyabortlab 629a67f45c3Smrg#define YYERROR goto yyerrorlab 63076910425Smrg 63176910425Smrg 63276910425Smrg#define YYRECOVERING() (!!yyerrstatus) 63376910425Smrg 634a67f45c3Smrg#define YYBACKUP(Token, Value) \ 635a67f45c3Smrgdo \ 636a67f45c3Smrg if (yychar == YYEMPTY) \ 637a67f45c3Smrg { \ 638a67f45c3Smrg yychar = (Token); \ 639a67f45c3Smrg yylval = (Value); \ 640a67f45c3Smrg YYPOPSTACK (yylen); \ 641a67f45c3Smrg yystate = *yyssp; \ 642a67f45c3Smrg goto yybackup; \ 643a67f45c3Smrg } \ 644a67f45c3Smrg else \ 645a67f45c3Smrg { \ 64676910425Smrg yyerror (YY_("syntax error: cannot back up")); \ 647a67f45c3Smrg YYERROR; \ 648a67f45c3Smrg } \ 649a67f45c3Smrgwhile (0) 65076910425Smrg 651a67f45c3Smrg/* Error token number */ 652a67f45c3Smrg#define YYTERROR 1 653a67f45c3Smrg#define YYERRCODE 256 65476910425Smrg 65576910425Smrg 65676910425Smrg 65776910425Smrg/* Enable debugging if requested. */ 65876910425Smrg#if YYDEBUG 65976910425Smrg 66076910425Smrg# ifndef YYFPRINTF 66176910425Smrg# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 66276910425Smrg# define YYFPRINTF fprintf 66376910425Smrg# endif 66476910425Smrg 665a67f45c3Smrg# define YYDPRINTF(Args) \ 666a67f45c3Smrgdo { \ 667a67f45c3Smrg if (yydebug) \ 668a67f45c3Smrg YYFPRINTF Args; \ 669a67f45c3Smrg} while (0) 670db17cd6dSmrg 671a67f45c3Smrg/* This macro is provided for backward compatibility. */ 672a67f45c3Smrg#ifndef YY_LOCATION_PRINT 673a67f45c3Smrg# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 674a67f45c3Smrg#endif 67576910425Smrg 676db17cd6dSmrg 677a67f45c3Smrg# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 678a67f45c3Smrgdo { \ 679a67f45c3Smrg if (yydebug) \ 680a67f45c3Smrg { \ 681a67f45c3Smrg YYFPRINTF (stderr, "%s ", Title); \ 682a67f45c3Smrg yy_symbol_print (stderr, \ 683a67f45c3Smrg Type, Value); \ 684a67f45c3Smrg YYFPRINTF (stderr, "\n"); \ 685a67f45c3Smrg } \ 686a67f45c3Smrg} while (0) 687a67f45c3Smrg 688a67f45c3Smrg 689a67f45c3Smrg/*----------------------------------------. 690a67f45c3Smrg| Print this symbol's value on YYOUTPUT. | 691a67f45c3Smrg`----------------------------------------*/ 692db17cd6dSmrg 693db17cd6dSmrgstatic void 694db17cd6dSmrgyy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 695db17cd6dSmrg{ 696a67f45c3Smrg FILE *yyo = yyoutput; 697a67f45c3Smrg YYUSE (yyo); 698db17cd6dSmrg if (!yyvaluep) 699db17cd6dSmrg return; 700db17cd6dSmrg# ifdef YYPRINT 701db17cd6dSmrg if (yytype < YYNTOKENS) 702db17cd6dSmrg YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 703db17cd6dSmrg# endif 704a67f45c3Smrg YYUSE (yytype); 705db17cd6dSmrg} 706db17cd6dSmrg 707db17cd6dSmrg 708db17cd6dSmrg/*--------------------------------. 709db17cd6dSmrg| Print this symbol on YYOUTPUT. | 710db17cd6dSmrg`--------------------------------*/ 711db17cd6dSmrg 712db17cd6dSmrgstatic void 713db17cd6dSmrgyy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 714db17cd6dSmrg{ 715a67f45c3Smrg YYFPRINTF (yyoutput, "%s %s (", 716a67f45c3Smrg yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 717db17cd6dSmrg 718db17cd6dSmrg yy_symbol_value_print (yyoutput, yytype, yyvaluep); 719db17cd6dSmrg YYFPRINTF (yyoutput, ")"); 720db17cd6dSmrg} 72176910425Smrg 72276910425Smrg/*------------------------------------------------------------------. 72376910425Smrg| yy_stack_print -- Print the state stack from its BOTTOM up to its | 72476910425Smrg| TOP (included). | 72576910425Smrg`------------------------------------------------------------------*/ 72676910425Smrg 72776910425Smrgstatic void 728a67f45c3Smrgyy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 72976910425Smrg{ 73076910425Smrg YYFPRINTF (stderr, "Stack now"); 731a67f45c3Smrg for (; yybottom <= yytop; yybottom++) 732a67f45c3Smrg { 733a67f45c3Smrg int yybot = *yybottom; 734a67f45c3Smrg YYFPRINTF (stderr, " %d", yybot); 735a67f45c3Smrg } 73676910425Smrg YYFPRINTF (stderr, "\n"); 73776910425Smrg} 73876910425Smrg 739a67f45c3Smrg# define YY_STACK_PRINT(Bottom, Top) \ 740a67f45c3Smrgdo { \ 741a67f45c3Smrg if (yydebug) \ 742a67f45c3Smrg yy_stack_print ((Bottom), (Top)); \ 743a67f45c3Smrg} while (0) 74476910425Smrg 74576910425Smrg 74676910425Smrg/*------------------------------------------------. 74776910425Smrg| Report that the YYRULE is going to be reduced. | 74876910425Smrg`------------------------------------------------*/ 74976910425Smrg 75076910425Smrgstatic void 751a67f45c3Smrgyy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) 75276910425Smrg{ 753a67f45c3Smrg unsigned long int yylno = yyrline[yyrule]; 754db17cd6dSmrg int yynrhs = yyr2[yyrule]; 75576910425Smrg int yyi; 756db17cd6dSmrg YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 757a67f45c3Smrg yyrule - 1, yylno); 758db17cd6dSmrg /* The symbols being reduced. */ 759db17cd6dSmrg for (yyi = 0; yyi < yynrhs; yyi++) 760db17cd6dSmrg { 761a67f45c3Smrg YYFPRINTF (stderr, " $%d = ", yyi + 1); 762a67f45c3Smrg yy_symbol_print (stderr, 763a67f45c3Smrg yystos[yyssp[yyi + 1 - yynrhs]], 764a67f45c3Smrg &(yyvsp[(yyi + 1) - (yynrhs)]) 765a67f45c3Smrg ); 766a67f45c3Smrg YYFPRINTF (stderr, "\n"); 767db17cd6dSmrg } 76876910425Smrg} 76976910425Smrg 770a67f45c3Smrg# define YY_REDUCE_PRINT(Rule) \ 771a67f45c3Smrgdo { \ 772a67f45c3Smrg if (yydebug) \ 773a67f45c3Smrg yy_reduce_print (yyssp, yyvsp, Rule); \ 774a67f45c3Smrg} while (0) 77576910425Smrg 77676910425Smrg/* Nonzero means print parse trace. It is left uninitialized so that 77776910425Smrg multiple parsers can coexist. */ 77876910425Smrgint yydebug; 77976910425Smrg#else /* !YYDEBUG */ 78076910425Smrg# define YYDPRINTF(Args) 78176910425Smrg# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 78276910425Smrg# define YY_STACK_PRINT(Bottom, Top) 78376910425Smrg# define YY_REDUCE_PRINT(Rule) 78476910425Smrg#endif /* !YYDEBUG */ 78576910425Smrg 78676910425Smrg 78776910425Smrg/* YYINITDEPTH -- initial size of the parser's stacks. */ 788a67f45c3Smrg#ifndef YYINITDEPTH 78976910425Smrg# define YYINITDEPTH 200 79076910425Smrg#endif 79176910425Smrg 79276910425Smrg/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 79376910425Smrg if the built-in stack extension method is used). 79476910425Smrg 79576910425Smrg Do not make this value too large; the results are undefined if 79676910425Smrg YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 79776910425Smrg evaluated with infinite-precision integer arithmetic. */ 79876910425Smrg 79976910425Smrg#ifndef YYMAXDEPTH 80076910425Smrg# define YYMAXDEPTH 10000 80176910425Smrg#endif 80276910425Smrg 80376910425Smrg 80476910425Smrg#if YYERROR_VERBOSE 80576910425Smrg 80676910425Smrg# ifndef yystrlen 807db17cd6dSmrg# if defined __GLIBC__ && defined _STRING_H 80876910425Smrg# define yystrlen strlen 80976910425Smrg# else 81076910425Smrg/* Return the length of YYSTR. */ 81176910425Smrgstatic YYSIZE_T 81276910425Smrgyystrlen (const char *yystr) 81376910425Smrg{ 814db17cd6dSmrg YYSIZE_T yylen; 815db17cd6dSmrg for (yylen = 0; yystr[yylen]; yylen++) 81676910425Smrg continue; 817db17cd6dSmrg return yylen; 81876910425Smrg} 81976910425Smrg# endif 82076910425Smrg# endif 82176910425Smrg 82276910425Smrg# ifndef yystpcpy 823db17cd6dSmrg# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 82476910425Smrg# define yystpcpy stpcpy 82576910425Smrg# else 82676910425Smrg/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 82776910425Smrg YYDEST. */ 82876910425Smrgstatic char * 82976910425Smrgyystpcpy (char *yydest, const char *yysrc) 83076910425Smrg{ 83176910425Smrg char *yyd = yydest; 83276910425Smrg const char *yys = yysrc; 83376910425Smrg 83476910425Smrg while ((*yyd++ = *yys++) != '\0') 83576910425Smrg continue; 83676910425Smrg 83776910425Smrg return yyd - 1; 83876910425Smrg} 83976910425Smrg# endif 84076910425Smrg# endif 84176910425Smrg 84276910425Smrg# ifndef yytnamerr 84376910425Smrg/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 84476910425Smrg quotes and backslashes, so that it's suitable for yyerror. The 84576910425Smrg heuristic is that double-quoting is unnecessary unless the string 84676910425Smrg contains an apostrophe, a comma, or backslash (other than 84776910425Smrg backslash-backslash). YYSTR is taken from yytname. If YYRES is 84876910425Smrg null, do not copy; instead, return the length of what the result 84976910425Smrg would have been. */ 85076910425Smrgstatic YYSIZE_T 85176910425Smrgyytnamerr (char *yyres, const char *yystr) 85276910425Smrg{ 85376910425Smrg if (*yystr == '"') 85476910425Smrg { 855db17cd6dSmrg YYSIZE_T yyn = 0; 85676910425Smrg char const *yyp = yystr; 85776910425Smrg 85876910425Smrg for (;;) 859a67f45c3Smrg switch (*++yyp) 860a67f45c3Smrg { 861a67f45c3Smrg case '\'': 862a67f45c3Smrg case ',': 863a67f45c3Smrg goto do_not_strip_quotes; 864a67f45c3Smrg 865a67f45c3Smrg case '\\': 866a67f45c3Smrg if (*++yyp != '\\') 867a67f45c3Smrg goto do_not_strip_quotes; 868a67f45c3Smrg /* Fall through. */ 869a67f45c3Smrg default: 870a67f45c3Smrg if (yyres) 871a67f45c3Smrg yyres[yyn] = *yyp; 872a67f45c3Smrg yyn++; 873a67f45c3Smrg break; 874a67f45c3Smrg 875a67f45c3Smrg case '"': 876a67f45c3Smrg if (yyres) 877a67f45c3Smrg yyres[yyn] = '\0'; 878a67f45c3Smrg return yyn; 879a67f45c3Smrg } 88076910425Smrg do_not_strip_quotes: ; 88176910425Smrg } 88276910425Smrg 88376910425Smrg if (! yyres) 88476910425Smrg return yystrlen (yystr); 88576910425Smrg 88676910425Smrg return yystpcpy (yyres, yystr) - yyres; 88776910425Smrg} 88876910425Smrg# endif 88976910425Smrg 890a67f45c3Smrg/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 891a67f45c3Smrg about the unexpected token YYTOKEN for the state stack whose top is 892a67f45c3Smrg YYSSP. 893a67f45c3Smrg 894a67f45c3Smrg Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 895a67f45c3Smrg not large enough to hold the message. In that case, also set 896a67f45c3Smrg *YYMSG_ALLOC to the required number of bytes. Return 2 if the 897a67f45c3Smrg required number of bytes is too large to store. */ 898a67f45c3Smrgstatic int 899a67f45c3Smrgyysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 900a67f45c3Smrg yytype_int16 *yyssp, int yytoken) 90176910425Smrg{ 902a67f45c3Smrg YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 903a67f45c3Smrg YYSIZE_T yysize = yysize0; 904a67f45c3Smrg enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 905a67f45c3Smrg /* Internationalized format string. */ 906a67f45c3Smrg const char *yyformat = YY_NULLPTR; 907a67f45c3Smrg /* Arguments of yyformat. */ 908a67f45c3Smrg char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 909a67f45c3Smrg /* Number of reported tokens (one for the "unexpected", one per 910a67f45c3Smrg "expected"). */ 911a67f45c3Smrg int yycount = 0; 912a67f45c3Smrg 913a67f45c3Smrg /* There are many possibilities here to consider: 914a67f45c3Smrg - If this state is a consistent state with a default action, then 915a67f45c3Smrg the only way this function was invoked is if the default action 916a67f45c3Smrg is an error action. In that case, don't check for expected 917a67f45c3Smrg tokens because there are none. 918a67f45c3Smrg - The only way there can be no lookahead present (in yychar) is if 919a67f45c3Smrg this state is a consistent state with a default action. Thus, 920a67f45c3Smrg detecting the absence of a lookahead is sufficient to determine 921a67f45c3Smrg that there is no unexpected or expected token to report. In that 922a67f45c3Smrg case, just report a simple "syntax error". 923a67f45c3Smrg - Don't assume there isn't a lookahead just because this state is a 924a67f45c3Smrg consistent state with a default action. There might have been a 925a67f45c3Smrg previous inconsistent state, consistent state with a non-default 926a67f45c3Smrg action, or user semantic action that manipulated yychar. 927a67f45c3Smrg - Of course, the expected token list depends on states to have 928a67f45c3Smrg correct lookahead information, and it depends on the parser not 929a67f45c3Smrg to perform extra reductions after fetching a lookahead from the 930a67f45c3Smrg scanner and before detecting a syntax error. Thus, state merging 931a67f45c3Smrg (from LALR or IELR) and default reductions corrupt the expected 932a67f45c3Smrg token list. However, the list is correct for canonical LR with 933a67f45c3Smrg one exception: it will still contain any token that will not be 934a67f45c3Smrg accepted due to an error action in a later state. 935a67f45c3Smrg */ 936a67f45c3Smrg if (yytoken != YYEMPTY) 937a67f45c3Smrg { 938a67f45c3Smrg int yyn = yypact[*yyssp]; 939a67f45c3Smrg yyarg[yycount++] = yytname[yytoken]; 940a67f45c3Smrg if (!yypact_value_is_default (yyn)) 941a67f45c3Smrg { 942a67f45c3Smrg /* Start YYX at -YYN if negative to avoid negative indexes in 943a67f45c3Smrg YYCHECK. In other words, skip the first -YYN actions for 944a67f45c3Smrg this state because they are default actions. */ 945a67f45c3Smrg int yyxbegin = yyn < 0 ? -yyn : 0; 946a67f45c3Smrg /* Stay within bounds of both yycheck and yytname. */ 947a67f45c3Smrg int yychecklim = YYLAST - yyn + 1; 948a67f45c3Smrg int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 949a67f45c3Smrg int yyx; 950a67f45c3Smrg 951a67f45c3Smrg for (yyx = yyxbegin; yyx < yyxend; ++yyx) 952a67f45c3Smrg if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 953a67f45c3Smrg && !yytable_value_is_error (yytable[yyx + yyn])) 954a67f45c3Smrg { 955a67f45c3Smrg if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 956a67f45c3Smrg { 957a67f45c3Smrg yycount = 1; 958a67f45c3Smrg yysize = yysize0; 959a67f45c3Smrg break; 960a67f45c3Smrg } 961a67f45c3Smrg yyarg[yycount++] = yytname[yyx]; 962a67f45c3Smrg { 963a67f45c3Smrg YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 964a67f45c3Smrg if (! (yysize <= yysize1 965a67f45c3Smrg && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 966a67f45c3Smrg return 2; 967a67f45c3Smrg yysize = yysize1; 968a67f45c3Smrg } 969a67f45c3Smrg } 970a67f45c3Smrg } 971a67f45c3Smrg } 97276910425Smrg 973a67f45c3Smrg switch (yycount) 974db17cd6dSmrg { 975a67f45c3Smrg# define YYCASE_(N, S) \ 976a67f45c3Smrg case N: \ 977a67f45c3Smrg yyformat = S; \ 978a67f45c3Smrg break 979a67f45c3Smrg YYCASE_(0, YY_("syntax error")); 980a67f45c3Smrg YYCASE_(1, YY_("syntax error, unexpected %s")); 981a67f45c3Smrg YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 982a67f45c3Smrg YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 983a67f45c3Smrg YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 984a67f45c3Smrg YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 985a67f45c3Smrg# undef YYCASE_ 98676910425Smrg } 987a67f45c3Smrg 988a67f45c3Smrg { 989a67f45c3Smrg YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 990a67f45c3Smrg if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 991a67f45c3Smrg return 2; 992a67f45c3Smrg yysize = yysize1; 993a67f45c3Smrg } 994a67f45c3Smrg 995a67f45c3Smrg if (*yymsg_alloc < yysize) 996a67f45c3Smrg { 997a67f45c3Smrg *yymsg_alloc = 2 * yysize; 998a67f45c3Smrg if (! (yysize <= *yymsg_alloc 999a67f45c3Smrg && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1000a67f45c3Smrg *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1001a67f45c3Smrg return 1; 1002a67f45c3Smrg } 1003a67f45c3Smrg 1004a67f45c3Smrg /* Avoid sprintf, as that infringes on the user's name space. 1005a67f45c3Smrg Don't have undefined behavior even if the translation 1006a67f45c3Smrg produced a string with the wrong number of "%s"s. */ 1007a67f45c3Smrg { 1008a67f45c3Smrg char *yyp = *yymsg; 1009a67f45c3Smrg int yyi = 0; 1010a67f45c3Smrg while ((*yyp = *yyformat) != '\0') 1011a67f45c3Smrg if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1012a67f45c3Smrg { 1013a67f45c3Smrg yyp += yytnamerr (yyp, yyarg[yyi++]); 1014a67f45c3Smrg yyformat += 2; 1015a67f45c3Smrg } 1016a67f45c3Smrg else 1017a67f45c3Smrg { 1018a67f45c3Smrg yyp++; 1019a67f45c3Smrg yyformat++; 1020a67f45c3Smrg } 1021a67f45c3Smrg } 1022a67f45c3Smrg return 0; 102376910425Smrg} 1024db17cd6dSmrg#endif /* YYERROR_VERBOSE */ 102576910425Smrg 102676910425Smrg/*-----------------------------------------------. 102776910425Smrg| Release the memory associated to this symbol. | 102876910425Smrg`-----------------------------------------------*/ 102976910425Smrg 103076910425Smrgstatic void 103176910425Smrgyydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 103276910425Smrg{ 1033db17cd6dSmrg YYUSE (yyvaluep); 103476910425Smrg if (!yymsg) 103576910425Smrg yymsg = "Deleting"; 103676910425Smrg YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 103776910425Smrg 1038a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1039a67f45c3Smrg YYUSE (yytype); 1040a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_END 104176910425Smrg} 104276910425Smrg 104376910425Smrg 104476910425Smrg 104576910425Smrg 1046a67f45c3Smrg/* The lookahead symbol. */ 104776910425Smrgint yychar; 104876910425Smrg 1049a67f45c3Smrg/* The semantic value of the lookahead symbol. */ 105076910425SmrgYYSTYPE yylval; 105176910425Smrg/* Number of syntax errors so far. */ 105276910425Smrgint yynerrs; 105376910425Smrg 105476910425Smrg 105576910425Smrg/*----------. 105676910425Smrg| yyparse. | 105776910425Smrg`----------*/ 105876910425Smrg 105976910425Smrgint 106076910425Smrgyyparse (void) 106176910425Smrg{ 1062a67f45c3Smrg int yystate; 1063a67f45c3Smrg /* Number of tokens to shift before error messages enabled. */ 1064a67f45c3Smrg int yyerrstatus; 1065a67f45c3Smrg 1066a67f45c3Smrg /* The stacks and their tools: 1067a67f45c3Smrg 'yyss': related to states. 1068a67f45c3Smrg 'yyvs': related to semantic values. 1069a67f45c3Smrg 1070a67f45c3Smrg Refer to the stacks through separate pointers, to allow yyoverflow 1071a67f45c3Smrg to reallocate them elsewhere. */ 1072a67f45c3Smrg 1073a67f45c3Smrg /* The state stack. */ 1074a67f45c3Smrg yytype_int16 yyssa[YYINITDEPTH]; 1075a67f45c3Smrg yytype_int16 *yyss; 1076a67f45c3Smrg yytype_int16 *yyssp; 1077a67f45c3Smrg 1078a67f45c3Smrg /* The semantic value stack. */ 1079a67f45c3Smrg YYSTYPE yyvsa[YYINITDEPTH]; 1080a67f45c3Smrg YYSTYPE *yyvs; 1081a67f45c3Smrg YYSTYPE *yyvsp; 1082a67f45c3Smrg 1083a67f45c3Smrg YYSIZE_T yystacksize; 1084a67f45c3Smrg 108576910425Smrg int yyn; 108676910425Smrg int yyresult; 1087a67f45c3Smrg /* Lookahead token as an internal (translated) token number. */ 108876910425Smrg int yytoken = 0; 1089a67f45c3Smrg /* The variables used to return semantic value and location from the 1090a67f45c3Smrg action routines. */ 1091a67f45c3Smrg YYSTYPE yyval; 1092a67f45c3Smrg 1093db17cd6dSmrg#if YYERROR_VERBOSE 1094db17cd6dSmrg /* Buffer for error messages, and its allocated size. */ 1095db17cd6dSmrg char yymsgbuf[128]; 1096db17cd6dSmrg char *yymsg = yymsgbuf; 1097db17cd6dSmrg YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1098db17cd6dSmrg#endif 109976910425Smrg 1100db17cd6dSmrg#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 110176910425Smrg 1102db17cd6dSmrg /* The number of symbols on the RHS of the reduced rule. 1103db17cd6dSmrg Keep to zero when no symbol should be popped. */ 1104db17cd6dSmrg int yylen = 0; 110576910425Smrg 1106a67f45c3Smrg yyssp = yyss = yyssa; 1107a67f45c3Smrg yyvsp = yyvs = yyvsa; 1108a67f45c3Smrg yystacksize = YYINITDEPTH; 1109a67f45c3Smrg 111076910425Smrg YYDPRINTF ((stderr, "Starting parse\n")); 111176910425Smrg 111276910425Smrg yystate = 0; 111376910425Smrg yyerrstatus = 0; 111476910425Smrg yynerrs = 0; 1115a67f45c3Smrg yychar = YYEMPTY; /* Cause a token to be read. */ 111676910425Smrg goto yysetstate; 111776910425Smrg 111876910425Smrg/*------------------------------------------------------------. 111976910425Smrg| yynewstate -- Push a new state, which is found in yystate. | 112076910425Smrg`------------------------------------------------------------*/ 112176910425Smrg yynewstate: 112276910425Smrg /* In all cases, when you get here, the value and location stacks 1123db17cd6dSmrg have just been pushed. So pushing a state here evens the stacks. */ 112476910425Smrg yyssp++; 112576910425Smrg 112676910425Smrg yysetstate: 112776910425Smrg *yyssp = yystate; 112876910425Smrg 112976910425Smrg if (yyss + yystacksize - 1 <= yyssp) 113076910425Smrg { 113176910425Smrg /* Get the current used size of the three stacks, in elements. */ 113276910425Smrg YYSIZE_T yysize = yyssp - yyss + 1; 113376910425Smrg 113476910425Smrg#ifdef yyoverflow 113576910425Smrg { 1136a67f45c3Smrg /* Give user a chance to reallocate the stack. Use copies of 1137a67f45c3Smrg these so that the &'s don't force the real ones into 1138a67f45c3Smrg memory. */ 1139a67f45c3Smrg YYSTYPE *yyvs1 = yyvs; 1140a67f45c3Smrg yytype_int16 *yyss1 = yyss; 1141a67f45c3Smrg 1142a67f45c3Smrg /* Each stack pointer address is followed by the size of the 1143a67f45c3Smrg data in use in that stack, in bytes. This used to be a 1144a67f45c3Smrg conditional around just the two extra args, but that might 1145a67f45c3Smrg be undefined if yyoverflow is a macro. */ 1146a67f45c3Smrg yyoverflow (YY_("memory exhausted"), 1147a67f45c3Smrg &yyss1, yysize * sizeof (*yyssp), 1148a67f45c3Smrg &yyvs1, yysize * sizeof (*yyvsp), 1149a67f45c3Smrg &yystacksize); 1150a67f45c3Smrg 1151a67f45c3Smrg yyss = yyss1; 1152a67f45c3Smrg yyvs = yyvs1; 115376910425Smrg } 115476910425Smrg#else /* no yyoverflow */ 115576910425Smrg# ifndef YYSTACK_RELOCATE 115676910425Smrg goto yyexhaustedlab; 115776910425Smrg# else 115876910425Smrg /* Extend the stack our own way. */ 115976910425Smrg if (YYMAXDEPTH <= yystacksize) 1160a67f45c3Smrg goto yyexhaustedlab; 116176910425Smrg yystacksize *= 2; 116276910425Smrg if (YYMAXDEPTH < yystacksize) 1163a67f45c3Smrg yystacksize = YYMAXDEPTH; 116476910425Smrg 116576910425Smrg { 1166a67f45c3Smrg yytype_int16 *yyss1 = yyss; 1167a67f45c3Smrg union yyalloc *yyptr = 1168a67f45c3Smrg (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1169a67f45c3Smrg if (! yyptr) 1170a67f45c3Smrg goto yyexhaustedlab; 1171a67f45c3Smrg YYSTACK_RELOCATE (yyss_alloc, yyss); 1172a67f45c3Smrg YYSTACK_RELOCATE (yyvs_alloc, yyvs); 117376910425Smrg# undef YYSTACK_RELOCATE 1174a67f45c3Smrg if (yyss1 != yyssa) 1175a67f45c3Smrg YYSTACK_FREE (yyss1); 117676910425Smrg } 117776910425Smrg# endif 117876910425Smrg#endif /* no yyoverflow */ 117976910425Smrg 118076910425Smrg yyssp = yyss + yysize - 1; 118176910425Smrg yyvsp = yyvs + yysize - 1; 118276910425Smrg 118376910425Smrg YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1184a67f45c3Smrg (unsigned long int) yystacksize)); 118576910425Smrg 118676910425Smrg if (yyss + yystacksize - 1 <= yyssp) 1187a67f45c3Smrg YYABORT; 118876910425Smrg } 118976910425Smrg 119076910425Smrg YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 119176910425Smrg 1192a67f45c3Smrg if (yystate == YYFINAL) 1193a67f45c3Smrg YYACCEPT; 1194a67f45c3Smrg 119576910425Smrg goto yybackup; 119676910425Smrg 119776910425Smrg/*-----------. 119876910425Smrg| yybackup. | 119976910425Smrg`-----------*/ 120076910425Smrgyybackup: 120176910425Smrg 1202db17cd6dSmrg /* Do appropriate processing given the current state. Read a 1203a67f45c3Smrg lookahead token if we need one and don't already have one. */ 120476910425Smrg 1205a67f45c3Smrg /* First try to decide what to do without reference to lookahead token. */ 120676910425Smrg yyn = yypact[yystate]; 1207a67f45c3Smrg if (yypact_value_is_default (yyn)) 120876910425Smrg goto yydefault; 120976910425Smrg 1210a67f45c3Smrg /* Not known => get a lookahead token if don't already have one. */ 121176910425Smrg 1212a67f45c3Smrg /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 121376910425Smrg if (yychar == YYEMPTY) 121476910425Smrg { 121576910425Smrg YYDPRINTF ((stderr, "Reading a token: ")); 1216a67f45c3Smrg yychar = yylex (); 121776910425Smrg } 121876910425Smrg 121976910425Smrg if (yychar <= YYEOF) 122076910425Smrg { 122176910425Smrg yychar = yytoken = YYEOF; 122276910425Smrg YYDPRINTF ((stderr, "Now at end of input.\n")); 122376910425Smrg } 122476910425Smrg else 122576910425Smrg { 122676910425Smrg yytoken = YYTRANSLATE (yychar); 122776910425Smrg YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 122876910425Smrg } 122976910425Smrg 123076910425Smrg /* If the proper action on seeing token YYTOKEN is to reduce or to 123176910425Smrg detect an error, take that action. */ 123276910425Smrg yyn += yytoken; 123376910425Smrg if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 123476910425Smrg goto yydefault; 123576910425Smrg yyn = yytable[yyn]; 123676910425Smrg if (yyn <= 0) 123776910425Smrg { 1238a67f45c3Smrg if (yytable_value_is_error (yyn)) 1239a67f45c3Smrg goto yyerrlab; 124076910425Smrg yyn = -yyn; 124176910425Smrg goto yyreduce; 124276910425Smrg } 124376910425Smrg 1244db17cd6dSmrg /* Count tokens shifted since error; after three, turn off error 1245db17cd6dSmrg status. */ 1246db17cd6dSmrg if (yyerrstatus) 1247db17cd6dSmrg yyerrstatus--; 1248db17cd6dSmrg 1249a67f45c3Smrg /* Shift the lookahead token. */ 125076910425Smrg YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 125176910425Smrg 1252a67f45c3Smrg /* Discard the shifted token. */ 1253a67f45c3Smrg yychar = YYEMPTY; 125476910425Smrg 1255db17cd6dSmrg yystate = yyn; 1256a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 125776910425Smrg *++yyvsp = yylval; 1258a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_END 125976910425Smrg 126076910425Smrg goto yynewstate; 126176910425Smrg 126276910425Smrg 126376910425Smrg/*-----------------------------------------------------------. 126476910425Smrg| yydefault -- do the default action for the current state. | 126576910425Smrg`-----------------------------------------------------------*/ 126676910425Smrgyydefault: 126776910425Smrg yyn = yydefact[yystate]; 126876910425Smrg if (yyn == 0) 126976910425Smrg goto yyerrlab; 127076910425Smrg goto yyreduce; 127176910425Smrg 127276910425Smrg 127376910425Smrg/*-----------------------------. 127476910425Smrg| yyreduce -- Do a reduction. | 127576910425Smrg`-----------------------------*/ 127676910425Smrgyyreduce: 127776910425Smrg /* yyn is the number of a rule to reduce with. */ 127876910425Smrg yylen = yyr2[yyn]; 127976910425Smrg 128076910425Smrg /* If YYLEN is nonzero, implement the default value of the action: 1281a67f45c3Smrg '$$ = $1'. 128276910425Smrg 128376910425Smrg Otherwise, the following line sets YYVAL to garbage. 128476910425Smrg This behavior is undocumented and Bison 128576910425Smrg users should not rely upon it. Assigning to YYVAL 128676910425Smrg unconditionally makes the parser a bit smaller, and it avoids a 128776910425Smrg GCC warning that YYVAL may be used uninitialized. */ 128876910425Smrg yyval = yyvsp[1-yylen]; 128976910425Smrg 129076910425Smrg 129176910425Smrg YY_REDUCE_PRINT (yyn); 129276910425Smrg switch (yyn) 129376910425Smrg { 129476910425Smrg case 2: 1295a67f45c3Smrg#line 87 "cfgparse.y" /* yacc.c:1646 */ 1296a67f45c3Smrg { InterpretConfigs((yyvsp[0].entry)); } 1297a67f45c3Smrg#line 1298 "cfgparse.c" /* yacc.c:1646 */ 129876910425Smrg break; 129976910425Smrg 130076910425Smrg case 3: 1301a67f45c3Smrg#line 91 "cfgparse.y" /* yacc.c:1646 */ 13029ff100acSmrg { 130376910425Smrg CfgEntryPtr tmp; 1304a67f45c3Smrg if ((yyvsp[-1].entry)!=NULL) { 1305a67f45c3Smrg for (tmp=(yyvsp[-1].entry);tmp->next!=NULL;tmp=tmp->next) { 130676910425Smrg /* conditional does the work */ 130776910425Smrg } 1308a67f45c3Smrg tmp->next= (yyvsp[0].entry); 1309a67f45c3Smrg (yyval.entry)= (yyvsp[-1].entry); 131076910425Smrg } 1311a67f45c3Smrg else (yyval.entry)= (yyvsp[0].entry); 131276910425Smrg } 1313a67f45c3Smrg#line 1314 "cfgparse.c" /* yacc.c:1646 */ 131476910425Smrg break; 131576910425Smrg 131676910425Smrg case 4: 1317a67f45c3Smrg#line 102 "cfgparse.y" /* yacc.c:1646 */ 1318a67f45c3Smrg { (yyval.entry)= (yyvsp[0].entry); } 1319a67f45c3Smrg#line 1320 "cfgparse.c" /* yacc.c:1646 */ 132076910425Smrg break; 132176910425Smrg 132276910425Smrg case 5: 1323a67f45c3Smrg#line 106 "cfgparse.y" /* yacc.c:1646 */ 132476910425Smrg { 1325a67f45c3Smrg if (((yyvsp[-1].entry))&&((yyvsp[0].act))) 1326a67f45c3Smrg (yyvsp[-1].entry)->action= *((yyvsp[0].act)); 1327a67f45c3Smrg if ((yyvsp[0].act)) 1328a67f45c3Smrg free((yyvsp[0].act)); 1329a67f45c3Smrg (yyval.entry)= (yyvsp[-1].entry); 133076910425Smrg } 1331a67f45c3Smrg#line 1332 "cfgparse.c" /* yacc.c:1646 */ 133276910425Smrg break; 133376910425Smrg 133476910425Smrg case 6: 1335a67f45c3Smrg#line 113 "cfgparse.y" /* yacc.c:1646 */ 1336a67f45c3Smrg { (yyval.entry)= (yyvsp[0].entry); } 1337a67f45c3Smrg#line 1338 "cfgparse.c" /* yacc.c:1646 */ 133876910425Smrg break; 133976910425Smrg 134076910425Smrg case 7: 1341a67f45c3Smrg#line 117 "cfgparse.y" /* yacc.c:1646 */ 134276910425Smrg { 134376910425Smrg CfgEntryPtr cfg; 13449ff100acSmrg cfg= calloc(1,sizeof(CfgEntryRec)); 134576910425Smrg if (cfg) { 134676910425Smrg cfg->entry_type= VariableDef; 134776910425Smrg cfg->event_type= 0; 1348a67f45c3Smrg cfg->name.str= (yyvsp[-2].str); 134976910425Smrg cfg->action.type= UnknownAction; 1350a67f45c3Smrg cfg->action.text= (yyvsp[0].str); 135176910425Smrg cfg->action.priv= 0; 135276910425Smrg cfg->next= NULL; 135376910425Smrg } 135476910425Smrg (yyval.entry)= cfg; 135576910425Smrg } 1356a67f45c3Smrg#line 1357 "cfgparse.c" /* yacc.c:1646 */ 135776910425Smrg break; 135876910425Smrg 135976910425Smrg case 8: 1360a67f45c3Smrg#line 134 "cfgparse.y" /* yacc.c:1646 */ 136176910425Smrg { 136276910425Smrg CfgEntryPtr cfg; 13639ff100acSmrg cfg= calloc(1,sizeof(CfgEntryRec)); 136476910425Smrg if (cfg) { 136576910425Smrg cfg->entry_type= EventDef; 1366a67f45c3Smrg cfg->event_type= (yyvsp[-3].ival); 1367a67f45c3Smrg cfg->name.str= (yyvsp[-1].str); 136876910425Smrg cfg->action.type= UnknownAction; 136976910425Smrg cfg->action.text= NULL; 137076910425Smrg cfg->action.priv= 0; 137176910425Smrg cfg->next= NULL; 137276910425Smrg } 137376910425Smrg (yyval.entry)= cfg; 137476910425Smrg } 1375a67f45c3Smrg#line 1376 "cfgparse.c" /* yacc.c:1646 */ 137676910425Smrg break; 137776910425Smrg 137876910425Smrg case 9: 1379a67f45c3Smrg#line 150 "cfgparse.y" /* yacc.c:1646 */ 138076910425Smrg { (yyval.ival)= XkbBellNotify; } 1381a67f45c3Smrg#line 1382 "cfgparse.c" /* yacc.c:1646 */ 138276910425Smrg break; 138376910425Smrg 138476910425Smrg case 10: 1385a67f45c3Smrg#line 151 "cfgparse.y" /* yacc.c:1646 */ 138676910425Smrg { (yyval.ival)= XkbAccessXNotify; } 1387a67f45c3Smrg#line 1388 "cfgparse.c" /* yacc.c:1646 */ 138876910425Smrg break; 138976910425Smrg 139076910425Smrg case 11: 1391a67f45c3Smrg#line 152 "cfgparse.y" /* yacc.c:1646 */ 139276910425Smrg { (yyval.ival)= XkbActionMessage; } 1393a67f45c3Smrg#line 1394 "cfgparse.c" /* yacc.c:1646 */ 139476910425Smrg break; 139576910425Smrg 139676910425Smrg case 12: 1397a67f45c3Smrg#line 156 "cfgparse.y" /* yacc.c:1646 */ 13989ff100acSmrg { 139976910425Smrg ActDefPtr act; 14009ff100acSmrg act= calloc(1,sizeof(ActDefRec)); 140176910425Smrg if (act) { 1402a67f45c3Smrg act->type= (yyvsp[-1].ival); 1403a67f45c3Smrg act->text= (yyvsp[0].str); 140476910425Smrg } 14059ff100acSmrg (yyval.act)= act; 140676910425Smrg } 1407a67f45c3Smrg#line 1408 "cfgparse.c" /* yacc.c:1646 */ 140876910425Smrg break; 140976910425Smrg 141076910425Smrg case 13: 1411a67f45c3Smrg#line 167 "cfgparse.y" /* yacc.c:1646 */ 141276910425Smrg { (yyval.ival) = NoAction; } 1413a67f45c3Smrg#line 1414 "cfgparse.c" /* yacc.c:1646 */ 141476910425Smrg break; 141576910425Smrg 141676910425Smrg case 14: 1417a67f45c3Smrg#line 168 "cfgparse.y" /* yacc.c:1646 */ 141876910425Smrg { (yyval.ival) = NoAction; } 1419a67f45c3Smrg#line 1420 "cfgparse.c" /* yacc.c:1646 */ 142076910425Smrg break; 142176910425Smrg 142276910425Smrg case 15: 1423a67f45c3Smrg#line 169 "cfgparse.y" /* yacc.c:1646 */ 142476910425Smrg { (yyval.ival) = EchoAction; } 1425a67f45c3Smrg#line 1426 "cfgparse.c" /* yacc.c:1646 */ 142676910425Smrg break; 142776910425Smrg 142876910425Smrg case 16: 1429a67f45c3Smrg#line 170 "cfgparse.y" /* yacc.c:1646 */ 143076910425Smrg { (yyval.ival) = PrintEvAction; } 1431a67f45c3Smrg#line 1432 "cfgparse.c" /* yacc.c:1646 */ 143276910425Smrg break; 143376910425Smrg 143476910425Smrg case 17: 1435a67f45c3Smrg#line 171 "cfgparse.y" /* yacc.c:1646 */ 143676910425Smrg { (yyval.ival) = ShellAction; } 1437a67f45c3Smrg#line 1438 "cfgparse.c" /* yacc.c:1646 */ 143876910425Smrg break; 143976910425Smrg 144076910425Smrg case 18: 1441a67f45c3Smrg#line 172 "cfgparse.y" /* yacc.c:1646 */ 144276910425Smrg { (yyval.ival) = SoundAction; } 1443a67f45c3Smrg#line 1444 "cfgparse.c" /* yacc.c:1646 */ 144476910425Smrg break; 144576910425Smrg 144676910425Smrg case 19: 1447a67f45c3Smrg#line 173 "cfgparse.y" /* yacc.c:1646 */ 144876910425Smrg { (yyval.ival) = UnknownAction; } 1449a67f45c3Smrg#line 1450 "cfgparse.c" /* yacc.c:1646 */ 145076910425Smrg break; 145176910425Smrg 145276910425Smrg case 20: 1453a67f45c3Smrg#line 176 "cfgparse.y" /* yacc.c:1646 */ 1454a67f45c3Smrg { (yyval.str)= (yyvsp[0].str); } 1455a67f45c3Smrg#line 1456 "cfgparse.c" /* yacc.c:1646 */ 145676910425Smrg break; 145776910425Smrg 145876910425Smrg case 21: 1459a67f45c3Smrg#line 177 "cfgparse.y" /* yacc.c:1646 */ 146076910425Smrg { (yyval.str)= NULL; } 1461a67f45c3Smrg#line 1462 "cfgparse.c" /* yacc.c:1646 */ 146276910425Smrg break; 146376910425Smrg 146476910425Smrg case 22: 1465a67f45c3Smrg#line 180 "cfgparse.y" /* yacc.c:1646 */ 1466a67f45c3Smrg { (yyval.str)= (yyvsp[0].str); } 1467a67f45c3Smrg#line 1468 "cfgparse.c" /* yacc.c:1646 */ 146876910425Smrg break; 146976910425Smrg 147076910425Smrg case 23: 1471a67f45c3Smrg#line 181 "cfgparse.y" /* yacc.c:1646 */ 1472a67f45c3Smrg { (yyval.str)= (yyvsp[0].str); } 1473a67f45c3Smrg#line 1474 "cfgparse.c" /* yacc.c:1646 */ 147476910425Smrg break; 147576910425Smrg 147676910425Smrg case 24: 1477a67f45c3Smrg#line 184 "cfgparse.y" /* yacc.c:1646 */ 147876910425Smrg { (yyval.str)= scanStr; scanStr= NULL; } 1479a67f45c3Smrg#line 1480 "cfgparse.c" /* yacc.c:1646 */ 148076910425Smrg break; 148176910425Smrg 148276910425Smrg case 25: 1483a67f45c3Smrg#line 187 "cfgparse.y" /* yacc.c:1646 */ 1484a67f45c3Smrg { (yyval.str)= (yyvsp[0].str); } 1485a67f45c3Smrg#line 1486 "cfgparse.c" /* yacc.c:1646 */ 148676910425Smrg break; 148776910425Smrg 148876910425Smrg case 26: 1489a67f45c3Smrg#line 188 "cfgparse.y" /* yacc.c:1646 */ 149076910425Smrg { (yyval.str)= NULL; } 1491a67f45c3Smrg#line 1492 "cfgparse.c" /* yacc.c:1646 */ 149276910425Smrg break; 149376910425Smrg 149476910425Smrg case 27: 1495a67f45c3Smrg#line 191 "cfgparse.y" /* yacc.c:1646 */ 149676910425Smrg { (yyval.str)= scanStr; scanStr= NULL; } 1497a67f45c3Smrg#line 1498 "cfgparse.c" /* yacc.c:1646 */ 149876910425Smrg break; 149976910425Smrg 150076910425Smrg 1501a67f45c3Smrg#line 1502 "cfgparse.c" /* yacc.c:1646 */ 150276910425Smrg default: break; 150376910425Smrg } 1504a67f45c3Smrg /* User semantic actions sometimes alter yychar, and that requires 1505a67f45c3Smrg that yytoken be updated with the new translation. We take the 1506a67f45c3Smrg approach of translating immediately before every use of yytoken. 1507a67f45c3Smrg One alternative is translating here after every semantic action, 1508a67f45c3Smrg but that translation would be missed if the semantic action invokes 1509a67f45c3Smrg YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 1510a67f45c3Smrg if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 1511a67f45c3Smrg incorrect destructor might then be invoked immediately. In the 1512a67f45c3Smrg case of YYERROR or YYBACKUP, subsequent parser actions might lead 1513a67f45c3Smrg to an incorrect destructor call or verbose syntax error message 1514a67f45c3Smrg before the lookahead is translated. */ 1515db17cd6dSmrg YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 151676910425Smrg 1517db17cd6dSmrg YYPOPSTACK (yylen); 1518db17cd6dSmrg yylen = 0; 151976910425Smrg YY_STACK_PRINT (yyss, yyssp); 152076910425Smrg 152176910425Smrg *++yyvsp = yyval; 152276910425Smrg 1523a67f45c3Smrg /* Now 'shift' the result of the reduction. Determine what state 152476910425Smrg that goes to, based on the state we popped back to and the rule 152576910425Smrg number reduced by. */ 152676910425Smrg 152776910425Smrg yyn = yyr1[yyn]; 152876910425Smrg 152976910425Smrg yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 153076910425Smrg if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 153176910425Smrg yystate = yytable[yystate]; 153276910425Smrg else 153376910425Smrg yystate = yydefgoto[yyn - YYNTOKENS]; 153476910425Smrg 153576910425Smrg goto yynewstate; 153676910425Smrg 153776910425Smrg 1538a67f45c3Smrg/*--------------------------------------. 1539a67f45c3Smrg| yyerrlab -- here on detecting error. | 1540a67f45c3Smrg`--------------------------------------*/ 154176910425Smrgyyerrlab: 1542a67f45c3Smrg /* Make sure we have latest lookahead translation. See comments at 1543a67f45c3Smrg user semantic actions for why this is necessary. */ 1544a67f45c3Smrg yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 1545a67f45c3Smrg 154676910425Smrg /* If not already recovering from an error, report this error. */ 154776910425Smrg if (!yyerrstatus) 154876910425Smrg { 154976910425Smrg ++yynerrs; 1550db17cd6dSmrg#if ! YYERROR_VERBOSE 1551db17cd6dSmrg yyerror (YY_("syntax error")); 1552db17cd6dSmrg#else 1553a67f45c3Smrg# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1554a67f45c3Smrg yyssp, yytoken) 1555db17cd6dSmrg { 1556a67f45c3Smrg char const *yymsgp = YY_("syntax error"); 1557a67f45c3Smrg int yysyntax_error_status; 1558a67f45c3Smrg yysyntax_error_status = YYSYNTAX_ERROR; 1559a67f45c3Smrg if (yysyntax_error_status == 0) 1560a67f45c3Smrg yymsgp = yymsg; 1561a67f45c3Smrg else if (yysyntax_error_status == 1) 1562a67f45c3Smrg { 1563a67f45c3Smrg if (yymsg != yymsgbuf) 1564a67f45c3Smrg YYSTACK_FREE (yymsg); 1565a67f45c3Smrg yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 1566a67f45c3Smrg if (!yymsg) 1567a67f45c3Smrg { 1568a67f45c3Smrg yymsg = yymsgbuf; 1569a67f45c3Smrg yymsg_alloc = sizeof yymsgbuf; 1570a67f45c3Smrg yysyntax_error_status = 2; 1571a67f45c3Smrg } 1572a67f45c3Smrg else 1573a67f45c3Smrg { 1574a67f45c3Smrg yysyntax_error_status = YYSYNTAX_ERROR; 1575a67f45c3Smrg yymsgp = yymsg; 1576a67f45c3Smrg } 1577a67f45c3Smrg } 1578a67f45c3Smrg yyerror (yymsgp); 1579a67f45c3Smrg if (yysyntax_error_status == 2) 1580a67f45c3Smrg goto yyexhaustedlab; 1581db17cd6dSmrg } 1582a67f45c3Smrg# undef YYSYNTAX_ERROR 1583db17cd6dSmrg#endif 158476910425Smrg } 158576910425Smrg 158676910425Smrg 158776910425Smrg 158876910425Smrg if (yyerrstatus == 3) 158976910425Smrg { 1590a67f45c3Smrg /* If just tried and failed to reuse lookahead token after an 1591a67f45c3Smrg error, discard it. */ 159276910425Smrg 159376910425Smrg if (yychar <= YYEOF) 1594a67f45c3Smrg { 1595a67f45c3Smrg /* Return failure if at end of input. */ 1596a67f45c3Smrg if (yychar == YYEOF) 1597a67f45c3Smrg YYABORT; 1598a67f45c3Smrg } 159976910425Smrg else 1600a67f45c3Smrg { 1601a67f45c3Smrg yydestruct ("Error: discarding", 1602a67f45c3Smrg yytoken, &yylval); 1603a67f45c3Smrg yychar = YYEMPTY; 1604a67f45c3Smrg } 160576910425Smrg } 160676910425Smrg 1607a67f45c3Smrg /* Else will try to reuse lookahead token after shifting the error 160876910425Smrg token. */ 160976910425Smrg goto yyerrlab1; 161076910425Smrg 161176910425Smrg 161276910425Smrg/*---------------------------------------------------. 161376910425Smrg| yyerrorlab -- error raised explicitly by YYERROR. | 161476910425Smrg`---------------------------------------------------*/ 161576910425Smrgyyerrorlab: 161676910425Smrg 161776910425Smrg /* Pacify compilers like GCC when the user code never invokes 161876910425Smrg YYERROR and the label yyerrorlab therefore never appears in user 161976910425Smrg code. */ 1620db17cd6dSmrg if (/*CONSTCOND*/ 0) 162176910425Smrg goto yyerrorlab; 162276910425Smrg 1623a67f45c3Smrg /* Do not reclaim the symbols of the rule whose action triggered 1624db17cd6dSmrg this YYERROR. */ 1625db17cd6dSmrg YYPOPSTACK (yylen); 1626db17cd6dSmrg yylen = 0; 1627db17cd6dSmrg YY_STACK_PRINT (yyss, yyssp); 162876910425Smrg yystate = *yyssp; 162976910425Smrg goto yyerrlab1; 163076910425Smrg 163176910425Smrg 163276910425Smrg/*-------------------------------------------------------------. 163376910425Smrg| yyerrlab1 -- common code for both syntax error and YYERROR. | 163476910425Smrg`-------------------------------------------------------------*/ 163576910425Smrgyyerrlab1: 1636a67f45c3Smrg yyerrstatus = 3; /* Each real token shifted decrements this. */ 163776910425Smrg 163876910425Smrg for (;;) 163976910425Smrg { 164076910425Smrg yyn = yypact[yystate]; 1641a67f45c3Smrg if (!yypact_value_is_default (yyn)) 1642a67f45c3Smrg { 1643a67f45c3Smrg yyn += YYTERROR; 1644a67f45c3Smrg if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1645a67f45c3Smrg { 1646a67f45c3Smrg yyn = yytable[yyn]; 1647a67f45c3Smrg if (0 < yyn) 1648a67f45c3Smrg break; 1649a67f45c3Smrg } 1650a67f45c3Smrg } 165176910425Smrg 165276910425Smrg /* Pop the current state because it cannot handle the error token. */ 165376910425Smrg if (yyssp == yyss) 1654a67f45c3Smrg YYABORT; 165576910425Smrg 165676910425Smrg 1657db17cd6dSmrg yydestruct ("Error: popping", 1658a67f45c3Smrg yystos[yystate], yyvsp); 1659db17cd6dSmrg YYPOPSTACK (1); 166076910425Smrg yystate = *yyssp; 166176910425Smrg YY_STACK_PRINT (yyss, yyssp); 166276910425Smrg } 166376910425Smrg 1664a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 166576910425Smrg *++yyvsp = yylval; 1666a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_END 166776910425Smrg 166876910425Smrg 1669db17cd6dSmrg /* Shift the error token. */ 167076910425Smrg YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 167176910425Smrg 167276910425Smrg yystate = yyn; 167376910425Smrg goto yynewstate; 167476910425Smrg 167576910425Smrg 167676910425Smrg/*-------------------------------------. 167776910425Smrg| yyacceptlab -- YYACCEPT comes here. | 167876910425Smrg`-------------------------------------*/ 167976910425Smrgyyacceptlab: 168076910425Smrg yyresult = 0; 168176910425Smrg goto yyreturn; 168276910425Smrg 168376910425Smrg/*-----------------------------------. 168476910425Smrg| yyabortlab -- YYABORT comes here. | 168576910425Smrg`-----------------------------------*/ 168676910425Smrgyyabortlab: 168776910425Smrg yyresult = 1; 168876910425Smrg goto yyreturn; 168976910425Smrg 1690a67f45c3Smrg#if !defined yyoverflow || YYERROR_VERBOSE 169176910425Smrg/*-------------------------------------------------. 169276910425Smrg| yyexhaustedlab -- memory exhaustion comes here. | 169376910425Smrg`-------------------------------------------------*/ 169476910425Smrgyyexhaustedlab: 169576910425Smrg yyerror (YY_("memory exhausted")); 169676910425Smrg yyresult = 2; 169776910425Smrg /* Fall through. */ 169876910425Smrg#endif 169976910425Smrg 170076910425Smrgyyreturn: 1701a67f45c3Smrg if (yychar != YYEMPTY) 1702a67f45c3Smrg { 1703a67f45c3Smrg /* Make sure we have latest lookahead translation. See comments at 1704a67f45c3Smrg user semantic actions for why this is necessary. */ 1705a67f45c3Smrg yytoken = YYTRANSLATE (yychar); 1706a67f45c3Smrg yydestruct ("Cleanup: discarding lookahead", 1707a67f45c3Smrg yytoken, &yylval); 1708a67f45c3Smrg } 1709a67f45c3Smrg /* Do not reclaim the symbols of the rule whose action triggered 1710db17cd6dSmrg this YYABORT or YYACCEPT. */ 1711db17cd6dSmrg YYPOPSTACK (yylen); 1712db17cd6dSmrg YY_STACK_PRINT (yyss, yyssp); 171376910425Smrg while (yyssp != yyss) 171476910425Smrg { 171576910425Smrg yydestruct ("Cleanup: popping", 1716a67f45c3Smrg yystos[*yyssp], yyvsp); 1717db17cd6dSmrg YYPOPSTACK (1); 171876910425Smrg } 171976910425Smrg#ifndef yyoverflow 172076910425Smrg if (yyss != yyssa) 172176910425Smrg YYSTACK_FREE (yyss); 172276910425Smrg#endif 1723db17cd6dSmrg#if YYERROR_VERBOSE 1724db17cd6dSmrg if (yymsg != yymsgbuf) 1725db17cd6dSmrg YYSTACK_FREE (yymsg); 1726db17cd6dSmrg#endif 1727a67f45c3Smrg return yyresult; 172876910425Smrg} 1729a67f45c3Smrg#line 193 "cfgparse.y" /* yacc.c:1906 */ 173076910425Smrg 173176910425Smrgint 173276910425Smrgyyerror(char *s) 173376910425Smrg{ 173476910425Smrg (void)fprintf(stderr,"%s: line %d of %s\n",s,lineNum, 173576910425Smrg (scanFile?scanFile:"(unknown)")); 173676910425Smrg if (scanStr) 173776910425Smrg (void)fprintf(stderr,"last scanned symbol is: %s\n",scanStr); 173876910425Smrg return 1; 173976910425Smrg} 174076910425Smrg 174176910425Smrg 174276910425Smrgint 174376910425Smrgyywrap(void) 174476910425Smrg{ 174576910425Smrg return 1; 174676910425Smrg} 174776910425Smrg 174876910425Smrgint 174976910425SmrgCFGParseFile(FILE *file) 175076910425Smrg{ 175176910425Smrg if (file) { 175276910425Smrg yyin= file; 175376910425Smrg if (yyparse()==0) { 175476910425Smrg return 1; 175576910425Smrg } 175676910425Smrg return 0; 175776910425Smrg } 175876910425Smrg return 1; 175976910425Smrg} 1760