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