cfgparse.c revision 9ff100ac
1db17cd6dSmrg/* A Bison parser, made by GNU Bison 2.3. */ 276910425Smrg 3db17cd6dSmrg/* Skeleton implementation for Bison's Yacc-like parsers in C 4db17cd6dSmrg 5db17cd6dSmrg Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 6db17cd6dSmrg Free Software Foundation, Inc. 776910425Smrg 876910425Smrg This program is free software; you can redistribute it and/or modify 976910425Smrg it under the terms of the GNU General Public License as published by 1076910425Smrg the Free Software Foundation; either version 2, or (at your option) 1176910425Smrg any later version. 1276910425Smrg 1376910425Smrg This program is distributed in the hope that it will be useful, 1476910425Smrg but WITHOUT ANY WARRANTY; without even the implied warranty of 1576910425Smrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1676910425Smrg GNU General Public License for more details. 1776910425Smrg 1876910425Smrg You should have received a copy of the GNU General Public License 1976910425Smrg along with this program; if not, write to the Free Software 2076910425Smrg Foundation, Inc., 51 Franklin Street, Fifth Floor, 2176910425Smrg Boston, MA 02110-1301, USA. */ 2276910425Smrg 23db17cd6dSmrg/* As a special exception, you may create a larger work that contains 24db17cd6dSmrg part or all of the Bison parser skeleton and distribute that work 25db17cd6dSmrg under terms of your choice, so long as that work isn't itself a 26db17cd6dSmrg parser generator using the skeleton or a modified version thereof 27db17cd6dSmrg as a parser skeleton. Alternatively, if you modify or redistribute 28db17cd6dSmrg the parser skeleton itself, you may (at your option) remove this 29db17cd6dSmrg special exception, which will cause the skeleton and the resulting 30db17cd6dSmrg Bison output files to be licensed under the GNU General Public 31db17cd6dSmrg License without this special exception. 32db17cd6dSmrg 33db17cd6dSmrg This special exception was added by the Free Software Foundation in 34db17cd6dSmrg version 2.2 of Bison. */ 3576910425Smrg 36db17cd6dSmrg/* C LALR(1) parser skeleton written by Richard Stallman, by 37db17cd6dSmrg simplifying the original so-called "semantic" parser. */ 3876910425Smrg 3976910425Smrg/* All symbols defined below should begin with yy or YY, to avoid 4076910425Smrg infringing on user name space. This should be done even for local 4176910425Smrg variables, as they might otherwise be expanded by user macros. 4276910425Smrg There are some unavoidable exceptions within include files to 4376910425Smrg define necessary library symbols; they are noted "INFRINGES ON 4476910425Smrg USER NAME SPACE" below. */ 4576910425Smrg 4676910425Smrg/* Identify Bison output. */ 4776910425Smrg#define YYBISON 1 4876910425Smrg 4976910425Smrg/* Bison version. */ 50db17cd6dSmrg#define YYBISON_VERSION "2.3" 5176910425Smrg 5276910425Smrg/* Skeleton name. */ 5376910425Smrg#define YYSKELETON_NAME "yacc.c" 5476910425Smrg 5576910425Smrg/* Pure parsers. */ 5676910425Smrg#define YYPURE 0 5776910425Smrg 5876910425Smrg/* Using locations. */ 5976910425Smrg#define YYLSP_NEEDED 0 6076910425Smrg 6176910425Smrg 6276910425Smrg 6376910425Smrg/* Tokens. */ 6476910425Smrg#ifndef YYTOKENTYPE 6576910425Smrg# define YYTOKENTYPE 6676910425Smrg /* Put the tokens into the symbol table, so that GDB and other debuggers 6776910425Smrg know about them. */ 6876910425Smrg enum yytokentype { 6976910425Smrg END_OF_FILE = 0, 7076910425Smrg ERROR = 255, 7176910425Smrg BELL = 1, 7276910425Smrg ACCESSX = 2, 7376910425Smrg MESSAGE = 3, 7476910425Smrg NONE = 20, 7576910425Smrg IGNORE = 21, 7676910425Smrg ECHO = 22, 7776910425Smrg PRINT_EV = 23, 7876910425Smrg SHELL = 24, 7976910425Smrg SOUND = 25, 8076910425Smrg EQUALS = 40, 8176910425Smrg PLUS = 41, 8276910425Smrg MINUS = 42, 8376910425Smrg DIVIDE = 43, 8476910425Smrg TIMES = 44, 8576910425Smrg OBRACE = 45, 8676910425Smrg CBRACE = 46, 8776910425Smrg OPAREN = 47, 8876910425Smrg CPAREN = 48, 8976910425Smrg OBRACKET = 49, 9076910425Smrg CBRACKET = 50, 9176910425Smrg DOT = 51, 9276910425Smrg COMMA = 52, 9376910425Smrg SEMI = 53, 9476910425Smrg EXCLAM = 54, 9576910425Smrg INVERT = 55, 9676910425Smrg STRING = 60, 9776910425Smrg INTEGER = 61, 9876910425Smrg FLOAT = 62, 9976910425Smrg IDENT = 63, 10076910425Smrg KEYNAME = 64 10176910425Smrg }; 10276910425Smrg#endif 10376910425Smrg/* Tokens. */ 10476910425Smrg#define END_OF_FILE 0 10576910425Smrg#define ERROR 255 10676910425Smrg#define BELL 1 10776910425Smrg#define ACCESSX 2 10876910425Smrg#define MESSAGE 3 10976910425Smrg#define NONE 20 11076910425Smrg#define IGNORE 21 11176910425Smrg#define ECHO 22 11276910425Smrg#define PRINT_EV 23 11376910425Smrg#define SHELL 24 11476910425Smrg#define SOUND 25 11576910425Smrg#define EQUALS 40 11676910425Smrg#define PLUS 41 11776910425Smrg#define MINUS 42 11876910425Smrg#define DIVIDE 43 11976910425Smrg#define TIMES 44 12076910425Smrg#define OBRACE 45 12176910425Smrg#define CBRACE 46 12276910425Smrg#define OPAREN 47 12376910425Smrg#define CPAREN 48 12476910425Smrg#define OBRACKET 49 12576910425Smrg#define CBRACKET 50 12676910425Smrg#define DOT 51 12776910425Smrg#define COMMA 52 12876910425Smrg#define SEMI 53 12976910425Smrg#define EXCLAM 54 13076910425Smrg#define INVERT 55 13176910425Smrg#define STRING 60 13276910425Smrg#define INTEGER 61 13376910425Smrg#define FLOAT 62 13476910425Smrg#define IDENT 63 13576910425Smrg#define KEYNAME 64 13676910425Smrg 13776910425Smrg 13876910425Smrg 13976910425Smrg 14076910425Smrg/* Copy the first part of user declarations. */ 1419ff100acSmrg#line 62 "cfgparse.y" 14276910425Smrg 14376910425Smrg#ifdef DEBUG 14476910425Smrg#define YYDEBUG 1 14576910425Smrg#endif 14676910425Smrg#include "xkbevd.h" 1479ff100acSmrg#include <stdlib.h> 14876910425Smrg 14976910425Smrg 15076910425Smrg/* Enabling traces. */ 15176910425Smrg#ifndef YYDEBUG 15276910425Smrg# define YYDEBUG 0 15376910425Smrg#endif 15476910425Smrg 15576910425Smrg/* Enabling verbose error messages. */ 15676910425Smrg#ifdef YYERROR_VERBOSE 15776910425Smrg# undef YYERROR_VERBOSE 15876910425Smrg# define YYERROR_VERBOSE 1 15976910425Smrg#else 16076910425Smrg# define YYERROR_VERBOSE 0 16176910425Smrg#endif 16276910425Smrg 16376910425Smrg/* Enabling the token table. */ 16476910425Smrg#ifndef YYTOKEN_TABLE 16576910425Smrg# define YYTOKEN_TABLE 0 16676910425Smrg#endif 16776910425Smrg 168db17cd6dSmrg#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 169db17cd6dSmrgtypedef union YYSTYPE 1709ff100acSmrg#line 75 "cfgparse.y" 171db17cd6dSmrg{ 17276910425Smrg char * str; 17376910425Smrg int ival; 17476910425Smrg CfgEntryPtr entry; 17576910425Smrg ActDefPtr act; 176db17cd6dSmrg} 177db17cd6dSmrg/* Line 187 of yacc.c. */ 178db17cd6dSmrg#line 179 "cfgparse.c" 179db17cd6dSmrg YYSTYPE; 18076910425Smrg# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 18176910425Smrg# define YYSTYPE_IS_DECLARED 1 18276910425Smrg# define YYSTYPE_IS_TRIVIAL 1 18376910425Smrg#endif 18476910425Smrg 18576910425Smrg 18676910425Smrg 18776910425Smrg/* Copy the second part of user declarations. */ 18876910425Smrg 18976910425Smrg 190db17cd6dSmrg/* Line 216 of yacc.c. */ 191db17cd6dSmrg#line 192 "cfgparse.c" 19276910425Smrg 193db17cd6dSmrg#ifdef short 194db17cd6dSmrg# undef short 19576910425Smrg#endif 196db17cd6dSmrg 197db17cd6dSmrg#ifdef YYTYPE_UINT8 198db17cd6dSmrgtypedef YYTYPE_UINT8 yytype_uint8; 199db17cd6dSmrg#else 200db17cd6dSmrgtypedef unsigned char yytype_uint8; 20176910425Smrg#endif 202db17cd6dSmrg 203db17cd6dSmrg#ifdef YYTYPE_INT8 204db17cd6dSmrgtypedef YYTYPE_INT8 yytype_int8; 205db17cd6dSmrg#elif (defined __STDC__ || defined __C99__FUNC__ \ 206db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 207db17cd6dSmrgtypedef signed char yytype_int8; 208db17cd6dSmrg#else 209db17cd6dSmrgtypedef short int yytype_int8; 210db17cd6dSmrg#endif 211db17cd6dSmrg 212db17cd6dSmrg#ifdef YYTYPE_UINT16 213db17cd6dSmrgtypedef YYTYPE_UINT16 yytype_uint16; 214db17cd6dSmrg#else 215db17cd6dSmrgtypedef unsigned short int yytype_uint16; 216db17cd6dSmrg#endif 217db17cd6dSmrg 218db17cd6dSmrg#ifdef YYTYPE_INT16 219db17cd6dSmrgtypedef YYTYPE_INT16 yytype_int16; 220db17cd6dSmrg#else 221db17cd6dSmrgtypedef short int yytype_int16; 22276910425Smrg#endif 223db17cd6dSmrg 224db17cd6dSmrg#ifndef YYSIZE_T 225db17cd6dSmrg# ifdef __SIZE_TYPE__ 226db17cd6dSmrg# define YYSIZE_T __SIZE_TYPE__ 227db17cd6dSmrg# elif defined size_t 228db17cd6dSmrg# define YYSIZE_T size_t 229db17cd6dSmrg# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 230db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 231db17cd6dSmrg# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 232db17cd6dSmrg# define YYSIZE_T size_t 233db17cd6dSmrg# else 234db17cd6dSmrg# define YYSIZE_T unsigned int 235db17cd6dSmrg# endif 23676910425Smrg#endif 23776910425Smrg 238db17cd6dSmrg#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 239db17cd6dSmrg 24076910425Smrg#ifndef YY_ 24176910425Smrg# if YYENABLE_NLS 24276910425Smrg# if ENABLE_NLS 24376910425Smrg# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 24476910425Smrg# define YY_(msgid) dgettext ("bison-runtime", msgid) 24576910425Smrg# endif 24676910425Smrg# endif 24776910425Smrg# ifndef YY_ 24876910425Smrg# define YY_(msgid) msgid 24976910425Smrg# endif 25076910425Smrg#endif 25176910425Smrg 252db17cd6dSmrg/* Suppress unused-variable warnings by "using" E. */ 253db17cd6dSmrg#if ! defined lint || defined __GNUC__ 254db17cd6dSmrg# define YYUSE(e) ((void) (e)) 255db17cd6dSmrg#else 256db17cd6dSmrg# define YYUSE(e) /* empty */ 257db17cd6dSmrg#endif 258db17cd6dSmrg 259db17cd6dSmrg/* Identity function, used to suppress warnings about constant conditions. */ 260db17cd6dSmrg#ifndef lint 261db17cd6dSmrg# define YYID(n) (n) 262db17cd6dSmrg#else 263db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 264db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 265db17cd6dSmrgstatic int 266db17cd6dSmrgYYID (int i) 267db17cd6dSmrg#else 268db17cd6dSmrgstatic int 269db17cd6dSmrgYYID (i) 270db17cd6dSmrg int i; 271db17cd6dSmrg#endif 272db17cd6dSmrg{ 273db17cd6dSmrg return i; 274db17cd6dSmrg} 275db17cd6dSmrg#endif 276db17cd6dSmrg 277db17cd6dSmrg#if ! defined yyoverflow || YYERROR_VERBOSE 27876910425Smrg 27976910425Smrg/* The parser invokes alloca or malloc; define the necessary symbols. */ 28076910425Smrg 28176910425Smrg# ifdef YYSTACK_USE_ALLOCA 28276910425Smrg# if YYSTACK_USE_ALLOCA 28376910425Smrg# ifdef __GNUC__ 28476910425Smrg# define YYSTACK_ALLOC __builtin_alloca 285db17cd6dSmrg# elif defined __BUILTIN_VA_ARG_INCR 286db17cd6dSmrg# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 287db17cd6dSmrg# elif defined _AIX 288db17cd6dSmrg# define YYSTACK_ALLOC __alloca 289db17cd6dSmrg# elif defined _MSC_VER 290db17cd6dSmrg# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 291db17cd6dSmrg# define alloca _alloca 29276910425Smrg# else 29376910425Smrg# define YYSTACK_ALLOC alloca 294db17cd6dSmrg# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 295db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 29676910425Smrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 297db17cd6dSmrg# ifndef _STDLIB_H 298db17cd6dSmrg# define _STDLIB_H 1 299db17cd6dSmrg# endif 30076910425Smrg# endif 30176910425Smrg# endif 30276910425Smrg# endif 30376910425Smrg# endif 30476910425Smrg 30576910425Smrg# ifdef YYSTACK_ALLOC 306db17cd6dSmrg /* Pacify GCC's `empty if-body' warning. */ 307db17cd6dSmrg# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 30876910425Smrg# ifndef YYSTACK_ALLOC_MAXIMUM 30976910425Smrg /* The OS might guarantee only one guard page at the bottom of the stack, 31076910425Smrg and a page size can be as small as 4096 bytes. So we cannot safely 31176910425Smrg invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 31276910425Smrg to allow for a few compiler-allocated temporary stack slots. */ 313db17cd6dSmrg# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 31476910425Smrg# endif 31576910425Smrg# else 31676910425Smrg# define YYSTACK_ALLOC YYMALLOC 31776910425Smrg# define YYSTACK_FREE YYFREE 31876910425Smrg# ifndef YYSTACK_ALLOC_MAXIMUM 319db17cd6dSmrg# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 32076910425Smrg# endif 321db17cd6dSmrg# if (defined __cplusplus && ! defined _STDLIB_H \ 322db17cd6dSmrg && ! ((defined YYMALLOC || defined malloc) \ 323db17cd6dSmrg && (defined YYFREE || defined free))) 324db17cd6dSmrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 325db17cd6dSmrg# ifndef _STDLIB_H 326db17cd6dSmrg# define _STDLIB_H 1 327db17cd6dSmrg# endif 32876910425Smrg# endif 32976910425Smrg# ifndef YYMALLOC 33076910425Smrg# define YYMALLOC malloc 331db17cd6dSmrg# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 332db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 33376910425Smrgvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 33476910425Smrg# endif 33576910425Smrg# endif 33676910425Smrg# ifndef YYFREE 33776910425Smrg# define YYFREE free 338db17cd6dSmrg# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 339db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 34076910425Smrgvoid free (void *); /* INFRINGES ON USER NAME SPACE */ 34176910425Smrg# endif 34276910425Smrg# endif 34376910425Smrg# endif 344db17cd6dSmrg#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 34576910425Smrg 34676910425Smrg 347db17cd6dSmrg#if (! defined yyoverflow \ 348db17cd6dSmrg && (! defined __cplusplus \ 349db17cd6dSmrg || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 35076910425Smrg 35176910425Smrg/* A type that is properly aligned for any stack member. */ 35276910425Smrgunion yyalloc 35376910425Smrg{ 354db17cd6dSmrg yytype_int16 yyss; 35576910425Smrg YYSTYPE yyvs; 35676910425Smrg }; 35776910425Smrg 35876910425Smrg/* The size of the maximum gap between one aligned stack and the next. */ 35976910425Smrg# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 36076910425Smrg 36176910425Smrg/* The size of an array large to enough to hold all stacks, each with 36276910425Smrg N elements. */ 36376910425Smrg# define YYSTACK_BYTES(N) \ 364db17cd6dSmrg ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 36576910425Smrg + YYSTACK_GAP_MAXIMUM) 36676910425Smrg 36776910425Smrg/* Copy COUNT objects from FROM to TO. The source and destination do 36876910425Smrg not overlap. */ 36976910425Smrg# ifndef YYCOPY 370db17cd6dSmrg# if defined __GNUC__ && 1 < __GNUC__ 37176910425Smrg# define YYCOPY(To, From, Count) \ 37276910425Smrg __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 37376910425Smrg# else 37476910425Smrg# define YYCOPY(To, From, Count) \ 37576910425Smrg do \ 37676910425Smrg { \ 37776910425Smrg YYSIZE_T yyi; \ 37876910425Smrg for (yyi = 0; yyi < (Count); yyi++) \ 37976910425Smrg (To)[yyi] = (From)[yyi]; \ 38076910425Smrg } \ 381db17cd6dSmrg while (YYID (0)) 38276910425Smrg# endif 38376910425Smrg# endif 38476910425Smrg 38576910425Smrg/* Relocate STACK from its old location to the new one. The 38676910425Smrg local variables YYSIZE and YYSTACKSIZE give the old and new number of 38776910425Smrg elements in the stack, and YYPTR gives the new location of the 38876910425Smrg stack. Advance YYPTR to a properly aligned location for the next 38976910425Smrg stack. */ 39076910425Smrg# define YYSTACK_RELOCATE(Stack) \ 39176910425Smrg do \ 39276910425Smrg { \ 39376910425Smrg YYSIZE_T yynewbytes; \ 39476910425Smrg YYCOPY (&yyptr->Stack, Stack, yysize); \ 39576910425Smrg Stack = &yyptr->Stack; \ 39676910425Smrg yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 39776910425Smrg yyptr += yynewbytes / sizeof (*yyptr); \ 39876910425Smrg } \ 399db17cd6dSmrg while (YYID (0)) 40076910425Smrg 40176910425Smrg#endif 40276910425Smrg 403db17cd6dSmrg/* YYFINAL -- State number of the termination state. */ 40476910425Smrg#define YYFINAL 12 40576910425Smrg/* YYLAST -- Last index in YYTABLE. */ 40676910425Smrg#define YYLAST 28 40776910425Smrg 408db17cd6dSmrg/* YYNTOKENS -- Number of terminals. */ 40976910425Smrg#define YYNTOKENS 34 410db17cd6dSmrg/* YYNNTS -- Number of nonterminals. */ 41176910425Smrg#define YYNNTS 14 412db17cd6dSmrg/* YYNRULES -- Number of rules. */ 41376910425Smrg#define YYNRULES 27 414db17cd6dSmrg/* YYNRULES -- Number of states. */ 41576910425Smrg#define YYNSTATES 33 41676910425Smrg 41776910425Smrg/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 41876910425Smrg#define YYUNDEFTOK 2 41976910425Smrg#define YYMAXUTOK 257 42076910425Smrg 42176910425Smrg#define YYTRANSLATE(YYX) \ 42276910425Smrg ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 42376910425Smrg 42476910425Smrg/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 425db17cd6dSmrgstatic const yytype_uint8 yytranslate[] = 42676910425Smrg{ 42776910425Smrg 0, 4, 5, 6, 2, 2, 2, 2, 2, 2, 42876910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 42976910425Smrg 7, 8, 9, 10, 11, 12, 2, 2, 2, 2, 43076910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 43176910425Smrg 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 43276910425Smrg 23, 24, 25, 26, 27, 28, 2, 2, 2, 2, 43376910425Smrg 29, 30, 31, 32, 33, 2, 2, 2, 2, 2, 43476910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 43576910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 43676910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 43776910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 43876910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 43976910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44076910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44176910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44276910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44376910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44476910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44576910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44676910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44776910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44876910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 44976910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 45076910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 45176910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 45276910425Smrg 2, 2, 2, 2, 2, 3, 1, 2 45376910425Smrg}; 45476910425Smrg 45576910425Smrg#if YYDEBUG 45676910425Smrg/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 45776910425Smrg YYRHS. */ 458db17cd6dSmrgstatic const yytype_uint8 yyprhs[] = 45976910425Smrg{ 46076910425Smrg 0, 0, 3, 5, 8, 10, 13, 15, 19, 24, 46176910425Smrg 26, 28, 30, 33, 35, 37, 39, 41, 43, 45, 46276910425Smrg 46, 48, 49, 51, 53, 55, 57, 58 46376910425Smrg}; 46476910425Smrg 465db17cd6dSmrg/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 466db17cd6dSmrgstatic const yytype_int8 yyrhs[] = 46776910425Smrg{ 46876910425Smrg 35, 0, -1, 36, -1, 36, 37, -1, 37, -1, 46976910425Smrg 39, 41, -1, 38, -1, 45, 13, 44, -1, 40, 47076910425Smrg 20, 43, 21, -1, 4, -1, 5, -1, 6, -1, 47176910425Smrg 42, 46, -1, 7, -1, 8, -1, 9, -1, 10, 47276910425Smrg -1, 11, -1, 12, -1, -1, 44, -1, -1, 45, 47376910425Smrg -1, 47, -1, 32, -1, 47, -1, -1, 29, -1 47476910425Smrg}; 47576910425Smrg 47676910425Smrg/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 477db17cd6dSmrgstatic const yytype_uint8 yyrline[] = 47876910425Smrg{ 4799ff100acSmrg 0, 86, 86, 90, 102, 105, 113, 116, 133, 150, 4809ff100acSmrg 151, 152, 155, 167, 168, 169, 170, 171, 172, 173, 4819ff100acSmrg 176, 177, 180, 181, 184, 187, 188, 191 48276910425Smrg}; 48376910425Smrg#endif 48476910425Smrg 48576910425Smrg#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 48676910425Smrg/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 487db17cd6dSmrg First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 48876910425Smrgstatic const char *const yytname[] = 48976910425Smrg{ 49076910425Smrg "END_OF_FILE", "error", "$undefined", "ERROR", "BELL", "ACCESSX", 49176910425Smrg "MESSAGE", "NONE", "IGNORE", "ECHO", "PRINT_EV", "SHELL", "SOUND", 49276910425Smrg "EQUALS", "PLUS", "MINUS", "DIVIDE", "TIMES", "OBRACE", "CBRACE", 49376910425Smrg "OPAREN", "CPAREN", "OBRACKET", "CBRACKET", "DOT", "COMMA", "SEMI", 49476910425Smrg "EXCLAM", "INVERT", "STRING", "INTEGER", "FLOAT", "IDENT", "KEYNAME", 49576910425Smrg "$accept", "CfgFile", "CfgEntryList", "CfgEntry", "VarDef", "EventDef", 49676910425Smrg "EventType", "ActionDef", "ActionType", "OptNameSpec", "NameSpec", 49776910425Smrg "Ident", "OptString", "String", 0 49876910425Smrg}; 49976910425Smrg#endif 50076910425Smrg 50176910425Smrg# ifdef YYPRINT 50276910425Smrg/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 50376910425Smrg token YYLEX-NUM. */ 504db17cd6dSmrgstatic const yytype_uint16 yytoknum[] = 50576910425Smrg{ 50676910425Smrg 0, 256, 257, 255, 1, 2, 3, 20, 21, 22, 50776910425Smrg 23, 24, 25, 40, 41, 42, 43, 44, 45, 46, 50876910425Smrg 47, 48, 49, 50, 51, 52, 53, 54, 55, 60, 50976910425Smrg 61, 62, 63, 64 51076910425Smrg}; 51176910425Smrg# endif 51276910425Smrg 51376910425Smrg/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 514db17cd6dSmrgstatic const yytype_uint8 yyr1[] = 51576910425Smrg{ 51676910425Smrg 0, 34, 35, 36, 36, 37, 37, 38, 39, 40, 51776910425Smrg 40, 40, 41, 42, 42, 42, 42, 42, 42, 42, 51876910425Smrg 43, 43, 44, 44, 45, 46, 46, 47 51976910425Smrg}; 52076910425Smrg 52176910425Smrg/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 522db17cd6dSmrgstatic const yytype_uint8 yyr2[] = 52376910425Smrg{ 52476910425Smrg 0, 2, 1, 2, 1, 2, 1, 3, 4, 1, 52576910425Smrg 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 52676910425Smrg 1, 0, 1, 1, 1, 1, 0, 1 52776910425Smrg}; 52876910425Smrg 52976910425Smrg/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 53076910425Smrg STATE-NUM when YYTABLE doesn't specify something else to do. Zero 53176910425Smrg means the default is an error. */ 532db17cd6dSmrgstatic const yytype_uint8 yydefact[] = 53376910425Smrg{ 53476910425Smrg 0, 9, 10, 11, 24, 0, 2, 4, 6, 19, 53576910425Smrg 0, 0, 1, 3, 13, 14, 15, 16, 17, 18, 53676910425Smrg 5, 26, 21, 0, 27, 12, 25, 0, 20, 22, 53776910425Smrg 23, 7, 8 53876910425Smrg}; 53976910425Smrg 540db17cd6dSmrg/* YYDEFGOTO[NTERM-NUM]. */ 541db17cd6dSmrgstatic const yytype_int8 yydefgoto[] = 54276910425Smrg{ 54376910425Smrg -1, 5, 6, 7, 8, 9, 10, 20, 21, 27, 54476910425Smrg 28, 11, 25, 30 54576910425Smrg}; 54676910425Smrg 54776910425Smrg/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 54876910425Smrg STATE-NUM. */ 54976910425Smrg#define YYPACT_NINF -20 550db17cd6dSmrgstatic const yytype_int8 yypact[] = 55176910425Smrg{ 55276910425Smrg -4, -20, -20, -20, -20, 3, -4, -20, -20, -3, 55376910425Smrg -6, 2, -20, -20, -20, -20, -20, -20, -20, -20, 55476910425Smrg -20, -13, -19, -19, -20, -20, -20, -2, -20, -20, 55576910425Smrg -20, -20, -20 55676910425Smrg}; 55776910425Smrg 55876910425Smrg/* YYPGOTO[NTERM-NUM]. */ 559db17cd6dSmrgstatic const yytype_int8 yypgoto[] = 56076910425Smrg{ 56176910425Smrg -20, -20, -20, 11, -20, -20, -20, -20, -20, -20, 56276910425Smrg -5, -11, -20, -1 56376910425Smrg}; 56476910425Smrg 56576910425Smrg/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 56676910425Smrg positive, shift that token. If negative, reduce the rule which 56776910425Smrg number is the opposite. If zero, do what YYDEFACT says. 56876910425Smrg If YYTABLE_NINF, syntax error. */ 56976910425Smrg#define YYTABLE_NINF -1 570db17cd6dSmrgstatic const yytype_uint8 yytable[] = 57176910425Smrg{ 57276910425Smrg 1, 2, 3, 12, 14, 15, 16, 17, 18, 19, 57376910425Smrg 24, 29, 29, 4, 22, 23, 24, 13, 31, 32, 57476910425Smrg 26, 0, 0, 0, 0, 0, 0, 0, 4 57576910425Smrg}; 57676910425Smrg 577db17cd6dSmrgstatic const yytype_int8 yycheck[] = 57876910425Smrg{ 57976910425Smrg 4, 5, 6, 0, 7, 8, 9, 10, 11, 12, 58076910425Smrg 29, 22, 23, 32, 20, 13, 29, 6, 23, 21, 58176910425Smrg 21, -1, -1, -1, -1, -1, -1, -1, 32 58276910425Smrg}; 58376910425Smrg 58476910425Smrg/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 58576910425Smrg symbol of state STATE-NUM. */ 586db17cd6dSmrgstatic const yytype_uint8 yystos[] = 58776910425Smrg{ 58876910425Smrg 0, 4, 5, 6, 32, 35, 36, 37, 38, 39, 58976910425Smrg 40, 45, 0, 37, 7, 8, 9, 10, 11, 12, 59076910425Smrg 41, 42, 20, 13, 29, 46, 47, 43, 44, 45, 59176910425Smrg 47, 44, 21 59276910425Smrg}; 59376910425Smrg 59476910425Smrg#define yyerrok (yyerrstatus = 0) 59576910425Smrg#define yyclearin (yychar = YYEMPTY) 59676910425Smrg#define YYEMPTY (-2) 59776910425Smrg#define YYEOF 0 59876910425Smrg 59976910425Smrg#define YYACCEPT goto yyacceptlab 60076910425Smrg#define YYABORT goto yyabortlab 60176910425Smrg#define YYERROR goto yyerrorlab 60276910425Smrg 60376910425Smrg 60476910425Smrg/* Like YYERROR except do call yyerror. This remains here temporarily 60576910425Smrg to ease the transition to the new meaning of YYERROR, for GCC. 60676910425Smrg Once GCC version 2 has supplanted version 1, this can go. */ 60776910425Smrg 60876910425Smrg#define YYFAIL goto yyerrlab 60976910425Smrg 61076910425Smrg#define YYRECOVERING() (!!yyerrstatus) 61176910425Smrg 61276910425Smrg#define YYBACKUP(Token, Value) \ 61376910425Smrgdo \ 61476910425Smrg if (yychar == YYEMPTY && yylen == 1) \ 61576910425Smrg { \ 61676910425Smrg yychar = (Token); \ 61776910425Smrg yylval = (Value); \ 61876910425Smrg yytoken = YYTRANSLATE (yychar); \ 619db17cd6dSmrg YYPOPSTACK (1); \ 62076910425Smrg goto yybackup; \ 62176910425Smrg } \ 62276910425Smrg else \ 62376910425Smrg { \ 62476910425Smrg yyerror (YY_("syntax error: cannot back up")); \ 62576910425Smrg YYERROR; \ 62676910425Smrg } \ 627db17cd6dSmrgwhile (YYID (0)) 62876910425Smrg 62976910425Smrg 63076910425Smrg#define YYTERROR 1 63176910425Smrg#define YYERRCODE 256 63276910425Smrg 63376910425Smrg 63476910425Smrg/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 63576910425Smrg If N is 0, then set CURRENT to the empty location which ends 63676910425Smrg the previous symbol: RHS[0] (always defined). */ 63776910425Smrg 63876910425Smrg#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 63976910425Smrg#ifndef YYLLOC_DEFAULT 64076910425Smrg# define YYLLOC_DEFAULT(Current, Rhs, N) \ 64176910425Smrg do \ 642db17cd6dSmrg if (YYID (N)) \ 64376910425Smrg { \ 64476910425Smrg (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 64576910425Smrg (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 64676910425Smrg (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 64776910425Smrg (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 64876910425Smrg } \ 64976910425Smrg else \ 65076910425Smrg { \ 65176910425Smrg (Current).first_line = (Current).last_line = \ 65276910425Smrg YYRHSLOC (Rhs, 0).last_line; \ 65376910425Smrg (Current).first_column = (Current).last_column = \ 65476910425Smrg YYRHSLOC (Rhs, 0).last_column; \ 65576910425Smrg } \ 656db17cd6dSmrg while (YYID (0)) 65776910425Smrg#endif 65876910425Smrg 65976910425Smrg 66076910425Smrg/* YY_LOCATION_PRINT -- Print the location on the stream. 66176910425Smrg This macro was not mandated originally: define only if we know 66276910425Smrg we won't break user code: when these are the locations we know. */ 66376910425Smrg 66476910425Smrg#ifndef YY_LOCATION_PRINT 66576910425Smrg# if YYLTYPE_IS_TRIVIAL 66676910425Smrg# define YY_LOCATION_PRINT(File, Loc) \ 66776910425Smrg fprintf (File, "%d.%d-%d.%d", \ 668db17cd6dSmrg (Loc).first_line, (Loc).first_column, \ 669db17cd6dSmrg (Loc).last_line, (Loc).last_column) 67076910425Smrg# else 67176910425Smrg# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 67276910425Smrg# endif 67376910425Smrg#endif 67476910425Smrg 67576910425Smrg 67676910425Smrg/* YYLEX -- calling `yylex' with the right arguments. */ 67776910425Smrg 67876910425Smrg#ifdef YYLEX_PARAM 67976910425Smrg# define YYLEX yylex (YYLEX_PARAM) 68076910425Smrg#else 68176910425Smrg# define YYLEX yylex () 68276910425Smrg#endif 68376910425Smrg 68476910425Smrg/* Enable debugging if requested. */ 68576910425Smrg#if YYDEBUG 68676910425Smrg 68776910425Smrg# ifndef YYFPRINTF 68876910425Smrg# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 68976910425Smrg# define YYFPRINTF fprintf 69076910425Smrg# endif 69176910425Smrg 69276910425Smrg# define YYDPRINTF(Args) \ 69376910425Smrgdo { \ 69476910425Smrg if (yydebug) \ 69576910425Smrg YYFPRINTF Args; \ 696db17cd6dSmrg} while (YYID (0)) 697db17cd6dSmrg 698db17cd6dSmrg# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 699db17cd6dSmrgdo { \ 700db17cd6dSmrg if (yydebug) \ 701db17cd6dSmrg { \ 702db17cd6dSmrg YYFPRINTF (stderr, "%s ", Title); \ 703db17cd6dSmrg yy_symbol_print (stderr, \ 704db17cd6dSmrg Type, Value); \ 705db17cd6dSmrg YYFPRINTF (stderr, "\n"); \ 706db17cd6dSmrg } \ 707db17cd6dSmrg} while (YYID (0)) 70876910425Smrg 709db17cd6dSmrg 710db17cd6dSmrg/*--------------------------------. 711db17cd6dSmrg| Print this symbol on YYOUTPUT. | 712db17cd6dSmrg`--------------------------------*/ 713db17cd6dSmrg 714db17cd6dSmrg/*ARGSUSED*/ 715db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 716db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 717db17cd6dSmrgstatic void 718db17cd6dSmrgyy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 719db17cd6dSmrg#else 720db17cd6dSmrgstatic void 721db17cd6dSmrgyy_symbol_value_print (yyoutput, yytype, yyvaluep) 722db17cd6dSmrg FILE *yyoutput; 723db17cd6dSmrg int yytype; 724db17cd6dSmrg YYSTYPE const * const yyvaluep; 725db17cd6dSmrg#endif 726db17cd6dSmrg{ 727db17cd6dSmrg if (!yyvaluep) 728db17cd6dSmrg return; 729db17cd6dSmrg# ifdef YYPRINT 730db17cd6dSmrg if (yytype < YYNTOKENS) 731db17cd6dSmrg YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 732db17cd6dSmrg# else 733db17cd6dSmrg YYUSE (yyoutput); 734db17cd6dSmrg# endif 735db17cd6dSmrg switch (yytype) 736db17cd6dSmrg { 737db17cd6dSmrg default: 738db17cd6dSmrg break; 739db17cd6dSmrg } 740db17cd6dSmrg} 741db17cd6dSmrg 742db17cd6dSmrg 743db17cd6dSmrg/*--------------------------------. 744db17cd6dSmrg| Print this symbol on YYOUTPUT. | 745db17cd6dSmrg`--------------------------------*/ 746db17cd6dSmrg 747db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 748db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 749db17cd6dSmrgstatic void 750db17cd6dSmrgyy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 751db17cd6dSmrg#else 752db17cd6dSmrgstatic void 753db17cd6dSmrgyy_symbol_print (yyoutput, yytype, yyvaluep) 754db17cd6dSmrg FILE *yyoutput; 755db17cd6dSmrg int yytype; 756db17cd6dSmrg YYSTYPE const * const yyvaluep; 757db17cd6dSmrg#endif 758db17cd6dSmrg{ 759db17cd6dSmrg if (yytype < YYNTOKENS) 760db17cd6dSmrg YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 761db17cd6dSmrg else 762db17cd6dSmrg YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 763db17cd6dSmrg 764db17cd6dSmrg yy_symbol_value_print (yyoutput, yytype, yyvaluep); 765db17cd6dSmrg YYFPRINTF (yyoutput, ")"); 766db17cd6dSmrg} 76776910425Smrg 76876910425Smrg/*------------------------------------------------------------------. 76976910425Smrg| yy_stack_print -- Print the state stack from its BOTTOM up to its | 77076910425Smrg| TOP (included). | 77176910425Smrg`------------------------------------------------------------------*/ 77276910425Smrg 773db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 774db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 77576910425Smrgstatic void 776db17cd6dSmrgyy_stack_print (yytype_int16 *bottom, yytype_int16 *top) 77776910425Smrg#else 77876910425Smrgstatic void 77976910425Smrgyy_stack_print (bottom, top) 780db17cd6dSmrg yytype_int16 *bottom; 781db17cd6dSmrg yytype_int16 *top; 78276910425Smrg#endif 78376910425Smrg{ 78476910425Smrg YYFPRINTF (stderr, "Stack now"); 785db17cd6dSmrg for (; bottom <= top; ++bottom) 78676910425Smrg YYFPRINTF (stderr, " %d", *bottom); 78776910425Smrg YYFPRINTF (stderr, "\n"); 78876910425Smrg} 78976910425Smrg 79076910425Smrg# define YY_STACK_PRINT(Bottom, Top) \ 79176910425Smrgdo { \ 79276910425Smrg if (yydebug) \ 79376910425Smrg yy_stack_print ((Bottom), (Top)); \ 794db17cd6dSmrg} while (YYID (0)) 79576910425Smrg 79676910425Smrg 79776910425Smrg/*------------------------------------------------. 79876910425Smrg| Report that the YYRULE is going to be reduced. | 79976910425Smrg`------------------------------------------------*/ 80076910425Smrg 801db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 802db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 80376910425Smrgstatic void 804db17cd6dSmrgyy_reduce_print (YYSTYPE *yyvsp, int yyrule) 80576910425Smrg#else 80676910425Smrgstatic void 807db17cd6dSmrgyy_reduce_print (yyvsp, yyrule) 808db17cd6dSmrg YYSTYPE *yyvsp; 80976910425Smrg int yyrule; 81076910425Smrg#endif 81176910425Smrg{ 812db17cd6dSmrg int yynrhs = yyr2[yyrule]; 81376910425Smrg int yyi; 81476910425Smrg unsigned long int yylno = yyrline[yyrule]; 815db17cd6dSmrg YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 816db17cd6dSmrg yyrule - 1, yylno); 817db17cd6dSmrg /* The symbols being reduced. */ 818db17cd6dSmrg for (yyi = 0; yyi < yynrhs; yyi++) 819db17cd6dSmrg { 820db17cd6dSmrg fprintf (stderr, " $%d = ", yyi + 1); 821db17cd6dSmrg yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 822db17cd6dSmrg &(yyvsp[(yyi + 1) - (yynrhs)]) 823db17cd6dSmrg ); 824db17cd6dSmrg fprintf (stderr, "\n"); 825db17cd6dSmrg } 82676910425Smrg} 82776910425Smrg 82876910425Smrg# define YY_REDUCE_PRINT(Rule) \ 82976910425Smrgdo { \ 83076910425Smrg if (yydebug) \ 831db17cd6dSmrg yy_reduce_print (yyvsp, Rule); \ 832db17cd6dSmrg} while (YYID (0)) 83376910425Smrg 83476910425Smrg/* Nonzero means print parse trace. It is left uninitialized so that 83576910425Smrg multiple parsers can coexist. */ 83676910425Smrgint yydebug; 83776910425Smrg#else /* !YYDEBUG */ 83876910425Smrg# define YYDPRINTF(Args) 83976910425Smrg# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 84076910425Smrg# define YY_STACK_PRINT(Bottom, Top) 84176910425Smrg# define YY_REDUCE_PRINT(Rule) 84276910425Smrg#endif /* !YYDEBUG */ 84376910425Smrg 84476910425Smrg 84576910425Smrg/* YYINITDEPTH -- initial size of the parser's stacks. */ 84676910425Smrg#ifndef YYINITDEPTH 84776910425Smrg# define YYINITDEPTH 200 84876910425Smrg#endif 84976910425Smrg 85076910425Smrg/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 85176910425Smrg if the built-in stack extension method is used). 85276910425Smrg 85376910425Smrg Do not make this value too large; the results are undefined if 85476910425Smrg YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 85576910425Smrg evaluated with infinite-precision integer arithmetic. */ 85676910425Smrg 85776910425Smrg#ifndef YYMAXDEPTH 85876910425Smrg# define YYMAXDEPTH 10000 85976910425Smrg#endif 86076910425Smrg 86176910425Smrg 86276910425Smrg 86376910425Smrg#if YYERROR_VERBOSE 86476910425Smrg 86576910425Smrg# ifndef yystrlen 866db17cd6dSmrg# if defined __GLIBC__ && defined _STRING_H 86776910425Smrg# define yystrlen strlen 86876910425Smrg# else 86976910425Smrg/* Return the length of YYSTR. */ 870db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 871db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 87276910425Smrgstatic YYSIZE_T 87376910425Smrgyystrlen (const char *yystr) 874db17cd6dSmrg#else 875db17cd6dSmrgstatic YYSIZE_T 87676910425Smrgyystrlen (yystr) 877db17cd6dSmrg const char *yystr; 878db17cd6dSmrg#endif 87976910425Smrg{ 880db17cd6dSmrg YYSIZE_T yylen; 881db17cd6dSmrg for (yylen = 0; yystr[yylen]; yylen++) 88276910425Smrg continue; 883db17cd6dSmrg return yylen; 88476910425Smrg} 88576910425Smrg# endif 88676910425Smrg# endif 88776910425Smrg 88876910425Smrg# ifndef yystpcpy 889db17cd6dSmrg# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 89076910425Smrg# define yystpcpy stpcpy 89176910425Smrg# else 89276910425Smrg/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 89376910425Smrg YYDEST. */ 894db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 895db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 89676910425Smrgstatic char * 89776910425Smrgyystpcpy (char *yydest, const char *yysrc) 898db17cd6dSmrg#else 899db17cd6dSmrgstatic char * 90076910425Smrgyystpcpy (yydest, yysrc) 901db17cd6dSmrg char *yydest; 902db17cd6dSmrg const char *yysrc; 903db17cd6dSmrg#endif 90476910425Smrg{ 90576910425Smrg char *yyd = yydest; 90676910425Smrg const char *yys = yysrc; 90776910425Smrg 90876910425Smrg while ((*yyd++ = *yys++) != '\0') 90976910425Smrg continue; 91076910425Smrg 91176910425Smrg return yyd - 1; 91276910425Smrg} 91376910425Smrg# endif 91476910425Smrg# endif 91576910425Smrg 91676910425Smrg# ifndef yytnamerr 91776910425Smrg/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 91876910425Smrg quotes and backslashes, so that it's suitable for yyerror. The 91976910425Smrg heuristic is that double-quoting is unnecessary unless the string 92076910425Smrg contains an apostrophe, a comma, or backslash (other than 92176910425Smrg backslash-backslash). YYSTR is taken from yytname. If YYRES is 92276910425Smrg null, do not copy; instead, return the length of what the result 92376910425Smrg would have been. */ 92476910425Smrgstatic YYSIZE_T 92576910425Smrgyytnamerr (char *yyres, const char *yystr) 92676910425Smrg{ 92776910425Smrg if (*yystr == '"') 92876910425Smrg { 929db17cd6dSmrg YYSIZE_T yyn = 0; 93076910425Smrg char const *yyp = yystr; 93176910425Smrg 93276910425Smrg for (;;) 93376910425Smrg switch (*++yyp) 93476910425Smrg { 93576910425Smrg case '\'': 93676910425Smrg case ',': 93776910425Smrg goto do_not_strip_quotes; 93876910425Smrg 93976910425Smrg case '\\': 94076910425Smrg if (*++yyp != '\\') 94176910425Smrg goto do_not_strip_quotes; 94276910425Smrg /* Fall through. */ 94376910425Smrg default: 94476910425Smrg if (yyres) 94576910425Smrg yyres[yyn] = *yyp; 94676910425Smrg yyn++; 94776910425Smrg break; 94876910425Smrg 94976910425Smrg case '"': 95076910425Smrg if (yyres) 95176910425Smrg yyres[yyn] = '\0'; 95276910425Smrg return yyn; 95376910425Smrg } 95476910425Smrg do_not_strip_quotes: ; 95576910425Smrg } 95676910425Smrg 95776910425Smrg if (! yyres) 95876910425Smrg return yystrlen (yystr); 95976910425Smrg 96076910425Smrg return yystpcpy (yyres, yystr) - yyres; 96176910425Smrg} 96276910425Smrg# endif 96376910425Smrg 964db17cd6dSmrg/* Copy into YYRESULT an error message about the unexpected token 965db17cd6dSmrg YYCHAR while in state YYSTATE. Return the number of bytes copied, 966db17cd6dSmrg including the terminating null byte. If YYRESULT is null, do not 967db17cd6dSmrg copy anything; just return the number of bytes that would be 968db17cd6dSmrg copied. As a special case, return 0 if an ordinary "syntax error" 969db17cd6dSmrg message will do. Return YYSIZE_MAXIMUM if overflow occurs during 970db17cd6dSmrg size calculation. */ 971db17cd6dSmrgstatic YYSIZE_T 972db17cd6dSmrgyysyntax_error (char *yyresult, int yystate, int yychar) 97376910425Smrg{ 974db17cd6dSmrg int yyn = yypact[yystate]; 97576910425Smrg 976db17cd6dSmrg if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 977db17cd6dSmrg return 0; 97876910425Smrg else 979db17cd6dSmrg { 980db17cd6dSmrg int yytype = YYTRANSLATE (yychar); 981db17cd6dSmrg YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 982db17cd6dSmrg YYSIZE_T yysize = yysize0; 983db17cd6dSmrg YYSIZE_T yysize1; 984db17cd6dSmrg int yysize_overflow = 0; 985db17cd6dSmrg enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 986db17cd6dSmrg char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 987db17cd6dSmrg int yyx; 988db17cd6dSmrg 989db17cd6dSmrg# if 0 990db17cd6dSmrg /* This is so xgettext sees the translatable formats that are 991db17cd6dSmrg constructed on the fly. */ 992db17cd6dSmrg YY_("syntax error, unexpected %s"); 993db17cd6dSmrg YY_("syntax error, unexpected %s, expecting %s"); 994db17cd6dSmrg YY_("syntax error, unexpected %s, expecting %s or %s"); 995db17cd6dSmrg YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 996db17cd6dSmrg YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 997db17cd6dSmrg# endif 998db17cd6dSmrg char *yyfmt; 999db17cd6dSmrg char const *yyf; 1000db17cd6dSmrg static char const yyunexpected[] = "syntax error, unexpected %s"; 1001db17cd6dSmrg static char const yyexpecting[] = ", expecting %s"; 1002db17cd6dSmrg static char const yyor[] = " or %s"; 1003db17cd6dSmrg char yyformat[sizeof yyunexpected 1004db17cd6dSmrg + sizeof yyexpecting - 1 1005db17cd6dSmrg + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 1006db17cd6dSmrg * (sizeof yyor - 1))]; 1007db17cd6dSmrg char const *yyprefix = yyexpecting; 1008db17cd6dSmrg 1009db17cd6dSmrg /* Start YYX at -YYN if negative to avoid negative indexes in 1010db17cd6dSmrg YYCHECK. */ 1011db17cd6dSmrg int yyxbegin = yyn < 0 ? -yyn : 0; 1012db17cd6dSmrg 1013db17cd6dSmrg /* Stay within bounds of both yycheck and yytname. */ 1014db17cd6dSmrg int yychecklim = YYLAST - yyn + 1; 1015db17cd6dSmrg int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1016db17cd6dSmrg int yycount = 1; 1017db17cd6dSmrg 1018db17cd6dSmrg yyarg[0] = yytname[yytype]; 1019db17cd6dSmrg yyfmt = yystpcpy (yyformat, yyunexpected); 1020db17cd6dSmrg 1021db17cd6dSmrg for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1022db17cd6dSmrg if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1023db17cd6dSmrg { 1024db17cd6dSmrg if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1025db17cd6dSmrg { 1026db17cd6dSmrg yycount = 1; 1027db17cd6dSmrg yysize = yysize0; 1028db17cd6dSmrg yyformat[sizeof yyunexpected - 1] = '\0'; 1029db17cd6dSmrg break; 1030db17cd6dSmrg } 1031db17cd6dSmrg yyarg[yycount++] = yytname[yyx]; 1032db17cd6dSmrg yysize1 = yysize + yytnamerr (0, yytname[yyx]); 1033db17cd6dSmrg yysize_overflow |= (yysize1 < yysize); 1034db17cd6dSmrg yysize = yysize1; 1035db17cd6dSmrg yyfmt = yystpcpy (yyfmt, yyprefix); 1036db17cd6dSmrg yyprefix = yyor; 1037db17cd6dSmrg } 103876910425Smrg 1039db17cd6dSmrg yyf = YY_(yyformat); 1040db17cd6dSmrg yysize1 = yysize + yystrlen (yyf); 1041db17cd6dSmrg yysize_overflow |= (yysize1 < yysize); 1042db17cd6dSmrg yysize = yysize1; 104376910425Smrg 1044db17cd6dSmrg if (yysize_overflow) 1045db17cd6dSmrg return YYSIZE_MAXIMUM; 1046db17cd6dSmrg 1047db17cd6dSmrg if (yyresult) 1048db17cd6dSmrg { 1049db17cd6dSmrg /* Avoid sprintf, as that infringes on the user's name space. 1050db17cd6dSmrg Don't have undefined behavior even if the translation 1051db17cd6dSmrg produced a string with the wrong number of "%s"s. */ 1052db17cd6dSmrg char *yyp = yyresult; 1053db17cd6dSmrg int yyi = 0; 1054db17cd6dSmrg while ((*yyp = *yyf) != '\0') 1055db17cd6dSmrg { 1056db17cd6dSmrg if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 1057db17cd6dSmrg { 1058db17cd6dSmrg yyp += yytnamerr (yyp, yyarg[yyi++]); 1059db17cd6dSmrg yyf += 2; 1060db17cd6dSmrg } 1061db17cd6dSmrg else 1062db17cd6dSmrg { 1063db17cd6dSmrg yyp++; 1064db17cd6dSmrg yyf++; 1065db17cd6dSmrg } 1066db17cd6dSmrg } 1067db17cd6dSmrg } 1068db17cd6dSmrg return yysize; 106976910425Smrg } 107076910425Smrg} 1071db17cd6dSmrg#endif /* YYERROR_VERBOSE */ 1072db17cd6dSmrg 107376910425Smrg 107476910425Smrg/*-----------------------------------------------. 107576910425Smrg| Release the memory associated to this symbol. | 107676910425Smrg`-----------------------------------------------*/ 107776910425Smrg 1078db17cd6dSmrg/*ARGSUSED*/ 1079db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 1080db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 108176910425Smrgstatic void 108276910425Smrgyydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 108376910425Smrg#else 108476910425Smrgstatic void 108576910425Smrgyydestruct (yymsg, yytype, yyvaluep) 108676910425Smrg const char *yymsg; 108776910425Smrg int yytype; 108876910425Smrg YYSTYPE *yyvaluep; 108976910425Smrg#endif 109076910425Smrg{ 1091db17cd6dSmrg YYUSE (yyvaluep); 109276910425Smrg 109376910425Smrg if (!yymsg) 109476910425Smrg yymsg = "Deleting"; 109576910425Smrg YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 109676910425Smrg 109776910425Smrg switch (yytype) 109876910425Smrg { 109976910425Smrg 110076910425Smrg default: 1101db17cd6dSmrg break; 110276910425Smrg } 110376910425Smrg} 110476910425Smrg 110576910425Smrg 110676910425Smrg/* Prevent warnings from -Wmissing-prototypes. */ 110776910425Smrg 110876910425Smrg#ifdef YYPARSE_PARAM 1109db17cd6dSmrg#if defined __STDC__ || defined __cplusplus 111076910425Smrgint yyparse (void *YYPARSE_PARAM); 1111db17cd6dSmrg#else 111276910425Smrgint yyparse (); 1113db17cd6dSmrg#endif 111476910425Smrg#else /* ! YYPARSE_PARAM */ 1115db17cd6dSmrg#if defined __STDC__ || defined __cplusplus 111676910425Smrgint yyparse (void); 111776910425Smrg#else 111876910425Smrgint yyparse (); 111976910425Smrg#endif 112076910425Smrg#endif /* ! YYPARSE_PARAM */ 112176910425Smrg 112276910425Smrg 112376910425Smrg 112476910425Smrg/* The look-ahead symbol. */ 112576910425Smrgint yychar; 112676910425Smrg 112776910425Smrg/* The semantic value of the look-ahead symbol. */ 112876910425SmrgYYSTYPE yylval; 112976910425Smrg 113076910425Smrg/* Number of syntax errors so far. */ 113176910425Smrgint yynerrs; 113276910425Smrg 113376910425Smrg 113476910425Smrg 113576910425Smrg/*----------. 113676910425Smrg| yyparse. | 113776910425Smrg`----------*/ 113876910425Smrg 113976910425Smrg#ifdef YYPARSE_PARAM 1140db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 1141db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 1142db17cd6dSmrgint 1143db17cd6dSmrgyyparse (void *YYPARSE_PARAM) 1144db17cd6dSmrg#else 1145db17cd6dSmrgint 1146db17cd6dSmrgyyparse (YYPARSE_PARAM) 1147db17cd6dSmrg void *YYPARSE_PARAM; 1148db17cd6dSmrg#endif 114976910425Smrg#else /* ! YYPARSE_PARAM */ 1150db17cd6dSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 1151db17cd6dSmrg || defined __cplusplus || defined _MSC_VER) 115276910425Smrgint 115376910425Smrgyyparse (void) 115476910425Smrg#else 115576910425Smrgint 115676910425Smrgyyparse () 1157db17cd6dSmrg 115876910425Smrg#endif 115976910425Smrg#endif 116076910425Smrg{ 116176910425Smrg 116276910425Smrg int yystate; 116376910425Smrg int yyn; 116476910425Smrg int yyresult; 116576910425Smrg /* Number of tokens to shift before error messages enabled. */ 116676910425Smrg int yyerrstatus; 116776910425Smrg /* Look-ahead token as an internal (translated) token number. */ 116876910425Smrg int yytoken = 0; 1169db17cd6dSmrg#if YYERROR_VERBOSE 1170db17cd6dSmrg /* Buffer for error messages, and its allocated size. */ 1171db17cd6dSmrg char yymsgbuf[128]; 1172db17cd6dSmrg char *yymsg = yymsgbuf; 1173db17cd6dSmrg YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1174db17cd6dSmrg#endif 117576910425Smrg 117676910425Smrg /* Three stacks and their tools: 117776910425Smrg `yyss': related to states, 117876910425Smrg `yyvs': related to semantic values, 117976910425Smrg `yyls': related to locations. 118076910425Smrg 118176910425Smrg Refer to the stacks thru separate pointers, to allow yyoverflow 118276910425Smrg to reallocate them elsewhere. */ 118376910425Smrg 118476910425Smrg /* The state stack. */ 1185db17cd6dSmrg yytype_int16 yyssa[YYINITDEPTH]; 1186db17cd6dSmrg yytype_int16 *yyss = yyssa; 1187db17cd6dSmrg yytype_int16 *yyssp; 118876910425Smrg 118976910425Smrg /* The semantic value stack. */ 119076910425Smrg YYSTYPE yyvsa[YYINITDEPTH]; 119176910425Smrg YYSTYPE *yyvs = yyvsa; 119276910425Smrg YYSTYPE *yyvsp; 119376910425Smrg 119476910425Smrg 119576910425Smrg 1196db17cd6dSmrg#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 119776910425Smrg 119876910425Smrg YYSIZE_T yystacksize = YYINITDEPTH; 119976910425Smrg 120076910425Smrg /* The variables used to return semantic value and location from the 120176910425Smrg action routines. */ 120276910425Smrg YYSTYPE yyval; 120376910425Smrg 120476910425Smrg 1205db17cd6dSmrg /* The number of symbols on the RHS of the reduced rule. 1206db17cd6dSmrg Keep to zero when no symbol should be popped. */ 1207db17cd6dSmrg int yylen = 0; 120876910425Smrg 120976910425Smrg YYDPRINTF ((stderr, "Starting parse\n")); 121076910425Smrg 121176910425Smrg yystate = 0; 121276910425Smrg yyerrstatus = 0; 121376910425Smrg yynerrs = 0; 121476910425Smrg yychar = YYEMPTY; /* Cause a token to be read. */ 121576910425Smrg 121676910425Smrg /* Initialize stack pointers. 121776910425Smrg Waste one element of value and location stack 121876910425Smrg so that they stay on the same level as the state stack. 121976910425Smrg The wasted elements are never initialized. */ 122076910425Smrg 122176910425Smrg yyssp = yyss; 122276910425Smrg yyvsp = yyvs; 122376910425Smrg 122476910425Smrg goto yysetstate; 122576910425Smrg 122676910425Smrg/*------------------------------------------------------------. 122776910425Smrg| yynewstate -- Push a new state, which is found in yystate. | 122876910425Smrg`------------------------------------------------------------*/ 122976910425Smrg yynewstate: 123076910425Smrg /* In all cases, when you get here, the value and location stacks 1231db17cd6dSmrg have just been pushed. So pushing a state here evens the stacks. */ 123276910425Smrg yyssp++; 123376910425Smrg 123476910425Smrg yysetstate: 123576910425Smrg *yyssp = yystate; 123676910425Smrg 123776910425Smrg if (yyss + yystacksize - 1 <= yyssp) 123876910425Smrg { 123976910425Smrg /* Get the current used size of the three stacks, in elements. */ 124076910425Smrg YYSIZE_T yysize = yyssp - yyss + 1; 124176910425Smrg 124276910425Smrg#ifdef yyoverflow 124376910425Smrg { 1244db17cd6dSmrg /* Give user a chance to reallocate the stack. Use copies of 124576910425Smrg these so that the &'s don't force the real ones into 124676910425Smrg memory. */ 124776910425Smrg YYSTYPE *yyvs1 = yyvs; 1248db17cd6dSmrg yytype_int16 *yyss1 = yyss; 124976910425Smrg 125076910425Smrg 125176910425Smrg /* Each stack pointer address is followed by the size of the 125276910425Smrg data in use in that stack, in bytes. This used to be a 125376910425Smrg conditional around just the two extra args, but that might 125476910425Smrg be undefined if yyoverflow is a macro. */ 125576910425Smrg yyoverflow (YY_("memory exhausted"), 125676910425Smrg &yyss1, yysize * sizeof (*yyssp), 125776910425Smrg &yyvs1, yysize * sizeof (*yyvsp), 125876910425Smrg 125976910425Smrg &yystacksize); 126076910425Smrg 126176910425Smrg yyss = yyss1; 126276910425Smrg yyvs = yyvs1; 126376910425Smrg } 126476910425Smrg#else /* no yyoverflow */ 126576910425Smrg# ifndef YYSTACK_RELOCATE 126676910425Smrg goto yyexhaustedlab; 126776910425Smrg# else 126876910425Smrg /* Extend the stack our own way. */ 126976910425Smrg if (YYMAXDEPTH <= yystacksize) 127076910425Smrg goto yyexhaustedlab; 127176910425Smrg yystacksize *= 2; 127276910425Smrg if (YYMAXDEPTH < yystacksize) 127376910425Smrg yystacksize = YYMAXDEPTH; 127476910425Smrg 127576910425Smrg { 1276db17cd6dSmrg yytype_int16 *yyss1 = yyss; 127776910425Smrg union yyalloc *yyptr = 127876910425Smrg (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 127976910425Smrg if (! yyptr) 128076910425Smrg goto yyexhaustedlab; 128176910425Smrg YYSTACK_RELOCATE (yyss); 128276910425Smrg YYSTACK_RELOCATE (yyvs); 128376910425Smrg 128476910425Smrg# undef YYSTACK_RELOCATE 128576910425Smrg if (yyss1 != yyssa) 128676910425Smrg YYSTACK_FREE (yyss1); 128776910425Smrg } 128876910425Smrg# endif 128976910425Smrg#endif /* no yyoverflow */ 129076910425Smrg 129176910425Smrg yyssp = yyss + yysize - 1; 129276910425Smrg yyvsp = yyvs + yysize - 1; 129376910425Smrg 129476910425Smrg 129576910425Smrg YYDPRINTF ((stderr, "Stack size increased to %lu\n", 129676910425Smrg (unsigned long int) yystacksize)); 129776910425Smrg 129876910425Smrg if (yyss + yystacksize - 1 <= yyssp) 129976910425Smrg YYABORT; 130076910425Smrg } 130176910425Smrg 130276910425Smrg YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 130376910425Smrg 130476910425Smrg goto yybackup; 130576910425Smrg 130676910425Smrg/*-----------. 130776910425Smrg| yybackup. | 130876910425Smrg`-----------*/ 130976910425Smrgyybackup: 131076910425Smrg 1311db17cd6dSmrg /* Do appropriate processing given the current state. Read a 1312db17cd6dSmrg look-ahead token if we need one and don't already have one. */ 131376910425Smrg 131476910425Smrg /* First try to decide what to do without reference to look-ahead token. */ 131576910425Smrg yyn = yypact[yystate]; 131676910425Smrg if (yyn == YYPACT_NINF) 131776910425Smrg goto yydefault; 131876910425Smrg 131976910425Smrg /* Not known => get a look-ahead token if don't already have one. */ 132076910425Smrg 132176910425Smrg /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 132276910425Smrg if (yychar == YYEMPTY) 132376910425Smrg { 132476910425Smrg YYDPRINTF ((stderr, "Reading a token: ")); 132576910425Smrg yychar = YYLEX; 132676910425Smrg } 132776910425Smrg 132876910425Smrg if (yychar <= YYEOF) 132976910425Smrg { 133076910425Smrg yychar = yytoken = YYEOF; 133176910425Smrg YYDPRINTF ((stderr, "Now at end of input.\n")); 133276910425Smrg } 133376910425Smrg else 133476910425Smrg { 133576910425Smrg yytoken = YYTRANSLATE (yychar); 133676910425Smrg YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 133776910425Smrg } 133876910425Smrg 133976910425Smrg /* If the proper action on seeing token YYTOKEN is to reduce or to 134076910425Smrg detect an error, take that action. */ 134176910425Smrg yyn += yytoken; 134276910425Smrg if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 134376910425Smrg goto yydefault; 134476910425Smrg yyn = yytable[yyn]; 134576910425Smrg if (yyn <= 0) 134676910425Smrg { 134776910425Smrg if (yyn == 0 || yyn == YYTABLE_NINF) 134876910425Smrg goto yyerrlab; 134976910425Smrg yyn = -yyn; 135076910425Smrg goto yyreduce; 135176910425Smrg } 135276910425Smrg 135376910425Smrg if (yyn == YYFINAL) 135476910425Smrg YYACCEPT; 135576910425Smrg 1356db17cd6dSmrg /* Count tokens shifted since error; after three, turn off error 1357db17cd6dSmrg status. */ 1358db17cd6dSmrg if (yyerrstatus) 1359db17cd6dSmrg yyerrstatus--; 1360db17cd6dSmrg 136176910425Smrg /* Shift the look-ahead token. */ 136276910425Smrg YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 136376910425Smrg 1364db17cd6dSmrg /* Discard the shifted token unless it is eof. */ 136576910425Smrg if (yychar != YYEOF) 136676910425Smrg yychar = YYEMPTY; 136776910425Smrg 1368db17cd6dSmrg yystate = yyn; 136976910425Smrg *++yyvsp = yylval; 137076910425Smrg 137176910425Smrg goto yynewstate; 137276910425Smrg 137376910425Smrg 137476910425Smrg/*-----------------------------------------------------------. 137576910425Smrg| yydefault -- do the default action for the current state. | 137676910425Smrg`-----------------------------------------------------------*/ 137776910425Smrgyydefault: 137876910425Smrg yyn = yydefact[yystate]; 137976910425Smrg if (yyn == 0) 138076910425Smrg goto yyerrlab; 138176910425Smrg goto yyreduce; 138276910425Smrg 138376910425Smrg 138476910425Smrg/*-----------------------------. 138576910425Smrg| yyreduce -- Do a reduction. | 138676910425Smrg`-----------------------------*/ 138776910425Smrgyyreduce: 138876910425Smrg /* yyn is the number of a rule to reduce with. */ 138976910425Smrg yylen = yyr2[yyn]; 139076910425Smrg 139176910425Smrg /* If YYLEN is nonzero, implement the default value of the action: 139276910425Smrg `$$ = $1'. 139376910425Smrg 139476910425Smrg Otherwise, the following line sets YYVAL to garbage. 139576910425Smrg This behavior is undocumented and Bison 139676910425Smrg users should not rely upon it. Assigning to YYVAL 139776910425Smrg unconditionally makes the parser a bit smaller, and it avoids a 139876910425Smrg GCC warning that YYVAL may be used uninitialized. */ 139976910425Smrg yyval = yyvsp[1-yylen]; 140076910425Smrg 140176910425Smrg 140276910425Smrg YY_REDUCE_PRINT (yyn); 140376910425Smrg switch (yyn) 140476910425Smrg { 140576910425Smrg case 2: 14069ff100acSmrg#line 87 "cfgparse.y" 1407db17cd6dSmrg { InterpretConfigs((yyvsp[(1) - (1)].entry)); } 140876910425Smrg break; 140976910425Smrg 141076910425Smrg case 3: 14119ff100acSmrg#line 91 "cfgparse.y" 14129ff100acSmrg { 141376910425Smrg CfgEntryPtr tmp; 1414db17cd6dSmrg if ((yyvsp[(1) - (2)].entry)!=NULL) { 1415db17cd6dSmrg for (tmp=(yyvsp[(1) - (2)].entry);tmp->next!=NULL;tmp=tmp->next) { 141676910425Smrg /* conditional does the work */ 141776910425Smrg } 1418db17cd6dSmrg tmp->next= (yyvsp[(2) - (2)].entry); 1419db17cd6dSmrg (yyval.entry)= (yyvsp[(1) - (2)].entry); 142076910425Smrg } 1421db17cd6dSmrg else (yyval.entry)= (yyvsp[(2) - (2)].entry); 142276910425Smrg } 142376910425Smrg break; 142476910425Smrg 142576910425Smrg case 4: 14269ff100acSmrg#line 102 "cfgparse.y" 1427db17cd6dSmrg { (yyval.entry)= (yyvsp[(1) - (1)].entry); } 142876910425Smrg break; 142976910425Smrg 143076910425Smrg case 5: 14319ff100acSmrg#line 106 "cfgparse.y" 143276910425Smrg { 1433db17cd6dSmrg if (((yyvsp[(1) - (2)].entry))&&((yyvsp[(2) - (2)].act))) 1434db17cd6dSmrg (yyvsp[(1) - (2)].entry)->action= *((yyvsp[(2) - (2)].act)); 1435db17cd6dSmrg if ((yyvsp[(2) - (2)].act)) 14369ff100acSmrg free((yyvsp[(2) - (2)].act)); 1437db17cd6dSmrg (yyval.entry)= (yyvsp[(1) - (2)].entry); 143876910425Smrg } 143976910425Smrg break; 144076910425Smrg 144176910425Smrg case 6: 14429ff100acSmrg#line 113 "cfgparse.y" 1443db17cd6dSmrg { (yyval.entry)= (yyvsp[(1) - (1)].entry); } 144476910425Smrg break; 144576910425Smrg 144676910425Smrg case 7: 14479ff100acSmrg#line 117 "cfgparse.y" 144876910425Smrg { 144976910425Smrg CfgEntryPtr cfg; 14509ff100acSmrg cfg= calloc(1,sizeof(CfgEntryRec)); 145176910425Smrg if (cfg) { 145276910425Smrg cfg->entry_type= VariableDef; 145376910425Smrg cfg->event_type= 0; 1454db17cd6dSmrg cfg->name.str= (yyvsp[(1) - (3)].str); 145576910425Smrg cfg->action.type= UnknownAction; 1456db17cd6dSmrg cfg->action.text= (yyvsp[(3) - (3)].str); 145776910425Smrg cfg->action.priv= 0; 145876910425Smrg cfg->next= NULL; 145976910425Smrg } 146076910425Smrg (yyval.entry)= cfg; 146176910425Smrg } 146276910425Smrg break; 146376910425Smrg 146476910425Smrg case 8: 14659ff100acSmrg#line 134 "cfgparse.y" 146676910425Smrg { 146776910425Smrg CfgEntryPtr cfg; 14689ff100acSmrg cfg= calloc(1,sizeof(CfgEntryRec)); 146976910425Smrg if (cfg) { 147076910425Smrg cfg->entry_type= EventDef; 1471db17cd6dSmrg cfg->event_type= (yyvsp[(1) - (4)].ival); 1472db17cd6dSmrg cfg->name.str= (yyvsp[(3) - (4)].str); 147376910425Smrg cfg->action.type= UnknownAction; 147476910425Smrg cfg->action.text= NULL; 147576910425Smrg cfg->action.priv= 0; 147676910425Smrg cfg->next= NULL; 147776910425Smrg } 147876910425Smrg (yyval.entry)= cfg; 147976910425Smrg } 148076910425Smrg break; 148176910425Smrg 148276910425Smrg case 9: 14839ff100acSmrg#line 150 "cfgparse.y" 148476910425Smrg { (yyval.ival)= XkbBellNotify; } 148576910425Smrg break; 148676910425Smrg 148776910425Smrg case 10: 14889ff100acSmrg#line 151 "cfgparse.y" 148976910425Smrg { (yyval.ival)= XkbAccessXNotify; } 149076910425Smrg break; 149176910425Smrg 149276910425Smrg case 11: 14939ff100acSmrg#line 152 "cfgparse.y" 149476910425Smrg { (yyval.ival)= XkbActionMessage; } 149576910425Smrg break; 149676910425Smrg 149776910425Smrg case 12: 14989ff100acSmrg#line 156 "cfgparse.y" 14999ff100acSmrg { 150076910425Smrg ActDefPtr act; 15019ff100acSmrg act= calloc(1,sizeof(ActDefRec)); 150276910425Smrg if (act) { 1503db17cd6dSmrg act->type= (yyvsp[(1) - (2)].ival); 1504db17cd6dSmrg act->text= (yyvsp[(2) - (2)].str); 150576910425Smrg } 15069ff100acSmrg (yyval.act)= act; 150776910425Smrg } 150876910425Smrg break; 150976910425Smrg 151076910425Smrg case 13: 15119ff100acSmrg#line 167 "cfgparse.y" 151276910425Smrg { (yyval.ival) = NoAction; } 151376910425Smrg break; 151476910425Smrg 151576910425Smrg case 14: 15169ff100acSmrg#line 168 "cfgparse.y" 151776910425Smrg { (yyval.ival) = NoAction; } 151876910425Smrg break; 151976910425Smrg 152076910425Smrg case 15: 15219ff100acSmrg#line 169 "cfgparse.y" 152276910425Smrg { (yyval.ival) = EchoAction; } 152376910425Smrg break; 152476910425Smrg 152576910425Smrg case 16: 15269ff100acSmrg#line 170 "cfgparse.y" 152776910425Smrg { (yyval.ival) = PrintEvAction; } 152876910425Smrg break; 152976910425Smrg 153076910425Smrg case 17: 15319ff100acSmrg#line 171 "cfgparse.y" 153276910425Smrg { (yyval.ival) = ShellAction; } 153376910425Smrg break; 153476910425Smrg 153576910425Smrg case 18: 15369ff100acSmrg#line 172 "cfgparse.y" 153776910425Smrg { (yyval.ival) = SoundAction; } 153876910425Smrg break; 153976910425Smrg 154076910425Smrg case 19: 15419ff100acSmrg#line 173 "cfgparse.y" 154276910425Smrg { (yyval.ival) = UnknownAction; } 154376910425Smrg break; 154476910425Smrg 154576910425Smrg case 20: 15469ff100acSmrg#line 176 "cfgparse.y" 1547db17cd6dSmrg { (yyval.str)= (yyvsp[(1) - (1)].str); } 154876910425Smrg break; 154976910425Smrg 155076910425Smrg case 21: 15519ff100acSmrg#line 177 "cfgparse.y" 155276910425Smrg { (yyval.str)= NULL; } 155376910425Smrg break; 155476910425Smrg 155576910425Smrg case 22: 15569ff100acSmrg#line 180 "cfgparse.y" 1557db17cd6dSmrg { (yyval.str)= (yyvsp[(1) - (1)].str); } 155876910425Smrg break; 155976910425Smrg 156076910425Smrg case 23: 15619ff100acSmrg#line 181 "cfgparse.y" 1562db17cd6dSmrg { (yyval.str)= (yyvsp[(1) - (1)].str); } 156376910425Smrg break; 156476910425Smrg 156576910425Smrg case 24: 15669ff100acSmrg#line 184 "cfgparse.y" 156776910425Smrg { (yyval.str)= scanStr; scanStr= NULL; } 156876910425Smrg break; 156976910425Smrg 157076910425Smrg case 25: 15719ff100acSmrg#line 187 "cfgparse.y" 1572db17cd6dSmrg { (yyval.str)= (yyvsp[(1) - (1)].str); } 157376910425Smrg break; 157476910425Smrg 157576910425Smrg case 26: 15769ff100acSmrg#line 188 "cfgparse.y" 157776910425Smrg { (yyval.str)= NULL; } 157876910425Smrg break; 157976910425Smrg 158076910425Smrg case 27: 15819ff100acSmrg#line 191 "cfgparse.y" 158276910425Smrg { (yyval.str)= scanStr; scanStr= NULL; } 158376910425Smrg break; 158476910425Smrg 158576910425Smrg 1586db17cd6dSmrg/* Line 1267 of yacc.c. */ 1587db17cd6dSmrg#line 1588 "cfgparse.c" 158876910425Smrg default: break; 158976910425Smrg } 1590db17cd6dSmrg YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 159176910425Smrg 1592db17cd6dSmrg YYPOPSTACK (yylen); 1593db17cd6dSmrg yylen = 0; 159476910425Smrg YY_STACK_PRINT (yyss, yyssp); 159576910425Smrg 159676910425Smrg *++yyvsp = yyval; 159776910425Smrg 159876910425Smrg 159976910425Smrg /* Now `shift' the result of the reduction. Determine what state 160076910425Smrg that goes to, based on the state we popped back to and the rule 160176910425Smrg number reduced by. */ 160276910425Smrg 160376910425Smrg yyn = yyr1[yyn]; 160476910425Smrg 160576910425Smrg yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 160676910425Smrg if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 160776910425Smrg yystate = yytable[yystate]; 160876910425Smrg else 160976910425Smrg yystate = yydefgoto[yyn - YYNTOKENS]; 161076910425Smrg 161176910425Smrg goto yynewstate; 161276910425Smrg 161376910425Smrg 161476910425Smrg/*------------------------------------. 161576910425Smrg| yyerrlab -- here on detecting error | 161676910425Smrg`------------------------------------*/ 161776910425Smrgyyerrlab: 161876910425Smrg /* If not already recovering from an error, report this error. */ 161976910425Smrg if (!yyerrstatus) 162076910425Smrg { 162176910425Smrg ++yynerrs; 1622db17cd6dSmrg#if ! YYERROR_VERBOSE 1623db17cd6dSmrg yyerror (YY_("syntax error")); 1624db17cd6dSmrg#else 1625db17cd6dSmrg { 1626db17cd6dSmrg YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 1627db17cd6dSmrg if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 1628db17cd6dSmrg { 1629db17cd6dSmrg YYSIZE_T yyalloc = 2 * yysize; 1630db17cd6dSmrg if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 1631db17cd6dSmrg yyalloc = YYSTACK_ALLOC_MAXIMUM; 1632db17cd6dSmrg if (yymsg != yymsgbuf) 1633db17cd6dSmrg YYSTACK_FREE (yymsg); 1634db17cd6dSmrg yymsg = (char *) YYSTACK_ALLOC (yyalloc); 1635db17cd6dSmrg if (yymsg) 1636db17cd6dSmrg yymsg_alloc = yyalloc; 1637db17cd6dSmrg else 163876910425Smrg { 1639db17cd6dSmrg yymsg = yymsgbuf; 1640db17cd6dSmrg yymsg_alloc = sizeof yymsgbuf; 164176910425Smrg } 1642db17cd6dSmrg } 164376910425Smrg 1644db17cd6dSmrg if (0 < yysize && yysize <= yymsg_alloc) 1645db17cd6dSmrg { 1646db17cd6dSmrg (void) yysyntax_error (yymsg, yystate, yychar); 1647db17cd6dSmrg yyerror (yymsg); 1648db17cd6dSmrg } 1649db17cd6dSmrg else 1650db17cd6dSmrg { 1651db17cd6dSmrg yyerror (YY_("syntax error")); 1652db17cd6dSmrg if (yysize != 0) 165376910425Smrg goto yyexhaustedlab; 1654db17cd6dSmrg } 1655db17cd6dSmrg } 1656db17cd6dSmrg#endif 165776910425Smrg } 165876910425Smrg 165976910425Smrg 166076910425Smrg 166176910425Smrg if (yyerrstatus == 3) 166276910425Smrg { 166376910425Smrg /* If just tried and failed to reuse look-ahead token after an 166476910425Smrg error, discard it. */ 166576910425Smrg 166676910425Smrg if (yychar <= YYEOF) 1667db17cd6dSmrg { 166876910425Smrg /* Return failure if at end of input. */ 166976910425Smrg if (yychar == YYEOF) 167076910425Smrg YYABORT; 1671db17cd6dSmrg } 167276910425Smrg else 167376910425Smrg { 1674db17cd6dSmrg yydestruct ("Error: discarding", 1675db17cd6dSmrg yytoken, &yylval); 167676910425Smrg yychar = YYEMPTY; 167776910425Smrg } 167876910425Smrg } 167976910425Smrg 168076910425Smrg /* Else will try to reuse look-ahead token after shifting the error 168176910425Smrg token. */ 168276910425Smrg goto yyerrlab1; 168376910425Smrg 168476910425Smrg 168576910425Smrg/*---------------------------------------------------. 168676910425Smrg| yyerrorlab -- error raised explicitly by YYERROR. | 168776910425Smrg`---------------------------------------------------*/ 168876910425Smrgyyerrorlab: 168976910425Smrg 169076910425Smrg /* Pacify compilers like GCC when the user code never invokes 169176910425Smrg YYERROR and the label yyerrorlab therefore never appears in user 169276910425Smrg code. */ 1693db17cd6dSmrg if (/*CONSTCOND*/ 0) 169476910425Smrg goto yyerrorlab; 169576910425Smrg 1696db17cd6dSmrg /* Do not reclaim the symbols of the rule which action triggered 1697db17cd6dSmrg this YYERROR. */ 1698db17cd6dSmrg YYPOPSTACK (yylen); 1699db17cd6dSmrg yylen = 0; 1700db17cd6dSmrg YY_STACK_PRINT (yyss, yyssp); 170176910425Smrg yystate = *yyssp; 170276910425Smrg goto yyerrlab1; 170376910425Smrg 170476910425Smrg 170576910425Smrg/*-------------------------------------------------------------. 170676910425Smrg| yyerrlab1 -- common code for both syntax error and YYERROR. | 170776910425Smrg`-------------------------------------------------------------*/ 170876910425Smrgyyerrlab1: 170976910425Smrg yyerrstatus = 3; /* Each real token shifted decrements this. */ 171076910425Smrg 171176910425Smrg for (;;) 171276910425Smrg { 171376910425Smrg yyn = yypact[yystate]; 171476910425Smrg if (yyn != YYPACT_NINF) 171576910425Smrg { 171676910425Smrg yyn += YYTERROR; 171776910425Smrg if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 171876910425Smrg { 171976910425Smrg yyn = yytable[yyn]; 172076910425Smrg if (0 < yyn) 172176910425Smrg break; 172276910425Smrg } 172376910425Smrg } 172476910425Smrg 172576910425Smrg /* Pop the current state because it cannot handle the error token. */ 172676910425Smrg if (yyssp == yyss) 172776910425Smrg YYABORT; 172876910425Smrg 172976910425Smrg 1730db17cd6dSmrg yydestruct ("Error: popping", 1731db17cd6dSmrg yystos[yystate], yyvsp); 1732db17cd6dSmrg YYPOPSTACK (1); 173376910425Smrg yystate = *yyssp; 173476910425Smrg YY_STACK_PRINT (yyss, yyssp); 173576910425Smrg } 173676910425Smrg 173776910425Smrg if (yyn == YYFINAL) 173876910425Smrg YYACCEPT; 173976910425Smrg 174076910425Smrg *++yyvsp = yylval; 174176910425Smrg 174276910425Smrg 1743db17cd6dSmrg /* Shift the error token. */ 174476910425Smrg YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 174576910425Smrg 174676910425Smrg yystate = yyn; 174776910425Smrg goto yynewstate; 174876910425Smrg 174976910425Smrg 175076910425Smrg/*-------------------------------------. 175176910425Smrg| yyacceptlab -- YYACCEPT comes here. | 175276910425Smrg`-------------------------------------*/ 175376910425Smrgyyacceptlab: 175476910425Smrg yyresult = 0; 175576910425Smrg goto yyreturn; 175676910425Smrg 175776910425Smrg/*-----------------------------------. 175876910425Smrg| yyabortlab -- YYABORT comes here. | 175976910425Smrg`-----------------------------------*/ 176076910425Smrgyyabortlab: 176176910425Smrg yyresult = 1; 176276910425Smrg goto yyreturn; 176376910425Smrg 176476910425Smrg#ifndef yyoverflow 176576910425Smrg/*-------------------------------------------------. 176676910425Smrg| yyexhaustedlab -- memory exhaustion comes here. | 176776910425Smrg`-------------------------------------------------*/ 176876910425Smrgyyexhaustedlab: 176976910425Smrg yyerror (YY_("memory exhausted")); 177076910425Smrg yyresult = 2; 177176910425Smrg /* Fall through. */ 177276910425Smrg#endif 177376910425Smrg 177476910425Smrgyyreturn: 177576910425Smrg if (yychar != YYEOF && yychar != YYEMPTY) 177676910425Smrg yydestruct ("Cleanup: discarding lookahead", 177776910425Smrg yytoken, &yylval); 1778db17cd6dSmrg /* Do not reclaim the symbols of the rule which action triggered 1779db17cd6dSmrg this YYABORT or YYACCEPT. */ 1780db17cd6dSmrg YYPOPSTACK (yylen); 1781db17cd6dSmrg YY_STACK_PRINT (yyss, yyssp); 178276910425Smrg while (yyssp != yyss) 178376910425Smrg { 178476910425Smrg yydestruct ("Cleanup: popping", 178576910425Smrg yystos[*yyssp], yyvsp); 1786db17cd6dSmrg YYPOPSTACK (1); 178776910425Smrg } 178876910425Smrg#ifndef yyoverflow 178976910425Smrg if (yyss != yyssa) 179076910425Smrg YYSTACK_FREE (yyss); 179176910425Smrg#endif 1792db17cd6dSmrg#if YYERROR_VERBOSE 1793db17cd6dSmrg if (yymsg != yymsgbuf) 1794db17cd6dSmrg YYSTACK_FREE (yymsg); 1795db17cd6dSmrg#endif 1796db17cd6dSmrg /* Make sure YYID is used. */ 1797db17cd6dSmrg return YYID (yyresult); 179876910425Smrg} 179976910425Smrg 180076910425Smrg 18019ff100acSmrg#line 193 "cfgparse.y" 180276910425Smrg 180376910425Smrgint 180476910425Smrgyyerror(char *s) 180576910425Smrg{ 180676910425Smrg (void)fprintf(stderr,"%s: line %d of %s\n",s,lineNum, 180776910425Smrg (scanFile?scanFile:"(unknown)")); 180876910425Smrg if (scanStr) 180976910425Smrg (void)fprintf(stderr,"last scanned symbol is: %s\n",scanStr); 181076910425Smrg return 1; 181176910425Smrg} 181276910425Smrg 181376910425Smrg 181476910425Smrgint 181576910425Smrgyywrap(void) 181676910425Smrg{ 181776910425Smrg return 1; 181876910425Smrg} 181976910425Smrg 182076910425Smrgint 182176910425SmrgCFGParseFile(FILE *file) 182276910425Smrg{ 182376910425Smrg if (file) { 182476910425Smrg yyin= file; 182576910425Smrg if (yyparse()==0) { 182676910425Smrg return 1; 182776910425Smrg } 182876910425Smrg return 0; 182976910425Smrg } 183076910425Smrg return 1; 183176910425Smrg} 183276910425Smrg 1833