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