1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
66 /* Copy the first part of user declarations. */
68 /* Line 268 of yacc.c */
69 #line 1 "winprefsyacc.y"
72 * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
73 * Copyright (C) Colin Harrison 2005-2008
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:
83 * The above copyright notice and this permission notice shall be
84 * included in all copies or substantial portions of the Software.
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.
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.
99 * Authors: Earle F. Philhower, III
104 #ifdef HAVE_XWIN_CONFIG_H
105 #include <xwin-config.h>
109 #define _STDLIB_H 1 /* bison checks this to know if stdlib has been included */
111 #include "winprefs.h"
113 /* The following give better error messages in bison at the cost of a few KB */
114 #define YYERROR_VERBOSE 1
116 /* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */
117 #define YYLTYPE_IS_TRIVIAL 1
118 #define YYENABLE_NLS 0
120 /* The global pref settings */
123 /* The working menu */
124 static MENUPARSED menu
;
126 /* Functions for parsing the tokens into out structure */
127 /* Defined at the end section of this file */
129 static void SetIconDirectory (char *path
);
130 static void SetDefaultIcon (char *fname
);
131 static void SetRootMenu (char *menu
);
132 static void SetDefaultSysMenu (char *menu
, int pos
);
133 static void SetTrayIcon (char *fname
);
135 static void OpenMenu(char *menuname
);
136 static void AddMenuLine(char *name
, MENUCOMMANDTYPE cmd
, char *param
);
137 static void CloseMenu(void);
139 static void OpenIcons(void);
140 static void AddIconLine(char *matchstr
, char *iconfile
);
141 static void CloseIcons(void);
143 static void OpenStyles(void);
144 static void AddStyleLine(char *matchstr
, unsigned long style
);
145 static void CloseStyles(void);
147 static void OpenSysMenu(void);
148 static void AddSysMenuLine(char *matchstr
, char *menuname
, int pos
);
149 static void CloseSysMenu(void);
151 static int yyerror (char *s
);
154 extern int yylex(void);
158 /* Line 268 of yacc.c */
159 #line 160 "winprefsyacc.c"
161 /* Enabling traces. */
166 /* Enabling verbose error messages. */
167 #ifdef YYERROR_VERBOSE
168 # undef YYERROR_VERBOSE
169 # define YYERROR_VERBOSE 1
171 # define YYERROR_VERBOSE 0
174 /* Enabling the token table. */
175 #ifndef YYTOKEN_TABLE
176 # define YYTOKEN_TABLE 0
183 /* Put the tokens into the symbol table, so that GDB and other debuggers
201 DEFAULTSYSMENU
= 273,
222 #define ICONDIRECTORY 262
223 #define DEFAULTICON 263
233 #define DEFAULTSYSMENU 273
236 #define SEPARATOR 276
240 #define ALWAYSONTOP 280
241 #define DEBUGOUTPUT 281
244 #define FORCEEXIT 284
245 #define SILENTEXIT 285
251 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
252 typedef union YYSTYPE
255 /* Line 293 of yacc.c */
256 #line 89 "winprefsyacc.y"
264 /* Line 293 of yacc.c */
265 #line 266 "winprefsyacc.c"
267 # define YYSTYPE_IS_TRIVIAL 1
268 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
269 # define YYSTYPE_IS_DECLARED 1
273 /* Copy the second part of user declarations. */
276 /* Line 343 of yacc.c */
277 #line 278 "winprefsyacc.c"
284 typedef YYTYPE_UINT8 yytype_uint8
;
286 typedef unsigned char yytype_uint8
;
290 typedef YYTYPE_INT8 yytype_int8
;
291 #elif (defined __STDC__ || defined __C99__FUNC__ \
292 || defined __cplusplus || defined _MSC_VER)
293 typedef signed char yytype_int8
;
295 typedef short int yytype_int8
;
299 typedef YYTYPE_UINT16 yytype_uint16
;
301 typedef unsigned short int yytype_uint16
;
305 typedef YYTYPE_INT16 yytype_int16
;
307 typedef short int yytype_int16
;
311 # ifdef __SIZE_TYPE__
312 # define YYSIZE_T __SIZE_TYPE__
313 # elif defined size_t
314 # define YYSIZE_T size_t
315 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
316 || defined __cplusplus || defined _MSC_VER)
317 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
318 # define YYSIZE_T size_t
320 # define YYSIZE_T unsigned int
324 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
327 # if defined YYENABLE_NLS && YYENABLE_NLS
329 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
330 # define YY_(msgid) dgettext ("bison-runtime", msgid)
334 # define YY_(msgid) msgid
338 /* Suppress unused-variable warnings by "using" E. */
339 #if ! defined lint || defined __GNUC__
340 # define YYUSE(e) ((void) (e))
342 # define YYUSE(e) /* empty */
345 /* Identity function, used to suppress warnings about constant conditions. */
349 #if (defined __STDC__ || defined __C99__FUNC__ \
350 || defined __cplusplus || defined _MSC_VER)
363 #if ! defined yyoverflow || YYERROR_VERBOSE
365 /* The parser invokes alloca or malloc; define the necessary symbols. */
367 # ifdef YYSTACK_USE_ALLOCA
368 # if YYSTACK_USE_ALLOCA
370 # define YYSTACK_ALLOC __builtin_alloca
371 # elif defined __BUILTIN_VA_ARG_INCR
372 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
374 # define YYSTACK_ALLOC __alloca
375 # elif defined _MSC_VER
376 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
377 # define alloca _alloca
379 # define YYSTACK_ALLOC alloca
380 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
381 || defined __cplusplus || defined _MSC_VER)
382 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
383 # ifndef EXIT_SUCCESS
384 # define EXIT_SUCCESS 0
391 # ifdef YYSTACK_ALLOC
392 /* Pacify GCC's `empty if-body' warning. */
393 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
394 # ifndef YYSTACK_ALLOC_MAXIMUM
395 /* The OS might guarantee only one guard page at the bottom of the stack,
396 and a page size can be as small as 4096 bytes. So we cannot safely
397 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
398 to allow for a few compiler-allocated temporary stack slots. */
399 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
402 # define YYSTACK_ALLOC YYMALLOC
403 # define YYSTACK_FREE YYFREE
404 # ifndef YYSTACK_ALLOC_MAXIMUM
405 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
407 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
408 && ! ((defined YYMALLOC || defined malloc) \
409 && (defined YYFREE || defined free)))
410 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
411 # ifndef EXIT_SUCCESS
412 # define EXIT_SUCCESS 0
416 # define YYMALLOC malloc
417 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
418 || defined __cplusplus || defined _MSC_VER)
419 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
424 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
425 || defined __cplusplus || defined _MSC_VER)
426 void free (void *); /* INFRINGES ON USER NAME SPACE */
430 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
433 #if (! defined yyoverflow \
434 && (! defined __cplusplus \
435 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
437 /* A type that is properly aligned for any stack member. */
440 yytype_int16 yyss_alloc
;
444 /* The size of the maximum gap between one aligned stack and the next. */
445 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
447 /* The size of an array large to enough to hold all stacks, each with
449 # define YYSTACK_BYTES(N) \
450 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
451 + YYSTACK_GAP_MAXIMUM)
453 # define YYCOPY_NEEDED 1
455 /* Relocate STACK from its old location to the new one. The
456 local variables YYSIZE and YYSTACKSIZE give the old and new number of
457 elements in the stack, and YYPTR gives the new location of the
458 stack. Advance YYPTR to a properly aligned location for the next
460 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
463 YYSIZE_T yynewbytes; \
464 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
465 Stack = &yyptr->Stack_alloc; \
466 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
467 yyptr += yynewbytes / sizeof (*yyptr); \
473 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
474 /* Copy COUNT objects from FROM to TO. The source and destination do
477 # if defined __GNUC__ && 1 < __GNUC__
478 # define YYCOPY(To, From, Count) \
479 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
481 # define YYCOPY(To, From, Count) \
485 for (yyi = 0; yyi < (Count); yyi++) \
486 (To)[yyi] = (From)[yyi]; \
491 #endif /* !YYCOPY_NEEDED */
493 /* YYFINAL -- State number of the termination state. */
495 /* YYLAST -- Last index in YYTABLE. */
498 /* YYNTOKENS -- Number of terminals. */
500 /* YYNNTS -- Number of nonterminals. */
502 /* YYNRULES -- Number of rules. */
504 /* YYNRULES -- Number of states. */
505 #define YYNSTATES 121
507 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
509 #define YYMAXUTOK 286
511 #define YYTRANSLATE(YYX) \
512 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
514 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
515 static const yytype_uint8 yytranslate
[] =
517 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
543 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
544 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
545 25, 26, 27, 28, 29, 30, 31
549 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
551 static const yytype_uint8 yyprhs
[] =
553 0, 0, 3, 4, 7, 9, 11, 12, 15, 17,
554 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
555 39, 43, 47, 52, 56, 60, 64, 69, 75, 81,
556 86, 88, 91, 92, 100, 105, 107, 110, 111, 118,
557 120, 122, 124, 126, 128, 130, 132, 134, 136, 139,
558 142, 147, 149, 152, 153, 160, 161, 163, 165, 171,
559 173, 176, 177, 185, 188, 191
562 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
563 static const yytype_int8 yyrhs
[] =
565 33, 0, -1, -1, 33, 34, -1, 3, -1, 36,
566 -1, -1, 3, 35, -1, 40, -1, 41, -1, 44,
567 -1, 48, -1, 55, -1, 60, -1, 38, -1, 39,
568 -1, 64, -1, 37, -1, 62, -1, 63, -1, 28,
569 31, 3, -1, 20, 31, 3, -1, 18, 31, 57,
570 3, -1, 8, 31, 3, -1, 7, 31, 3, -1,
571 21, 3, 35, -1, 31, 25, 3, 35, -1, 31,
572 24, 31, 3, 35, -1, 31, 4, 31, 3, 35,
573 -1, 31, 27, 3, 35, -1, 42, -1, 42, 43,
574 -1, -1, 4, 31, 5, 45, 35, 43, 6, -1,
575 31, 31, 3, 35, -1, 46, -1, 46, 47, -1,
576 -1, 9, 5, 49, 35, 47, 6, -1, 11, -1,
577 12, -1, 13, -1, 14, -1, 15, -1, 16, -1,
578 17, -1, 50, -1, 51, -1, 50, 51, -1, 51,
579 50, -1, 31, 52, 3, 35, -1, 53, -1, 53,
580 54, -1, -1, 10, 5, 56, 35, 54, 6, -1,
581 -1, 22, -1, 23, -1, 31, 31, 57, 3, 35,
582 -1, 58, -1, 58, 59, -1, -1, 19, 5, 3,
583 61, 35, 59, 6, -1, 29, 3, -1, 30, 3,
587 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
588 static const yytype_uint8 yyrline
[] =
590 0, 132, 132, 133, 136, 137, 141, 142, 145, 146,
591 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
592 159, 162, 165, 168, 171, 174, 175, 176, 177, 178,
593 181, 182, 185, 185, 188, 191, 192, 195, 195, 198,
594 199, 200, 201, 204, 205, 206, 209, 210, 211, 212,
595 215, 218, 219, 222, 222, 225, 226, 227, 230, 233,
596 234, 237, 237, 240, 243, 246
600 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
601 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
602 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
603 static const char *const yytname
[] =
605 "$end", "error", "$undefined", "NEWLINE", "MENU", "LB", "RB",
606 "ICONDIRECTORY", "DEFAULTICON", "ICONS", "STYLES", "TOPMOST", "MAXIMIZE",
607 "MINIMIZE", "BOTTOM", "NOTITLE", "OUTLINE", "NOFRAME", "DEFAULTSYSMENU",
608 "SYSMENU", "ROOTMENU", "SEPARATOR", "ATSTART", "ATEND", "EXEC",
609 "ALWAYSONTOP", "\"DEBUG\"", "RELOAD", "TRAYICON", "FORCEEXIT",
610 "SILENTEXIT", "STRING", "$accept", "input", "line", "newline_or_nada",
611 "command", "trayicon", "rootmenu", "defaultsysmenu", "defaulticon",
612 "icondirectory", "menuline", "menulist", "menu", "$@1", "iconline",
613 "iconlist", "icons", "$@2", "group1", "group2", "stylecombo",
614 "styleline", "stylelist", "styles", "$@3", "atspot", "sysmenuline",
615 "sysmenulist", "sysmenu", "$@4", "forceexit", "silentexit", "debug", 0
620 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
622 static const yytype_uint16 yytoknum
[] =
624 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
625 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
626 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
631 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
632 static const yytype_uint8 yyr1
[] =
634 0, 32, 33, 33, 34, 34, 35, 35, 36, 36,
635 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
636 37, 38, 39, 40, 41, 42, 42, 42, 42, 42,
637 43, 43, 45, 44, 46, 47, 47, 49, 48, 50,
638 50, 50, 50, 51, 51, 51, 52, 52, 52, 52,
639 53, 54, 54, 56, 55, 57, 57, 57, 58, 59,
640 59, 61, 60, 62, 63, 64
643 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
644 static const yytype_uint8 yyr2
[] =
646 0, 2, 0, 2, 1, 1, 0, 2, 1, 1,
647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
648 3, 3, 4, 3, 3, 3, 4, 5, 5, 4,
649 1, 2, 0, 7, 4, 1, 2, 0, 6, 1,
650 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
651 4, 1, 2, 0, 6, 0, 1, 1, 5, 1,
655 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
656 Performed when YYTABLE doesn't specify something else to do. Zero
657 means the default is an error. */
658 static const yytype_uint8 yydefact
[] =
660 2, 0, 1, 4, 0, 0, 0, 0, 0, 0,
661 0, 0, 0, 0, 0, 0, 3, 5, 17, 14,
662 15, 8, 9, 10, 11, 12, 13, 18, 19, 16,
663 0, 0, 0, 37, 53, 55, 0, 0, 0, 0,
664 63, 64, 32, 24, 23, 6, 6, 56, 57, 0,
665 61, 21, 65, 20, 6, 6, 0, 0, 22, 6,
666 0, 7, 0, 35, 0, 0, 51, 0, 0, 0,
667 0, 30, 0, 0, 36, 38, 39, 40, 41, 42,
668 43, 44, 45, 46, 47, 0, 52, 54, 0, 59,
669 0, 6, 0, 0, 0, 0, 31, 33, 6, 48,
670 49, 6, 55, 60, 62, 25, 0, 0, 6, 6,
671 34, 50, 0, 6, 6, 26, 29, 6, 28, 27,
675 /* YYDEFGOTO[NTERM-NUM]. */
676 static const yytype_int8 yydefgoto
[] =
678 -1, 1, 16, 56, 17, 18, 19, 20, 21, 22,
679 71, 72, 23, 54, 63, 64, 24, 45, 83, 84,
680 85, 66, 67, 25, 46, 49, 89, 90, 26, 59,
684 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
686 #define YYPACT_NINF -47
687 static const yytype_int8 yypact
[] =
689 -47, 7, -47, -47, -1, 0, 1, 18, 29, 15,
690 42, 17, 19, 20, 46, 50, -47, -47, -47, -47,
691 -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
692 49, 53, 54, -47, -47, 6, 55, 56, 57, 58,
693 -47, -47, -47, -47, -47, 61, 61, -47, -47, 62,
694 -47, -47, -47, -47, 61, 61, 35, 38, -47, 61,
695 -19, -47, 39, 35, 66, 27, 38, 67, 43, 72,
696 -3, -19, 70, 74, -47, -47, -47, -47, -47, -47,
697 -47, -47, -47, 3, -8, 75, -47, -47, 48, 43,
698 76, 61, 52, 59, 77, 78, -47, -47, 61, -47,
699 -47, 61, 6, -47, -47, -47, 81, 82, 61, 61,
700 -47, -47, 83, 61, 61, -47, -47, 61, -47, -47,
704 /* YYPGOTO[NTERM-NUM]. */
705 static const yytype_int8 yypgoto
[] =
707 -47, -47, -47, -46, -47, -47, -47, -47, -47, -47,
708 -47, 16, -47, -47, -47, 25, -47, -47, 5, 8,
709 -47, -47, 26, -47, -47, -9, -47, 9, -47, -47,
713 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
714 positive, shift that token. If negative, reduce the rule which
715 number is the opposite. If YYTABLE_NINF, syntax error. */
716 #define YYTABLE_NINF -1
717 static const yytype_uint8 yytable
[] =
719 57, 92, 69, 76, 77, 78, 79, 2, 60, 61,
720 3, 4, 70, 68, 5, 6, 7, 8, 80, 81,
721 82, 93, 94, 33, 95, 9, 10, 11, 47, 48,
722 30, 31, 32, 12, 34, 13, 14, 15, 76, 77,
723 78, 79, 80, 81, 82, 105, 35, 36, 37, 40,
724 38, 39, 110, 41, 42, 111, 43, 44, 50, 51,
725 52, 53, 115, 116, 55, 58, 62, 118, 119, 65,
726 73, 120, 75, 87, 88, 91, 97, 98, 101, 102,
727 108, 109, 104, 106, 113, 114, 117, 96, 74, 100,
728 107, 99, 86, 112, 0, 0, 0, 0, 103
731 #define yypact_value_is_default(yystate) \
734 #define yytable_value_is_error(yytable_value) \
737 static const yytype_int8 yycheck
[] =
739 46, 4, 21, 11, 12, 13, 14, 0, 54, 55,
740 3, 4, 31, 59, 7, 8, 9, 10, 15, 16,
741 17, 24, 25, 5, 27, 18, 19, 20, 22, 23,
742 31, 31, 31, 26, 5, 28, 29, 30, 11, 12,
743 13, 14, 15, 16, 17, 91, 31, 5, 31, 3,
744 31, 31, 98, 3, 5, 101, 3, 3, 3, 3,
745 3, 3, 108, 109, 3, 3, 31, 113, 114, 31,
746 31, 117, 6, 6, 31, 3, 6, 3, 3, 31,
747 3, 3, 6, 31, 3, 3, 3, 71, 63, 84,
748 31, 83, 66, 102, -1, -1, -1, -1, 89
751 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
752 symbol of state STATE-NUM. */
753 static const yytype_uint8 yystos
[] =
755 0, 33, 0, 3, 4, 7, 8, 9, 10, 18,
756 19, 20, 26, 28, 29, 30, 34, 36, 37, 38,
757 39, 40, 41, 44, 48, 55, 60, 62, 63, 64,
758 31, 31, 31, 5, 5, 31, 5, 31, 31, 31,
759 3, 3, 5, 3, 3, 49, 56, 22, 23, 57,
760 3, 3, 3, 3, 45, 3, 35, 35, 3, 61,
761 35, 35, 31, 46, 47, 31, 53, 54, 35, 21,
762 31, 42, 43, 31, 47, 6, 11, 12, 13, 14,
763 15, 16, 17, 50, 51, 52, 54, 6, 31, 58,
764 59, 3, 4, 24, 25, 27, 43, 6, 3, 51,
765 50, 3, 31, 59, 6, 35, 31, 31, 3, 3,
766 35, 35, 57, 3, 3, 35, 35, 3, 35, 35,
770 #define yyerrok (yyerrstatus = 0)
771 #define yyclearin (yychar = YYEMPTY)
775 #define YYACCEPT goto yyacceptlab
776 #define YYABORT goto yyabortlab
777 #define YYERROR goto yyerrorlab
780 /* Like YYERROR except do call yyerror. This remains here temporarily
781 to ease the transition to the new meaning of YYERROR, for GCC.
782 Once GCC version 2 has supplanted version 1, this can go. However,
783 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
784 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
787 #define YYFAIL goto yyerrlab
789 /* This is here to suppress warnings from the GCC cpp's
790 -Wunused-macros. Normally we don't worry about that warning, but
791 some users do, and we want to make it easy for users to remove
792 YYFAIL uses, which will produce warnings from Bison 2.5. */
795 #define YYRECOVERING() (!!yyerrstatus)
797 #define YYBACKUP(Token, Value) \
799 if (yychar == YYEMPTY && yylen == 1) \
808 yyerror (YY_("syntax error: cannot back up")); \
815 #define YYERRCODE 256
818 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
819 If N is 0, then set CURRENT to the empty location which ends
820 the previous symbol: RHS[0] (always defined). */
822 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
823 #ifndef YYLLOC_DEFAULT
824 # define YYLLOC_DEFAULT(Current, Rhs, N) \
828 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
829 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
830 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
831 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
835 (Current).first_line = (Current).last_line = \
836 YYRHSLOC (Rhs, 0).last_line; \
837 (Current).first_column = (Current).last_column = \
838 YYRHSLOC (Rhs, 0).last_column; \
844 /* This macro is provided for backward compatibility. */
846 #ifndef YY_LOCATION_PRINT
847 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
851 /* YYLEX -- calling `yylex' with the right arguments. */
854 # define YYLEX yylex (YYLEX_PARAM)
856 # define YYLEX yylex ()
859 /* Enable debugging if requested. */
863 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
864 # define YYFPRINTF fprintf
867 # define YYDPRINTF(Args) \
873 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
877 YYFPRINTF (stderr, "%s ", Title); \
878 yy_symbol_print (stderr, \
880 YYFPRINTF (stderr, "\n"); \
885 /*--------------------------------.
886 | Print this symbol on YYOUTPUT. |
887 `--------------------------------*/
890 #if (defined __STDC__ || defined __C99__FUNC__ \
891 || defined __cplusplus || defined _MSC_VER)
893 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
896 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
899 YYSTYPE
const * const yyvaluep
;
905 if (yytype
< YYNTOKENS
)
906 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
918 /*--------------------------------.
919 | Print this symbol on YYOUTPUT. |
920 `--------------------------------*/
922 #if (defined __STDC__ || defined __C99__FUNC__ \
923 || defined __cplusplus || defined _MSC_VER)
925 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
928 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
931 YYSTYPE
const * const yyvaluep
;
934 if (yytype
< YYNTOKENS
)
935 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
937 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
939 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
940 YYFPRINTF (yyoutput
, ")");
943 /*------------------------------------------------------------------.
944 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
946 `------------------------------------------------------------------*/
948 #if (defined __STDC__ || defined __C99__FUNC__ \
949 || defined __cplusplus || defined _MSC_VER)
951 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
954 yy_stack_print (yybottom
, yytop
)
955 yytype_int16
*yybottom
;
959 YYFPRINTF (stderr
, "Stack now");
960 for (; yybottom
<= yytop
; yybottom
++)
962 int yybot
= *yybottom
;
963 YYFPRINTF (stderr
, " %d", yybot
);
965 YYFPRINTF (stderr
, "\n");
968 # define YY_STACK_PRINT(Bottom, Top) \
971 yy_stack_print ((Bottom), (Top)); \
975 /*------------------------------------------------.
976 | Report that the YYRULE is going to be reduced. |
977 `------------------------------------------------*/
979 #if (defined __STDC__ || defined __C99__FUNC__ \
980 || defined __cplusplus || defined _MSC_VER)
982 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
985 yy_reduce_print (yyvsp
, yyrule
)
990 int yynrhs
= yyr2
[yyrule
];
992 unsigned long int yylno
= yyrline
[yyrule
];
993 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
995 /* The symbols being reduced. */
996 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
998 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
999 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1000 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1002 YYFPRINTF (stderr
, "\n");
1006 # define YY_REDUCE_PRINT(Rule) \
1009 yy_reduce_print (yyvsp, Rule); \
1012 /* Nonzero means print parse trace. It is left uninitialized so that
1013 multiple parsers can coexist. */
1015 #else /* !YYDEBUG */
1016 # define YYDPRINTF(Args)
1017 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1018 # define YY_STACK_PRINT(Bottom, Top)
1019 # define YY_REDUCE_PRINT(Rule)
1020 #endif /* !YYDEBUG */
1023 /* YYINITDEPTH -- initial size of the parser's stacks. */
1025 # define YYINITDEPTH 200
1028 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1029 if the built-in stack extension method is used).
1031 Do not make this value too large; the results are undefined if
1032 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1033 evaluated with infinite-precision integer arithmetic. */
1036 # define YYMAXDEPTH 10000
1043 # if defined __GLIBC__ && defined _STRING_H
1044 # define yystrlen strlen
1046 /* Return the length of YYSTR. */
1047 #if (defined __STDC__ || defined __C99__FUNC__ \
1048 || defined __cplusplus || defined _MSC_VER)
1050 yystrlen (const char *yystr
)
1058 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1066 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1067 # define yystpcpy stpcpy
1069 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1071 #if (defined __STDC__ || defined __C99__FUNC__ \
1072 || defined __cplusplus || defined _MSC_VER)
1074 yystpcpy (char *yydest
, const char *yysrc
)
1077 yystpcpy (yydest
, yysrc
)
1083 const char *yys
= yysrc
;
1085 while ((*yyd
++ = *yys
++) != '\0')
1094 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1095 quotes and backslashes, so that it's suitable for yyerror. The
1096 heuristic is that double-quoting is unnecessary unless the string
1097 contains an apostrophe, a comma, or backslash (other than
1098 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1099 null, do not copy; instead, return the length of what the result
1102 yytnamerr (char *yyres
, const char *yystr
)
1107 char const *yyp
= yystr
;
1114 goto do_not_strip_quotes
;
1118 goto do_not_strip_quotes
;
1131 do_not_strip_quotes
: ;
1135 return yystrlen (yystr
);
1137 return yystpcpy (yyres
, yystr
) - yyres
;
1141 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1142 about the unexpected token YYTOKEN for the state stack whose top is
1145 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1146 not large enough to hold the message. In that case, also set
1147 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1148 required number of bytes is too large to store. */
1150 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1151 yytype_int16
*yyssp
, int yytoken
)
1153 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1154 YYSIZE_T yysize
= yysize0
;
1156 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1157 /* Internationalized format string. */
1158 const char *yyformat
= 0;
1159 /* Arguments of yyformat. */
1160 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1161 /* Number of reported tokens (one for the "unexpected", one per
1165 /* There are many possibilities here to consider:
1166 - Assume YYFAIL is not used. It's too flawed to consider. See
1167 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1168 for details. YYERROR is fine as it does not invoke this
1170 - If this state is a consistent state with a default action, then
1171 the only way this function was invoked is if the default action
1172 is an error action. In that case, don't check for expected
1173 tokens because there are none.
1174 - The only way there can be no lookahead present (in yychar) is if
1175 this state is a consistent state with a default action. Thus,
1176 detecting the absence of a lookahead is sufficient to determine
1177 that there is no unexpected or expected token to report. In that
1178 case, just report a simple "syntax error".
1179 - Don't assume there isn't a lookahead just because this state is a
1180 consistent state with a default action. There might have been a
1181 previous inconsistent state, consistent state with a non-default
1182 action, or user semantic action that manipulated yychar.
1183 - Of course, the expected token list depends on states to have
1184 correct lookahead information, and it depends on the parser not
1185 to perform extra reductions after fetching a lookahead from the
1186 scanner and before detecting a syntax error. Thus, state merging
1187 (from LALR or IELR) and default reductions corrupt the expected
1188 token list. However, the list is correct for canonical LR with
1189 one exception: it will still contain any token that will not be
1190 accepted due to an error action in a later state.
1192 if (yytoken
!= YYEMPTY
)
1194 int yyn
= yypact
[*yyssp
];
1195 yyarg
[yycount
++] = yytname
[yytoken
];
1196 if (!yypact_value_is_default (yyn
))
1198 /* Start YYX at -YYN if negative to avoid negative indexes in
1199 YYCHECK. In other words, skip the first -YYN actions for
1200 this state because they are default actions. */
1201 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1202 /* Stay within bounds of both yycheck and yytname. */
1203 int yychecklim
= YYLAST
- yyn
+ 1;
1204 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1207 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1208 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1209 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1211 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1217 yyarg
[yycount
++] = yytname
[yyx
];
1218 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1219 if (! (yysize
<= yysize1
1220 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1229 # define YYCASE_(N, S) \
1233 YYCASE_(0, YY_("syntax error"));
1234 YYCASE_(1, YY_("syntax error, unexpected %s"));
1235 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1236 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1237 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1238 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1242 yysize1
= yysize
+ yystrlen (yyformat
);
1243 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1247 if (*yymsg_alloc
< yysize
)
1249 *yymsg_alloc
= 2 * yysize
;
1250 if (! (yysize
<= *yymsg_alloc
1251 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1252 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1256 /* Avoid sprintf, as that infringes on the user's name space.
1257 Don't have undefined behavior even if the translation
1258 produced a string with the wrong number of "%s"s. */
1262 while ((*yyp
= *yyformat
) != '\0')
1263 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1265 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1276 #endif /* YYERROR_VERBOSE */
1278 /*-----------------------------------------------.
1279 | Release the memory associated to this symbol. |
1280 `-----------------------------------------------*/
1283 #if (defined __STDC__ || defined __C99__FUNC__ \
1284 || defined __cplusplus || defined _MSC_VER)
1286 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1289 yydestruct (yymsg
, yytype
, yyvaluep
)
1299 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1310 /* Prevent warnings from -Wmissing-prototypes. */
1311 #ifdef YYPARSE_PARAM
1312 #if defined __STDC__ || defined __cplusplus
1313 int yyparse (void *YYPARSE_PARAM
);
1317 #else /* ! YYPARSE_PARAM */
1318 #if defined __STDC__ || defined __cplusplus
1323 #endif /* ! YYPARSE_PARAM */
1326 /* The lookahead symbol. */
1329 /* The semantic value of the lookahead symbol. */
1332 /* Number of syntax errors so far. */
1340 #ifdef YYPARSE_PARAM
1341 #if (defined __STDC__ || defined __C99__FUNC__ \
1342 || defined __cplusplus || defined _MSC_VER)
1344 yyparse (void *YYPARSE_PARAM
)
1347 yyparse (YYPARSE_PARAM
)
1348 void *YYPARSE_PARAM
;
1350 #else /* ! YYPARSE_PARAM */
1351 #if (defined __STDC__ || defined __C99__FUNC__ \
1352 || defined __cplusplus || defined _MSC_VER)
1363 /* Number of tokens to shift before error messages enabled. */
1366 /* The stacks and their tools:
1367 `yyss': related to states.
1368 `yyvs': related to semantic values.
1370 Refer to the stacks thru separate pointers, to allow yyoverflow
1371 to reallocate them elsewhere. */
1373 /* The state stack. */
1374 yytype_int16 yyssa
[YYINITDEPTH
];
1376 yytype_int16
*yyssp
;
1378 /* The semantic value stack. */
1379 YYSTYPE yyvsa
[YYINITDEPTH
];
1383 YYSIZE_T yystacksize
;
1387 /* Lookahead token as an internal (translated) token number. */
1389 /* The variables used to return semantic value and location from the
1394 /* Buffer for error messages, and its allocated size. */
1396 char *yymsg
= yymsgbuf
;
1397 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1400 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1402 /* The number of symbols on the RHS of the reduced rule.
1403 Keep to zero when no symbol should be popped. */
1409 yystacksize
= YYINITDEPTH
;
1411 YYDPRINTF ((stderr
, "Starting parse\n"));
1416 yychar
= YYEMPTY
; /* Cause a token to be read. */
1418 /* Initialize stack pointers.
1419 Waste one element of value and location stack
1420 so that they stay on the same level as the state stack.
1421 The wasted elements are never initialized. */
1427 /*------------------------------------------------------------.
1428 | yynewstate -- Push a new state, which is found in yystate. |
1429 `------------------------------------------------------------*/
1431 /* In all cases, when you get here, the value and location stacks
1432 have just been pushed. So pushing a state here evens the stacks. */
1438 if (yyss
+ yystacksize
- 1 <= yyssp
)
1440 /* Get the current used size of the three stacks, in elements. */
1441 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1445 /* Give user a chance to reallocate the stack. Use copies of
1446 these so that the &'s don't force the real ones into
1448 YYSTYPE
*yyvs1
= yyvs
;
1449 yytype_int16
*yyss1
= yyss
;
1451 /* Each stack pointer address is followed by the size of the
1452 data in use in that stack, in bytes. This used to be a
1453 conditional around just the two extra args, but that might
1454 be undefined if yyoverflow is a macro. */
1455 yyoverflow (YY_("memory exhausted"),
1456 &yyss1
, yysize
* sizeof (*yyssp
),
1457 &yyvs1
, yysize
* sizeof (*yyvsp
),
1463 #else /* no yyoverflow */
1464 # ifndef YYSTACK_RELOCATE
1465 goto yyexhaustedlab
;
1467 /* Extend the stack our own way. */
1468 if (YYMAXDEPTH
<= yystacksize
)
1469 goto yyexhaustedlab
;
1471 if (YYMAXDEPTH
< yystacksize
)
1472 yystacksize
= YYMAXDEPTH
;
1475 yytype_int16
*yyss1
= yyss
;
1476 union yyalloc
*yyptr
=
1477 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1479 goto yyexhaustedlab
;
1480 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1481 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1482 # undef YYSTACK_RELOCATE
1484 YYSTACK_FREE (yyss1
);
1487 #endif /* no yyoverflow */
1489 yyssp
= yyss
+ yysize
- 1;
1490 yyvsp
= yyvs
+ yysize
- 1;
1492 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1493 (unsigned long int) yystacksize
));
1495 if (yyss
+ yystacksize
- 1 <= yyssp
)
1499 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1501 if (yystate
== YYFINAL
)
1511 /* Do appropriate processing given the current state. Read a
1512 lookahead token if we need one and don't already have one. */
1514 /* First try to decide what to do without reference to lookahead token. */
1515 yyn
= yypact
[yystate
];
1516 if (yypact_value_is_default (yyn
))
1519 /* Not known => get a lookahead token if don't already have one. */
1521 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1522 if (yychar
== YYEMPTY
)
1524 YYDPRINTF ((stderr
, "Reading a token: "));
1528 if (yychar
<= YYEOF
)
1530 yychar
= yytoken
= YYEOF
;
1531 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1535 yytoken
= YYTRANSLATE (yychar
);
1536 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1539 /* If the proper action on seeing token YYTOKEN is to reduce or to
1540 detect an error, take that action. */
1542 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1547 if (yytable_value_is_error (yyn
))
1553 /* Count tokens shifted since error; after three, turn off error
1558 /* Shift the lookahead token. */
1559 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1561 /* Discard the shifted token. */
1570 /*-----------------------------------------------------------.
1571 | yydefault -- do the default action for the current state. |
1572 `-----------------------------------------------------------*/
1574 yyn
= yydefact
[yystate
];
1580 /*-----------------------------.
1581 | yyreduce -- Do a reduction. |
1582 `-----------------------------*/
1584 /* yyn is the number of a rule to reduce with. */
1587 /* If YYLEN is nonzero, implement the default value of the action:
1590 Otherwise, the following line sets YYVAL to garbage.
1591 This behavior is undocumented and Bison
1592 users should not rely upon it. Assigning to YYVAL
1593 unconditionally makes the parser a bit smaller, and it avoids a
1594 GCC warning that YYVAL may be used uninitialized. */
1595 yyval
= yyvsp
[1-yylen
];
1598 YY_REDUCE_PRINT (yyn
);
1603 /* Line 1806 of yacc.c */
1604 #line 159 "winprefsyacc.y"
1605 { SetTrayIcon((yyvsp
[(2) - (3)].sVal
)); free((yyvsp
[(2) - (3)].sVal
)); }
1610 /* Line 1806 of yacc.c */
1611 #line 162 "winprefsyacc.y"
1612 { SetRootMenu((yyvsp
[(2) - (3)].sVal
)); free((yyvsp
[(2) - (3)].sVal
)); }
1617 /* Line 1806 of yacc.c */
1618 #line 165 "winprefsyacc.y"
1619 { SetDefaultSysMenu((yyvsp
[(2) - (4)].sVal
), (yyvsp
[(3) - (4)].iVal
)); free((yyvsp
[(2) - (4)].sVal
)); }
1624 /* Line 1806 of yacc.c */
1625 #line 168 "winprefsyacc.y"
1626 { SetDefaultIcon((yyvsp
[(2) - (3)].sVal
)); free((yyvsp
[(2) - (3)].sVal
)); }
1631 /* Line 1806 of yacc.c */
1632 #line 171 "winprefsyacc.y"
1633 { SetIconDirectory((yyvsp
[(2) - (3)].sVal
)); free((yyvsp
[(2) - (3)].sVal
)); }
1638 /* Line 1806 of yacc.c */
1639 #line 174 "winprefsyacc.y"
1640 { AddMenuLine("-", CMD_SEPARATOR
, ""); }
1645 /* Line 1806 of yacc.c */
1646 #line 175 "winprefsyacc.y"
1647 { AddMenuLine((yyvsp
[(1) - (4)].sVal
), CMD_ALWAYSONTOP
, ""); free((yyvsp
[(1) - (4)].sVal
)); }
1652 /* Line 1806 of yacc.c */
1653 #line 176 "winprefsyacc.y"
1654 { AddMenuLine((yyvsp
[(1) - (5)].sVal
), CMD_EXEC
, (yyvsp
[(3) - (5)].sVal
)); free((yyvsp
[(1) - (5)].sVal
)); free((yyvsp
[(3) - (5)].sVal
)); }
1659 /* Line 1806 of yacc.c */
1660 #line 177 "winprefsyacc.y"
1661 { AddMenuLine((yyvsp
[(1) - (5)].sVal
), CMD_MENU
, (yyvsp
[(3) - (5)].sVal
)); free((yyvsp
[(1) - (5)].sVal
)); free((yyvsp
[(3) - (5)].sVal
)); }
1666 /* Line 1806 of yacc.c */
1667 #line 178 "winprefsyacc.y"
1668 { AddMenuLine((yyvsp
[(1) - (4)].sVal
), CMD_RELOAD
, ""); free((yyvsp
[(1) - (4)].sVal
)); }
1673 /* Line 1806 of yacc.c */
1674 #line 185 "winprefsyacc.y"
1675 { OpenMenu((yyvsp
[(2) - (3)].sVal
)); free((yyvsp
[(2) - (3)].sVal
)); }
1680 /* Line 1806 of yacc.c */
1681 #line 185 "winprefsyacc.y"
1687 /* Line 1806 of yacc.c */
1688 #line 188 "winprefsyacc.y"
1689 { AddIconLine((yyvsp
[(1) - (4)].sVal
), (yyvsp
[(2) - (4)].sVal
)); free((yyvsp
[(1) - (4)].sVal
)); free((yyvsp
[(2) - (4)].sVal
)); }
1694 /* Line 1806 of yacc.c */
1695 #line 195 "winprefsyacc.y"
1701 /* Line 1806 of yacc.c */
1702 #line 195 "winprefsyacc.y"
1708 /* Line 1806 of yacc.c */
1709 #line 198 "winprefsyacc.y"
1710 { (yyval
.uVal
)=STYLE_TOPMOST
; }
1715 /* Line 1806 of yacc.c */
1716 #line 199 "winprefsyacc.y"
1717 { (yyval
.uVal
)=STYLE_MAXIMIZE
; }
1722 /* Line 1806 of yacc.c */
1723 #line 200 "winprefsyacc.y"
1724 { (yyval
.uVal
)=STYLE_MINIMIZE
; }
1729 /* Line 1806 of yacc.c */
1730 #line 201 "winprefsyacc.y"
1731 { (yyval
.uVal
)=STYLE_BOTTOM
; }
1736 /* Line 1806 of yacc.c */
1737 #line 204 "winprefsyacc.y"
1738 { (yyval
.uVal
)=STYLE_NOTITLE
; }
1743 /* Line 1806 of yacc.c */
1744 #line 205 "winprefsyacc.y"
1745 { (yyval
.uVal
)=STYLE_OUTLINE
; }
1750 /* Line 1806 of yacc.c */
1751 #line 206 "winprefsyacc.y"
1752 { (yyval
.uVal
)=STYLE_NOFRAME
; }
1757 /* Line 1806 of yacc.c */
1758 #line 209 "winprefsyacc.y"
1759 { (yyval
.uVal
)=(yyvsp
[(1) - (1)].uVal
); }
1764 /* Line 1806 of yacc.c */
1765 #line 210 "winprefsyacc.y"
1766 { (yyval
.uVal
)=(yyvsp
[(1) - (1)].uVal
); }
1771 /* Line 1806 of yacc.c */
1772 #line 211 "winprefsyacc.y"
1773 { (yyval
.uVal
)=(yyvsp
[(1) - (2)].uVal
)|(yyvsp
[(2) - (2)].uVal
); }
1778 /* Line 1806 of yacc.c */
1779 #line 212 "winprefsyacc.y"
1780 { (yyval
.uVal
)=(yyvsp
[(1) - (2)].uVal
)|(yyvsp
[(2) - (2)].uVal
); }
1785 /* Line 1806 of yacc.c */
1786 #line 215 "winprefsyacc.y"
1787 { AddStyleLine((yyvsp
[(1) - (4)].sVal
), (yyvsp
[(2) - (4)].uVal
)); free((yyvsp
[(1) - (4)].sVal
)); }
1792 /* Line 1806 of yacc.c */
1793 #line 222 "winprefsyacc.y"
1799 /* Line 1806 of yacc.c */
1800 #line 222 "winprefsyacc.y"
1806 /* Line 1806 of yacc.c */
1807 #line 225 "winprefsyacc.y"
1808 { (yyval
.iVal
)=AT_END
; }
1813 /* Line 1806 of yacc.c */
1814 #line 226 "winprefsyacc.y"
1815 { (yyval
.iVal
)=AT_START
; }
1820 /* Line 1806 of yacc.c */
1821 #line 227 "winprefsyacc.y"
1822 { (yyval
.iVal
)=AT_END
; }
1827 /* Line 1806 of yacc.c */
1828 #line 230 "winprefsyacc.y"
1829 { AddSysMenuLine((yyvsp
[(1) - (5)].sVal
), (yyvsp
[(2) - (5)].sVal
), (yyvsp
[(3) - (5)].iVal
)); free((yyvsp
[(1) - (5)].sVal
)); free((yyvsp
[(2) - (5)].sVal
)); }
1834 /* Line 1806 of yacc.c */
1835 #line 237 "winprefsyacc.y"
1841 /* Line 1806 of yacc.c */
1842 #line 237 "winprefsyacc.y"
1848 /* Line 1806 of yacc.c */
1849 #line 240 "winprefsyacc.y"
1850 { pref
.fForceExit
= TRUE
; }
1855 /* Line 1806 of yacc.c */
1856 #line 243 "winprefsyacc.y"
1857 { pref
.fSilentExit
= TRUE
; }
1862 /* Line 1806 of yacc.c */
1863 #line 246 "winprefsyacc.y"
1864 { ErrorF("LoadPreferences: %s\n", (yyvsp
[(2) - (3)].sVal
)); free((yyvsp
[(2) - (3)].sVal
)); }
1869 /* Line 1806 of yacc.c */
1870 #line 1871 "winprefsyacc.c"
1873 /* User semantic actions sometimes alter yychar, and that requires
1874 that yytoken be updated with the new translation. We take the
1875 approach of translating immediately before every use of yytoken.
1876 One alternative is translating here after every semantic action,
1877 but that translation would be missed if the semantic action invokes
1878 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1879 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1880 incorrect destructor might then be invoked immediately. In the
1881 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1882 to an incorrect destructor call or verbose syntax error message
1883 before the lookahead is translated. */
1884 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
1888 YY_STACK_PRINT (yyss
, yyssp
);
1892 /* Now `shift' the result of the reduction. Determine what state
1893 that goes to, based on the state we popped back to and the rule
1894 number reduced by. */
1898 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1899 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1900 yystate
= yytable
[yystate
];
1902 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1907 /*------------------------------------.
1908 | yyerrlab -- here on detecting error |
1909 `------------------------------------*/
1911 /* Make sure we have latest lookahead translation. See comments at
1912 user semantic actions for why this is necessary. */
1913 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
1915 /* If not already recovering from an error, report this error. */
1919 #if ! YYERROR_VERBOSE
1920 yyerror (YY_("syntax error"));
1922 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1925 char const *yymsgp
= YY_("syntax error");
1926 int yysyntax_error_status
;
1927 yysyntax_error_status
= YYSYNTAX_ERROR
;
1928 if (yysyntax_error_status
== 0)
1930 else if (yysyntax_error_status
== 1)
1932 if (yymsg
!= yymsgbuf
)
1933 YYSTACK_FREE (yymsg
);
1934 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
1938 yymsg_alloc
= sizeof yymsgbuf
;
1939 yysyntax_error_status
= 2;
1943 yysyntax_error_status
= YYSYNTAX_ERROR
;
1948 if (yysyntax_error_status
== 2)
1949 goto yyexhaustedlab
;
1951 # undef YYSYNTAX_ERROR
1957 if (yyerrstatus
== 3)
1959 /* If just tried and failed to reuse lookahead token after an
1960 error, discard it. */
1962 if (yychar
<= YYEOF
)
1964 /* Return failure if at end of input. */
1965 if (yychar
== YYEOF
)
1970 yydestruct ("Error: discarding",
1976 /* Else will try to reuse lookahead token after shifting the error
1981 /*---------------------------------------------------.
1982 | yyerrorlab -- error raised explicitly by YYERROR. |
1983 `---------------------------------------------------*/
1986 /* Pacify compilers like GCC when the user code never invokes
1987 YYERROR and the label yyerrorlab therefore never appears in user
1989 if (/*CONSTCOND*/ 0)
1992 /* Do not reclaim the symbols of the rule which action triggered
1996 YY_STACK_PRINT (yyss
, yyssp
);
2001 /*-------------------------------------------------------------.
2002 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2003 `-------------------------------------------------------------*/
2005 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2009 yyn
= yypact
[yystate
];
2010 if (!yypact_value_is_default (yyn
))
2013 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2021 /* Pop the current state because it cannot handle the error token. */
2026 yydestruct ("Error: popping",
2027 yystos
[yystate
], yyvsp
);
2030 YY_STACK_PRINT (yyss
, yyssp
);
2036 /* Shift the error token. */
2037 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2043 /*-------------------------------------.
2044 | yyacceptlab -- YYACCEPT comes here. |
2045 `-------------------------------------*/
2050 /*-----------------------------------.
2051 | yyabortlab -- YYABORT comes here. |
2052 `-----------------------------------*/
2057 #if !defined(yyoverflow) || YYERROR_VERBOSE
2058 /*-------------------------------------------------.
2059 | yyexhaustedlab -- memory exhaustion comes here. |
2060 `-------------------------------------------------*/
2062 yyerror (YY_("memory exhausted"));
2068 if (yychar
!= YYEMPTY
)
2070 /* Make sure we have latest lookahead translation. See comments at
2071 user semantic actions for why this is necessary. */
2072 yytoken
= YYTRANSLATE (yychar
);
2073 yydestruct ("Cleanup: discarding lookahead",
2076 /* Do not reclaim the symbols of the rule which action triggered
2077 this YYABORT or YYACCEPT. */
2079 YY_STACK_PRINT (yyss
, yyssp
);
2080 while (yyssp
!= yyss
)
2082 yydestruct ("Cleanup: popping",
2083 yystos
[*yyssp
], yyvsp
);
2088 YYSTACK_FREE (yyss
);
2091 if (yymsg
!= yymsgbuf
)
2092 YYSTACK_FREE (yymsg
);
2094 /* Make sure YYID is used. */
2095 return YYID (yyresult
);
2100 /* Line 2067 of yacc.c */
2101 #line 250 "winprefsyacc.y"
2104 * Errors in parsing abort and print log messages
2109 extern int yylineno
; /* Handled by flex internally */
2111 ErrorF("LoadPreferences: %s line %d\n", s
, yylineno
);
2115 /* Miscellaneous functions to store TOKENs into the structure */
2117 SetIconDirectory (char *path
)
2119 strncpy (pref
.iconDirectory
, path
, PATH_MAX
);
2120 pref
.iconDirectory
[PATH_MAX
] = 0;
2124 SetDefaultIcon (char *fname
)
2126 strncpy (pref
.defaultIconName
, fname
, NAME_MAX
);
2127 pref
.defaultIconName
[NAME_MAX
] = 0;
2131 SetTrayIcon (char *fname
)
2133 strncpy (pref
.trayIconName
, fname
, NAME_MAX
);
2134 pref
.trayIconName
[NAME_MAX
] = 0;
2138 SetRootMenu (char *menuname
)
2140 strncpy (pref
.rootMenuName
, menuname
, MENU_MAX
);
2141 pref
.rootMenuName
[MENU_MAX
] = 0;
2145 SetDefaultSysMenu (char *menuname
, int pos
)
2147 strncpy (pref
.defaultSysMenuName
, menuname
, MENU_MAX
);
2148 pref
.defaultSysMenuName
[MENU_MAX
] = 0;
2149 pref
.defaultSysMenuPos
= pos
;
2153 OpenMenu (char *menuname
)
2155 if (menu
.menuItem
) free(menu
.menuItem
);
2156 menu
.menuItem
= NULL
;
2157 strncpy(menu
.menuName
, menuname
, MENU_MAX
);
2158 menu
.menuName
[MENU_MAX
] = 0;
2163 AddMenuLine (char *text
, MENUCOMMANDTYPE cmd
, char *param
)
2165 if (menu
.menuItem
==NULL
)
2166 menu
.menuItem
= (MENUITEM
*)malloc(sizeof(MENUITEM
));
2168 menu
.menuItem
= (MENUITEM
*)
2169 realloc(menu
.menuItem
, sizeof(MENUITEM
)*(menu
.menuItems
+1));
2171 strncpy (menu
.menuItem
[menu
.menuItems
].text
, text
, MENU_MAX
);
2172 menu
.menuItem
[menu
.menuItems
].text
[MENU_MAX
] = 0;
2174 menu
.menuItem
[menu
.menuItems
].cmd
= cmd
;
2176 strncpy(menu
.menuItem
[menu
.menuItems
].param
, param
, PARAM_MAX
);
2177 menu
.menuItem
[menu
.menuItems
].param
[PARAM_MAX
] = 0;
2179 menu
.menuItem
[menu
.menuItems
].commandID
= 0;
2187 if (menu
.menuItem
==NULL
|| menu
.menuItems
==0)
2189 ErrorF("LoadPreferences: Empty menu detected\n");
2194 pref
.menu
= (MENUPARSED
*)
2195 realloc (pref
.menu
, (pref
.menuItems
+1)*sizeof(MENUPARSED
));
2197 pref
.menu
= (MENUPARSED
*)malloc (sizeof(MENUPARSED
));
2199 memcpy (pref
.menu
+pref
.menuItems
, &menu
, sizeof(MENUPARSED
));
2202 memset (&menu
, 0, sizeof(MENUPARSED
));
2208 if (pref
.icon
!= NULL
) {
2209 ErrorF("LoadPreferences: Redefining icon mappings\n");
2217 AddIconLine (char *matchstr
, char *iconfile
)
2219 if (pref
.icon
==NULL
)
2220 pref
.icon
= (ICONITEM
*)malloc(sizeof(ICONITEM
));
2222 pref
.icon
= (ICONITEM
*)
2223 realloc(pref
.icon
, sizeof(ICONITEM
)*(pref
.iconItems
+1));
2225 strncpy(pref
.icon
[pref
.iconItems
].match
, matchstr
, MENU_MAX
);
2226 pref
.icon
[pref
.iconItems
].match
[MENU_MAX
] = 0;
2228 strncpy(pref
.icon
[pref
.iconItems
].iconFile
, iconfile
, PATH_MAX
+NAME_MAX
+1);
2229 pref
.icon
[pref
.iconItems
].iconFile
[PATH_MAX
+NAME_MAX
+1] = 0;
2231 pref
.icon
[pref
.iconItems
].hicon
= 0;
2244 if (pref
.style
!= NULL
) {
2245 ErrorF("LoadPreferences: Redefining window style\n");
2249 pref
.styleItems
= 0;
2253 AddStyleLine (char *matchstr
, unsigned long style
)
2255 if (pref
.style
==NULL
)
2256 pref
.style
= (STYLEITEM
*)malloc(sizeof(STYLEITEM
));
2258 pref
.style
= (STYLEITEM
*)
2259 realloc(pref
.style
, sizeof(STYLEITEM
)*(pref
.styleItems
+1));
2261 strncpy(pref
.style
[pref
.styleItems
].match
, matchstr
, MENU_MAX
);
2262 pref
.style
[pref
.styleItems
].match
[MENU_MAX
] = 0;
2264 pref
.style
[pref
.styleItems
].type
= style
;
2277 if (pref
.sysMenu
!= NULL
) {
2278 ErrorF("LoadPreferences: Redefining system menu\n");
2280 pref
.sysMenu
= NULL
;
2282 pref
.sysMenuItems
= 0;
2286 AddSysMenuLine (char *matchstr
, char *menuname
, int pos
)
2288 if (pref
.sysMenu
==NULL
)
2289 pref
.sysMenu
= (SYSMENUITEM
*)malloc(sizeof(SYSMENUITEM
));
2291 pref
.sysMenu
= (SYSMENUITEM
*)
2292 realloc(pref
.sysMenu
, sizeof(SYSMENUITEM
)*(pref
.sysMenuItems
+1));
2294 strncpy (pref
.sysMenu
[pref
.sysMenuItems
].match
, matchstr
, MENU_MAX
);
2295 pref
.sysMenu
[pref
.sysMenuItems
].match
[MENU_MAX
] = 0;
2297 strncpy (pref
.sysMenu
[pref
.sysMenuItems
].menuName
, menuname
, MENU_MAX
);
2298 pref
.sysMenu
[pref
.sysMenuItems
].menuName
[MENU_MAX
] = 0;
2300 pref
.sysMenu
[pref
.sysMenuItems
].menuPos
= pos
;
2302 pref
.sysMenuItems
++;