18bfe6addSmrg/* A Bison parser, made by GNU Bison 3.8.2. */ 276910425Smrg 3a67f45c3Smrg/* Bison implementation for Yacc-like parsers in C 4db17cd6dSmrg 58bfe6addSmrg Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, 68bfe6addSmrg Inc. 776910425Smrg 8a67f45c3Smrg 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 10a67f45c3Smrg the Free Software Foundation, either version 3 of the License, or 11a67f45c3Smrg (at your option) 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 198bfe6addSmrg along with this program. If not, see <https://www.gnu.org/licenses/>. */ 2076910425Smrg 21db17cd6dSmrg/* As a special exception, you may create a larger work that contains 22db17cd6dSmrg part or all of the Bison parser skeleton and distribute that work 23db17cd6dSmrg under terms of your choice, so long as that work isn't itself a 24db17cd6dSmrg parser generator using the skeleton or a modified version thereof 25db17cd6dSmrg as a parser skeleton. Alternatively, if you modify or redistribute 26db17cd6dSmrg the parser skeleton itself, you may (at your option) remove this 27db17cd6dSmrg special exception, which will cause the skeleton and the resulting 28db17cd6dSmrg Bison output files to be licensed under the GNU General Public 29db17cd6dSmrg License without this special exception. 30db17cd6dSmrg 31db17cd6dSmrg This special exception was added by the Free Software Foundation in 32db17cd6dSmrg version 2.2 of Bison. */ 3376910425Smrg 34db17cd6dSmrg/* C LALR(1) parser skeleton written by Richard Stallman, by 35db17cd6dSmrg simplifying the original so-called "semantic" parser. */ 3676910425Smrg 378bfe6addSmrg/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, 388bfe6addSmrg especially those whose name start with YY_ or yy_. They are 398bfe6addSmrg private implementation details that can be changed or removed. */ 408bfe6addSmrg 4176910425Smrg/* All symbols defined below should begin with yy or YY, to avoid 4276910425Smrg infringing on user name space. This should be done even for local 4376910425Smrg variables, as they might otherwise be expanded by user macros. 4476910425Smrg There are some unavoidable exceptions within include files to 4576910425Smrg define necessary library symbols; they are noted "INFRINGES ON 4676910425Smrg USER NAME SPACE" below. */ 4776910425Smrg 488bfe6addSmrg/* Identify Bison output, and Bison version. */ 498bfe6addSmrg#define YYBISON 30802 5076910425Smrg 518bfe6addSmrg/* Bison version string. */ 528bfe6addSmrg#define YYBISON_VERSION "3.8.2" 5376910425Smrg 5476910425Smrg/* Skeleton name. */ 5576910425Smrg#define YYSKELETON_NAME "yacc.c" 5676910425Smrg 5776910425Smrg/* Pure parsers. */ 5876910425Smrg#define YYPURE 0 5976910425Smrg 60a67f45c3Smrg/* Push parsers. */ 61a67f45c3Smrg#define YYPUSH 0 6276910425Smrg 63a67f45c3Smrg/* Pull parsers. */ 64a67f45c3Smrg#define YYPULL 1 6576910425Smrg 6676910425Smrg 67a67f45c3Smrg 68a67f45c3Smrg 698bfe6addSmrg/* First part of user prologue. */ 708bfe6addSmrg#line 62 "cfgparse.y" 71a67f45c3Smrg 72a67f45c3Smrg#ifdef DEBUG 73a67f45c3Smrg#define YYDEBUG 1 74a67f45c3Smrg#endif 75a67f45c3Smrg#include "xkbevd.h" 76a67f45c3Smrg#include <stdlib.h> 77a67f45c3Smrg 788bfe6addSmrg#line 79 "cfgparse.c" 79a67f45c3Smrg 808bfe6addSmrg# ifndef YY_CAST 818bfe6addSmrg# ifdef __cplusplus 828bfe6addSmrg# define YY_CAST(Type, Val) static_cast<Type> (Val) 838bfe6addSmrg# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) 848bfe6addSmrg# else 858bfe6addSmrg# define YY_CAST(Type, Val) ((Type) (Val)) 868bfe6addSmrg# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) 878bfe6addSmrg# endif 888bfe6addSmrg# endif 89a67f45c3Smrg# ifndef YY_NULLPTR 908bfe6addSmrg# if defined __cplusplus 918bfe6addSmrg# if 201103L <= __cplusplus 928bfe6addSmrg# define YY_NULLPTR nullptr 938bfe6addSmrg# else 948bfe6addSmrg# define YY_NULLPTR 0 958bfe6addSmrg# endif 96a67f45c3Smrg# else 978bfe6addSmrg# define YY_NULLPTR ((void*)0) 98a67f45c3Smrg# endif 99a67f45c3Smrg# endif 100a67f45c3Smrg 101a67f45c3Smrg 102a67f45c3Smrg/* Debug traces. */ 103a67f45c3Smrg#ifndef YYDEBUG 104a67f45c3Smrg# define YYDEBUG 0 105a67f45c3Smrg#endif 106a67f45c3Smrg#if YYDEBUG 107a67f45c3Smrgextern int yydebug; 108a67f45c3Smrg#endif 109a67f45c3Smrg 1108bfe6addSmrg/* Token kinds. */ 11176910425Smrg#ifndef YYTOKENTYPE 11276910425Smrg# define YYTOKENTYPE 113a67f45c3Smrg enum yytokentype 114a67f45c3Smrg { 1158bfe6addSmrg YYEMPTY = -2, 1168bfe6addSmrg END_OF_FILE = 0, /* END_OF_FILE */ 1178bfe6addSmrg YYerror = 256, /* error */ 1188bfe6addSmrg YYUNDEF = 257, /* "invalid token" */ 1198bfe6addSmrg ERROR = 255, /* ERROR */ 1208bfe6addSmrg BELL = 1, /* BELL */ 1218bfe6addSmrg ACCESSX = 2, /* ACCESSX */ 1228bfe6addSmrg MESSAGE = 3, /* MESSAGE */ 1238bfe6addSmrg NONE = 20, /* NONE */ 1248bfe6addSmrg IGNORE = 21, /* IGNORE */ 1258bfe6addSmrg ECHO = 22, /* ECHO */ 1268bfe6addSmrg PRINT_EV = 23, /* PRINT_EV */ 1278bfe6addSmrg SHELL = 24, /* SHELL */ 1288bfe6addSmrg SOUND = 25, /* SOUND */ 1298bfe6addSmrg EQUALS = 40, /* EQUALS */ 1308bfe6addSmrg PLUS = 41, /* PLUS */ 1318bfe6addSmrg MINUS = 42, /* MINUS */ 1328bfe6addSmrg DIVIDE = 43, /* DIVIDE */ 1338bfe6addSmrg TIMES = 44, /* TIMES */ 1348bfe6addSmrg OBRACE = 45, /* OBRACE */ 1358bfe6addSmrg CBRACE = 46, /* CBRACE */ 1368bfe6addSmrg OPAREN = 47, /* OPAREN */ 1378bfe6addSmrg CPAREN = 48, /* CPAREN */ 1388bfe6addSmrg OBRACKET = 49, /* OBRACKET */ 1398bfe6addSmrg CBRACKET = 50, /* CBRACKET */ 1408bfe6addSmrg DOT = 51, /* DOT */ 1418bfe6addSmrg COMMA = 52, /* COMMA */ 1428bfe6addSmrg SEMI = 53, /* SEMI */ 1438bfe6addSmrg EXCLAM = 54, /* EXCLAM */ 1448bfe6addSmrg INVERT = 55, /* INVERT */ 1458bfe6addSmrg STRING = 60, /* STRING */ 1468bfe6addSmrg INTEGER = 61, /* INTEGER */ 1478bfe6addSmrg FLOAT = 62, /* FLOAT */ 1488bfe6addSmrg IDENT = 63, /* IDENT */ 1498bfe6addSmrg KEYNAME = 64 /* KEYNAME */ 150a67f45c3Smrg }; 1518bfe6addSmrg typedef enum yytokentype yytoken_kind_t; 15276910425Smrg#endif 1538bfe6addSmrg/* Token kinds. */ 1548bfe6addSmrg#define YYEMPTY -2 15576910425Smrg#define END_OF_FILE 0 1568bfe6addSmrg#define YYerror 256 1578bfe6addSmrg#define YYUNDEF 257 15876910425Smrg#define ERROR 255 15976910425Smrg#define BELL 1 16076910425Smrg#define ACCESSX 2 16176910425Smrg#define MESSAGE 3 16276910425Smrg#define NONE 20 16376910425Smrg#define IGNORE 21 16476910425Smrg#define ECHO 22 16576910425Smrg#define PRINT_EV 23 16676910425Smrg#define SHELL 24 16776910425Smrg#define SOUND 25 16876910425Smrg#define EQUALS 40 16976910425Smrg#define PLUS 41 17076910425Smrg#define MINUS 42 17176910425Smrg#define DIVIDE 43 17276910425Smrg#define TIMES 44 17376910425Smrg#define OBRACE 45 17476910425Smrg#define CBRACE 46 17576910425Smrg#define OPAREN 47 17676910425Smrg#define CPAREN 48 17776910425Smrg#define OBRACKET 49 17876910425Smrg#define CBRACKET 50 17976910425Smrg#define DOT 51 18076910425Smrg#define COMMA 52 18176910425Smrg#define SEMI 53 18276910425Smrg#define EXCLAM 54 18376910425Smrg#define INVERT 55 18476910425Smrg#define STRING 60 18576910425Smrg#define INTEGER 61 18676910425Smrg#define FLOAT 62 18776910425Smrg#define IDENT 63 18876910425Smrg#define KEYNAME 64 18976910425Smrg 190a67f45c3Smrg/* Value type. */ 191db17cd6dSmrg#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 192a67f45c3Smrgunion YYSTYPE 193db17cd6dSmrg{ 1948bfe6addSmrg#line 75 "cfgparse.y" 195a67f45c3Smrg 19676910425Smrg char * str; 19776910425Smrg int ival; 19876910425Smrg CfgEntryPtr entry; 19976910425Smrg ActDefPtr act; 200a67f45c3Smrg 2018bfe6addSmrg#line 202 "cfgparse.c" 202a67f45c3Smrg 2038bfe6addSmrg}; 204a67f45c3Smrgtypedef union YYSTYPE YYSTYPE; 20576910425Smrg# define YYSTYPE_IS_TRIVIAL 1 206a67f45c3Smrg# define YYSTYPE_IS_DECLARED 1 20776910425Smrg#endif 20876910425Smrg 20976910425Smrg 210a67f45c3Smrgextern YYSTYPE yylval; 211a67f45c3Smrg 2128bfe6addSmrg 213a67f45c3Smrgint yyparse (void); 21476910425Smrg 21576910425Smrg 21676910425Smrg 2178bfe6addSmrg/* Symbol kind. */ 2188bfe6addSmrgenum yysymbol_kind_t 2198bfe6addSmrg{ 2208bfe6addSmrg YYSYMBOL_YYEMPTY = -2, 2218bfe6addSmrg YYSYMBOL_YYEOF = 0, /* END_OF_FILE */ 2228bfe6addSmrg YYSYMBOL_YYerror = 1, /* error */ 2238bfe6addSmrg YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ 2248bfe6addSmrg YYSYMBOL_ERROR = 3, /* ERROR */ 2258bfe6addSmrg YYSYMBOL_BELL = 4, /* BELL */ 2268bfe6addSmrg YYSYMBOL_ACCESSX = 5, /* ACCESSX */ 2278bfe6addSmrg YYSYMBOL_MESSAGE = 6, /* MESSAGE */ 2288bfe6addSmrg YYSYMBOL_NONE = 7, /* NONE */ 2298bfe6addSmrg YYSYMBOL_IGNORE = 8, /* IGNORE */ 2308bfe6addSmrg YYSYMBOL_ECHO = 9, /* ECHO */ 2318bfe6addSmrg YYSYMBOL_PRINT_EV = 10, /* PRINT_EV */ 2328bfe6addSmrg YYSYMBOL_SHELL = 11, /* SHELL */ 2338bfe6addSmrg YYSYMBOL_SOUND = 12, /* SOUND */ 2348bfe6addSmrg YYSYMBOL_EQUALS = 13, /* EQUALS */ 2358bfe6addSmrg YYSYMBOL_PLUS = 14, /* PLUS */ 2368bfe6addSmrg YYSYMBOL_MINUS = 15, /* MINUS */ 2378bfe6addSmrg YYSYMBOL_DIVIDE = 16, /* DIVIDE */ 2388bfe6addSmrg YYSYMBOL_TIMES = 17, /* TIMES */ 2398bfe6addSmrg YYSYMBOL_OBRACE = 18, /* OBRACE */ 2408bfe6addSmrg YYSYMBOL_CBRACE = 19, /* CBRACE */ 2418bfe6addSmrg YYSYMBOL_OPAREN = 20, /* OPAREN */ 2428bfe6addSmrg YYSYMBOL_CPAREN = 21, /* CPAREN */ 2438bfe6addSmrg YYSYMBOL_OBRACKET = 22, /* OBRACKET */ 2448bfe6addSmrg YYSYMBOL_CBRACKET = 23, /* CBRACKET */ 2458bfe6addSmrg YYSYMBOL_DOT = 24, /* DOT */ 2468bfe6addSmrg YYSYMBOL_COMMA = 25, /* COMMA */ 2478bfe6addSmrg YYSYMBOL_SEMI = 26, /* SEMI */ 2488bfe6addSmrg YYSYMBOL_EXCLAM = 27, /* EXCLAM */ 2498bfe6addSmrg YYSYMBOL_INVERT = 28, /* INVERT */ 2508bfe6addSmrg YYSYMBOL_STRING = 29, /* STRING */ 2518bfe6addSmrg YYSYMBOL_INTEGER = 30, /* INTEGER */ 2528bfe6addSmrg YYSYMBOL_FLOAT = 31, /* FLOAT */ 2538bfe6addSmrg YYSYMBOL_IDENT = 32, /* IDENT */ 2548bfe6addSmrg YYSYMBOL_KEYNAME = 33, /* KEYNAME */ 2558bfe6addSmrg YYSYMBOL_YYACCEPT = 34, /* $accept */ 2568bfe6addSmrg YYSYMBOL_CfgFile = 35, /* CfgFile */ 2578bfe6addSmrg YYSYMBOL_CfgEntryList = 36, /* CfgEntryList */ 2588bfe6addSmrg YYSYMBOL_CfgEntry = 37, /* CfgEntry */ 2598bfe6addSmrg YYSYMBOL_VarDef = 38, /* VarDef */ 2608bfe6addSmrg YYSYMBOL_EventDef = 39, /* EventDef */ 2618bfe6addSmrg YYSYMBOL_EventType = 40, /* EventType */ 2628bfe6addSmrg YYSYMBOL_ActionDef = 41, /* ActionDef */ 2638bfe6addSmrg YYSYMBOL_ActionType = 42, /* ActionType */ 2648bfe6addSmrg YYSYMBOL_OptNameSpec = 43, /* OptNameSpec */ 2658bfe6addSmrg YYSYMBOL_NameSpec = 44, /* NameSpec */ 2668bfe6addSmrg YYSYMBOL_Ident = 45, /* Ident */ 2678bfe6addSmrg YYSYMBOL_OptString = 46, /* OptString */ 2688bfe6addSmrg YYSYMBOL_String = 47 /* String */ 2698bfe6addSmrg}; 2708bfe6addSmrgtypedef enum yysymbol_kind_t yysymbol_kind_t; 2718bfe6addSmrg 2728bfe6addSmrg 273a67f45c3Smrg 27476910425Smrg 275db17cd6dSmrg#ifdef short 276db17cd6dSmrg# undef short 27776910425Smrg#endif 278db17cd6dSmrg 2798bfe6addSmrg/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure 2808bfe6addSmrg <limits.h> and (if available) <stdint.h> are included 2818bfe6addSmrg so that the code can choose integer types of a good width. */ 2828bfe6addSmrg 2838bfe6addSmrg#ifndef __PTRDIFF_MAX__ 2848bfe6addSmrg# include <limits.h> /* INFRINGES ON USER NAME SPACE */ 2858bfe6addSmrg# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ 2868bfe6addSmrg# include <stdint.h> /* INFRINGES ON USER NAME SPACE */ 2878bfe6addSmrg# define YY_STDINT_H 2888bfe6addSmrg# endif 28976910425Smrg#endif 290db17cd6dSmrg 2918bfe6addSmrg/* Narrow types that promote to a signed type and that can represent a 2928bfe6addSmrg signed or unsigned integer of at least N bits. In tables they can 2938bfe6addSmrg save space and decrease cache pressure. Promoting to a signed type 2948bfe6addSmrg helps avoid bugs in integer arithmetic. */ 2958bfe6addSmrg 2968bfe6addSmrg#ifdef __INT_LEAST8_MAX__ 2978bfe6addSmrgtypedef __INT_LEAST8_TYPE__ yytype_int8; 2988bfe6addSmrg#elif defined YY_STDINT_H 2998bfe6addSmrgtypedef int_least8_t yytype_int8; 300db17cd6dSmrg#else 301a67f45c3Smrgtypedef signed char yytype_int8; 302db17cd6dSmrg#endif 303db17cd6dSmrg 3048bfe6addSmrg#ifdef __INT_LEAST16_MAX__ 3058bfe6addSmrgtypedef __INT_LEAST16_TYPE__ yytype_int16; 3068bfe6addSmrg#elif defined YY_STDINT_H 3078bfe6addSmrgtypedef int_least16_t yytype_int16; 308db17cd6dSmrg#else 3098bfe6addSmrgtypedef short yytype_int16; 310db17cd6dSmrg#endif 311db17cd6dSmrg 3128bfe6addSmrg/* Work around bug in HP-UX 11.23, which defines these macros 3138bfe6addSmrg incorrectly for preprocessor constants. This workaround can likely 3148bfe6addSmrg be removed in 2023, as HPE has promised support for HP-UX 11.23 3158bfe6addSmrg (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of 3168bfe6addSmrg <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ 3178bfe6addSmrg#ifdef __hpux 3188bfe6addSmrg# undef UINT_LEAST8_MAX 3198bfe6addSmrg# undef UINT_LEAST16_MAX 3208bfe6addSmrg# define UINT_LEAST8_MAX 255 3218bfe6addSmrg# define UINT_LEAST16_MAX 65535 3228bfe6addSmrg#endif 3238bfe6addSmrg 3248bfe6addSmrg#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ 3258bfe6addSmrgtypedef __UINT_LEAST8_TYPE__ yytype_uint8; 3268bfe6addSmrg#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ 3278bfe6addSmrg && UINT_LEAST8_MAX <= INT_MAX) 3288bfe6addSmrgtypedef uint_least8_t yytype_uint8; 3298bfe6addSmrg#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX 3308bfe6addSmrgtypedef unsigned char yytype_uint8; 3318bfe6addSmrg#else 3328bfe6addSmrgtypedef short yytype_uint8; 3338bfe6addSmrg#endif 3348bfe6addSmrg 3358bfe6addSmrg#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ 3368bfe6addSmrgtypedef __UINT_LEAST16_TYPE__ yytype_uint16; 3378bfe6addSmrg#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ 3388bfe6addSmrg && UINT_LEAST16_MAX <= INT_MAX) 3398bfe6addSmrgtypedef uint_least16_t yytype_uint16; 3408bfe6addSmrg#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX 3418bfe6addSmrgtypedef unsigned short yytype_uint16; 342db17cd6dSmrg#else 3438bfe6addSmrgtypedef int yytype_uint16; 3448bfe6addSmrg#endif 3458bfe6addSmrg 3468bfe6addSmrg#ifndef YYPTRDIFF_T 3478bfe6addSmrg# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ 3488bfe6addSmrg# define YYPTRDIFF_T __PTRDIFF_TYPE__ 3498bfe6addSmrg# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ 3508bfe6addSmrg# elif defined PTRDIFF_MAX 3518bfe6addSmrg# ifndef ptrdiff_t 3528bfe6addSmrg# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 3538bfe6addSmrg# endif 3548bfe6addSmrg# define YYPTRDIFF_T ptrdiff_t 3558bfe6addSmrg# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX 3568bfe6addSmrg# else 3578bfe6addSmrg# define YYPTRDIFF_T long 3588bfe6addSmrg# define YYPTRDIFF_MAXIMUM LONG_MAX 3598bfe6addSmrg# endif 36076910425Smrg#endif 361db17cd6dSmrg 362db17cd6dSmrg#ifndef YYSIZE_T 363db17cd6dSmrg# ifdef __SIZE_TYPE__ 364db17cd6dSmrg# define YYSIZE_T __SIZE_TYPE__ 365db17cd6dSmrg# elif defined size_t 366db17cd6dSmrg# define YYSIZE_T size_t 3678bfe6addSmrg# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ 368db17cd6dSmrg# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 369db17cd6dSmrg# define YYSIZE_T size_t 370db17cd6dSmrg# else 3718bfe6addSmrg# define YYSIZE_T unsigned 372db17cd6dSmrg# endif 37376910425Smrg#endif 37476910425Smrg 3758bfe6addSmrg#define YYSIZE_MAXIMUM \ 3768bfe6addSmrg YY_CAST (YYPTRDIFF_T, \ 3778bfe6addSmrg (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ 3788bfe6addSmrg ? YYPTRDIFF_MAXIMUM \ 3798bfe6addSmrg : YY_CAST (YYSIZE_T, -1))) 3808bfe6addSmrg 3818bfe6addSmrg#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) 3828bfe6addSmrg 3838bfe6addSmrg 3848bfe6addSmrg/* Stored state numbers (used for stacks). */ 3858bfe6addSmrgtypedef yytype_int8 yy_state_t; 3868bfe6addSmrg 3878bfe6addSmrg/* State numbers in computations. */ 3888bfe6addSmrgtypedef int yy_state_fast_t; 389db17cd6dSmrg 39076910425Smrg#ifndef YY_ 391a67f45c3Smrg# if defined YYENABLE_NLS && YYENABLE_NLS 39276910425Smrg# if ENABLE_NLS 39376910425Smrg# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 394a67f45c3Smrg# define YY_(Msgid) dgettext ("bison-runtime", Msgid) 39576910425Smrg# endif 39676910425Smrg# endif 39776910425Smrg# ifndef YY_ 398a67f45c3Smrg# define YY_(Msgid) Msgid 399a67f45c3Smrg# endif 400a67f45c3Smrg#endif 401a67f45c3Smrg 402a67f45c3Smrg 403a67f45c3Smrg#ifndef YY_ATTRIBUTE_PURE 4048bfe6addSmrg# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) 4058bfe6addSmrg# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) 4068bfe6addSmrg# else 4078bfe6addSmrg# define YY_ATTRIBUTE_PURE 4088bfe6addSmrg# endif 409a67f45c3Smrg#endif 410a67f45c3Smrg 411a67f45c3Smrg#ifndef YY_ATTRIBUTE_UNUSED 4128bfe6addSmrg# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) 4138bfe6addSmrg# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 414a67f45c3Smrg# else 4158bfe6addSmrg# define YY_ATTRIBUTE_UNUSED 41676910425Smrg# endif 41776910425Smrg#endif 41876910425Smrg 419db17cd6dSmrg/* Suppress unused-variable warnings by "using" E. */ 420db17cd6dSmrg#if ! defined lint || defined __GNUC__ 4218bfe6addSmrg# define YY_USE(E) ((void) (E)) 422db17cd6dSmrg#else 4238bfe6addSmrg# define YY_USE(E) /* empty */ 424db17cd6dSmrg#endif 425db17cd6dSmrg 426a67f45c3Smrg/* Suppress an incorrect diagnostic about yylval being uninitialized. */ 4278bfe6addSmrg#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ 4288bfe6addSmrg# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 4298bfe6addSmrg# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 4308bfe6addSmrg _Pragma ("GCC diagnostic push") \ 4318bfe6addSmrg _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") 4328bfe6addSmrg# else 4338bfe6addSmrg# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 4348bfe6addSmrg _Pragma ("GCC diagnostic push") \ 4358bfe6addSmrg _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ 436a67f45c3Smrg _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 4378bfe6addSmrg# endif 4388bfe6addSmrg# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 439a67f45c3Smrg _Pragma ("GCC diagnostic pop") 440db17cd6dSmrg#else 441a67f45c3Smrg# define YY_INITIAL_VALUE(Value) Value 442db17cd6dSmrg#endif 443a67f45c3Smrg#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 444a67f45c3Smrg# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 445a67f45c3Smrg# define YY_IGNORE_MAYBE_UNINITIALIZED_END 446a67f45c3Smrg#endif 447a67f45c3Smrg#ifndef YY_INITIAL_VALUE 448a67f45c3Smrg# define YY_INITIAL_VALUE(Value) /* Nothing. */ 449db17cd6dSmrg#endif 450db17cd6dSmrg 4518bfe6addSmrg#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ 4528bfe6addSmrg# define YY_IGNORE_USELESS_CAST_BEGIN \ 4538bfe6addSmrg _Pragma ("GCC diagnostic push") \ 4548bfe6addSmrg _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") 4558bfe6addSmrg# define YY_IGNORE_USELESS_CAST_END \ 4568bfe6addSmrg _Pragma ("GCC diagnostic pop") 4578bfe6addSmrg#endif 4588bfe6addSmrg#ifndef YY_IGNORE_USELESS_CAST_BEGIN 4598bfe6addSmrg# define YY_IGNORE_USELESS_CAST_BEGIN 4608bfe6addSmrg# define YY_IGNORE_USELESS_CAST_END 4618bfe6addSmrg#endif 462a67f45c3Smrg 4638bfe6addSmrg 4648bfe6addSmrg#define YY_ASSERT(E) ((void) (0 && (E))) 4658bfe6addSmrg 4668bfe6addSmrg#if !defined yyoverflow 46776910425Smrg 46876910425Smrg/* The parser invokes alloca or malloc; define the necessary symbols. */ 46976910425Smrg 47076910425Smrg# ifdef YYSTACK_USE_ALLOCA 47176910425Smrg# if YYSTACK_USE_ALLOCA 47276910425Smrg# ifdef __GNUC__ 47376910425Smrg# define YYSTACK_ALLOC __builtin_alloca 474db17cd6dSmrg# elif defined __BUILTIN_VA_ARG_INCR 475db17cd6dSmrg# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 476db17cd6dSmrg# elif defined _AIX 477db17cd6dSmrg# define YYSTACK_ALLOC __alloca 478db17cd6dSmrg# elif defined _MSC_VER 479db17cd6dSmrg# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 480db17cd6dSmrg# define alloca _alloca 48176910425Smrg# else 48276910425Smrg# define YYSTACK_ALLOC alloca 483a67f45c3Smrg# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 48476910425Smrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 485a67f45c3Smrg /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 486a67f45c3Smrg# ifndef EXIT_SUCCESS 487a67f45c3Smrg# define EXIT_SUCCESS 0 488db17cd6dSmrg# endif 48976910425Smrg# endif 49076910425Smrg# endif 49176910425Smrg# endif 49276910425Smrg# endif 49376910425Smrg 49476910425Smrg# ifdef YYSTACK_ALLOC 495a67f45c3Smrg /* Pacify GCC's 'empty if-body' warning. */ 496a67f45c3Smrg# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 49776910425Smrg# ifndef YYSTACK_ALLOC_MAXIMUM 49876910425Smrg /* The OS might guarantee only one guard page at the bottom of the stack, 49976910425Smrg and a page size can be as small as 4096 bytes. So we cannot safely 50076910425Smrg invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 50176910425Smrg to allow for a few compiler-allocated temporary stack slots. */ 502db17cd6dSmrg# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 50376910425Smrg# endif 50476910425Smrg# else 50576910425Smrg# define YYSTACK_ALLOC YYMALLOC 50676910425Smrg# define YYSTACK_FREE YYFREE 50776910425Smrg# ifndef YYSTACK_ALLOC_MAXIMUM 508db17cd6dSmrg# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 50976910425Smrg# endif 510a67f45c3Smrg# if (defined __cplusplus && ! defined EXIT_SUCCESS \ 511db17cd6dSmrg && ! ((defined YYMALLOC || defined malloc) \ 512a67f45c3Smrg && (defined YYFREE || defined free))) 513db17cd6dSmrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 514a67f45c3Smrg# ifndef EXIT_SUCCESS 515a67f45c3Smrg# define EXIT_SUCCESS 0 516db17cd6dSmrg# endif 51776910425Smrg# endif 51876910425Smrg# ifndef YYMALLOC 51976910425Smrg# define YYMALLOC malloc 520a67f45c3Smrg# if ! defined malloc && ! defined EXIT_SUCCESS 52176910425Smrgvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 52276910425Smrg# endif 52376910425Smrg# endif 52476910425Smrg# ifndef YYFREE 52576910425Smrg# define YYFREE free 526a67f45c3Smrg# if ! defined free && ! defined EXIT_SUCCESS 52776910425Smrgvoid free (void *); /* INFRINGES ON USER NAME SPACE */ 52876910425Smrg# endif 52976910425Smrg# endif 53076910425Smrg# endif 5318bfe6addSmrg#endif /* !defined yyoverflow */ 53276910425Smrg 533db17cd6dSmrg#if (! defined yyoverflow \ 534db17cd6dSmrg && (! defined __cplusplus \ 535a67f45c3Smrg || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 53676910425Smrg 53776910425Smrg/* A type that is properly aligned for any stack member. */ 53876910425Smrgunion yyalloc 53976910425Smrg{ 5408bfe6addSmrg yy_state_t yyss_alloc; 541a67f45c3Smrg YYSTYPE yyvs_alloc; 542a67f45c3Smrg}; 54376910425Smrg 54476910425Smrg/* The size of the maximum gap between one aligned stack and the next. */ 5458bfe6addSmrg# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) 54676910425Smrg 54776910425Smrg/* The size of an array large to enough to hold all stacks, each with 54876910425Smrg N elements. */ 54976910425Smrg# define YYSTACK_BYTES(N) \ 5508bfe6addSmrg ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ 55176910425Smrg + YYSTACK_GAP_MAXIMUM) 55276910425Smrg 553a67f45c3Smrg# define YYCOPY_NEEDED 1 55476910425Smrg 55576910425Smrg/* Relocate STACK from its old location to the new one. The 55676910425Smrg local variables YYSIZE and YYSTACKSIZE give the old and new number of 55776910425Smrg elements in the stack, and YYPTR gives the new location of the 55876910425Smrg stack. Advance YYPTR to a properly aligned location for the next 55976910425Smrg stack. */ 560a67f45c3Smrg# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 561a67f45c3Smrg do \ 562a67f45c3Smrg { \ 5638bfe6addSmrg YYPTRDIFF_T yynewbytes; \ 564a67f45c3Smrg YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 565a67f45c3Smrg Stack = &yyptr->Stack_alloc; \ 5668bfe6addSmrg yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ 5678bfe6addSmrg yyptr += yynewbytes / YYSIZEOF (*yyptr); \ 568a67f45c3Smrg } \ 569a67f45c3Smrg while (0) 57076910425Smrg 57176910425Smrg#endif 57276910425Smrg 573a67f45c3Smrg#if defined YYCOPY_NEEDED && YYCOPY_NEEDED 574a67f45c3Smrg/* Copy COUNT objects from SRC to DST. The source and destination do 575a67f45c3Smrg not overlap. */ 576a67f45c3Smrg# ifndef YYCOPY 577a67f45c3Smrg# if defined __GNUC__ && 1 < __GNUC__ 578a67f45c3Smrg# define YYCOPY(Dst, Src, Count) \ 5798bfe6addSmrg __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) 580a67f45c3Smrg# else 581a67f45c3Smrg# define YYCOPY(Dst, Src, Count) \ 582a67f45c3Smrg do \ 583a67f45c3Smrg { \ 5848bfe6addSmrg YYPTRDIFF_T yyi; \ 585a67f45c3Smrg for (yyi = 0; yyi < (Count); yyi++) \ 586a67f45c3Smrg (Dst)[yyi] = (Src)[yyi]; \ 587a67f45c3Smrg } \ 588a67f45c3Smrg while (0) 589a67f45c3Smrg# endif 590a67f45c3Smrg# endif 591a67f45c3Smrg#endif /* !YYCOPY_NEEDED */ 592a67f45c3Smrg 593db17cd6dSmrg/* YYFINAL -- State number of the termination state. */ 59476910425Smrg#define YYFINAL 12 59576910425Smrg/* YYLAST -- Last index in YYTABLE. */ 59676910425Smrg#define YYLAST 28 59776910425Smrg 598db17cd6dSmrg/* YYNTOKENS -- Number of terminals. */ 59976910425Smrg#define YYNTOKENS 34 600db17cd6dSmrg/* YYNNTS -- Number of nonterminals. */ 60176910425Smrg#define YYNNTS 14 602db17cd6dSmrg/* YYNRULES -- Number of rules. */ 60376910425Smrg#define YYNRULES 27 604a67f45c3Smrg/* YYNSTATES -- Number of states. */ 60576910425Smrg#define YYNSTATES 33 60676910425Smrg 6078bfe6addSmrg/* YYMAXUTOK -- Last valid token kind. */ 60876910425Smrg#define YYMAXUTOK 257 60976910425Smrg 6108bfe6addSmrg 6118bfe6addSmrg/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM 6128bfe6addSmrg as returned by yylex, with out-of-bounds checking. */ 6138bfe6addSmrg#define YYTRANSLATE(YYX) \ 6148bfe6addSmrg (0 <= (YYX) && (YYX) <= YYMAXUTOK \ 6158bfe6addSmrg ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ 6168bfe6addSmrg : YYSYMBOL_YYUNDEF) 61776910425Smrg 618a67f45c3Smrg/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 6198bfe6addSmrg as returned by yylex. */ 6208bfe6addSmrgstatic const yytype_int8 yytranslate[] = 62176910425Smrg{ 62276910425Smrg 0, 4, 5, 6, 2, 2, 2, 2, 2, 2, 62376910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 62476910425Smrg 7, 8, 9, 10, 11, 12, 2, 2, 2, 2, 62576910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 62676910425Smrg 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 62776910425Smrg 23, 24, 25, 26, 27, 28, 2, 2, 2, 2, 62876910425Smrg 29, 30, 31, 32, 33, 2, 2, 2, 2, 2, 62976910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63076910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63176910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63276910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63376910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63476910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63576910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63676910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63776910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63876910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63976910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64076910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64176910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64276910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64376910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64476910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64576910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64676910425Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64776910425Smrg 2, 2, 2, 2, 2, 3, 1, 2 64876910425Smrg}; 64976910425Smrg 65076910425Smrg#if YYDEBUG 6518bfe6addSmrg/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 652db17cd6dSmrgstatic const yytype_uint8 yyrline[] = 65376910425Smrg{ 6549ff100acSmrg 0, 86, 86, 90, 102, 105, 113, 116, 133, 150, 6559ff100acSmrg 151, 152, 155, 167, 168, 169, 170, 171, 172, 173, 6569ff100acSmrg 176, 177, 180, 181, 184, 187, 188, 191 65776910425Smrg}; 65876910425Smrg#endif 65976910425Smrg 6608bfe6addSmrg/** Accessing symbol of state STATE. */ 6618bfe6addSmrg#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) 6628bfe6addSmrg 6638bfe6addSmrg#if YYDEBUG || 0 6648bfe6addSmrg/* The user-facing name of the symbol whose (internal) number is 6658bfe6addSmrg YYSYMBOL. No bounds checking. */ 6668bfe6addSmrgstatic const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; 6678bfe6addSmrg 66876910425Smrg/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 669db17cd6dSmrg First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 67076910425Smrgstatic const char *const yytname[] = 67176910425Smrg{ 6728bfe6addSmrg "END_OF_FILE", "error", "\"invalid token\"", "ERROR", "BELL", "ACCESSX", 67376910425Smrg "MESSAGE", "NONE", "IGNORE", "ECHO", "PRINT_EV", "SHELL", "SOUND", 67476910425Smrg "EQUALS", "PLUS", "MINUS", "DIVIDE", "TIMES", "OBRACE", "CBRACE", 67576910425Smrg "OPAREN", "CPAREN", "OBRACKET", "CBRACKET", "DOT", "COMMA", "SEMI", 67676910425Smrg "EXCLAM", "INVERT", "STRING", "INTEGER", "FLOAT", "IDENT", "KEYNAME", 67776910425Smrg "$accept", "CfgFile", "CfgEntryList", "CfgEntry", "VarDef", "EventDef", 67876910425Smrg "EventType", "ActionDef", "ActionType", "OptNameSpec", "NameSpec", 679a67f45c3Smrg "Ident", "OptString", "String", YY_NULLPTR 68076910425Smrg}; 68176910425Smrg 6828bfe6addSmrgstatic const char * 6838bfe6addSmrgyysymbol_name (yysymbol_kind_t yysymbol) 68476910425Smrg{ 6858bfe6addSmrg return yytname[yysymbol]; 6868bfe6addSmrg} 6878bfe6addSmrg#endif 68876910425Smrg 6898bfe6addSmrg#define YYPACT_NINF (-20) 69076910425Smrg 6918bfe6addSmrg#define yypact_value_is_default(Yyn) \ 6928bfe6addSmrg ((Yyn) == YYPACT_NINF) 69376910425Smrg 6948bfe6addSmrg#define YYTABLE_NINF (-1) 69576910425Smrg 6968bfe6addSmrg#define yytable_value_is_error(Yyn) \ 697a67f45c3Smrg 0 69876910425Smrg 6998bfe6addSmrg/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 7008bfe6addSmrg STATE-NUM. */ 701db17cd6dSmrgstatic const yytype_int8 yypact[] = 70276910425Smrg{ 70376910425Smrg -4, -20, -20, -20, -20, 3, -4, -20, -20, -3, 70476910425Smrg -6, 2, -20, -20, -20, -20, -20, -20, -20, -20, 70576910425Smrg -20, -13, -19, -19, -20, -20, -20, -2, -20, -20, 70676910425Smrg -20, -20, -20 70776910425Smrg}; 70876910425Smrg 7098bfe6addSmrg/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 7108bfe6addSmrg Performed when YYTABLE does not specify something else to do. Zero 7118bfe6addSmrg means the default is an error. */ 7128bfe6addSmrgstatic const yytype_int8 yydefact[] = 713a67f45c3Smrg{ 714a67f45c3Smrg 0, 9, 10, 11, 24, 0, 2, 4, 6, 19, 715a67f45c3Smrg 0, 0, 1, 3, 13, 14, 15, 16, 17, 18, 716a67f45c3Smrg 5, 26, 21, 0, 27, 12, 25, 0, 20, 22, 717a67f45c3Smrg 23, 7, 8 718a67f45c3Smrg}; 719a67f45c3Smrg 7208bfe6addSmrg/* YYPGOTO[NTERM-NUM]. */ 721db17cd6dSmrgstatic const yytype_int8 yypgoto[] = 72276910425Smrg{ 72376910425Smrg -20, -20, -20, 11, -20, -20, -20, -20, -20, -20, 72476910425Smrg -5, -11, -20, -1 72576910425Smrg}; 72676910425Smrg 7278bfe6addSmrg/* YYDEFGOTO[NTERM-NUM]. */ 728a67f45c3Smrgstatic const yytype_int8 yydefgoto[] = 729a67f45c3Smrg{ 7308bfe6addSmrg 0, 5, 6, 7, 8, 9, 10, 20, 21, 27, 731a67f45c3Smrg 28, 11, 25, 30 732a67f45c3Smrg}; 733a67f45c3Smrg 7348bfe6addSmrg/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 7358bfe6addSmrg positive, shift that token. If negative, reduce the rule whose 7368bfe6addSmrg number is the opposite. If YYTABLE_NINF, syntax error. */ 7378bfe6addSmrgstatic const yytype_int8 yytable[] = 73876910425Smrg{ 73976910425Smrg 1, 2, 3, 12, 14, 15, 16, 17, 18, 19, 74076910425Smrg 24, 29, 29, 4, 22, 23, 24, 13, 31, 32, 74176910425Smrg 26, 0, 0, 0, 0, 0, 0, 0, 4 74276910425Smrg}; 74376910425Smrg 744db17cd6dSmrgstatic const yytype_int8 yycheck[] = 74576910425Smrg{ 74676910425Smrg 4, 5, 6, 0, 7, 8, 9, 10, 11, 12, 74776910425Smrg 29, 22, 23, 32, 20, 13, 29, 6, 23, 21, 74876910425Smrg 21, -1, -1, -1, -1, -1, -1, -1, 32 74976910425Smrg}; 75076910425Smrg 7518bfe6addSmrg/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of 7528bfe6addSmrg state STATE-NUM. */ 7538bfe6addSmrgstatic const yytype_int8 yystos[] = 75476910425Smrg{ 75576910425Smrg 0, 4, 5, 6, 32, 35, 36, 37, 38, 39, 75676910425Smrg 40, 45, 0, 37, 7, 8, 9, 10, 11, 12, 75776910425Smrg 41, 42, 20, 13, 29, 46, 47, 43, 44, 45, 75876910425Smrg 47, 44, 21 75976910425Smrg}; 76076910425Smrg 7618bfe6addSmrg/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ 7628bfe6addSmrgstatic const yytype_int8 yyr1[] = 763a67f45c3Smrg{ 764a67f45c3Smrg 0, 34, 35, 36, 36, 37, 37, 38, 39, 40, 765a67f45c3Smrg 40, 40, 41, 42, 42, 42, 42, 42, 42, 42, 766a67f45c3Smrg 43, 43, 44, 44, 45, 46, 46, 47 767a67f45c3Smrg}; 768a67f45c3Smrg 7698bfe6addSmrg/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ 7708bfe6addSmrgstatic const yytype_int8 yyr2[] = 771a67f45c3Smrg{ 772a67f45c3Smrg 0, 2, 1, 2, 1, 2, 1, 3, 4, 1, 773a67f45c3Smrg 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 774a67f45c3Smrg 1, 0, 1, 1, 1, 1, 0, 1 775a67f45c3Smrg}; 77676910425Smrg 77776910425Smrg 7788bfe6addSmrgenum { YYENOMEM = -2 }; 7798bfe6addSmrg 780a67f45c3Smrg#define yyerrok (yyerrstatus = 0) 781a67f45c3Smrg#define yyclearin (yychar = YYEMPTY) 78276910425Smrg 783a67f45c3Smrg#define YYACCEPT goto yyacceptlab 784a67f45c3Smrg#define YYABORT goto yyabortlab 785a67f45c3Smrg#define YYERROR goto yyerrorlab 7868bfe6addSmrg#define YYNOMEM goto yyexhaustedlab 78776910425Smrg 78876910425Smrg 78976910425Smrg#define YYRECOVERING() (!!yyerrstatus) 79076910425Smrg 7918bfe6addSmrg#define YYBACKUP(Token, Value) \ 7928bfe6addSmrg do \ 7938bfe6addSmrg if (yychar == YYEMPTY) \ 7948bfe6addSmrg { \ 7958bfe6addSmrg yychar = (Token); \ 7968bfe6addSmrg yylval = (Value); \ 7978bfe6addSmrg YYPOPSTACK (yylen); \ 7988bfe6addSmrg yystate = *yyssp; \ 7998bfe6addSmrg goto yybackup; \ 8008bfe6addSmrg } \ 8018bfe6addSmrg else \ 8028bfe6addSmrg { \ 8038bfe6addSmrg yyerror (YY_("syntax error: cannot back up")); \ 8048bfe6addSmrg YYERROR; \ 8058bfe6addSmrg } \ 8068bfe6addSmrg while (0) 8078bfe6addSmrg 8088bfe6addSmrg/* Backward compatibility with an undocumented macro. 8098bfe6addSmrg Use YYerror or YYUNDEF. */ 8108bfe6addSmrg#define YYERRCODE YYUNDEF 81176910425Smrg 81276910425Smrg 81376910425Smrg/* Enable debugging if requested. */ 81476910425Smrg#if YYDEBUG 81576910425Smrg 81676910425Smrg# ifndef YYFPRINTF 81776910425Smrg# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 81876910425Smrg# define YYFPRINTF fprintf 81976910425Smrg# endif 82076910425Smrg 821a67f45c3Smrg# define YYDPRINTF(Args) \ 822a67f45c3Smrgdo { \ 823a67f45c3Smrg if (yydebug) \ 824a67f45c3Smrg YYFPRINTF Args; \ 825a67f45c3Smrg} while (0) 826db17cd6dSmrg 82776910425Smrg 828db17cd6dSmrg 8298bfe6addSmrg 8308bfe6addSmrg# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ 831a67f45c3Smrgdo { \ 832a67f45c3Smrg if (yydebug) \ 833a67f45c3Smrg { \ 834a67f45c3Smrg YYFPRINTF (stderr, "%s ", Title); \ 835a67f45c3Smrg yy_symbol_print (stderr, \ 8368bfe6addSmrg Kind, Value); \ 837a67f45c3Smrg YYFPRINTF (stderr, "\n"); \ 838a67f45c3Smrg } \ 839a67f45c3Smrg} while (0) 840a67f45c3Smrg 841a67f45c3Smrg 8428bfe6addSmrg/*-----------------------------------. 8438bfe6addSmrg| Print this symbol's value on YYO. | 8448bfe6addSmrg`-----------------------------------*/ 845db17cd6dSmrg 846db17cd6dSmrgstatic void 8478bfe6addSmrgyy_symbol_value_print (FILE *yyo, 8488bfe6addSmrg yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) 849db17cd6dSmrg{ 8508bfe6addSmrg FILE *yyoutput = yyo; 8518bfe6addSmrg YY_USE (yyoutput); 852db17cd6dSmrg if (!yyvaluep) 853db17cd6dSmrg return; 8548bfe6addSmrg YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 8558bfe6addSmrg YY_USE (yykind); 8568bfe6addSmrg YY_IGNORE_MAYBE_UNINITIALIZED_END 857db17cd6dSmrg} 858db17cd6dSmrg 859db17cd6dSmrg 8608bfe6addSmrg/*---------------------------. 8618bfe6addSmrg| Print this symbol on YYO. | 8628bfe6addSmrg`---------------------------*/ 863db17cd6dSmrg 864db17cd6dSmrgstatic void 8658bfe6addSmrgyy_symbol_print (FILE *yyo, 8668bfe6addSmrg yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) 867db17cd6dSmrg{ 8688bfe6addSmrg YYFPRINTF (yyo, "%s %s (", 8698bfe6addSmrg yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); 870db17cd6dSmrg 8718bfe6addSmrg yy_symbol_value_print (yyo, yykind, yyvaluep); 8728bfe6addSmrg YYFPRINTF (yyo, ")"); 873db17cd6dSmrg} 87476910425Smrg 87576910425Smrg/*------------------------------------------------------------------. 87676910425Smrg| yy_stack_print -- Print the state stack from its BOTTOM up to its | 87776910425Smrg| TOP (included). | 87876910425Smrg`------------------------------------------------------------------*/ 87976910425Smrg 88076910425Smrgstatic void 8818bfe6addSmrgyy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) 88276910425Smrg{ 88376910425Smrg YYFPRINTF (stderr, "Stack now"); 884a67f45c3Smrg for (; yybottom <= yytop; yybottom++) 885a67f45c3Smrg { 886a67f45c3Smrg int yybot = *yybottom; 887a67f45c3Smrg YYFPRINTF (stderr, " %d", yybot); 888a67f45c3Smrg } 88976910425Smrg YYFPRINTF (stderr, "\n"); 89076910425Smrg} 89176910425Smrg 892a67f45c3Smrg# define YY_STACK_PRINT(Bottom, Top) \ 893a67f45c3Smrgdo { \ 894a67f45c3Smrg if (yydebug) \ 895a67f45c3Smrg yy_stack_print ((Bottom), (Top)); \ 896a67f45c3Smrg} while (0) 89776910425Smrg 89876910425Smrg 89976910425Smrg/*------------------------------------------------. 90076910425Smrg| Report that the YYRULE is going to be reduced. | 90176910425Smrg`------------------------------------------------*/ 90276910425Smrg 90376910425Smrgstatic void 9048bfe6addSmrgyy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, 9058bfe6addSmrg int yyrule) 90676910425Smrg{ 9078bfe6addSmrg int yylno = yyrline[yyrule]; 908db17cd6dSmrg int yynrhs = yyr2[yyrule]; 90976910425Smrg int yyi; 9108bfe6addSmrg YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", 911a67f45c3Smrg yyrule - 1, yylno); 912db17cd6dSmrg /* The symbols being reduced. */ 913db17cd6dSmrg for (yyi = 0; yyi < yynrhs; yyi++) 914db17cd6dSmrg { 915a67f45c3Smrg YYFPRINTF (stderr, " $%d = ", yyi + 1); 916a67f45c3Smrg yy_symbol_print (stderr, 9178bfe6addSmrg YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), 9188bfe6addSmrg &yyvsp[(yyi + 1) - (yynrhs)]); 919a67f45c3Smrg YYFPRINTF (stderr, "\n"); 920db17cd6dSmrg } 92176910425Smrg} 92276910425Smrg 923a67f45c3Smrg# define YY_REDUCE_PRINT(Rule) \ 924a67f45c3Smrgdo { \ 925a67f45c3Smrg if (yydebug) \ 926a67f45c3Smrg yy_reduce_print (yyssp, yyvsp, Rule); \ 927a67f45c3Smrg} while (0) 92876910425Smrg 92976910425Smrg/* Nonzero means print parse trace. It is left uninitialized so that 93076910425Smrg multiple parsers can coexist. */ 93176910425Smrgint yydebug; 93276910425Smrg#else /* !YYDEBUG */ 9338bfe6addSmrg# define YYDPRINTF(Args) ((void) 0) 9348bfe6addSmrg# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) 93576910425Smrg# define YY_STACK_PRINT(Bottom, Top) 93676910425Smrg# define YY_REDUCE_PRINT(Rule) 93776910425Smrg#endif /* !YYDEBUG */ 93876910425Smrg 93976910425Smrg 94076910425Smrg/* YYINITDEPTH -- initial size of the parser's stacks. */ 941a67f45c3Smrg#ifndef YYINITDEPTH 94276910425Smrg# define YYINITDEPTH 200 94376910425Smrg#endif 94476910425Smrg 94576910425Smrg/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 94676910425Smrg if the built-in stack extension method is used). 94776910425Smrg 94876910425Smrg Do not make this value too large; the results are undefined if 94976910425Smrg YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 95076910425Smrg evaluated with infinite-precision integer arithmetic. */ 95176910425Smrg 95276910425Smrg#ifndef YYMAXDEPTH 95376910425Smrg# define YYMAXDEPTH 10000 95476910425Smrg#endif 95576910425Smrg 95676910425Smrg 95776910425Smrg 95876910425Smrg 95976910425Smrg 96076910425Smrg 96176910425Smrg/*-----------------------------------------------. 96276910425Smrg| Release the memory associated to this symbol. | 96376910425Smrg`-----------------------------------------------*/ 96476910425Smrg 96576910425Smrgstatic void 9668bfe6addSmrgyydestruct (const char *yymsg, 9678bfe6addSmrg yysymbol_kind_t yykind, YYSTYPE *yyvaluep) 96876910425Smrg{ 9698bfe6addSmrg YY_USE (yyvaluep); 97076910425Smrg if (!yymsg) 97176910425Smrg yymsg = "Deleting"; 9728bfe6addSmrg YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); 97376910425Smrg 974a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 9758bfe6addSmrg YY_USE (yykind); 976a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_END 97776910425Smrg} 97876910425Smrg 97976910425Smrg 9808bfe6addSmrg/* Lookahead token kind. */ 98176910425Smrgint yychar; 98276910425Smrg 983a67f45c3Smrg/* The semantic value of the lookahead symbol. */ 98476910425SmrgYYSTYPE yylval; 98576910425Smrg/* Number of syntax errors so far. */ 98676910425Smrgint yynerrs; 98776910425Smrg 98876910425Smrg 9898bfe6addSmrg 9908bfe6addSmrg 99176910425Smrg/*----------. 99276910425Smrg| yyparse. | 99376910425Smrg`----------*/ 99476910425Smrg 99576910425Smrgint 99676910425Smrgyyparse (void) 99776910425Smrg{ 9988bfe6addSmrg yy_state_fast_t yystate = 0; 999a67f45c3Smrg /* Number of tokens to shift before error messages enabled. */ 10008bfe6addSmrg int yyerrstatus = 0; 1001a67f45c3Smrg 10028bfe6addSmrg /* Refer to the stacks through separate pointers, to allow yyoverflow 1003a67f45c3Smrg to reallocate them elsewhere. */ 1004a67f45c3Smrg 10058bfe6addSmrg /* Their size. */ 10068bfe6addSmrg YYPTRDIFF_T yystacksize = YYINITDEPTH; 1007a67f45c3Smrg 10088bfe6addSmrg /* The state stack: array, bottom, top. */ 10098bfe6addSmrg yy_state_t yyssa[YYINITDEPTH]; 10108bfe6addSmrg yy_state_t *yyss = yyssa; 10118bfe6addSmrg yy_state_t *yyssp = yyss; 1012a67f45c3Smrg 10138bfe6addSmrg /* The semantic value stack: array, bottom, top. */ 10148bfe6addSmrg YYSTYPE yyvsa[YYINITDEPTH]; 10158bfe6addSmrg YYSTYPE *yyvs = yyvsa; 10168bfe6addSmrg YYSTYPE *yyvsp = yyvs; 1017a67f45c3Smrg 101876910425Smrg int yyn; 10198bfe6addSmrg /* The return value of yyparse. */ 102076910425Smrg int yyresult; 10218bfe6addSmrg /* Lookahead symbol kind. */ 10228bfe6addSmrg yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; 1023a67f45c3Smrg /* The variables used to return semantic value and location from the 1024a67f45c3Smrg action routines. */ 1025a67f45c3Smrg YYSTYPE yyval; 1026a67f45c3Smrg 10278bfe6addSmrg 102876910425Smrg 1029db17cd6dSmrg#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 103076910425Smrg 1031db17cd6dSmrg /* The number of symbols on the RHS of the reduced rule. 1032db17cd6dSmrg Keep to zero when no symbol should be popped. */ 1033db17cd6dSmrg int yylen = 0; 103476910425Smrg 103576910425Smrg YYDPRINTF ((stderr, "Starting parse\n")); 103676910425Smrg 1037a67f45c3Smrg yychar = YYEMPTY; /* Cause a token to be read. */ 10388bfe6addSmrg 103976910425Smrg goto yysetstate; 104076910425Smrg 10418bfe6addSmrg 104276910425Smrg/*------------------------------------------------------------. 10438bfe6addSmrg| yynewstate -- push a new state, which is found in yystate. | 104476910425Smrg`------------------------------------------------------------*/ 10458bfe6addSmrgyynewstate: 104676910425Smrg /* In all cases, when you get here, the value and location stacks 1047db17cd6dSmrg have just been pushed. So pushing a state here evens the stacks. */ 104876910425Smrg yyssp++; 104976910425Smrg 10508bfe6addSmrg 10518bfe6addSmrg/*--------------------------------------------------------------------. 10528bfe6addSmrg| yysetstate -- set current state (the top of the stack) to yystate. | 10538bfe6addSmrg`--------------------------------------------------------------------*/ 10548bfe6addSmrgyysetstate: 10558bfe6addSmrg YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 10568bfe6addSmrg YY_ASSERT (0 <= yystate && yystate < YYNSTATES); 10578bfe6addSmrg YY_IGNORE_USELESS_CAST_BEGIN 10588bfe6addSmrg *yyssp = YY_CAST (yy_state_t, yystate); 10598bfe6addSmrg YY_IGNORE_USELESS_CAST_END 10608bfe6addSmrg YY_STACK_PRINT (yyss, yyssp); 106176910425Smrg 106276910425Smrg if (yyss + yystacksize - 1 <= yyssp) 10638bfe6addSmrg#if !defined yyoverflow && !defined YYSTACK_RELOCATE 10648bfe6addSmrg YYNOMEM; 10658bfe6addSmrg#else 106676910425Smrg { 106776910425Smrg /* Get the current used size of the three stacks, in elements. */ 10688bfe6addSmrg YYPTRDIFF_T yysize = yyssp - yyss + 1; 106976910425Smrg 10708bfe6addSmrg# if defined yyoverflow 107176910425Smrg { 1072a67f45c3Smrg /* Give user a chance to reallocate the stack. Use copies of 1073a67f45c3Smrg these so that the &'s don't force the real ones into 1074a67f45c3Smrg memory. */ 10758bfe6addSmrg yy_state_t *yyss1 = yyss; 1076a67f45c3Smrg YYSTYPE *yyvs1 = yyvs; 1077a67f45c3Smrg 1078a67f45c3Smrg /* Each stack pointer address is followed by the size of the 1079a67f45c3Smrg data in use in that stack, in bytes. This used to be a 1080a67f45c3Smrg conditional around just the two extra args, but that might 1081a67f45c3Smrg be undefined if yyoverflow is a macro. */ 1082a67f45c3Smrg yyoverflow (YY_("memory exhausted"), 10838bfe6addSmrg &yyss1, yysize * YYSIZEOF (*yyssp), 10848bfe6addSmrg &yyvs1, yysize * YYSIZEOF (*yyvsp), 1085a67f45c3Smrg &yystacksize); 1086a67f45c3Smrg yyss = yyss1; 1087a67f45c3Smrg yyvs = yyvs1; 108876910425Smrg } 10898bfe6addSmrg# else /* defined YYSTACK_RELOCATE */ 109076910425Smrg /* Extend the stack our own way. */ 109176910425Smrg if (YYMAXDEPTH <= yystacksize) 10928bfe6addSmrg YYNOMEM; 109376910425Smrg yystacksize *= 2; 109476910425Smrg if (YYMAXDEPTH < yystacksize) 1095a67f45c3Smrg yystacksize = YYMAXDEPTH; 109676910425Smrg 109776910425Smrg { 10988bfe6addSmrg yy_state_t *yyss1 = yyss; 1099a67f45c3Smrg union yyalloc *yyptr = 11008bfe6addSmrg YY_CAST (union yyalloc *, 11018bfe6addSmrg YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); 1102a67f45c3Smrg if (! yyptr) 11038bfe6addSmrg YYNOMEM; 1104a67f45c3Smrg YYSTACK_RELOCATE (yyss_alloc, yyss); 1105a67f45c3Smrg YYSTACK_RELOCATE (yyvs_alloc, yyvs); 110676910425Smrg# undef YYSTACK_RELOCATE 1107a67f45c3Smrg if (yyss1 != yyssa) 1108a67f45c3Smrg YYSTACK_FREE (yyss1); 110976910425Smrg } 111076910425Smrg# endif 111176910425Smrg 111276910425Smrg yyssp = yyss + yysize - 1; 111376910425Smrg yyvsp = yyvs + yysize - 1; 111476910425Smrg 11158bfe6addSmrg YY_IGNORE_USELESS_CAST_BEGIN 11168bfe6addSmrg YYDPRINTF ((stderr, "Stack size increased to %ld\n", 11178bfe6addSmrg YY_CAST (long, yystacksize))); 11188bfe6addSmrg YY_IGNORE_USELESS_CAST_END 111976910425Smrg 112076910425Smrg if (yyss + yystacksize - 1 <= yyssp) 1121a67f45c3Smrg YYABORT; 112276910425Smrg } 11238bfe6addSmrg#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ 112476910425Smrg 112576910425Smrg 1126a67f45c3Smrg if (yystate == YYFINAL) 1127a67f45c3Smrg YYACCEPT; 1128a67f45c3Smrg 112976910425Smrg goto yybackup; 113076910425Smrg 11318bfe6addSmrg 113276910425Smrg/*-----------. 113376910425Smrg| yybackup. | 113476910425Smrg`-----------*/ 113576910425Smrgyybackup: 1136db17cd6dSmrg /* Do appropriate processing given the current state. Read a 1137a67f45c3Smrg lookahead token if we need one and don't already have one. */ 113876910425Smrg 1139a67f45c3Smrg /* First try to decide what to do without reference to lookahead token. */ 114076910425Smrg yyn = yypact[yystate]; 1141a67f45c3Smrg if (yypact_value_is_default (yyn)) 114276910425Smrg goto yydefault; 114376910425Smrg 1144a67f45c3Smrg /* Not known => get a lookahead token if don't already have one. */ 114576910425Smrg 11468bfe6addSmrg /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ 114776910425Smrg if (yychar == YYEMPTY) 114876910425Smrg { 11498bfe6addSmrg YYDPRINTF ((stderr, "Reading a token\n")); 1150a67f45c3Smrg yychar = yylex (); 115176910425Smrg } 115276910425Smrg 11538bfe6addSmrg if (yychar <= END_OF_FILE) 115476910425Smrg { 11558bfe6addSmrg yychar = END_OF_FILE; 11568bfe6addSmrg yytoken = YYSYMBOL_YYEOF; 115776910425Smrg YYDPRINTF ((stderr, "Now at end of input.\n")); 115876910425Smrg } 11598bfe6addSmrg else if (yychar == YYerror) 11608bfe6addSmrg { 11618bfe6addSmrg /* The scanner already issued an error message, process directly 11628bfe6addSmrg to error recovery. But do not keep the error token as 11638bfe6addSmrg lookahead, it is too special and may lead us to an endless 11648bfe6addSmrg loop in error recovery. */ 11658bfe6addSmrg yychar = YYUNDEF; 11668bfe6addSmrg yytoken = YYSYMBOL_YYerror; 11678bfe6addSmrg goto yyerrlab1; 11688bfe6addSmrg } 116976910425Smrg else 117076910425Smrg { 117176910425Smrg yytoken = YYTRANSLATE (yychar); 117276910425Smrg YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 117376910425Smrg } 117476910425Smrg 117576910425Smrg /* If the proper action on seeing token YYTOKEN is to reduce or to 117676910425Smrg detect an error, take that action. */ 117776910425Smrg yyn += yytoken; 117876910425Smrg if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 117976910425Smrg goto yydefault; 118076910425Smrg yyn = yytable[yyn]; 118176910425Smrg if (yyn <= 0) 118276910425Smrg { 1183a67f45c3Smrg if (yytable_value_is_error (yyn)) 1184a67f45c3Smrg goto yyerrlab; 118576910425Smrg yyn = -yyn; 118676910425Smrg goto yyreduce; 118776910425Smrg } 118876910425Smrg 1189db17cd6dSmrg /* Count tokens shifted since error; after three, turn off error 1190db17cd6dSmrg status. */ 1191db17cd6dSmrg if (yyerrstatus) 1192db17cd6dSmrg yyerrstatus--; 1193db17cd6dSmrg 1194a67f45c3Smrg /* Shift the lookahead token. */ 119576910425Smrg YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1196db17cd6dSmrg yystate = yyn; 1197a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 119876910425Smrg *++yyvsp = yylval; 1199a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_END 120076910425Smrg 12018bfe6addSmrg /* Discard the shifted token. */ 12028bfe6addSmrg yychar = YYEMPTY; 120376910425Smrg goto yynewstate; 120476910425Smrg 120576910425Smrg 120676910425Smrg/*-----------------------------------------------------------. 120776910425Smrg| yydefault -- do the default action for the current state. | 120876910425Smrg`-----------------------------------------------------------*/ 120976910425Smrgyydefault: 121076910425Smrg yyn = yydefact[yystate]; 121176910425Smrg if (yyn == 0) 121276910425Smrg goto yyerrlab; 121376910425Smrg goto yyreduce; 121476910425Smrg 121576910425Smrg 121676910425Smrg/*-----------------------------. 12178bfe6addSmrg| yyreduce -- do a reduction. | 121876910425Smrg`-----------------------------*/ 121976910425Smrgyyreduce: 122076910425Smrg /* yyn is the number of a rule to reduce with. */ 122176910425Smrg yylen = yyr2[yyn]; 122276910425Smrg 122376910425Smrg /* If YYLEN is nonzero, implement the default value of the action: 1224a67f45c3Smrg '$$ = $1'. 122576910425Smrg 122676910425Smrg Otherwise, the following line sets YYVAL to garbage. 122776910425Smrg This behavior is undocumented and Bison 122876910425Smrg users should not rely upon it. Assigning to YYVAL 122976910425Smrg unconditionally makes the parser a bit smaller, and it avoids a 123076910425Smrg GCC warning that YYVAL may be used uninitialized. */ 123176910425Smrg yyval = yyvsp[1-yylen]; 123276910425Smrg 123376910425Smrg 123476910425Smrg YY_REDUCE_PRINT (yyn); 123576910425Smrg switch (yyn) 123676910425Smrg { 12378bfe6addSmrg case 2: /* CfgFile: CfgEntryList */ 12388bfe6addSmrg#line 87 "cfgparse.y" 12398bfe6addSmrg { InterpretConfigs((yyvsp[0].entry)); } 12408bfe6addSmrg#line 1241 "cfgparse.c" 124176910425Smrg break; 124276910425Smrg 12438bfe6addSmrg case 3: /* CfgEntryList: CfgEntryList CfgEntry */ 12448bfe6addSmrg#line 91 "cfgparse.y" 12458bfe6addSmrg { 124676910425Smrg CfgEntryPtr tmp; 1247a67f45c3Smrg if ((yyvsp[-1].entry)!=NULL) { 1248a67f45c3Smrg for (tmp=(yyvsp[-1].entry);tmp->next!=NULL;tmp=tmp->next) { 124976910425Smrg /* conditional does the work */ 125076910425Smrg } 1251a67f45c3Smrg tmp->next= (yyvsp[0].entry); 1252a67f45c3Smrg (yyval.entry)= (yyvsp[-1].entry); 125376910425Smrg } 1254a67f45c3Smrg else (yyval.entry)= (yyvsp[0].entry); 125576910425Smrg } 12568bfe6addSmrg#line 1257 "cfgparse.c" 125776910425Smrg break; 125876910425Smrg 12598bfe6addSmrg case 4: /* CfgEntryList: CfgEntry */ 12608bfe6addSmrg#line 102 "cfgparse.y" 12618bfe6addSmrg { (yyval.entry)= (yyvsp[0].entry); } 12628bfe6addSmrg#line 1263 "cfgparse.c" 126376910425Smrg break; 126476910425Smrg 12658bfe6addSmrg case 5: /* CfgEntry: EventDef ActionDef */ 12668bfe6addSmrg#line 106 "cfgparse.y" 12678bfe6addSmrg { 1268a67f45c3Smrg if (((yyvsp[-1].entry))&&((yyvsp[0].act))) 1269a67f45c3Smrg (yyvsp[-1].entry)->action= *((yyvsp[0].act)); 1270a67f45c3Smrg if ((yyvsp[0].act)) 1271a67f45c3Smrg free((yyvsp[0].act)); 1272a67f45c3Smrg (yyval.entry)= (yyvsp[-1].entry); 127376910425Smrg } 12748bfe6addSmrg#line 1275 "cfgparse.c" 127576910425Smrg break; 127676910425Smrg 12778bfe6addSmrg case 6: /* CfgEntry: VarDef */ 12788bfe6addSmrg#line 113 "cfgparse.y" 12798bfe6addSmrg { (yyval.entry)= (yyvsp[0].entry); } 12808bfe6addSmrg#line 1281 "cfgparse.c" 128176910425Smrg break; 128276910425Smrg 12838bfe6addSmrg case 7: /* VarDef: Ident EQUALS NameSpec */ 12848bfe6addSmrg#line 117 "cfgparse.y" 12858bfe6addSmrg { 128676910425Smrg CfgEntryPtr cfg; 12879ff100acSmrg cfg= calloc(1,sizeof(CfgEntryRec)); 128876910425Smrg if (cfg) { 128976910425Smrg cfg->entry_type= VariableDef; 129076910425Smrg cfg->event_type= 0; 1291a67f45c3Smrg cfg->name.str= (yyvsp[-2].str); 129276910425Smrg cfg->action.type= UnknownAction; 1293a67f45c3Smrg cfg->action.text= (yyvsp[0].str); 129476910425Smrg cfg->action.priv= 0; 129576910425Smrg cfg->next= NULL; 129676910425Smrg } 129776910425Smrg (yyval.entry)= cfg; 129876910425Smrg } 12998bfe6addSmrg#line 1300 "cfgparse.c" 130076910425Smrg break; 130176910425Smrg 13028bfe6addSmrg case 8: /* EventDef: EventType OPAREN OptNameSpec CPAREN */ 13038bfe6addSmrg#line 134 "cfgparse.y" 13048bfe6addSmrg { 130576910425Smrg CfgEntryPtr cfg; 13069ff100acSmrg cfg= calloc(1,sizeof(CfgEntryRec)); 130776910425Smrg if (cfg) { 130876910425Smrg cfg->entry_type= EventDef; 1309a67f45c3Smrg cfg->event_type= (yyvsp[-3].ival); 1310a67f45c3Smrg cfg->name.str= (yyvsp[-1].str); 131176910425Smrg cfg->action.type= UnknownAction; 131276910425Smrg cfg->action.text= NULL; 131376910425Smrg cfg->action.priv= 0; 131476910425Smrg cfg->next= NULL; 131576910425Smrg } 131676910425Smrg (yyval.entry)= cfg; 131776910425Smrg } 13188bfe6addSmrg#line 1319 "cfgparse.c" 131976910425Smrg break; 132076910425Smrg 13218bfe6addSmrg case 9: /* EventType: BELL */ 13228bfe6addSmrg#line 150 "cfgparse.y" 13238bfe6addSmrg { (yyval.ival)= XkbBellNotify; } 13248bfe6addSmrg#line 1325 "cfgparse.c" 132576910425Smrg break; 132676910425Smrg 13278bfe6addSmrg case 10: /* EventType: ACCESSX */ 13288bfe6addSmrg#line 151 "cfgparse.y" 13298bfe6addSmrg { (yyval.ival)= XkbAccessXNotify; } 13308bfe6addSmrg#line 1331 "cfgparse.c" 133176910425Smrg break; 133276910425Smrg 13338bfe6addSmrg case 11: /* EventType: MESSAGE */ 13348bfe6addSmrg#line 152 "cfgparse.y" 13358bfe6addSmrg { (yyval.ival)= XkbActionMessage; } 13368bfe6addSmrg#line 1337 "cfgparse.c" 133776910425Smrg break; 133876910425Smrg 13398bfe6addSmrg case 12: /* ActionDef: ActionType OptString */ 13408bfe6addSmrg#line 156 "cfgparse.y" 13418bfe6addSmrg { 134276910425Smrg ActDefPtr act; 13439ff100acSmrg act= calloc(1,sizeof(ActDefRec)); 134476910425Smrg if (act) { 1345a67f45c3Smrg act->type= (yyvsp[-1].ival); 1346a67f45c3Smrg act->text= (yyvsp[0].str); 134776910425Smrg } 13489ff100acSmrg (yyval.act)= act; 134976910425Smrg } 13508bfe6addSmrg#line 1351 "cfgparse.c" 135176910425Smrg break; 135276910425Smrg 13538bfe6addSmrg case 13: /* ActionType: NONE */ 13548bfe6addSmrg#line 167 "cfgparse.y" 13558bfe6addSmrg { (yyval.ival) = NoAction; } 13568bfe6addSmrg#line 1357 "cfgparse.c" 135776910425Smrg break; 135876910425Smrg 13598bfe6addSmrg case 14: /* ActionType: IGNORE */ 13608bfe6addSmrg#line 168 "cfgparse.y" 13618bfe6addSmrg { (yyval.ival) = NoAction; } 13628bfe6addSmrg#line 1363 "cfgparse.c" 136376910425Smrg break; 136476910425Smrg 13658bfe6addSmrg case 15: /* ActionType: ECHO */ 13668bfe6addSmrg#line 169 "cfgparse.y" 13678bfe6addSmrg { (yyval.ival) = EchoAction; } 13688bfe6addSmrg#line 1369 "cfgparse.c" 136976910425Smrg break; 137076910425Smrg 13718bfe6addSmrg case 16: /* ActionType: PRINT_EV */ 13728bfe6addSmrg#line 170 "cfgparse.y" 13738bfe6addSmrg { (yyval.ival) = PrintEvAction; } 13748bfe6addSmrg#line 1375 "cfgparse.c" 137576910425Smrg break; 137676910425Smrg 13778bfe6addSmrg case 17: /* ActionType: SHELL */ 13788bfe6addSmrg#line 171 "cfgparse.y" 13798bfe6addSmrg { (yyval.ival) = ShellAction; } 13808bfe6addSmrg#line 1381 "cfgparse.c" 138176910425Smrg break; 138276910425Smrg 13838bfe6addSmrg case 18: /* ActionType: SOUND */ 13848bfe6addSmrg#line 172 "cfgparse.y" 13858bfe6addSmrg { (yyval.ival) = SoundAction; } 13868bfe6addSmrg#line 1387 "cfgparse.c" 138776910425Smrg break; 138876910425Smrg 13898bfe6addSmrg case 19: /* ActionType: %empty */ 13908bfe6addSmrg#line 173 "cfgparse.y" 13918bfe6addSmrg { (yyval.ival) = UnknownAction; } 13928bfe6addSmrg#line 1393 "cfgparse.c" 139376910425Smrg break; 139476910425Smrg 13958bfe6addSmrg case 20: /* OptNameSpec: NameSpec */ 13968bfe6addSmrg#line 176 "cfgparse.y" 13978bfe6addSmrg { (yyval.str)= (yyvsp[0].str); } 13988bfe6addSmrg#line 1399 "cfgparse.c" 139976910425Smrg break; 140076910425Smrg 14018bfe6addSmrg case 21: /* OptNameSpec: %empty */ 14028bfe6addSmrg#line 177 "cfgparse.y" 14038bfe6addSmrg { (yyval.str)= NULL; } 14048bfe6addSmrg#line 1405 "cfgparse.c" 140576910425Smrg break; 140676910425Smrg 14078bfe6addSmrg case 22: /* NameSpec: Ident */ 14088bfe6addSmrg#line 180 "cfgparse.y" 14098bfe6addSmrg { (yyval.str)= (yyvsp[0].str); } 14108bfe6addSmrg#line 1411 "cfgparse.c" 141176910425Smrg break; 141276910425Smrg 14138bfe6addSmrg case 23: /* NameSpec: String */ 14148bfe6addSmrg#line 181 "cfgparse.y" 14158bfe6addSmrg { (yyval.str)= (yyvsp[0].str); } 14168bfe6addSmrg#line 1417 "cfgparse.c" 141776910425Smrg break; 141876910425Smrg 14198bfe6addSmrg case 24: /* Ident: IDENT */ 14208bfe6addSmrg#line 184 "cfgparse.y" 14218bfe6addSmrg { (yyval.str)= scanStr; scanStr= NULL; } 14228bfe6addSmrg#line 1423 "cfgparse.c" 142376910425Smrg break; 142476910425Smrg 14258bfe6addSmrg case 25: /* OptString: String */ 14268bfe6addSmrg#line 187 "cfgparse.y" 14278bfe6addSmrg { (yyval.str)= (yyvsp[0].str); } 14288bfe6addSmrg#line 1429 "cfgparse.c" 142976910425Smrg break; 143076910425Smrg 14318bfe6addSmrg case 26: /* OptString: %empty */ 14328bfe6addSmrg#line 188 "cfgparse.y" 14338bfe6addSmrg { (yyval.str)= NULL; } 14348bfe6addSmrg#line 1435 "cfgparse.c" 143576910425Smrg break; 143676910425Smrg 14378bfe6addSmrg case 27: /* String: STRING */ 14388bfe6addSmrg#line 191 "cfgparse.y" 14398bfe6addSmrg { (yyval.str)= scanStr; scanStr= NULL; } 14408bfe6addSmrg#line 1441 "cfgparse.c" 144176910425Smrg break; 144276910425Smrg 144376910425Smrg 14448bfe6addSmrg#line 1445 "cfgparse.c" 14458bfe6addSmrg 144676910425Smrg default: break; 144776910425Smrg } 1448a67f45c3Smrg /* User semantic actions sometimes alter yychar, and that requires 1449a67f45c3Smrg that yytoken be updated with the new translation. We take the 1450a67f45c3Smrg approach of translating immediately before every use of yytoken. 1451a67f45c3Smrg One alternative is translating here after every semantic action, 1452a67f45c3Smrg but that translation would be missed if the semantic action invokes 1453a67f45c3Smrg YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 1454a67f45c3Smrg if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 1455a67f45c3Smrg incorrect destructor might then be invoked immediately. In the 1456a67f45c3Smrg case of YYERROR or YYBACKUP, subsequent parser actions might lead 1457a67f45c3Smrg to an incorrect destructor call or verbose syntax error message 1458a67f45c3Smrg before the lookahead is translated. */ 14598bfe6addSmrg YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); 146076910425Smrg 1461db17cd6dSmrg YYPOPSTACK (yylen); 1462db17cd6dSmrg yylen = 0; 146376910425Smrg 146476910425Smrg *++yyvsp = yyval; 146576910425Smrg 1466a67f45c3Smrg /* Now 'shift' the result of the reduction. Determine what state 146776910425Smrg that goes to, based on the state we popped back to and the rule 146876910425Smrg number reduced by. */ 14698bfe6addSmrg { 14708bfe6addSmrg const int yylhs = yyr1[yyn] - YYNTOKENS; 14718bfe6addSmrg const int yyi = yypgoto[yylhs] + *yyssp; 14728bfe6addSmrg yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp 14738bfe6addSmrg ? yytable[yyi] 14748bfe6addSmrg : yydefgoto[yylhs]); 14758bfe6addSmrg } 147676910425Smrg 147776910425Smrg goto yynewstate; 147876910425Smrg 147976910425Smrg 1480a67f45c3Smrg/*--------------------------------------. 1481a67f45c3Smrg| yyerrlab -- here on detecting error. | 1482a67f45c3Smrg`--------------------------------------*/ 148376910425Smrgyyerrlab: 1484a67f45c3Smrg /* Make sure we have latest lookahead translation. See comments at 1485a67f45c3Smrg user semantic actions for why this is necessary. */ 14868bfe6addSmrg yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); 148776910425Smrg /* If not already recovering from an error, report this error. */ 148876910425Smrg if (!yyerrstatus) 148976910425Smrg { 149076910425Smrg ++yynerrs; 1491db17cd6dSmrg yyerror (YY_("syntax error")); 149276910425Smrg } 149376910425Smrg 149476910425Smrg if (yyerrstatus == 3) 149576910425Smrg { 1496a67f45c3Smrg /* If just tried and failed to reuse lookahead token after an 1497a67f45c3Smrg error, discard it. */ 149876910425Smrg 14998bfe6addSmrg if (yychar <= END_OF_FILE) 1500a67f45c3Smrg { 1501a67f45c3Smrg /* Return failure if at end of input. */ 15028bfe6addSmrg if (yychar == END_OF_FILE) 1503a67f45c3Smrg YYABORT; 1504a67f45c3Smrg } 150576910425Smrg else 1506a67f45c3Smrg { 1507a67f45c3Smrg yydestruct ("Error: discarding", 1508a67f45c3Smrg yytoken, &yylval); 1509a67f45c3Smrg yychar = YYEMPTY; 1510a67f45c3Smrg } 151176910425Smrg } 151276910425Smrg 1513a67f45c3Smrg /* Else will try to reuse lookahead token after shifting the error 151476910425Smrg token. */ 151576910425Smrg goto yyerrlab1; 151676910425Smrg 151776910425Smrg 151876910425Smrg/*---------------------------------------------------. 151976910425Smrg| yyerrorlab -- error raised explicitly by YYERROR. | 152076910425Smrg`---------------------------------------------------*/ 152176910425Smrgyyerrorlab: 15228bfe6addSmrg /* Pacify compilers when the user code never invokes YYERROR and the 15238bfe6addSmrg label yyerrorlab therefore never appears in user code. */ 15248bfe6addSmrg if (0) 15258bfe6addSmrg YYERROR; 15268bfe6addSmrg ++yynerrs; 152776910425Smrg 1528a67f45c3Smrg /* Do not reclaim the symbols of the rule whose action triggered 1529db17cd6dSmrg this YYERROR. */ 1530db17cd6dSmrg YYPOPSTACK (yylen); 1531db17cd6dSmrg yylen = 0; 1532db17cd6dSmrg YY_STACK_PRINT (yyss, yyssp); 153376910425Smrg yystate = *yyssp; 153476910425Smrg goto yyerrlab1; 153576910425Smrg 153676910425Smrg 153776910425Smrg/*-------------------------------------------------------------. 153876910425Smrg| yyerrlab1 -- common code for both syntax error and YYERROR. | 153976910425Smrg`-------------------------------------------------------------*/ 154076910425Smrgyyerrlab1: 1541a67f45c3Smrg yyerrstatus = 3; /* Each real token shifted decrements this. */ 154276910425Smrg 15438bfe6addSmrg /* Pop stack until we find a state that shifts the error token. */ 154476910425Smrg for (;;) 154576910425Smrg { 154676910425Smrg yyn = yypact[yystate]; 1547a67f45c3Smrg if (!yypact_value_is_default (yyn)) 1548a67f45c3Smrg { 15498bfe6addSmrg yyn += YYSYMBOL_YYerror; 15508bfe6addSmrg if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) 1551a67f45c3Smrg { 1552a67f45c3Smrg yyn = yytable[yyn]; 1553a67f45c3Smrg if (0 < yyn) 1554a67f45c3Smrg break; 1555a67f45c3Smrg } 1556a67f45c3Smrg } 155776910425Smrg 155876910425Smrg /* Pop the current state because it cannot handle the error token. */ 155976910425Smrg if (yyssp == yyss) 1560a67f45c3Smrg YYABORT; 156176910425Smrg 156276910425Smrg 1563db17cd6dSmrg yydestruct ("Error: popping", 15648bfe6addSmrg YY_ACCESSING_SYMBOL (yystate), yyvsp); 1565db17cd6dSmrg YYPOPSTACK (1); 156676910425Smrg yystate = *yyssp; 156776910425Smrg YY_STACK_PRINT (yyss, yyssp); 156876910425Smrg } 156976910425Smrg 1570a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 157176910425Smrg *++yyvsp = yylval; 1572a67f45c3Smrg YY_IGNORE_MAYBE_UNINITIALIZED_END 157376910425Smrg 157476910425Smrg 1575db17cd6dSmrg /* Shift the error token. */ 15768bfe6addSmrg YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); 157776910425Smrg 157876910425Smrg yystate = yyn; 157976910425Smrg goto yynewstate; 158076910425Smrg 158176910425Smrg 158276910425Smrg/*-------------------------------------. 158376910425Smrg| yyacceptlab -- YYACCEPT comes here. | 158476910425Smrg`-------------------------------------*/ 158576910425Smrgyyacceptlab: 158676910425Smrg yyresult = 0; 15878bfe6addSmrg goto yyreturnlab; 15888bfe6addSmrg 158976910425Smrg 159076910425Smrg/*-----------------------------------. 159176910425Smrg| yyabortlab -- YYABORT comes here. | 159276910425Smrg`-----------------------------------*/ 159376910425Smrgyyabortlab: 159476910425Smrg yyresult = 1; 15958bfe6addSmrg goto yyreturnlab; 15968bfe6addSmrg 159776910425Smrg 15988bfe6addSmrg/*-----------------------------------------------------------. 15998bfe6addSmrg| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | 16008bfe6addSmrg`-----------------------------------------------------------*/ 160176910425Smrgyyexhaustedlab: 160276910425Smrg yyerror (YY_("memory exhausted")); 160376910425Smrg yyresult = 2; 16048bfe6addSmrg goto yyreturnlab; 16058bfe6addSmrg 160676910425Smrg 16078bfe6addSmrg/*----------------------------------------------------------. 16088bfe6addSmrg| yyreturnlab -- parsing is finished, clean up and return. | 16098bfe6addSmrg`----------------------------------------------------------*/ 16108bfe6addSmrgyyreturnlab: 1611a67f45c3Smrg if (yychar != YYEMPTY) 1612a67f45c3Smrg { 1613a67f45c3Smrg /* Make sure we have latest lookahead translation. See comments at 1614a67f45c3Smrg user semantic actions for why this is necessary. */ 1615a67f45c3Smrg yytoken = YYTRANSLATE (yychar); 1616a67f45c3Smrg yydestruct ("Cleanup: discarding lookahead", 1617a67f45c3Smrg yytoken, &yylval); 1618a67f45c3Smrg } 1619a67f45c3Smrg /* Do not reclaim the symbols of the rule whose action triggered 1620db17cd6dSmrg this YYABORT or YYACCEPT. */ 1621db17cd6dSmrg YYPOPSTACK (yylen); 1622db17cd6dSmrg YY_STACK_PRINT (yyss, yyssp); 162376910425Smrg while (yyssp != yyss) 162476910425Smrg { 162576910425Smrg yydestruct ("Cleanup: popping", 16268bfe6addSmrg YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); 1627db17cd6dSmrg YYPOPSTACK (1); 162876910425Smrg } 162976910425Smrg#ifndef yyoverflow 163076910425Smrg if (yyss != yyssa) 163176910425Smrg YYSTACK_FREE (yyss); 163276910425Smrg#endif 16338bfe6addSmrg 1634a67f45c3Smrg return yyresult; 163576910425Smrg} 16368bfe6addSmrg 16378bfe6addSmrg#line 193 "cfgparse.y" 163876910425Smrg 163976910425Smrgint 164076910425Smrgyyerror(char *s) 164176910425Smrg{ 164276910425Smrg (void)fprintf(stderr,"%s: line %d of %s\n",s,lineNum, 164376910425Smrg (scanFile?scanFile:"(unknown)")); 164476910425Smrg if (scanStr) 164576910425Smrg (void)fprintf(stderr,"last scanned symbol is: %s\n",scanStr); 164676910425Smrg return 1; 164776910425Smrg} 164876910425Smrg 164976910425Smrg 165076910425Smrgint 165176910425Smrgyywrap(void) 165276910425Smrg{ 165376910425Smrg return 1; 165476910425Smrg} 165576910425Smrg 165676910425Smrgint 165776910425SmrgCFGParseFile(FILE *file) 165876910425Smrg{ 165976910425Smrg if (file) { 166076910425Smrg yyin= file; 166176910425Smrg if (yyparse()==0) { 166276910425Smrg return 1; 166376910425Smrg } 166476910425Smrg return 0; 166576910425Smrg } 166676910425Smrg return 1; 166776910425Smrg} 1668