winprefsyacc.c revision 25da500f
1/* A Bison parser, made by GNU Bison 3.1. */ 2 3/* Bison implementation for Yacc-like parsers in C 4 5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. 6 7 This program is free software: you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation, either version 3 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19 20/* As a special exception, you may create a larger work that contains 21 part or all of the Bison parser skeleton and distribute that work 22 under terms of your choice, so long as that work isn't itself a 23 parser generator using the skeleton or a modified version thereof 24 as a parser skeleton. Alternatively, if you modify or redistribute 25 the parser skeleton itself, you may (at your option) remove this 26 special exception, which will cause the skeleton and the resulting 27 Bison output files to be licensed under the GNU General Public 28 License without this special exception. 29 30 This special exception was added by the Free Software Foundation in 31 version 2.2 of Bison. */ 32 33/* C LALR(1) parser skeleton written by Richard Stallman, by 34 simplifying the original so-called "semantic" parser. */ 35 36/* All symbols defined below should begin with yy or YY, to avoid 37 infringing on user name space. This should be done even for local 38 variables, as they might otherwise be expanded by user macros. 39 There are some unavoidable exceptions within include files to 40 define necessary library symbols; they are noted "INFRINGES ON 41 USER NAME SPACE" below. */ 42 43/* Identify Bison output. */ 44#define YYBISON 1 45 46/* Bison version. */ 47#define YYBISON_VERSION "3.1" 48 49/* Skeleton name. */ 50#define YYSKELETON_NAME "yacc.c" 51 52/* Pure parsers. */ 53#define YYPURE 0 54 55/* Push parsers. */ 56#define YYPUSH 0 57 58/* Pull parsers. */ 59#define YYPULL 1 60 61 62 63 64/* Copy the first part of user declarations. */ 65#line 1 "winprefsyacc.y" /* yacc.c:339 */ 66 67/* 68 * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. 69 * Copyright (C) Colin Harrison 2005-2008 70 * 71 * Permission is hereby granted, free of charge, to any person obtaining 72 * a copy of this software and associated documentation files (the 73 * "Software"), to deal in the Software without restriction, including 74 * without limitation the rights to use, copy, modify, merge, publish, 75 * distribute, sublicense, and/or sell copies of the Software, and to 76 * permit persons to whom the Software is furnished to do so, subject to 77 * the following conditions: 78 * 79 * The above copyright notice and this permission notice shall be 80 * included in all copies or substantial portions of the Software. 81 * 82 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 83 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 84 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 85 * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR 86 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 87 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 88 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 89 * 90 * Except as contained in this notice, the name of the XFree86 Project 91 * shall not be used in advertising or otherwise to promote the sale, use 92 * or other dealings in this Software without prior written authorization 93 * from the XFree86 Project. 94 * 95 * Authors: Earle F. Philhower, III 96 * Colin Harrison 97 */ 98/* $XFree86: $ */ 99 100#ifdef HAVE_XWIN_CONFIG_H 101#include <xwin-config.h> 102#endif 103#include <stdio.h> 104#include <stdlib.h> 105#define _STDLIB_H 1 /* bison checks this to know if stdlib has been included */ 106#include <string.h> 107#include "winprefs.h" 108 109/* The following give better error messages in bison at the cost of a few KB */ 110#define YYERROR_VERBOSE 1 111 112/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */ 113#define YYLTYPE_IS_TRIVIAL 1 114#define YYENABLE_NLS 0 115 116/* The global pref settings */ 117WINPREFS pref; 118 119/* The working menu */ 120static MENUPARSED menu; 121 122/* Functions for parsing the tokens into out structure */ 123/* Defined at the end section of this file */ 124 125static void SetIconDirectory (char *path); 126static void SetDefaultIcon (char *fname); 127static void SetRootMenu (char *menu); 128static void SetDefaultSysMenu (char *menu, int pos); 129static void SetTrayIcon (char *fname); 130 131static void OpenMenu(char *menuname); 132static void AddMenuLine(const char *name, MENUCOMMANDTYPE cmd, const char *param); 133static void CloseMenu(void); 134 135static void OpenIcons(void); 136static void AddIconLine(char *matchstr, char *iconfile); 137static void CloseIcons(void); 138 139static void OpenStyles(void); 140static void AddStyleLine(char *matchstr, unsigned long style); 141static void CloseStyles(void); 142 143static void OpenSysMenu(void); 144static void AddSysMenuLine(char *matchstr, char *menuname, int pos); 145static void CloseSysMenu(void); 146 147static int yyerror (const char *s); 148 149extern char *yytext; 150extern int yylineno; 151extern int yylex(void); 152 153 154#line 155 "winprefsyacc.c" /* yacc.c:339 */ 155 156# ifndef YY_NULLPTR 157# if defined __cplusplus && 201103L <= __cplusplus 158# define YY_NULLPTR nullptr 159# else 160# define YY_NULLPTR 0 161# endif 162# endif 163 164/* Enabling verbose error messages. */ 165#ifdef YYERROR_VERBOSE 166# undef YYERROR_VERBOSE 167# define YYERROR_VERBOSE 1 168#else 169# define YYERROR_VERBOSE 0 170#endif 171 172/* In a future release of Bison, this section will be replaced 173 by #include "y.tab.h". */ 174#ifndef YY_YY_WINPREFSYACC_H_INCLUDED 175# define YY_YY_WINPREFSYACC_H_INCLUDED 176/* Debug traces. */ 177#ifndef YYDEBUG 178# define YYDEBUG 0 179#endif 180#if YYDEBUG 181extern int yydebug; 182#endif 183 184/* Token type. */ 185#ifndef YYTOKENTYPE 186# define YYTOKENTYPE 187 enum yytokentype 188 { 189 NEWLINE = 258, 190 MENU = 259, 191 LB = 260, 192 RB = 261, 193 ICONDIRECTORY = 262, 194 DEFAULTICON = 263, 195 ICONS = 264, 196 STYLES = 265, 197 TOPMOST = 266, 198 MAXIMIZE = 267, 199 MINIMIZE = 268, 200 BOTTOM = 269, 201 NOTITLE = 270, 202 OUTLINE = 271, 203 NOFRAME = 272, 204 DEFAULTSYSMENU = 273, 205 SYSMENU = 274, 206 ROOTMENU = 275, 207 SEPARATOR = 276, 208 ATSTART = 277, 209 ATEND = 278, 210 EXEC = 279, 211 ALWAYSONTOP = 280, 212 DEBUGOUTPUT = 281, 213 RELOAD = 282, 214 TRAYICON = 283, 215 FORCEEXIT = 284, 216 SILENTEXIT = 285, 217 STRING = 286 218 }; 219#endif 220/* Tokens. */ 221#define NEWLINE 258 222#define MENU 259 223#define LB 260 224#define RB 261 225#define ICONDIRECTORY 262 226#define DEFAULTICON 263 227#define ICONS 264 228#define STYLES 265 229#define TOPMOST 266 230#define MAXIMIZE 267 231#define MINIMIZE 268 232#define BOTTOM 269 233#define NOTITLE 270 234#define OUTLINE 271 235#define NOFRAME 272 236#define DEFAULTSYSMENU 273 237#define SYSMENU 274 238#define ROOTMENU 275 239#define SEPARATOR 276 240#define ATSTART 277 241#define ATEND 278 242#define EXEC 279 243#define ALWAYSONTOP 280 244#define DEBUGOUTPUT 281 245#define RELOAD 282 246#define TRAYICON 283 247#define FORCEEXIT 284 248#define SILENTEXIT 285 249#define STRING 286 250 251/* Value type. */ 252#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 253 254union YYSTYPE 255{ 256#line 90 "winprefsyacc.y" /* yacc.c:355 */ 257 258 char *sVal; 259 unsigned long uVal; 260 int iVal; 261 262#line 263 "winprefsyacc.c" /* yacc.c:355 */ 263}; 264 265typedef union YYSTYPE YYSTYPE; 266# define YYSTYPE_IS_TRIVIAL 1 267# define YYSTYPE_IS_DECLARED 1 268#endif 269 270 271extern YYSTYPE yylval; 272 273int yyparse (void); 274 275#endif /* !YY_YY_WINPREFSYACC_H_INCLUDED */ 276 277/* Copy the second part of user declarations. */ 278 279#line 280 "winprefsyacc.c" /* yacc.c:358 */ 280 281#ifdef short 282# undef short 283#endif 284 285#ifdef YYTYPE_UINT8 286typedef YYTYPE_UINT8 yytype_uint8; 287#else 288typedef unsigned char yytype_uint8; 289#endif 290 291#ifdef YYTYPE_INT8 292typedef YYTYPE_INT8 yytype_int8; 293#else 294typedef signed char yytype_int8; 295#endif 296 297#ifdef YYTYPE_UINT16 298typedef YYTYPE_UINT16 yytype_uint16; 299#else 300typedef unsigned short yytype_uint16; 301#endif 302 303#ifdef YYTYPE_INT16 304typedef YYTYPE_INT16 yytype_int16; 305#else 306typedef short yytype_int16; 307#endif 308 309#ifndef YYSIZE_T 310# ifdef __SIZE_TYPE__ 311# define YYSIZE_T __SIZE_TYPE__ 312# elif defined size_t 313# define YYSIZE_T size_t 314# elif ! defined YYSIZE_T 315# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 316# define YYSIZE_T size_t 317# else 318# define YYSIZE_T unsigned 319# endif 320#endif 321 322#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 323 324#ifndef YY_ 325# if defined YYENABLE_NLS && YYENABLE_NLS 326# if ENABLE_NLS 327# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 328# define YY_(Msgid) dgettext ("bison-runtime", Msgid) 329# endif 330# endif 331# ifndef YY_ 332# define YY_(Msgid) Msgid 333# endif 334#endif 335 336#ifndef YY_ATTRIBUTE 337# if (defined __GNUC__ \ 338 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 339 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 340# define YY_ATTRIBUTE(Spec) __attribute__(Spec) 341# else 342# define YY_ATTRIBUTE(Spec) /* empty */ 343# endif 344#endif 345 346#ifndef YY_ATTRIBUTE_PURE 347# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 348#endif 349 350#ifndef YY_ATTRIBUTE_UNUSED 351# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 352#endif 353 354#if !defined _Noreturn \ 355 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 356# if defined _MSC_VER && 1200 <= _MSC_VER 357# define _Noreturn __declspec (noreturn) 358# else 359# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 360# endif 361#endif 362 363/* Suppress unused-variable warnings by "using" E. */ 364#if ! defined lint || defined __GNUC__ 365# define YYUSE(E) ((void) (E)) 366#else 367# define YYUSE(E) /* empty */ 368#endif 369 370#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 371/* Suppress an incorrect diagnostic about yylval being uninitialized. */ 372# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 373 _Pragma ("GCC diagnostic push") \ 374 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 375 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 376# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 377 _Pragma ("GCC diagnostic pop") 378#else 379# define YY_INITIAL_VALUE(Value) Value 380#endif 381#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 382# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 383# define YY_IGNORE_MAYBE_UNINITIALIZED_END 384#endif 385#ifndef YY_INITIAL_VALUE 386# define YY_INITIAL_VALUE(Value) /* Nothing. */ 387#endif 388 389 390#if ! defined yyoverflow || YYERROR_VERBOSE 391 392/* The parser invokes alloca or malloc; define the necessary symbols. */ 393 394# ifdef YYSTACK_USE_ALLOCA 395# if YYSTACK_USE_ALLOCA 396# ifdef __GNUC__ 397# define YYSTACK_ALLOC __builtin_alloca 398# elif defined __BUILTIN_VA_ARG_INCR 399# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 400# elif defined _AIX 401# define YYSTACK_ALLOC __alloca 402# elif defined _MSC_VER 403# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 404# define alloca _alloca 405# else 406# define YYSTACK_ALLOC alloca 407# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 408# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 409 /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 410# ifndef EXIT_SUCCESS 411# define EXIT_SUCCESS 0 412# endif 413# endif 414# endif 415# endif 416# endif 417 418# ifdef YYSTACK_ALLOC 419 /* Pacify GCC's 'empty if-body' warning. */ 420# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 421# ifndef YYSTACK_ALLOC_MAXIMUM 422 /* The OS might guarantee only one guard page at the bottom of the stack, 423 and a page size can be as small as 4096 bytes. So we cannot safely 424 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 425 to allow for a few compiler-allocated temporary stack slots. */ 426# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 427# endif 428# else 429# define YYSTACK_ALLOC YYMALLOC 430# define YYSTACK_FREE YYFREE 431# ifndef YYSTACK_ALLOC_MAXIMUM 432# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 433# endif 434# if (defined __cplusplus && ! defined EXIT_SUCCESS \ 435 && ! ((defined YYMALLOC || defined malloc) \ 436 && (defined YYFREE || defined free))) 437# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 438# ifndef EXIT_SUCCESS 439# define EXIT_SUCCESS 0 440# endif 441# endif 442# ifndef YYMALLOC 443# define YYMALLOC malloc 444# if ! defined malloc && ! defined EXIT_SUCCESS 445void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 446# endif 447# endif 448# ifndef YYFREE 449# define YYFREE free 450# if ! defined free && ! defined EXIT_SUCCESS 451void free (void *); /* INFRINGES ON USER NAME SPACE */ 452# endif 453# endif 454# endif 455#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 456 457 458#if (! defined yyoverflow \ 459 && (! defined __cplusplus \ 460 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 461 462/* A type that is properly aligned for any stack member. */ 463union yyalloc 464{ 465 yytype_int16 yyss_alloc; 466 YYSTYPE yyvs_alloc; 467}; 468 469/* The size of the maximum gap between one aligned stack and the next. */ 470# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 471 472/* The size of an array large to enough to hold all stacks, each with 473 N elements. */ 474# define YYSTACK_BYTES(N) \ 475 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 476 + YYSTACK_GAP_MAXIMUM) 477 478# define YYCOPY_NEEDED 1 479 480/* Relocate STACK from its old location to the new one. The 481 local variables YYSIZE and YYSTACKSIZE give the old and new number of 482 elements in the stack, and YYPTR gives the new location of the 483 stack. Advance YYPTR to a properly aligned location for the next 484 stack. */ 485# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 486 do \ 487 { \ 488 YYSIZE_T yynewbytes; \ 489 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 490 Stack = &yyptr->Stack_alloc; \ 491 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 492 yyptr += yynewbytes / sizeof (*yyptr); \ 493 } \ 494 while (0) 495 496#endif 497 498#if defined YYCOPY_NEEDED && YYCOPY_NEEDED 499/* Copy COUNT objects from SRC to DST. The source and destination do 500 not overlap. */ 501# ifndef YYCOPY 502# if defined __GNUC__ && 1 < __GNUC__ 503# define YYCOPY(Dst, Src, Count) \ 504 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 505# else 506# define YYCOPY(Dst, Src, Count) \ 507 do \ 508 { \ 509 YYSIZE_T yyi; \ 510 for (yyi = 0; yyi < (Count); yyi++) \ 511 (Dst)[yyi] = (Src)[yyi]; \ 512 } \ 513 while (0) 514# endif 515# endif 516#endif /* !YYCOPY_NEEDED */ 517 518/* YYFINAL -- State number of the termination state. */ 519#define YYFINAL 2 520/* YYLAST -- Last index in YYTABLE. */ 521#define YYLAST 98 522 523/* YYNTOKENS -- Number of terminals. */ 524#define YYNTOKENS 32 525/* YYNNTS -- Number of nonterminals. */ 526#define YYNNTS 33 527/* YYNRULES -- Number of rules. */ 528#define YYNRULES 65 529/* YYNSTATES -- Number of states. */ 530#define YYNSTATES 121 531 532/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 533 by yylex, with out-of-bounds checking. */ 534#define YYUNDEFTOK 2 535#define YYMAXUTOK 286 536 537#define YYTRANSLATE(YYX) \ 538 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 539 540/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 541 as returned by yylex, without out-of-bounds checking. */ 542static const yytype_uint8 yytranslate[] = 543{ 544 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 569 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 570 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 571 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 572 25, 26, 27, 28, 29, 30, 31 573}; 574 575#if YYDEBUG 576 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 577static const yytype_uint8 yyrline[] = 578{ 579 0, 133, 133, 134, 137, 138, 142, 143, 146, 147, 580 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 581 160, 163, 166, 169, 172, 175, 176, 177, 178, 179, 582 182, 183, 186, 186, 189, 192, 193, 196, 196, 199, 583 200, 201, 202, 205, 206, 207, 210, 211, 212, 213, 584 216, 219, 220, 223, 223, 226, 227, 228, 231, 234, 585 235, 238, 238, 241, 244, 247 586}; 587#endif 588 589#if YYDEBUG || YYERROR_VERBOSE || 0 590/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 591 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 592static const char *const yytname[] = 593{ 594 "$end", "error", "$undefined", "NEWLINE", "MENU", "LB", "RB", 595 "ICONDIRECTORY", "DEFAULTICON", "ICONS", "STYLES", "TOPMOST", "MAXIMIZE", 596 "MINIMIZE", "BOTTOM", "NOTITLE", "OUTLINE", "NOFRAME", "DEFAULTSYSMENU", 597 "SYSMENU", "ROOTMENU", "SEPARATOR", "ATSTART", "ATEND", "EXEC", 598 "ALWAYSONTOP", "\"DEBUG\"", "RELOAD", "TRAYICON", "FORCEEXIT", 599 "SILENTEXIT", "STRING", "$accept", "input", "line", "newline_or_nada", 600 "command", "trayicon", "rootmenu", "defaultsysmenu", "defaulticon", 601 "icondirectory", "menuline", "menulist", "menu", "$@1", "iconline", 602 "iconlist", "icons", "$@2", "group1", "group2", "stylecombo", 603 "styleline", "stylelist", "styles", "$@3", "atspot", "sysmenuline", 604 "sysmenulist", "sysmenu", "$@4", "forceexit", "silentexit", "debug", YY_NULLPTR 605}; 606#endif 607 608# ifdef YYPRINT 609/* YYTOKNUM[NUM] -- (External) token number corresponding to the 610 (internal) symbol number NUM (which must be that of a token). */ 611static const yytype_uint16 yytoknum[] = 612{ 613 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 614 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 615 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 616 285, 286 617}; 618# endif 619 620#define YYPACT_NINF -47 621 622#define yypact_value_is_default(Yystate) \ 623 (!!((Yystate) == (-47))) 624 625#define YYTABLE_NINF -1 626 627#define yytable_value_is_error(Yytable_value) \ 628 0 629 630 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 631 STATE-NUM. */ 632static const yytype_int8 yypact[] = 633{ 634 -47, 7, -47, -47, -1, 0, 1, 18, 29, 15, 635 42, 17, 19, 20, 46, 50, -47, -47, -47, -47, 636 -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, 637 49, 53, 54, -47, -47, 6, 55, 56, 57, 58, 638 -47, -47, -47, -47, -47, 61, 61, -47, -47, 62, 639 -47, -47, -47, -47, 61, 61, 35, 38, -47, 61, 640 -19, -47, 39, 35, 66, 27, 38, 67, 43, 72, 641 -3, -19, 70, 74, -47, -47, -47, -47, -47, -47, 642 -47, -47, -47, 3, -8, 75, -47, -47, 48, 43, 643 76, 61, 52, 59, 77, 78, -47, -47, 61, -47, 644 -47, 61, 6, -47, -47, -47, 81, 82, 61, 61, 645 -47, -47, 83, 61, 61, -47, -47, 61, -47, -47, 646 -47 647}; 648 649 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 650 Performed when YYTABLE does not specify something else to do. Zero 651 means the default is an error. */ 652static const yytype_uint8 yydefact[] = 653{ 654 2, 0, 1, 4, 0, 0, 0, 0, 0, 0, 655 0, 0, 0, 0, 0, 0, 3, 5, 17, 14, 656 15, 8, 9, 10, 11, 12, 13, 18, 19, 16, 657 0, 0, 0, 37, 53, 55, 0, 0, 0, 0, 658 63, 64, 32, 24, 23, 6, 6, 56, 57, 0, 659 61, 21, 65, 20, 6, 6, 0, 0, 22, 6, 660 0, 7, 0, 35, 0, 0, 51, 0, 0, 0, 661 0, 30, 0, 0, 36, 38, 39, 40, 41, 42, 662 43, 44, 45, 46, 47, 0, 52, 54, 0, 59, 663 0, 6, 0, 0, 0, 0, 31, 33, 6, 48, 664 49, 6, 55, 60, 62, 25, 0, 0, 6, 6, 665 34, 50, 0, 6, 6, 26, 29, 6, 28, 27, 666 58 667}; 668 669 /* YYPGOTO[NTERM-NUM]. */ 670static const yytype_int8 yypgoto[] = 671{ 672 -47, -47, -47, -46, -47, -47, -47, -47, -47, -47, 673 -47, 16, -47, -47, -47, 25, -47, -47, 5, 8, 674 -47, -47, 26, -47, -47, -9, -47, 9, -47, -47, 675 -47, -47, -47 676}; 677 678 /* YYDEFGOTO[NTERM-NUM]. */ 679static const yytype_int8 yydefgoto[] = 680{ 681 -1, 1, 16, 56, 17, 18, 19, 20, 21, 22, 682 71, 72, 23, 54, 63, 64, 24, 45, 83, 84, 683 85, 66, 67, 25, 46, 49, 89, 90, 26, 59, 684 27, 28, 29 685}; 686 687 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 688 positive, shift that token. If negative, reduce the rule whose 689 number is the opposite. If YYTABLE_NINF, syntax error. */ 690static const yytype_uint8 yytable[] = 691{ 692 57, 92, 69, 76, 77, 78, 79, 2, 60, 61, 693 3, 4, 70, 68, 5, 6, 7, 8, 80, 81, 694 82, 93, 94, 33, 95, 9, 10, 11, 47, 48, 695 30, 31, 32, 12, 34, 13, 14, 15, 76, 77, 696 78, 79, 80, 81, 82, 105, 35, 36, 37, 40, 697 38, 39, 110, 41, 42, 111, 43, 44, 50, 51, 698 52, 53, 115, 116, 55, 58, 62, 118, 119, 65, 699 73, 120, 75, 87, 88, 91, 97, 98, 101, 102, 700 108, 109, 104, 106, 113, 114, 117, 96, 74, 100, 701 107, 99, 86, 112, 0, 0, 0, 0, 103 702}; 703 704static const yytype_int8 yycheck[] = 705{ 706 46, 4, 21, 11, 12, 13, 14, 0, 54, 55, 707 3, 4, 31, 59, 7, 8, 9, 10, 15, 16, 708 17, 24, 25, 5, 27, 18, 19, 20, 22, 23, 709 31, 31, 31, 26, 5, 28, 29, 30, 11, 12, 710 13, 14, 15, 16, 17, 91, 31, 5, 31, 3, 711 31, 31, 98, 3, 5, 101, 3, 3, 3, 3, 712 3, 3, 108, 109, 3, 3, 31, 113, 114, 31, 713 31, 117, 6, 6, 31, 3, 6, 3, 3, 31, 714 3, 3, 6, 31, 3, 3, 3, 71, 63, 84, 715 31, 83, 66, 102, -1, -1, -1, -1, 89 716}; 717 718 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 719 symbol of state STATE-NUM. */ 720static const yytype_uint8 yystos[] = 721{ 722 0, 33, 0, 3, 4, 7, 8, 9, 10, 18, 723 19, 20, 26, 28, 29, 30, 34, 36, 37, 38, 724 39, 40, 41, 44, 48, 55, 60, 62, 63, 64, 725 31, 31, 31, 5, 5, 31, 5, 31, 31, 31, 726 3, 3, 5, 3, 3, 49, 56, 22, 23, 57, 727 3, 3, 3, 3, 45, 3, 35, 35, 3, 61, 728 35, 35, 31, 46, 47, 31, 53, 54, 35, 21, 729 31, 42, 43, 31, 47, 6, 11, 12, 13, 14, 730 15, 16, 17, 50, 51, 52, 54, 6, 31, 58, 731 59, 3, 4, 24, 25, 27, 43, 6, 3, 51, 732 50, 3, 31, 59, 6, 35, 31, 31, 3, 3, 733 35, 35, 57, 3, 3, 35, 35, 3, 35, 35, 734 35 735}; 736 737 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 738static const yytype_uint8 yyr1[] = 739{ 740 0, 32, 33, 33, 34, 34, 35, 35, 36, 36, 741 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 742 37, 38, 39, 40, 41, 42, 42, 42, 42, 42, 743 43, 43, 45, 44, 46, 47, 47, 49, 48, 50, 744 50, 50, 50, 51, 51, 51, 52, 52, 52, 52, 745 53, 54, 54, 56, 55, 57, 57, 57, 58, 59, 746 59, 61, 60, 62, 63, 64 747}; 748 749 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ 750static const yytype_uint8 yyr2[] = 751{ 752 0, 2, 0, 2, 1, 1, 0, 2, 1, 1, 753 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 754 3, 3, 4, 3, 3, 3, 4, 5, 5, 4, 755 1, 2, 0, 7, 4, 1, 2, 0, 6, 1, 756 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 757 4, 1, 2, 0, 6, 0, 1, 1, 5, 1, 758 2, 0, 7, 2, 2, 3 759}; 760 761 762#define yyerrok (yyerrstatus = 0) 763#define yyclearin (yychar = YYEMPTY) 764#define YYEMPTY (-2) 765#define YYEOF 0 766 767#define YYACCEPT goto yyacceptlab 768#define YYABORT goto yyabortlab 769#define YYERROR goto yyerrorlab 770 771 772#define YYRECOVERING() (!!yyerrstatus) 773 774#define YYBACKUP(Token, Value) \ 775do \ 776 if (yychar == YYEMPTY) \ 777 { \ 778 yychar = (Token); \ 779 yylval = (Value); \ 780 YYPOPSTACK (yylen); \ 781 yystate = *yyssp; \ 782 goto yybackup; \ 783 } \ 784 else \ 785 { \ 786 yyerror (YY_("syntax error: cannot back up")); \ 787 YYERROR; \ 788 } \ 789while (0) 790 791/* Error token number */ 792#define YYTERROR 1 793#define YYERRCODE 256 794 795 796 797/* Enable debugging if requested. */ 798#if YYDEBUG 799 800# ifndef YYFPRINTF 801# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 802# define YYFPRINTF fprintf 803# endif 804 805# define YYDPRINTF(Args) \ 806do { \ 807 if (yydebug) \ 808 YYFPRINTF Args; \ 809} while (0) 810 811/* This macro is provided for backward compatibility. */ 812#ifndef YY_LOCATION_PRINT 813# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 814#endif 815 816 817# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 818do { \ 819 if (yydebug) \ 820 { \ 821 YYFPRINTF (stderr, "%s ", Title); \ 822 yy_symbol_print (stderr, \ 823 Type, Value); \ 824 YYFPRINTF (stderr, "\n"); \ 825 } \ 826} while (0) 827 828 829/*----------------------------------------. 830| Print this symbol's value on YYOUTPUT. | 831`----------------------------------------*/ 832 833static void 834yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 835{ 836 FILE *yyo = yyoutput; 837 YYUSE (yyo); 838 if (!yyvaluep) 839 return; 840# ifdef YYPRINT 841 if (yytype < YYNTOKENS) 842 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 843# endif 844 YYUSE (yytype); 845} 846 847 848/*--------------------------------. 849| Print this symbol on YYOUTPUT. | 850`--------------------------------*/ 851 852static void 853yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 854{ 855 YYFPRINTF (yyoutput, "%s %s (", 856 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 857 858 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 859 YYFPRINTF (yyoutput, ")"); 860} 861 862/*------------------------------------------------------------------. 863| yy_stack_print -- Print the state stack from its BOTTOM up to its | 864| TOP (included). | 865`------------------------------------------------------------------*/ 866 867static void 868yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 869{ 870 YYFPRINTF (stderr, "Stack now"); 871 for (; yybottom <= yytop; yybottom++) 872 { 873 int yybot = *yybottom; 874 YYFPRINTF (stderr, " %d", yybot); 875 } 876 YYFPRINTF (stderr, "\n"); 877} 878 879# define YY_STACK_PRINT(Bottom, Top) \ 880do { \ 881 if (yydebug) \ 882 yy_stack_print ((Bottom), (Top)); \ 883} while (0) 884 885 886/*------------------------------------------------. 887| Report that the YYRULE is going to be reduced. | 888`------------------------------------------------*/ 889 890static void 891yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) 892{ 893 unsigned long yylno = yyrline[yyrule]; 894 int yynrhs = yyr2[yyrule]; 895 int yyi; 896 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 897 yyrule - 1, yylno); 898 /* The symbols being reduced. */ 899 for (yyi = 0; yyi < yynrhs; yyi++) 900 { 901 YYFPRINTF (stderr, " $%d = ", yyi + 1); 902 yy_symbol_print (stderr, 903 yystos[yyssp[yyi + 1 - yynrhs]], 904 &(yyvsp[(yyi + 1) - (yynrhs)]) 905 ); 906 YYFPRINTF (stderr, "\n"); 907 } 908} 909 910# define YY_REDUCE_PRINT(Rule) \ 911do { \ 912 if (yydebug) \ 913 yy_reduce_print (yyssp, yyvsp, Rule); \ 914} while (0) 915 916/* Nonzero means print parse trace. It is left uninitialized so that 917 multiple parsers can coexist. */ 918int yydebug; 919#else /* !YYDEBUG */ 920# define YYDPRINTF(Args) 921# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 922# define YY_STACK_PRINT(Bottom, Top) 923# define YY_REDUCE_PRINT(Rule) 924#endif /* !YYDEBUG */ 925 926 927/* YYINITDEPTH -- initial size of the parser's stacks. */ 928#ifndef YYINITDEPTH 929# define YYINITDEPTH 200 930#endif 931 932/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 933 if the built-in stack extension method is used). 934 935 Do not make this value too large; the results are undefined if 936 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 937 evaluated with infinite-precision integer arithmetic. */ 938 939#ifndef YYMAXDEPTH 940# define YYMAXDEPTH 10000 941#endif 942 943 944#if YYERROR_VERBOSE 945 946# ifndef yystrlen 947# if defined __GLIBC__ && defined _STRING_H 948# define yystrlen strlen 949# else 950/* Return the length of YYSTR. */ 951static YYSIZE_T 952yystrlen (const char *yystr) 953{ 954 YYSIZE_T yylen; 955 for (yylen = 0; yystr[yylen]; yylen++) 956 continue; 957 return yylen; 958} 959# endif 960# endif 961 962# ifndef yystpcpy 963# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 964# define yystpcpy stpcpy 965# else 966/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 967 YYDEST. */ 968static char * 969yystpcpy (char *yydest, const char *yysrc) 970{ 971 char *yyd = yydest; 972 const char *yys = yysrc; 973 974 while ((*yyd++ = *yys++) != '\0') 975 continue; 976 977 return yyd - 1; 978} 979# endif 980# endif 981 982# ifndef yytnamerr 983/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 984 quotes and backslashes, so that it's suitable for yyerror. The 985 heuristic is that double-quoting is unnecessary unless the string 986 contains an apostrophe, a comma, or backslash (other than 987 backslash-backslash). YYSTR is taken from yytname. If YYRES is 988 null, do not copy; instead, return the length of what the result 989 would have been. */ 990static YYSIZE_T 991yytnamerr (char *yyres, const char *yystr) 992{ 993 if (*yystr == '"') 994 { 995 YYSIZE_T yyn = 0; 996 char const *yyp = yystr; 997 998 for (;;) 999 switch (*++yyp) 1000 { 1001 case '\'': 1002 case ',': 1003 goto do_not_strip_quotes; 1004 1005 case '\\': 1006 if (*++yyp != '\\') 1007 goto do_not_strip_quotes; 1008 /* Fall through. */ 1009 default: 1010 if (yyres) 1011 yyres[yyn] = *yyp; 1012 yyn++; 1013 break; 1014 1015 case '"': 1016 if (yyres) 1017 yyres[yyn] = '\0'; 1018 return yyn; 1019 } 1020 do_not_strip_quotes: ; 1021 } 1022 1023 if (! yyres) 1024 return yystrlen (yystr); 1025 1026 return yystpcpy (yyres, yystr) - yyres; 1027} 1028# endif 1029 1030/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 1031 about the unexpected token YYTOKEN for the state stack whose top is 1032 YYSSP. 1033 1034 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 1035 not large enough to hold the message. In that case, also set 1036 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 1037 required number of bytes is too large to store. */ 1038static int 1039yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 1040 yytype_int16 *yyssp, int yytoken) 1041{ 1042 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 1043 YYSIZE_T yysize = yysize0; 1044 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1045 /* Internationalized format string. */ 1046 const char *yyformat = YY_NULLPTR; 1047 /* Arguments of yyformat. */ 1048 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1049 /* Number of reported tokens (one for the "unexpected", one per 1050 "expected"). */ 1051 int yycount = 0; 1052 1053 /* There are many possibilities here to consider: 1054 - If this state is a consistent state with a default action, then 1055 the only way this function was invoked is if the default action 1056 is an error action. In that case, don't check for expected 1057 tokens because there are none. 1058 - The only way there can be no lookahead present (in yychar) is if 1059 this state is a consistent state with a default action. Thus, 1060 detecting the absence of a lookahead is sufficient to determine 1061 that there is no unexpected or expected token to report. In that 1062 case, just report a simple "syntax error". 1063 - Don't assume there isn't a lookahead just because this state is a 1064 consistent state with a default action. There might have been a 1065 previous inconsistent state, consistent state with a non-default 1066 action, or user semantic action that manipulated yychar. 1067 - Of course, the expected token list depends on states to have 1068 correct lookahead information, and it depends on the parser not 1069 to perform extra reductions after fetching a lookahead from the 1070 scanner and before detecting a syntax error. Thus, state merging 1071 (from LALR or IELR) and default reductions corrupt the expected 1072 token list. However, the list is correct for canonical LR with 1073 one exception: it will still contain any token that will not be 1074 accepted due to an error action in a later state. 1075 */ 1076 if (yytoken != YYEMPTY) 1077 { 1078 int yyn = yypact[*yyssp]; 1079 yyarg[yycount++] = yytname[yytoken]; 1080 if (!yypact_value_is_default (yyn)) 1081 { 1082 /* Start YYX at -YYN if negative to avoid negative indexes in 1083 YYCHECK. In other words, skip the first -YYN actions for 1084 this state because they are default actions. */ 1085 int yyxbegin = yyn < 0 ? -yyn : 0; 1086 /* Stay within bounds of both yycheck and yytname. */ 1087 int yychecklim = YYLAST - yyn + 1; 1088 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1089 int yyx; 1090 1091 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1092 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 1093 && !yytable_value_is_error (yytable[yyx + yyn])) 1094 { 1095 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1096 { 1097 yycount = 1; 1098 yysize = yysize0; 1099 break; 1100 } 1101 yyarg[yycount++] = yytname[yyx]; 1102 { 1103 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 1104 if (! (yysize <= yysize1 1105 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1106 return 2; 1107 yysize = yysize1; 1108 } 1109 } 1110 } 1111 } 1112 1113 switch (yycount) 1114 { 1115# define YYCASE_(N, S) \ 1116 case N: \ 1117 yyformat = S; \ 1118 break 1119 default: /* Avoid compiler warnings. */ 1120 YYCASE_(0, YY_("syntax error")); 1121 YYCASE_(1, YY_("syntax error, unexpected %s")); 1122 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1123 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1124 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1125 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1126# undef YYCASE_ 1127 } 1128 1129 { 1130 YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 1131 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1132 return 2; 1133 yysize = yysize1; 1134 } 1135 1136 if (*yymsg_alloc < yysize) 1137 { 1138 *yymsg_alloc = 2 * yysize; 1139 if (! (yysize <= *yymsg_alloc 1140 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1141 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1142 return 1; 1143 } 1144 1145 /* Avoid sprintf, as that infringes on the user's name space. 1146 Don't have undefined behavior even if the translation 1147 produced a string with the wrong number of "%s"s. */ 1148 { 1149 char *yyp = *yymsg; 1150 int yyi = 0; 1151 while ((*yyp = *yyformat) != '\0') 1152 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1153 { 1154 yyp += yytnamerr (yyp, yyarg[yyi++]); 1155 yyformat += 2; 1156 } 1157 else 1158 { 1159 yyp++; 1160 yyformat++; 1161 } 1162 } 1163 return 0; 1164} 1165#endif /* YYERROR_VERBOSE */ 1166 1167/*-----------------------------------------------. 1168| Release the memory associated to this symbol. | 1169`-----------------------------------------------*/ 1170 1171static void 1172yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1173{ 1174 YYUSE (yyvaluep); 1175 if (!yymsg) 1176 yymsg = "Deleting"; 1177 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1178 1179 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1180 YYUSE (yytype); 1181 YY_IGNORE_MAYBE_UNINITIALIZED_END 1182} 1183 1184 1185 1186 1187/* The lookahead symbol. */ 1188int yychar; 1189 1190/* The semantic value of the lookahead symbol. */ 1191YYSTYPE yylval; 1192/* Number of syntax errors so far. */ 1193int yynerrs; 1194 1195 1196/*----------. 1197| yyparse. | 1198`----------*/ 1199 1200int 1201yyparse (void) 1202{ 1203 int yystate; 1204 /* Number of tokens to shift before error messages enabled. */ 1205 int yyerrstatus; 1206 1207 /* The stacks and their tools: 1208 'yyss': related to states. 1209 'yyvs': related to semantic values. 1210 1211 Refer to the stacks through separate pointers, to allow yyoverflow 1212 to reallocate them elsewhere. */ 1213 1214 /* The state stack. */ 1215 yytype_int16 yyssa[YYINITDEPTH]; 1216 yytype_int16 *yyss; 1217 yytype_int16 *yyssp; 1218 1219 /* The semantic value stack. */ 1220 YYSTYPE yyvsa[YYINITDEPTH]; 1221 YYSTYPE *yyvs; 1222 YYSTYPE *yyvsp; 1223 1224 YYSIZE_T yystacksize; 1225 1226 int yyn; 1227 int yyresult; 1228 /* Lookahead token as an internal (translated) token number. */ 1229 int yytoken = 0; 1230 /* The variables used to return semantic value and location from the 1231 action routines. */ 1232 YYSTYPE yyval; 1233 1234#if YYERROR_VERBOSE 1235 /* Buffer for error messages, and its allocated size. */ 1236 char yymsgbuf[128]; 1237 char *yymsg = yymsgbuf; 1238 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1239#endif 1240 1241#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1242 1243 /* The number of symbols on the RHS of the reduced rule. 1244 Keep to zero when no symbol should be popped. */ 1245 int yylen = 0; 1246 1247 yyssp = yyss = yyssa; 1248 yyvsp = yyvs = yyvsa; 1249 yystacksize = YYINITDEPTH; 1250 1251 YYDPRINTF ((stderr, "Starting parse\n")); 1252 1253 yystate = 0; 1254 yyerrstatus = 0; 1255 yynerrs = 0; 1256 yychar = YYEMPTY; /* Cause a token to be read. */ 1257 goto yysetstate; 1258 1259/*------------------------------------------------------------. 1260| yynewstate -- Push a new state, which is found in yystate. | 1261`------------------------------------------------------------*/ 1262 yynewstate: 1263 /* In all cases, when you get here, the value and location stacks 1264 have just been pushed. So pushing a state here evens the stacks. */ 1265 yyssp++; 1266 1267 yysetstate: 1268 *yyssp = yystate; 1269 1270 if (yyss + yystacksize - 1 <= yyssp) 1271 { 1272 /* Get the current used size of the three stacks, in elements. */ 1273 YYSIZE_T yysize = yyssp - yyss + 1; 1274 1275#ifdef yyoverflow 1276 { 1277 /* Give user a chance to reallocate the stack. Use copies of 1278 these so that the &'s don't force the real ones into 1279 memory. */ 1280 YYSTYPE *yyvs1 = yyvs; 1281 yytype_int16 *yyss1 = yyss; 1282 1283 /* Each stack pointer address is followed by the size of the 1284 data in use in that stack, in bytes. This used to be a 1285 conditional around just the two extra args, but that might 1286 be undefined if yyoverflow is a macro. */ 1287 yyoverflow (YY_("memory exhausted"), 1288 &yyss1, yysize * sizeof (*yyssp), 1289 &yyvs1, yysize * sizeof (*yyvsp), 1290 &yystacksize); 1291 1292 yyss = yyss1; 1293 yyvs = yyvs1; 1294 } 1295#else /* no yyoverflow */ 1296# ifndef YYSTACK_RELOCATE 1297 goto yyexhaustedlab; 1298# else 1299 /* Extend the stack our own way. */ 1300 if (YYMAXDEPTH <= yystacksize) 1301 goto yyexhaustedlab; 1302 yystacksize *= 2; 1303 if (YYMAXDEPTH < yystacksize) 1304 yystacksize = YYMAXDEPTH; 1305 1306 { 1307 yytype_int16 *yyss1 = yyss; 1308 union yyalloc *yyptr = 1309 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1310 if (! yyptr) 1311 goto yyexhaustedlab; 1312 YYSTACK_RELOCATE (yyss_alloc, yyss); 1313 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1314# undef YYSTACK_RELOCATE 1315 if (yyss1 != yyssa) 1316 YYSTACK_FREE (yyss1); 1317 } 1318# endif 1319#endif /* no yyoverflow */ 1320 1321 yyssp = yyss + yysize - 1; 1322 yyvsp = yyvs + yysize - 1; 1323 1324 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1325 (unsigned long) yystacksize)); 1326 1327 if (yyss + yystacksize - 1 <= yyssp) 1328 YYABORT; 1329 } 1330 1331 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1332 1333 if (yystate == YYFINAL) 1334 YYACCEPT; 1335 1336 goto yybackup; 1337 1338/*-----------. 1339| yybackup. | 1340`-----------*/ 1341yybackup: 1342 1343 /* Do appropriate processing given the current state. Read a 1344 lookahead token if we need one and don't already have one. */ 1345 1346 /* First try to decide what to do without reference to lookahead token. */ 1347 yyn = yypact[yystate]; 1348 if (yypact_value_is_default (yyn)) 1349 goto yydefault; 1350 1351 /* Not known => get a lookahead token if don't already have one. */ 1352 1353 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1354 if (yychar == YYEMPTY) 1355 { 1356 YYDPRINTF ((stderr, "Reading a token: ")); 1357 yychar = yylex (); 1358 } 1359 1360 if (yychar <= YYEOF) 1361 { 1362 yychar = yytoken = YYEOF; 1363 YYDPRINTF ((stderr, "Now at end of input.\n")); 1364 } 1365 else 1366 { 1367 yytoken = YYTRANSLATE (yychar); 1368 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1369 } 1370 1371 /* If the proper action on seeing token YYTOKEN is to reduce or to 1372 detect an error, take that action. */ 1373 yyn += yytoken; 1374 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1375 goto yydefault; 1376 yyn = yytable[yyn]; 1377 if (yyn <= 0) 1378 { 1379 if (yytable_value_is_error (yyn)) 1380 goto yyerrlab; 1381 yyn = -yyn; 1382 goto yyreduce; 1383 } 1384 1385 /* Count tokens shifted since error; after three, turn off error 1386 status. */ 1387 if (yyerrstatus) 1388 yyerrstatus--; 1389 1390 /* Shift the lookahead token. */ 1391 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1392 1393 /* Discard the shifted token. */ 1394 yychar = YYEMPTY; 1395 1396 yystate = yyn; 1397 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1398 *++yyvsp = yylval; 1399 YY_IGNORE_MAYBE_UNINITIALIZED_END 1400 1401 goto yynewstate; 1402 1403 1404/*-----------------------------------------------------------. 1405| yydefault -- do the default action for the current state. | 1406`-----------------------------------------------------------*/ 1407yydefault: 1408 yyn = yydefact[yystate]; 1409 if (yyn == 0) 1410 goto yyerrlab; 1411 goto yyreduce; 1412 1413 1414/*-----------------------------. 1415| yyreduce -- Do a reduction. | 1416`-----------------------------*/ 1417yyreduce: 1418 /* yyn is the number of a rule to reduce with. */ 1419 yylen = yyr2[yyn]; 1420 1421 /* If YYLEN is nonzero, implement the default value of the action: 1422 '$$ = $1'. 1423 1424 Otherwise, the following line sets YYVAL to garbage. 1425 This behavior is undocumented and Bison 1426 users should not rely upon it. Assigning to YYVAL 1427 unconditionally makes the parser a bit smaller, and it avoids a 1428 GCC warning that YYVAL may be used uninitialized. */ 1429 yyval = yyvsp[1-yylen]; 1430 1431 1432 YY_REDUCE_PRINT (yyn); 1433 switch (yyn) 1434 { 1435 case 20: 1436#line 160 "winprefsyacc.y" /* yacc.c:1651 */ 1437 { SetTrayIcon((yyvsp[-1].sVal)); free((yyvsp[-1].sVal)); } 1438#line 1439 "winprefsyacc.c" /* yacc.c:1651 */ 1439 break; 1440 1441 case 21: 1442#line 163 "winprefsyacc.y" /* yacc.c:1651 */ 1443 { SetRootMenu((yyvsp[-1].sVal)); free((yyvsp[-1].sVal)); } 1444#line 1445 "winprefsyacc.c" /* yacc.c:1651 */ 1445 break; 1446 1447 case 22: 1448#line 166 "winprefsyacc.y" /* yacc.c:1651 */ 1449 { SetDefaultSysMenu((yyvsp[-2].sVal), (yyvsp[-1].iVal)); free((yyvsp[-2].sVal)); } 1450#line 1451 "winprefsyacc.c" /* yacc.c:1651 */ 1451 break; 1452 1453 case 23: 1454#line 169 "winprefsyacc.y" /* yacc.c:1651 */ 1455 { SetDefaultIcon((yyvsp[-1].sVal)); free((yyvsp[-1].sVal)); } 1456#line 1457 "winprefsyacc.c" /* yacc.c:1651 */ 1457 break; 1458 1459 case 24: 1460#line 172 "winprefsyacc.y" /* yacc.c:1651 */ 1461 { SetIconDirectory((yyvsp[-1].sVal)); free((yyvsp[-1].sVal)); } 1462#line 1463 "winprefsyacc.c" /* yacc.c:1651 */ 1463 break; 1464 1465 case 25: 1466#line 175 "winprefsyacc.y" /* yacc.c:1651 */ 1467 { AddMenuLine("-", CMD_SEPARATOR, ""); } 1468#line 1469 "winprefsyacc.c" /* yacc.c:1651 */ 1469 break; 1470 1471 case 26: 1472#line 176 "winprefsyacc.y" /* yacc.c:1651 */ 1473 { AddMenuLine((yyvsp[-3].sVal), CMD_ALWAYSONTOP, ""); free((yyvsp[-3].sVal)); } 1474#line 1475 "winprefsyacc.c" /* yacc.c:1651 */ 1475 break; 1476 1477 case 27: 1478#line 177 "winprefsyacc.y" /* yacc.c:1651 */ 1479 { AddMenuLine((yyvsp[-4].sVal), CMD_EXEC, (yyvsp[-2].sVal)); free((yyvsp[-4].sVal)); free((yyvsp[-2].sVal)); } 1480#line 1481 "winprefsyacc.c" /* yacc.c:1651 */ 1481 break; 1482 1483 case 28: 1484#line 178 "winprefsyacc.y" /* yacc.c:1651 */ 1485 { AddMenuLine((yyvsp[-4].sVal), CMD_MENU, (yyvsp[-2].sVal)); free((yyvsp[-4].sVal)); free((yyvsp[-2].sVal)); } 1486#line 1487 "winprefsyacc.c" /* yacc.c:1651 */ 1487 break; 1488 1489 case 29: 1490#line 179 "winprefsyacc.y" /* yacc.c:1651 */ 1491 { AddMenuLine((yyvsp[-3].sVal), CMD_RELOAD, ""); free((yyvsp[-3].sVal)); } 1492#line 1493 "winprefsyacc.c" /* yacc.c:1651 */ 1493 break; 1494 1495 case 32: 1496#line 186 "winprefsyacc.y" /* yacc.c:1651 */ 1497 { OpenMenu((yyvsp[-1].sVal)); free((yyvsp[-1].sVal)); } 1498#line 1499 "winprefsyacc.c" /* yacc.c:1651 */ 1499 break; 1500 1501 case 33: 1502#line 186 "winprefsyacc.y" /* yacc.c:1651 */ 1503 {CloseMenu();} 1504#line 1505 "winprefsyacc.c" /* yacc.c:1651 */ 1505 break; 1506 1507 case 34: 1508#line 189 "winprefsyacc.y" /* yacc.c:1651 */ 1509 { AddIconLine((yyvsp[-3].sVal), (yyvsp[-2].sVal)); free((yyvsp[-3].sVal)); free((yyvsp[-2].sVal)); } 1510#line 1511 "winprefsyacc.c" /* yacc.c:1651 */ 1511 break; 1512 1513 case 37: 1514#line 196 "winprefsyacc.y" /* yacc.c:1651 */ 1515 {OpenIcons();} 1516#line 1517 "winprefsyacc.c" /* yacc.c:1651 */ 1517 break; 1518 1519 case 38: 1520#line 196 "winprefsyacc.y" /* yacc.c:1651 */ 1521 {CloseIcons();} 1522#line 1523 "winprefsyacc.c" /* yacc.c:1651 */ 1523 break; 1524 1525 case 39: 1526#line 199 "winprefsyacc.y" /* yacc.c:1651 */ 1527 { (yyval.uVal)=STYLE_TOPMOST; } 1528#line 1529 "winprefsyacc.c" /* yacc.c:1651 */ 1529 break; 1530 1531 case 40: 1532#line 200 "winprefsyacc.y" /* yacc.c:1651 */ 1533 { (yyval.uVal)=STYLE_MAXIMIZE; } 1534#line 1535 "winprefsyacc.c" /* yacc.c:1651 */ 1535 break; 1536 1537 case 41: 1538#line 201 "winprefsyacc.y" /* yacc.c:1651 */ 1539 { (yyval.uVal)=STYLE_MINIMIZE; } 1540#line 1541 "winprefsyacc.c" /* yacc.c:1651 */ 1541 break; 1542 1543 case 42: 1544#line 202 "winprefsyacc.y" /* yacc.c:1651 */ 1545 { (yyval.uVal)=STYLE_BOTTOM; } 1546#line 1547 "winprefsyacc.c" /* yacc.c:1651 */ 1547 break; 1548 1549 case 43: 1550#line 205 "winprefsyacc.y" /* yacc.c:1651 */ 1551 { (yyval.uVal)=STYLE_NOTITLE; } 1552#line 1553 "winprefsyacc.c" /* yacc.c:1651 */ 1553 break; 1554 1555 case 44: 1556#line 206 "winprefsyacc.y" /* yacc.c:1651 */ 1557 { (yyval.uVal)=STYLE_OUTLINE; } 1558#line 1559 "winprefsyacc.c" /* yacc.c:1651 */ 1559 break; 1560 1561 case 45: 1562#line 207 "winprefsyacc.y" /* yacc.c:1651 */ 1563 { (yyval.uVal)=STYLE_NOFRAME; } 1564#line 1565 "winprefsyacc.c" /* yacc.c:1651 */ 1565 break; 1566 1567 case 46: 1568#line 210 "winprefsyacc.y" /* yacc.c:1651 */ 1569 { (yyval.uVal)=(yyvsp[0].uVal); } 1570#line 1571 "winprefsyacc.c" /* yacc.c:1651 */ 1571 break; 1572 1573 case 47: 1574#line 211 "winprefsyacc.y" /* yacc.c:1651 */ 1575 { (yyval.uVal)=(yyvsp[0].uVal); } 1576#line 1577 "winprefsyacc.c" /* yacc.c:1651 */ 1577 break; 1578 1579 case 48: 1580#line 212 "winprefsyacc.y" /* yacc.c:1651 */ 1581 { (yyval.uVal)=(yyvsp[-1].uVal)|(yyvsp[0].uVal); } 1582#line 1583 "winprefsyacc.c" /* yacc.c:1651 */ 1583 break; 1584 1585 case 49: 1586#line 213 "winprefsyacc.y" /* yacc.c:1651 */ 1587 { (yyval.uVal)=(yyvsp[-1].uVal)|(yyvsp[0].uVal); } 1588#line 1589 "winprefsyacc.c" /* yacc.c:1651 */ 1589 break; 1590 1591 case 50: 1592#line 216 "winprefsyacc.y" /* yacc.c:1651 */ 1593 { AddStyleLine((yyvsp[-3].sVal), (yyvsp[-2].uVal)); free((yyvsp[-3].sVal)); } 1594#line 1595 "winprefsyacc.c" /* yacc.c:1651 */ 1595 break; 1596 1597 case 53: 1598#line 223 "winprefsyacc.y" /* yacc.c:1651 */ 1599 {OpenStyles();} 1600#line 1601 "winprefsyacc.c" /* yacc.c:1651 */ 1601 break; 1602 1603 case 54: 1604#line 223 "winprefsyacc.y" /* yacc.c:1651 */ 1605 {CloseStyles();} 1606#line 1607 "winprefsyacc.c" /* yacc.c:1651 */ 1607 break; 1608 1609 case 55: 1610#line 226 "winprefsyacc.y" /* yacc.c:1651 */ 1611 { (yyval.iVal)=AT_END; } 1612#line 1613 "winprefsyacc.c" /* yacc.c:1651 */ 1613 break; 1614 1615 case 56: 1616#line 227 "winprefsyacc.y" /* yacc.c:1651 */ 1617 { (yyval.iVal)=AT_START; } 1618#line 1619 "winprefsyacc.c" /* yacc.c:1651 */ 1619 break; 1620 1621 case 57: 1622#line 228 "winprefsyacc.y" /* yacc.c:1651 */ 1623 { (yyval.iVal)=AT_END; } 1624#line 1625 "winprefsyacc.c" /* yacc.c:1651 */ 1625 break; 1626 1627 case 58: 1628#line 231 "winprefsyacc.y" /* yacc.c:1651 */ 1629 { AddSysMenuLine((yyvsp[-4].sVal), (yyvsp[-3].sVal), (yyvsp[-2].iVal)); free((yyvsp[-4].sVal)); free((yyvsp[-3].sVal)); } 1630#line 1631 "winprefsyacc.c" /* yacc.c:1651 */ 1631 break; 1632 1633 case 61: 1634#line 238 "winprefsyacc.y" /* yacc.c:1651 */ 1635 {OpenSysMenu();} 1636#line 1637 "winprefsyacc.c" /* yacc.c:1651 */ 1637 break; 1638 1639 case 62: 1640#line 238 "winprefsyacc.y" /* yacc.c:1651 */ 1641 {CloseSysMenu();} 1642#line 1643 "winprefsyacc.c" /* yacc.c:1651 */ 1643 break; 1644 1645 case 63: 1646#line 241 "winprefsyacc.y" /* yacc.c:1651 */ 1647 { pref.fForceExit = TRUE; } 1648#line 1649 "winprefsyacc.c" /* yacc.c:1651 */ 1649 break; 1650 1651 case 64: 1652#line 244 "winprefsyacc.y" /* yacc.c:1651 */ 1653 { pref.fSilentExit = TRUE; } 1654#line 1655 "winprefsyacc.c" /* yacc.c:1651 */ 1655 break; 1656 1657 case 65: 1658#line 247 "winprefsyacc.y" /* yacc.c:1651 */ 1659 { ErrorF("LoadPreferences: %s\n", (yyvsp[-1].sVal)); free((yyvsp[-1].sVal)); } 1660#line 1661 "winprefsyacc.c" /* yacc.c:1651 */ 1661 break; 1662 1663 1664#line 1665 "winprefsyacc.c" /* yacc.c:1651 */ 1665 default: break; 1666 } 1667 /* User semantic actions sometimes alter yychar, and that requires 1668 that yytoken be updated with the new translation. We take the 1669 approach of translating immediately before every use of yytoken. 1670 One alternative is translating here after every semantic action, 1671 but that translation would be missed if the semantic action invokes 1672 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 1673 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 1674 incorrect destructor might then be invoked immediately. In the 1675 case of YYERROR or YYBACKUP, subsequent parser actions might lead 1676 to an incorrect destructor call or verbose syntax error message 1677 before the lookahead is translated. */ 1678 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1679 1680 YYPOPSTACK (yylen); 1681 yylen = 0; 1682 YY_STACK_PRINT (yyss, yyssp); 1683 1684 *++yyvsp = yyval; 1685 1686 /* Now 'shift' the result of the reduction. Determine what state 1687 that goes to, based on the state we popped back to and the rule 1688 number reduced by. */ 1689 1690 yyn = yyr1[yyn]; 1691 1692 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1693 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1694 yystate = yytable[yystate]; 1695 else 1696 yystate = yydefgoto[yyn - YYNTOKENS]; 1697 1698 goto yynewstate; 1699 1700 1701/*--------------------------------------. 1702| yyerrlab -- here on detecting error. | 1703`--------------------------------------*/ 1704yyerrlab: 1705 /* Make sure we have latest lookahead translation. See comments at 1706 user semantic actions for why this is necessary. */ 1707 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 1708 1709 /* If not already recovering from an error, report this error. */ 1710 if (!yyerrstatus) 1711 { 1712 ++yynerrs; 1713#if ! YYERROR_VERBOSE 1714 yyerror (YY_("syntax error")); 1715#else 1716# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1717 yyssp, yytoken) 1718 { 1719 char const *yymsgp = YY_("syntax error"); 1720 int yysyntax_error_status; 1721 yysyntax_error_status = YYSYNTAX_ERROR; 1722 if (yysyntax_error_status == 0) 1723 yymsgp = yymsg; 1724 else if (yysyntax_error_status == 1) 1725 { 1726 if (yymsg != yymsgbuf) 1727 YYSTACK_FREE (yymsg); 1728 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 1729 if (!yymsg) 1730 { 1731 yymsg = yymsgbuf; 1732 yymsg_alloc = sizeof yymsgbuf; 1733 yysyntax_error_status = 2; 1734 } 1735 else 1736 { 1737 yysyntax_error_status = YYSYNTAX_ERROR; 1738 yymsgp = yymsg; 1739 } 1740 } 1741 yyerror (yymsgp); 1742 if (yysyntax_error_status == 2) 1743 goto yyexhaustedlab; 1744 } 1745# undef YYSYNTAX_ERROR 1746#endif 1747 } 1748 1749 1750 1751 if (yyerrstatus == 3) 1752 { 1753 /* If just tried and failed to reuse lookahead token after an 1754 error, discard it. */ 1755 1756 if (yychar <= YYEOF) 1757 { 1758 /* Return failure if at end of input. */ 1759 if (yychar == YYEOF) 1760 YYABORT; 1761 } 1762 else 1763 { 1764 yydestruct ("Error: discarding", 1765 yytoken, &yylval); 1766 yychar = YYEMPTY; 1767 } 1768 } 1769 1770 /* Else will try to reuse lookahead token after shifting the error 1771 token. */ 1772 goto yyerrlab1; 1773 1774 1775/*---------------------------------------------------. 1776| yyerrorlab -- error raised explicitly by YYERROR. | 1777`---------------------------------------------------*/ 1778yyerrorlab: 1779 1780 /* Pacify compilers like GCC when the user code never invokes 1781 YYERROR and the label yyerrorlab therefore never appears in user 1782 code. */ 1783 if (/*CONSTCOND*/ 0) 1784 goto yyerrorlab; 1785 1786 /* Do not reclaim the symbols of the rule whose action triggered 1787 this YYERROR. */ 1788 YYPOPSTACK (yylen); 1789 yylen = 0; 1790 YY_STACK_PRINT (yyss, yyssp); 1791 yystate = *yyssp; 1792 goto yyerrlab1; 1793 1794 1795/*-------------------------------------------------------------. 1796| yyerrlab1 -- common code for both syntax error and YYERROR. | 1797`-------------------------------------------------------------*/ 1798yyerrlab1: 1799 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1800 1801 for (;;) 1802 { 1803 yyn = yypact[yystate]; 1804 if (!yypact_value_is_default (yyn)) 1805 { 1806 yyn += YYTERROR; 1807 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1808 { 1809 yyn = yytable[yyn]; 1810 if (0 < yyn) 1811 break; 1812 } 1813 } 1814 1815 /* Pop the current state because it cannot handle the error token. */ 1816 if (yyssp == yyss) 1817 YYABORT; 1818 1819 1820 yydestruct ("Error: popping", 1821 yystos[yystate], yyvsp); 1822 YYPOPSTACK (1); 1823 yystate = *yyssp; 1824 YY_STACK_PRINT (yyss, yyssp); 1825 } 1826 1827 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1828 *++yyvsp = yylval; 1829 YY_IGNORE_MAYBE_UNINITIALIZED_END 1830 1831 1832 /* Shift the error token. */ 1833 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1834 1835 yystate = yyn; 1836 goto yynewstate; 1837 1838 1839/*-------------------------------------. 1840| yyacceptlab -- YYACCEPT comes here. | 1841`-------------------------------------*/ 1842yyacceptlab: 1843 yyresult = 0; 1844 goto yyreturn; 1845 1846/*-----------------------------------. 1847| yyabortlab -- YYABORT comes here. | 1848`-----------------------------------*/ 1849yyabortlab: 1850 yyresult = 1; 1851 goto yyreturn; 1852 1853#if !defined yyoverflow || YYERROR_VERBOSE 1854/*-------------------------------------------------. 1855| yyexhaustedlab -- memory exhaustion comes here. | 1856`-------------------------------------------------*/ 1857yyexhaustedlab: 1858 yyerror (YY_("memory exhausted")); 1859 yyresult = 2; 1860 /* Fall through. */ 1861#endif 1862 1863yyreturn: 1864 if (yychar != YYEMPTY) 1865 { 1866 /* Make sure we have latest lookahead translation. See comments at 1867 user semantic actions for why this is necessary. */ 1868 yytoken = YYTRANSLATE (yychar); 1869 yydestruct ("Cleanup: discarding lookahead", 1870 yytoken, &yylval); 1871 } 1872 /* Do not reclaim the symbols of the rule whose action triggered 1873 this YYABORT or YYACCEPT. */ 1874 YYPOPSTACK (yylen); 1875 YY_STACK_PRINT (yyss, yyssp); 1876 while (yyssp != yyss) 1877 { 1878 yydestruct ("Cleanup: popping", 1879 yystos[*yyssp], yyvsp); 1880 YYPOPSTACK (1); 1881 } 1882#ifndef yyoverflow 1883 if (yyss != yyssa) 1884 YYSTACK_FREE (yyss); 1885#endif 1886#if YYERROR_VERBOSE 1887 if (yymsg != yymsgbuf) 1888 YYSTACK_FREE (yymsg); 1889#endif 1890 return yyresult; 1891} 1892#line 251 "winprefsyacc.y" /* yacc.c:1910 */ 1893 1894/* 1895 * Errors in parsing abort and print log messages 1896 */ 1897static int 1898yyerror (const char *s) 1899{ 1900 ErrorF("LoadPreferences: %s line %d\n", s, yylineno); 1901 return 1; 1902} 1903 1904/* Miscellaneous functions to store TOKENs into the structure */ 1905static void 1906SetIconDirectory (char *path) 1907{ 1908 strncpy (pref.iconDirectory, path, PATH_MAX); 1909 pref.iconDirectory[PATH_MAX] = 0; 1910} 1911 1912static void 1913SetDefaultIcon (char *fname) 1914{ 1915 strncpy (pref.defaultIconName, fname, NAME_MAX); 1916 pref.defaultIconName[NAME_MAX] = 0; 1917} 1918 1919static void 1920SetTrayIcon (char *fname) 1921{ 1922 strncpy (pref.trayIconName, fname, NAME_MAX); 1923 pref.trayIconName[NAME_MAX] = 0; 1924} 1925 1926static void 1927SetRootMenu (char *menuname) 1928{ 1929 strncpy (pref.rootMenuName, menuname, MENU_MAX); 1930 pref.rootMenuName[MENU_MAX] = 0; 1931} 1932 1933static void 1934SetDefaultSysMenu (char *menuname, int pos) 1935{ 1936 strncpy (pref.defaultSysMenuName, menuname, MENU_MAX); 1937 pref.defaultSysMenuName[MENU_MAX] = 0; 1938 pref.defaultSysMenuPos = pos; 1939} 1940 1941static void 1942OpenMenu (char *menuname) 1943{ 1944 if (menu.menuItem) free(menu.menuItem); 1945 menu.menuItem = NULL; 1946 strncpy(menu.menuName, menuname, MENU_MAX); 1947 menu.menuName[MENU_MAX] = 0; 1948 menu.menuItems = 0; 1949} 1950 1951static void 1952AddMenuLine (const char *text, MENUCOMMANDTYPE cmd, const char *param) 1953{ 1954 if (menu.menuItem==NULL) 1955 menu.menuItem = malloc(sizeof(MENUITEM)); 1956 else 1957 menu.menuItem = realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1)); 1958 1959 strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX); 1960 menu.menuItem[menu.menuItems].text[MENU_MAX] = 0; 1961 1962 menu.menuItem[menu.menuItems].cmd = cmd; 1963 1964 strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX); 1965 menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0; 1966 1967 menu.menuItem[menu.menuItems].commandID = 0; 1968 1969 menu.menuItems++; 1970} 1971 1972static void 1973CloseMenu (void) 1974{ 1975 if (menu.menuItem==NULL || menu.menuItems==0) 1976 { 1977 ErrorF("LoadPreferences: Empty menu detected\n"); 1978 return; 1979 } 1980 1981 if (pref.menuItems) 1982 pref.menu = realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED)); 1983 else 1984 pref.menu = malloc (sizeof(MENUPARSED)); 1985 1986 memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED)); 1987 pref.menuItems++; 1988 1989 memset (&menu, 0, sizeof(MENUPARSED)); 1990} 1991 1992static void 1993OpenIcons (void) 1994{ 1995 if (pref.icon != NULL) { 1996 ErrorF("LoadPreferences: Redefining icon mappings\n"); 1997 free(pref.icon); 1998 pref.icon = NULL; 1999 } 2000 pref.iconItems = 0; 2001} 2002 2003static void 2004AddIconLine (char *matchstr, char *iconfile) 2005{ 2006 if (pref.icon==NULL) 2007 pref.icon = malloc(sizeof(ICONITEM)); 2008 else 2009 pref.icon = realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1)); 2010 2011 strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX); 2012 pref.icon[pref.iconItems].match[MENU_MAX] = 0; 2013 2014 strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1); 2015 pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0; 2016 2017 pref.icon[pref.iconItems].hicon = 0; 2018 2019 pref.iconItems++; 2020} 2021 2022static void 2023CloseIcons (void) 2024{ 2025} 2026 2027static void 2028OpenStyles (void) 2029{ 2030 if (pref.style != NULL) { 2031 ErrorF("LoadPreferences: Redefining window style\n"); 2032 free(pref.style); 2033 pref.style = NULL; 2034 } 2035 pref.styleItems = 0; 2036} 2037 2038static void 2039AddStyleLine (char *matchstr, unsigned long style) 2040{ 2041 if (pref.style==NULL) 2042 pref.style = malloc(sizeof(STYLEITEM)); 2043 else 2044 pref.style = realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1)); 2045 2046 strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX); 2047 pref.style[pref.styleItems].match[MENU_MAX] = 0; 2048 2049 pref.style[pref.styleItems].type = style; 2050 2051 pref.styleItems++; 2052} 2053 2054static void 2055CloseStyles (void) 2056{ 2057} 2058 2059static void 2060OpenSysMenu (void) 2061{ 2062 if (pref.sysMenu != NULL) { 2063 ErrorF("LoadPreferences: Redefining system menu\n"); 2064 free(pref.sysMenu); 2065 pref.sysMenu = NULL; 2066 } 2067 pref.sysMenuItems = 0; 2068} 2069 2070static void 2071AddSysMenuLine (char *matchstr, char *menuname, int pos) 2072{ 2073 if (pref.sysMenu==NULL) 2074 pref.sysMenu = malloc(sizeof(SYSMENUITEM)); 2075 else 2076 pref.sysMenu = realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1)); 2077 2078 strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX); 2079 pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0; 2080 2081 strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX); 2082 pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0; 2083 2084 pref.sysMenu[pref.sysMenuItems].menuPos = pos; 2085 2086 pref.sysMenuItems++; 2087} 2088 2089static void 2090CloseSysMenu (void) 2091{ 2092} 2093 2094