Commit | Line | Data |
---|---|---|
a09e091a JB |
1 | /* A Bison parser, made by GNU Bison 2.5. */ |
2 | ||
3 | /* Bison implementation for Yacc-like parsers in C | |
4 | ||
5 | Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. | |
6 | ||
7 | This program is free software: you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation, either version 3 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | /* As a special exception, you may create a larger work that contains | |
21 | part or all of the Bison parser skeleton and distribute that work | |
22 | under terms of your choice, so long as that work isn't itself a | |
23 | parser generator using the skeleton or a modified version thereof | |
24 | as a parser skeleton. Alternatively, if you modify or redistribute | |
25 | the parser skeleton itself, you may (at your option) remove this | |
26 | special exception, which will cause the skeleton and the resulting | |
27 | Bison output files to be licensed under the GNU General Public | |
28 | License without this special exception. | |
29 | ||
30 | This special exception was added by the Free Software Foundation in | |
31 | version 2.2 of Bison. */ | |
32 | ||
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by | |
34 | simplifying the original so-called "semantic" parser. */ | |
35 | ||
36 | /* All symbols defined below should begin with yy or YY, to avoid | |
37 | infringing on user name space. This should be done even for local | |
38 | variables, as they might otherwise be expanded by user macros. | |
39 | There are some unavoidable exceptions within include files to | |
40 | define necessary library symbols; they are noted "INFRINGES ON | |
41 | USER NAME SPACE" below. */ | |
42 | ||
43 | /* Identify Bison output. */ | |
44 | #define YYBISON 1 | |
45 | ||
46 | /* Bison version. */ | |
47 | #define YYBISON_VERSION "2.5" | |
48 | ||
49 | /* Skeleton name. */ | |
50 | #define YYSKELETON_NAME "yacc.c" | |
51 | ||
52 | /* Pure parsers. */ | |
53 | #define YYPURE 0 | |
54 | ||
55 | /* Push parsers. */ | |
56 | #define YYPUSH 0 | |
57 | ||
58 | /* Pull parsers. */ | |
59 | #define YYPULL 1 | |
60 | ||
61 | /* Using locations. */ | |
62 | #define YYLSP_NEEDED 0 | |
63 | ||
64 | ||
65 | ||
66 | /* Copy the first part of user declarations. */ | |
67 | ||
68 | /* Line 268 of yacc.c */ | |
69 | #line 1 "winprefsyacc.y" | |
70 | ||
71 | /* | |
72 | * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. | |
73 | * Copyright (C) Colin Harrison 2005-2008 | |
74 | * | |
75 | * Permission is hereby granted, free of charge, to any person obtaining | |
76 | * a copy of this software and associated documentation files (the | |
77 | * "Software"), to deal in the Software without restriction, including | |
78 | * without limitation the rights to use, copy, modify, merge, publish, | |
79 | * distribute, sublicense, and/or sell copies of the Software, and to | |
80 | * permit persons to whom the Software is furnished to do so, subject to | |
81 | * the following conditions: | |
82 | * | |
83 | * The above copyright notice and this permission notice shall be | |
84 | * included in all copies or substantial portions of the Software. | |
85 | * | |
86 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
87 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
88 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
89 | * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR | |
90 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | |
91 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
92 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
93 | * | |
94 | * Except as contained in this notice, the name of the XFree86 Project | |
95 | * shall not be used in advertising or otherwise to promote the sale, use | |
96 | * or other dealings in this Software without prior written authorization | |
97 | * from the XFree86 Project. | |
98 | * | |
99 | * Authors: Earle F. Philhower, III | |
100 | * Colin Harrison | |
101 | */ | |
102 | /* $XFree86: $ */ | |
103 | ||
104 | #ifdef HAVE_XWIN_CONFIG_H | |
105 | #include <xwin-config.h> | |
106 | #endif | |
107 | #include <stdio.h> | |
108 | #include <stdlib.h> | |
109 | #define _STDLIB_H 1 /* bison checks this to know if stdlib has been included */ | |
110 | #include <string.h> | |
111 | #include "winprefs.h" | |
112 | ||
113 | /* The following give better error messages in bison at the cost of a few KB */ | |
114 | #define YYERROR_VERBOSE 1 | |
115 | ||
116 | /* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */ | |
117 | #define YYLTYPE_IS_TRIVIAL 1 | |
118 | #define YYENABLE_NLS 0 | |
119 | ||
120 | /* The global pref settings */ | |
121 | WINPREFS pref; | |
122 | ||
123 | /* The working menu */ | |
124 | static MENUPARSED menu; | |
125 | ||
126 | /* Functions for parsing the tokens into out structure */ | |
127 | /* Defined at the end section of this file */ | |
128 | ||
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); | |
134 | ||
135 | static void OpenMenu(char *menuname); | |
136 | static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param); | |
137 | static void CloseMenu(void); | |
138 | ||
139 | static void OpenIcons(void); | |
140 | static void AddIconLine(char *matchstr, char *iconfile); | |
141 | static void CloseIcons(void); | |
142 | ||
143 | static void OpenStyles(void); | |
144 | static void AddStyleLine(char *matchstr, unsigned long style); | |
145 | static void CloseStyles(void); | |
146 | ||
147 | static void OpenSysMenu(void); | |
148 | static void AddSysMenuLine(char *matchstr, char *menuname, int pos); | |
149 | static void CloseSysMenu(void); | |
150 | ||
151 | static int yyerror (char *s); | |
152 | ||
153 | extern char *yytext; | |
154 | extern int yylex(void); | |
155 | ||
156 | ||
157 | ||
158 | /* Line 268 of yacc.c */ | |
159 | #line 160 "winprefsyacc.c" | |
160 | ||
161 | /* Enabling traces. */ | |
162 | #ifndef YYDEBUG | |
163 | # define YYDEBUG 0 | |
164 | #endif | |
165 | ||
166 | /* Enabling verbose error messages. */ | |
167 | #ifdef YYERROR_VERBOSE | |
168 | # undef YYERROR_VERBOSE | |
169 | # define YYERROR_VERBOSE 1 | |
170 | #else | |
171 | # define YYERROR_VERBOSE 0 | |
172 | #endif | |
173 | ||
174 | /* Enabling the token table. */ | |
175 | #ifndef YYTOKEN_TABLE | |
176 | # define YYTOKEN_TABLE 0 | |
177 | #endif | |
178 | ||
179 | ||
180 | /* Tokens. */ | |
181 | #ifndef YYTOKENTYPE | |
182 | # define YYTOKENTYPE | |
183 | /* Put the tokens into the symbol table, so that GDB and other debuggers | |
184 | know about them. */ | |
185 | enum yytokentype { | |
186 | NEWLINE = 258, | |
187 | MENU = 259, | |
188 | LB = 260, | |
189 | RB = 261, | |
190 | ICONDIRECTORY = 262, | |
191 | DEFAULTICON = 263, | |
192 | ICONS = 264, | |
193 | STYLES = 265, | |
194 | TOPMOST = 266, | |
195 | MAXIMIZE = 267, | |
196 | MINIMIZE = 268, | |
197 | BOTTOM = 269, | |
198 | NOTITLE = 270, | |
199 | OUTLINE = 271, | |
200 | NOFRAME = 272, | |
201 | DEFAULTSYSMENU = 273, | |
202 | SYSMENU = 274, | |
203 | ROOTMENU = 275, | |
204 | SEPARATOR = 276, | |
205 | ATSTART = 277, | |
206 | ATEND = 278, | |
207 | EXEC = 279, | |
208 | ALWAYSONTOP = 280, | |
209 | DEBUGOUTPUT = 281, | |
210 | RELOAD = 282, | |
211 | TRAYICON = 283, | |
212 | FORCEEXIT = 284, | |
213 | SILENTEXIT = 285, | |
214 | STRING = 286 | |
215 | }; | |
216 | #endif | |
217 | /* Tokens. */ | |
218 | #define NEWLINE 258 | |
219 | #define MENU 259 | |
220 | #define LB 260 | |
221 | #define RB 261 | |
222 | #define ICONDIRECTORY 262 | |
223 | #define DEFAULTICON 263 | |
224 | #define ICONS 264 | |
225 | #define STYLES 265 | |
226 | #define TOPMOST 266 | |
227 | #define MAXIMIZE 267 | |
228 | #define MINIMIZE 268 | |
229 | #define BOTTOM 269 | |
230 | #define NOTITLE 270 | |
231 | #define OUTLINE 271 | |
232 | #define NOFRAME 272 | |
233 | #define DEFAULTSYSMENU 273 | |
234 | #define SYSMENU 274 | |
235 | #define ROOTMENU 275 | |
236 | #define SEPARATOR 276 | |
237 | #define ATSTART 277 | |
238 | #define ATEND 278 | |
239 | #define EXEC 279 | |
240 | #define ALWAYSONTOP 280 | |
241 | #define DEBUGOUTPUT 281 | |
242 | #define RELOAD 282 | |
243 | #define TRAYICON 283 | |
244 | #define FORCEEXIT 284 | |
245 | #define SILENTEXIT 285 | |
246 | #define STRING 286 | |
247 | ||
248 | ||
249 | ||
250 | ||
251 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
252 | typedef union YYSTYPE | |
253 | { | |
254 | ||
255 | /* Line 293 of yacc.c */ | |
256 | #line 89 "winprefsyacc.y" | |
257 | ||
258 | char *sVal; | |
259 | unsigned long uVal; | |
260 | int iVal; | |
261 | ||
262 | ||
263 | ||
264 | /* Line 293 of yacc.c */ | |
265 | #line 266 "winprefsyacc.c" | |
266 | } YYSTYPE; | |
267 | # define YYSTYPE_IS_TRIVIAL 1 | |
268 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
269 | # define YYSTYPE_IS_DECLARED 1 | |
270 | #endif | |
271 | ||
272 | ||
273 | /* Copy the second part of user declarations. */ | |
274 | ||
275 | ||
276 | /* Line 343 of yacc.c */ | |
277 | #line 278 "winprefsyacc.c" | |
278 | ||
279 | #ifdef short | |
280 | # undef short | |
281 | #endif | |
282 | ||
283 | #ifdef YYTYPE_UINT8 | |
284 | typedef YYTYPE_UINT8 yytype_uint8; | |
285 | #else | |
286 | typedef unsigned char yytype_uint8; | |
287 | #endif | |
288 | ||
289 | #ifdef YYTYPE_INT8 | |
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; | |
294 | #else | |
295 | typedef short int yytype_int8; | |
296 | #endif | |
297 | ||
298 | #ifdef YYTYPE_UINT16 | |
299 | typedef YYTYPE_UINT16 yytype_uint16; | |
300 | #else | |
301 | typedef unsigned short int yytype_uint16; | |
302 | #endif | |
303 | ||
304 | #ifdef YYTYPE_INT16 | |
305 | typedef YYTYPE_INT16 yytype_int16; | |
306 | #else | |
307 | typedef short int yytype_int16; | |
308 | #endif | |
309 | ||
310 | #ifndef YYSIZE_T | |
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 | |
319 | # else | |
320 | # define YYSIZE_T unsigned int | |
321 | # endif | |
322 | #endif | |
323 | ||
324 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) | |
325 | ||
326 | #ifndef YY_ | |
327 | # if defined YYENABLE_NLS && YYENABLE_NLS | |
328 | # if ENABLE_NLS | |
329 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
330 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | |
331 | # endif | |
332 | # endif | |
333 | # ifndef YY_ | |
334 | # define YY_(msgid) msgid | |
335 | # endif | |
336 | #endif | |
337 | ||
338 | /* Suppress unused-variable warnings by "using" E. */ | |
339 | #if ! defined lint || defined __GNUC__ | |
340 | # define YYUSE(e) ((void) (e)) | |
341 | #else | |
342 | # define YYUSE(e) /* empty */ | |
343 | #endif | |
344 | ||
345 | /* Identity function, used to suppress warnings about constant conditions. */ | |
346 | #ifndef lint | |
347 | # define YYID(n) (n) | |
348 | #else | |
349 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
350 | || defined __cplusplus || defined _MSC_VER) | |
351 | static int | |
352 | YYID (int yyi) | |
353 | #else | |
354 | static int | |
355 | YYID (yyi) | |
356 | int yyi; | |
357 | #endif | |
358 | { | |
359 | return yyi; | |
360 | } | |
361 | #endif | |
362 | ||
363 | #if ! defined yyoverflow || YYERROR_VERBOSE | |
364 | ||
365 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
366 | ||
367 | # ifdef YYSTACK_USE_ALLOCA | |
368 | # if YYSTACK_USE_ALLOCA | |
369 | # ifdef __GNUC__ | |
370 | # define YYSTACK_ALLOC __builtin_alloca | |
371 | # elif defined __BUILTIN_VA_ARG_INCR | |
372 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ | |
373 | # elif defined _AIX | |
374 | # define YYSTACK_ALLOC __alloca | |
375 | # elif defined _MSC_VER | |
376 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ | |
377 | # define alloca _alloca | |
378 | # else | |
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 | |
385 | # endif | |
386 | # endif | |
387 | # endif | |
388 | # endif | |
389 | # endif | |
390 | ||
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 */ | |
400 | # endif | |
401 | # else | |
402 | # define YYSTACK_ALLOC YYMALLOC | |
403 | # define YYSTACK_FREE YYFREE | |
404 | # ifndef YYSTACK_ALLOC_MAXIMUM | |
405 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM | |
406 | # endif | |
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 | |
413 | # endif | |
414 | # endif | |
415 | # ifndef YYMALLOC | |
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 */ | |
420 | # endif | |
421 | # endif | |
422 | # ifndef YYFREE | |
423 | # define YYFREE free | |
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 */ | |
427 | # endif | |
428 | # endif | |
429 | # endif | |
430 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ | |
431 | ||
432 | ||
433 | #if (! defined yyoverflow \ | |
434 | && (! defined __cplusplus \ | |
435 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
436 | ||
437 | /* A type that is properly aligned for any stack member. */ | |
438 | union yyalloc | |
439 | { | |
440 | yytype_int16 yyss_alloc; | |
441 | YYSTYPE yyvs_alloc; | |
442 | }; | |
443 | ||
444 | /* The size of the maximum gap between one aligned stack and the next. */ | |
445 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) | |
446 | ||
447 | /* The size of an array large to enough to hold all stacks, each with | |
448 | N elements. */ | |
449 | # define YYSTACK_BYTES(N) \ | |
450 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ | |
451 | + YYSTACK_GAP_MAXIMUM) | |
452 | ||
453 | # define YYCOPY_NEEDED 1 | |
454 | ||
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 | |
459 | stack. */ | |
460 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ | |
461 | do \ | |
462 | { \ | |
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); \ | |
468 | } \ | |
469 | while (YYID (0)) | |
470 | ||
471 | #endif | |
472 | ||
473 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED | |
474 | /* Copy COUNT objects from FROM to TO. The source and destination do | |
475 | not overlap. */ | |
476 | # ifndef YYCOPY | |
477 | # if defined __GNUC__ && 1 < __GNUC__ | |
478 | # define YYCOPY(To, From, Count) \ | |
479 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
480 | # else | |
481 | # define YYCOPY(To, From, Count) \ | |
482 | do \ | |
483 | { \ | |
484 | YYSIZE_T yyi; \ | |
485 | for (yyi = 0; yyi < (Count); yyi++) \ | |
486 | (To)[yyi] = (From)[yyi]; \ | |
487 | } \ | |
488 | while (YYID (0)) | |
489 | # endif | |
490 | # endif | |
491 | #endif /* !YYCOPY_NEEDED */ | |
492 | ||
493 | /* YYFINAL -- State number of the termination state. */ | |
494 | #define YYFINAL 2 | |
495 | /* YYLAST -- Last index in YYTABLE. */ | |
496 | #define YYLAST 98 | |
497 | ||
498 | /* YYNTOKENS -- Number of terminals. */ | |
499 | #define YYNTOKENS 32 | |
500 | /* YYNNTS -- Number of nonterminals. */ | |
501 | #define YYNNTS 33 | |
502 | /* YYNRULES -- Number of rules. */ | |
503 | #define YYNRULES 65 | |
504 | /* YYNRULES -- Number of states. */ | |
505 | #define YYNSTATES 121 | |
506 | ||
507 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
508 | #define YYUNDEFTOK 2 | |
509 | #define YYMAXUTOK 286 | |
510 | ||
511 | #define YYTRANSLATE(YYX) \ | |
512 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | |
513 | ||
514 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
515 | static const yytype_uint8 yytranslate[] = | |
516 | { | |
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 | |
546 | }; | |
547 | ||
548 | #if YYDEBUG | |
549 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
550 | YYRHS. */ | |
551 | static const yytype_uint8 yyprhs[] = | |
552 | { | |
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 | |
560 | }; | |
561 | ||
562 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ | |
563 | static const yytype_int8 yyrhs[] = | |
564 | { | |
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, | |
584 | -1, 26, 31, 3, -1 | |
585 | }; | |
586 | ||
587 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | |
588 | static const yytype_uint8 yyrline[] = | |
589 | { | |
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 | |
597 | }; | |
598 | #endif | |
599 | ||
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[] = | |
604 | { | |
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 | |
616 | }; | |
617 | #endif | |
618 | ||
619 | # ifdef YYPRINT | |
620 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to | |
621 | token YYLEX-NUM. */ | |
622 | static const yytype_uint16 yytoknum[] = | |
623 | { | |
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, | |
627 | 285, 286 | |
628 | }; | |
629 | # endif | |
630 | ||
631 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
632 | static const yytype_uint8 yyr1[] = | |
633 | { | |
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 | |
641 | }; | |
642 | ||
643 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
644 | static const yytype_uint8 yyr2[] = | |
645 | { | |
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, | |
652 | 2, 0, 7, 2, 2, 3 | |
653 | }; | |
654 | ||
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[] = | |
659 | { | |
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, | |
672 | 58 | |
673 | }; | |
674 | ||
675 | /* YYDEFGOTO[NTERM-NUM]. */ | |
676 | static const yytype_int8 yydefgoto[] = | |
677 | { | |
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, | |
681 | 27, 28, 29 | |
682 | }; | |
683 | ||
684 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
685 | STATE-NUM. */ | |
686 | #define YYPACT_NINF -47 | |
687 | static const yytype_int8 yypact[] = | |
688 | { | |
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, | |
701 | -47 | |
702 | }; | |
703 | ||
704 | /* YYPGOTO[NTERM-NUM]. */ | |
705 | static const yytype_int8 yypgoto[] = | |
706 | { | |
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, | |
710 | -47, -47, -47 | |
711 | }; | |
712 | ||
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[] = | |
718 | { | |
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 | |
729 | }; | |
730 | ||
731 | #define yypact_value_is_default(yystate) \ | |
732 | ((yystate) == (-47)) | |
733 | ||
734 | #define yytable_value_is_error(yytable_value) \ | |
735 | YYID (0) | |
736 | ||
737 | static const yytype_int8 yycheck[] = | |
738 | { | |
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 | |
749 | }; | |
750 | ||
751 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | |
752 | symbol of state STATE-NUM. */ | |
753 | static const yytype_uint8 yystos[] = | |
754 | { | |
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, | |
767 | 35 | |
768 | }; | |
769 | ||
770 | #define yyerrok (yyerrstatus = 0) | |
771 | #define yyclearin (yychar = YYEMPTY) | |
772 | #define YYEMPTY (-2) | |
773 | #define YYEOF 0 | |
774 | ||
775 | #define YYACCEPT goto yyacceptlab | |
776 | #define YYABORT goto yyabortlab | |
777 | #define YYERROR goto yyerrorlab | |
778 | ||
779 | ||
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 | |
785 | discussed. */ | |
786 | ||
787 | #define YYFAIL goto yyerrlab | |
788 | #if defined YYFAIL | |
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. */ | |
793 | #endif | |
794 | ||
795 | #define YYRECOVERING() (!!yyerrstatus) | |
796 | ||
797 | #define YYBACKUP(Token, Value) \ | |
798 | do \ | |
799 | if (yychar == YYEMPTY && yylen == 1) \ | |
800 | { \ | |
801 | yychar = (Token); \ | |
802 | yylval = (Value); \ | |
803 | YYPOPSTACK (1); \ | |
804 | goto yybackup; \ | |
805 | } \ | |
806 | else \ | |
807 | { \ | |
808 | yyerror (YY_("syntax error: cannot back up")); \ | |
809 | YYERROR; \ | |
810 | } \ | |
811 | while (YYID (0)) | |
812 | ||
813 | ||
814 | #define YYTERROR 1 | |
815 | #define YYERRCODE 256 | |
816 | ||
817 | ||
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). */ | |
821 | ||
822 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) | |
823 | #ifndef YYLLOC_DEFAULT | |
824 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ | |
825 | do \ | |
826 | if (YYID (N)) \ | |
827 | { \ | |
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; \ | |
832 | } \ | |
833 | else \ | |
834 | { \ | |
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; \ | |
839 | } \ | |
840 | while (YYID (0)) | |
841 | #endif | |
842 | ||
843 | ||
844 | /* This macro is provided for backward compatibility. */ | |
845 | ||
846 | #ifndef YY_LOCATION_PRINT | |
847 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
848 | #endif | |
849 | ||
850 | ||
851 | /* YYLEX -- calling `yylex' with the right arguments. */ | |
852 | ||
853 | #ifdef YYLEX_PARAM | |
854 | # define YYLEX yylex (YYLEX_PARAM) | |
855 | #else | |
856 | # define YYLEX yylex () | |
857 | #endif | |
858 | ||
859 | /* Enable debugging if requested. */ | |
860 | #if YYDEBUG | |
861 | ||
862 | # ifndef YYFPRINTF | |
863 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
864 | # define YYFPRINTF fprintf | |
865 | # endif | |
866 | ||
867 | # define YYDPRINTF(Args) \ | |
868 | do { \ | |
869 | if (yydebug) \ | |
870 | YYFPRINTF Args; \ | |
871 | } while (YYID (0)) | |
872 | ||
873 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ | |
874 | do { \ | |
875 | if (yydebug) \ | |
876 | { \ | |
877 | YYFPRINTF (stderr, "%s ", Title); \ | |
878 | yy_symbol_print (stderr, \ | |
879 | Type, Value); \ | |
880 | YYFPRINTF (stderr, "\n"); \ | |
881 | } \ | |
882 | } while (YYID (0)) | |
883 | ||
884 | ||
885 | /*--------------------------------. | |
886 | | Print this symbol on YYOUTPUT. | | |
887 | `--------------------------------*/ | |
888 | ||
889 | /*ARGSUSED*/ | |
890 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
891 | || defined __cplusplus || defined _MSC_VER) | |
892 | static void | |
893 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
894 | #else | |
895 | static void | |
896 | yy_symbol_value_print (yyoutput, yytype, yyvaluep) | |
897 | FILE *yyoutput; | |
898 | int yytype; | |
899 | YYSTYPE const * const yyvaluep; | |
900 | #endif | |
901 | { | |
902 | if (!yyvaluep) | |
903 | return; | |
904 | # ifdef YYPRINT | |
905 | if (yytype < YYNTOKENS) | |
906 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
907 | # else | |
908 | YYUSE (yyoutput); | |
909 | # endif | |
910 | switch (yytype) | |
911 | { | |
912 | default: | |
913 | break; | |
914 | } | |
915 | } | |
916 | ||
917 | ||
918 | /*--------------------------------. | |
919 | | Print this symbol on YYOUTPUT. | | |
920 | `--------------------------------*/ | |
921 | ||
922 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
923 | || defined __cplusplus || defined _MSC_VER) | |
924 | static void | |
925 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
926 | #else | |
927 | static void | |
928 | yy_symbol_print (yyoutput, yytype, yyvaluep) | |
929 | FILE *yyoutput; | |
930 | int yytype; | |
931 | YYSTYPE const * const yyvaluep; | |
932 | #endif | |
933 | { | |
934 | if (yytype < YYNTOKENS) | |
935 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | |
936 | else | |
937 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | |
938 | ||
939 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); | |
940 | YYFPRINTF (yyoutput, ")"); | |
941 | } | |
942 | ||
943 | /*------------------------------------------------------------------. | |
944 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
945 | | TOP (included). | | |
946 | `------------------------------------------------------------------*/ | |
947 | ||
948 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
949 | || defined __cplusplus || defined _MSC_VER) | |
950 | static void | |
951 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) | |
952 | #else | |
953 | static void | |
954 | yy_stack_print (yybottom, yytop) | |
955 | yytype_int16 *yybottom; | |
956 | yytype_int16 *yytop; | |
957 | #endif | |
958 | { | |
959 | YYFPRINTF (stderr, "Stack now"); | |
960 | for (; yybottom <= yytop; yybottom++) | |
961 | { | |
962 | int yybot = *yybottom; | |
963 | YYFPRINTF (stderr, " %d", yybot); | |
964 | } | |
965 | YYFPRINTF (stderr, "\n"); | |
966 | } | |
967 | ||
968 | # define YY_STACK_PRINT(Bottom, Top) \ | |
969 | do { \ | |
970 | if (yydebug) \ | |
971 | yy_stack_print ((Bottom), (Top)); \ | |
972 | } while (YYID (0)) | |
973 | ||
974 | ||
975 | /*------------------------------------------------. | |
976 | | Report that the YYRULE is going to be reduced. | | |
977 | `------------------------------------------------*/ | |
978 | ||
979 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
980 | || defined __cplusplus || defined _MSC_VER) | |
981 | static void | |
982 | yy_reduce_print (YYSTYPE *yyvsp, int yyrule) | |
983 | #else | |
984 | static void | |
985 | yy_reduce_print (yyvsp, yyrule) | |
986 | YYSTYPE *yyvsp; | |
987 | int yyrule; | |
988 | #endif | |
989 | { | |
990 | int yynrhs = yyr2[yyrule]; | |
991 | int yyi; | |
992 | unsigned long int yylno = yyrline[yyrule]; | |
993 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", | |
994 | yyrule - 1, yylno); | |
995 | /* The symbols being reduced. */ | |
996 | for (yyi = 0; yyi < yynrhs; yyi++) | |
997 | { | |
998 | YYFPRINTF (stderr, " $%d = ", yyi + 1); | |
999 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], | |
1000 | &(yyvsp[(yyi + 1) - (yynrhs)]) | |
1001 | ); | |
1002 | YYFPRINTF (stderr, "\n"); | |
1003 | } | |
1004 | } | |
1005 | ||
1006 | # define YY_REDUCE_PRINT(Rule) \ | |
1007 | do { \ | |
1008 | if (yydebug) \ | |
1009 | yy_reduce_print (yyvsp, Rule); \ | |
1010 | } while (YYID (0)) | |
1011 | ||
1012 | /* Nonzero means print parse trace. It is left uninitialized so that | |
1013 | multiple parsers can coexist. */ | |
1014 | int yydebug; | |
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 */ | |
1021 | ||
1022 | ||
1023 | /* YYINITDEPTH -- initial size of the parser's stacks. */ | |
1024 | #ifndef YYINITDEPTH | |
1025 | # define YYINITDEPTH 200 | |
1026 | #endif | |
1027 | ||
1028 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only | |
1029 | if the built-in stack extension method is used). | |
1030 | ||
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. */ | |
1034 | ||
1035 | #ifndef YYMAXDEPTH | |
1036 | # define YYMAXDEPTH 10000 | |
1037 | #endif | |
1038 | ||
1039 | ||
1040 | #if YYERROR_VERBOSE | |
1041 | ||
1042 | # ifndef yystrlen | |
1043 | # if defined __GLIBC__ && defined _STRING_H | |
1044 | # define yystrlen strlen | |
1045 | # else | |
1046 | /* Return the length of YYSTR. */ | |
1047 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1048 | || defined __cplusplus || defined _MSC_VER) | |
1049 | static YYSIZE_T | |
1050 | yystrlen (const char *yystr) | |
1051 | #else | |
1052 | static YYSIZE_T | |
1053 | yystrlen (yystr) | |
1054 | const char *yystr; | |
1055 | #endif | |
1056 | { | |
1057 | YYSIZE_T yylen; | |
1058 | for (yylen = 0; yystr[yylen]; yylen++) | |
1059 | continue; | |
1060 | return yylen; | |
1061 | } | |
1062 | # endif | |
1063 | # endif | |
1064 | ||
1065 | # ifndef yystpcpy | |
1066 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE | |
1067 | # define yystpcpy stpcpy | |
1068 | # else | |
1069 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
1070 | YYDEST. */ | |
1071 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1072 | || defined __cplusplus || defined _MSC_VER) | |
1073 | static char * | |
1074 | yystpcpy (char *yydest, const char *yysrc) | |
1075 | #else | |
1076 | static char * | |
1077 | yystpcpy (yydest, yysrc) | |
1078 | char *yydest; | |
1079 | const char *yysrc; | |
1080 | #endif | |
1081 | { | |
1082 | char *yyd = yydest; | |
1083 | const char *yys = yysrc; | |
1084 | ||
1085 | while ((*yyd++ = *yys++) != '\0') | |
1086 | continue; | |
1087 | ||
1088 | return yyd - 1; | |
1089 | } | |
1090 | # endif | |
1091 | # endif | |
1092 | ||
1093 | # ifndef yytnamerr | |
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 | |
1100 | would have been. */ | |
1101 | static YYSIZE_T | |
1102 | yytnamerr (char *yyres, const char *yystr) | |
1103 | { | |
1104 | if (*yystr == '"') | |
1105 | { | |
1106 | YYSIZE_T yyn = 0; | |
1107 | char const *yyp = yystr; | |
1108 | ||
1109 | for (;;) | |
1110 | switch (*++yyp) | |
1111 | { | |
1112 | case '\'': | |
1113 | case ',': | |
1114 | goto do_not_strip_quotes; | |
1115 | ||
1116 | case '\\': | |
1117 | if (*++yyp != '\\') | |
1118 | goto do_not_strip_quotes; | |
1119 | /* Fall through. */ | |
1120 | default: | |
1121 | if (yyres) | |
1122 | yyres[yyn] = *yyp; | |
1123 | yyn++; | |
1124 | break; | |
1125 | ||
1126 | case '"': | |
1127 | if (yyres) | |
1128 | yyres[yyn] = '\0'; | |
1129 | return yyn; | |
1130 | } | |
1131 | do_not_strip_quotes: ; | |
1132 | } | |
1133 | ||
1134 | if (! yyres) | |
1135 | return yystrlen (yystr); | |
1136 | ||
1137 | return yystpcpy (yyres, yystr) - yyres; | |
1138 | } | |
1139 | # endif | |
1140 | ||
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 | |
1143 | YYSSP. | |
1144 | ||
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. */ | |
1149 | static int | |
1150 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |
1151 | yytype_int16 *yyssp, int yytoken) | |
1152 | { | |
1153 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); | |
1154 | YYSIZE_T yysize = yysize0; | |
1155 | YYSIZE_T yysize1; | |
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 | |
1162 | "expected"). */ | |
1163 | int yycount = 0; | |
1164 | ||
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 | |
1169 | function. | |
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. | |
1191 | */ | |
1192 | if (yytoken != YYEMPTY) | |
1193 | { | |
1194 | int yyn = yypact[*yyssp]; | |
1195 | yyarg[yycount++] = yytname[yytoken]; | |
1196 | if (!yypact_value_is_default (yyn)) | |
1197 | { | |
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; | |
1205 | int yyx; | |
1206 | ||
1207 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) | |
1208 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR | |
1209 | && !yytable_value_is_error (yytable[yyx + yyn])) | |
1210 | { | |
1211 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | |
1212 | { | |
1213 | yycount = 1; | |
1214 | yysize = yysize0; | |
1215 | break; | |
1216 | } | |
1217 | yyarg[yycount++] = yytname[yyx]; | |
1218 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); | |
1219 | if (! (yysize <= yysize1 | |
1220 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1221 | return 2; | |
1222 | yysize = yysize1; | |
1223 | } | |
1224 | } | |
1225 | } | |
1226 | ||
1227 | switch (yycount) | |
1228 | { | |
1229 | # define YYCASE_(N, S) \ | |
1230 | case N: \ | |
1231 | yyformat = S; \ | |
1232 | break | |
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")); | |
1239 | # undef YYCASE_ | |
1240 | } | |
1241 | ||
1242 | yysize1 = yysize + yystrlen (yyformat); | |
1243 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1244 | return 2; | |
1245 | yysize = yysize1; | |
1246 | ||
1247 | if (*yymsg_alloc < yysize) | |
1248 | { | |
1249 | *yymsg_alloc = 2 * yysize; | |
1250 | if (! (yysize <= *yymsg_alloc | |
1251 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) | |
1252 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; | |
1253 | return 1; | |
1254 | } | |
1255 | ||
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. */ | |
1259 | { | |
1260 | char *yyp = *yymsg; | |
1261 | int yyi = 0; | |
1262 | while ((*yyp = *yyformat) != '\0') | |
1263 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | |
1264 | { | |
1265 | yyp += yytnamerr (yyp, yyarg[yyi++]); | |
1266 | yyformat += 2; | |
1267 | } | |
1268 | else | |
1269 | { | |
1270 | yyp++; | |
1271 | yyformat++; | |
1272 | } | |
1273 | } | |
1274 | return 0; | |
1275 | } | |
1276 | #endif /* YYERROR_VERBOSE */ | |
1277 | ||
1278 | /*-----------------------------------------------. | |
1279 | | Release the memory associated to this symbol. | | |
1280 | `-----------------------------------------------*/ | |
1281 | ||
1282 | /*ARGSUSED*/ | |
1283 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1284 | || defined __cplusplus || defined _MSC_VER) | |
1285 | static void | |
1286 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) | |
1287 | #else | |
1288 | static void | |
1289 | yydestruct (yymsg, yytype, yyvaluep) | |
1290 | const char *yymsg; | |
1291 | int yytype; | |
1292 | YYSTYPE *yyvaluep; | |
1293 | #endif | |
1294 | { | |
1295 | YYUSE (yyvaluep); | |
1296 | ||
1297 | if (!yymsg) | |
1298 | yymsg = "Deleting"; | |
1299 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
1300 | ||
1301 | switch (yytype) | |
1302 | { | |
1303 | ||
1304 | default: | |
1305 | break; | |
1306 | } | |
1307 | } | |
1308 | ||
1309 | ||
1310 | /* Prevent warnings from -Wmissing-prototypes. */ | |
1311 | #ifdef YYPARSE_PARAM | |
1312 | #if defined __STDC__ || defined __cplusplus | |
1313 | int yyparse (void *YYPARSE_PARAM); | |
1314 | #else | |
1315 | int yyparse (); | |
1316 | #endif | |
1317 | #else /* ! YYPARSE_PARAM */ | |
1318 | #if defined __STDC__ || defined __cplusplus | |
1319 | int yyparse (void); | |
1320 | #else | |
1321 | int yyparse (); | |
1322 | #endif | |
1323 | #endif /* ! YYPARSE_PARAM */ | |
1324 | ||
1325 | ||
1326 | /* The lookahead symbol. */ | |
1327 | int yychar; | |
1328 | ||
1329 | /* The semantic value of the lookahead symbol. */ | |
1330 | YYSTYPE yylval; | |
1331 | ||
1332 | /* Number of syntax errors so far. */ | |
1333 | int yynerrs; | |
1334 | ||
1335 | ||
1336 | /*----------. | |
1337 | | yyparse. | | |
1338 | `----------*/ | |
1339 | ||
1340 | #ifdef YYPARSE_PARAM | |
1341 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1342 | || defined __cplusplus || defined _MSC_VER) | |
1343 | int | |
1344 | yyparse (void *YYPARSE_PARAM) | |
1345 | #else | |
1346 | int | |
1347 | yyparse (YYPARSE_PARAM) | |
1348 | void *YYPARSE_PARAM; | |
1349 | #endif | |
1350 | #else /* ! YYPARSE_PARAM */ | |
1351 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1352 | || defined __cplusplus || defined _MSC_VER) | |
1353 | int | |
1354 | yyparse (void) | |
1355 | #else | |
1356 | int | |
1357 | yyparse () | |
1358 | ||
1359 | #endif | |
1360 | #endif | |
1361 | { | |
1362 | int yystate; | |
1363 | /* Number of tokens to shift before error messages enabled. */ | |
1364 | int yyerrstatus; | |
1365 | ||
1366 | /* The stacks and their tools: | |
1367 | `yyss': related to states. | |
1368 | `yyvs': related to semantic values. | |
1369 | ||
1370 | Refer to the stacks thru separate pointers, to allow yyoverflow | |
1371 | to reallocate them elsewhere. */ | |
1372 | ||
1373 | /* The state stack. */ | |
1374 | yytype_int16 yyssa[YYINITDEPTH]; | |
1375 | yytype_int16 *yyss; | |
1376 | yytype_int16 *yyssp; | |
1377 | ||
1378 | /* The semantic value stack. */ | |
1379 | YYSTYPE yyvsa[YYINITDEPTH]; | |
1380 | YYSTYPE *yyvs; | |
1381 | YYSTYPE *yyvsp; | |
1382 | ||
1383 | YYSIZE_T yystacksize; | |
1384 | ||
1385 | int yyn; | |
1386 | int yyresult; | |
1387 | /* Lookahead token as an internal (translated) token number. */ | |
1388 | int yytoken; | |
1389 | /* The variables used to return semantic value and location from the | |
1390 | action routines. */ | |
1391 | YYSTYPE yyval; | |
1392 | ||
1393 | #if YYERROR_VERBOSE | |
1394 | /* Buffer for error messages, and its allocated size. */ | |
1395 | char yymsgbuf[128]; | |
1396 | char *yymsg = yymsgbuf; | |
1397 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
1398 | #endif | |
1399 | ||
1400 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) | |
1401 | ||
1402 | /* The number of symbols on the RHS of the reduced rule. | |
1403 | Keep to zero when no symbol should be popped. */ | |
1404 | int yylen = 0; | |
1405 | ||
1406 | yytoken = 0; | |
1407 | yyss = yyssa; | |
1408 | yyvs = yyvsa; | |
1409 | yystacksize = YYINITDEPTH; | |
1410 | ||
1411 | YYDPRINTF ((stderr, "Starting parse\n")); | |
1412 | ||
1413 | yystate = 0; | |
1414 | yyerrstatus = 0; | |
1415 | yynerrs = 0; | |
1416 | yychar = YYEMPTY; /* Cause a token to be read. */ | |
1417 | ||
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. */ | |
1422 | yyssp = yyss; | |
1423 | yyvsp = yyvs; | |
1424 | ||
1425 | goto yysetstate; | |
1426 | ||
1427 | /*------------------------------------------------------------. | |
1428 | | yynewstate -- Push a new state, which is found in yystate. | | |
1429 | `------------------------------------------------------------*/ | |
1430 | yynewstate: | |
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. */ | |
1433 | yyssp++; | |
1434 | ||
1435 | yysetstate: | |
1436 | *yyssp = yystate; | |
1437 | ||
1438 | if (yyss + yystacksize - 1 <= yyssp) | |
1439 | { | |
1440 | /* Get the current used size of the three stacks, in elements. */ | |
1441 | YYSIZE_T yysize = yyssp - yyss + 1; | |
1442 | ||
1443 | #ifdef yyoverflow | |
1444 | { | |
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 | |
1447 | memory. */ | |
1448 | YYSTYPE *yyvs1 = yyvs; | |
1449 | yytype_int16 *yyss1 = yyss; | |
1450 | ||
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), | |
1458 | &yystacksize); | |
1459 | ||
1460 | yyss = yyss1; | |
1461 | yyvs = yyvs1; | |
1462 | } | |
1463 | #else /* no yyoverflow */ | |
1464 | # ifndef YYSTACK_RELOCATE | |
1465 | goto yyexhaustedlab; | |
1466 | # else | |
1467 | /* Extend the stack our own way. */ | |
1468 | if (YYMAXDEPTH <= yystacksize) | |
1469 | goto yyexhaustedlab; | |
1470 | yystacksize *= 2; | |
1471 | if (YYMAXDEPTH < yystacksize) | |
1472 | yystacksize = YYMAXDEPTH; | |
1473 | ||
1474 | { | |
1475 | yytype_int16 *yyss1 = yyss; | |
1476 | union yyalloc *yyptr = | |
1477 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
1478 | if (! yyptr) | |
1479 | goto yyexhaustedlab; | |
1480 | YYSTACK_RELOCATE (yyss_alloc, yyss); | |
1481 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
1482 | # undef YYSTACK_RELOCATE | |
1483 | if (yyss1 != yyssa) | |
1484 | YYSTACK_FREE (yyss1); | |
1485 | } | |
1486 | # endif | |
1487 | #endif /* no yyoverflow */ | |
1488 | ||
1489 | yyssp = yyss + yysize - 1; | |
1490 | yyvsp = yyvs + yysize - 1; | |
1491 | ||
1492 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", | |
1493 | (unsigned long int) yystacksize)); | |
1494 | ||
1495 | if (yyss + yystacksize - 1 <= yyssp) | |
1496 | YYABORT; | |
1497 | } | |
1498 | ||
1499 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
1500 | ||
1501 | if (yystate == YYFINAL) | |
1502 | YYACCEPT; | |
1503 | ||
1504 | goto yybackup; | |
1505 | ||
1506 | /*-----------. | |
1507 | | yybackup. | | |
1508 | `-----------*/ | |
1509 | yybackup: | |
1510 | ||
1511 | /* Do appropriate processing given the current state. Read a | |
1512 | lookahead token if we need one and don't already have one. */ | |
1513 | ||
1514 | /* First try to decide what to do without reference to lookahead token. */ | |
1515 | yyn = yypact[yystate]; | |
1516 | if (yypact_value_is_default (yyn)) | |
1517 | goto yydefault; | |
1518 | ||
1519 | /* Not known => get a lookahead token if don't already have one. */ | |
1520 | ||
1521 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ | |
1522 | if (yychar == YYEMPTY) | |
1523 | { | |
1524 | YYDPRINTF ((stderr, "Reading a token: ")); | |
1525 | yychar = YYLEX; | |
1526 | } | |
1527 | ||
1528 | if (yychar <= YYEOF) | |
1529 | { | |
1530 | yychar = yytoken = YYEOF; | |
1531 | YYDPRINTF ((stderr, "Now at end of input.\n")); | |
1532 | } | |
1533 | else | |
1534 | { | |
1535 | yytoken = YYTRANSLATE (yychar); | |
1536 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); | |
1537 | } | |
1538 | ||
1539 | /* If the proper action on seeing token YYTOKEN is to reduce or to | |
1540 | detect an error, take that action. */ | |
1541 | yyn += yytoken; | |
1542 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) | |
1543 | goto yydefault; | |
1544 | yyn = yytable[yyn]; | |
1545 | if (yyn <= 0) | |
1546 | { | |
1547 | if (yytable_value_is_error (yyn)) | |
1548 | goto yyerrlab; | |
1549 | yyn = -yyn; | |
1550 | goto yyreduce; | |
1551 | } | |
1552 | ||
1553 | /* Count tokens shifted since error; after three, turn off error | |
1554 | status. */ | |
1555 | if (yyerrstatus) | |
1556 | yyerrstatus--; | |
1557 | ||
1558 | /* Shift the lookahead token. */ | |
1559 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); | |
1560 | ||
1561 | /* Discard the shifted token. */ | |
1562 | yychar = YYEMPTY; | |
1563 | ||
1564 | yystate = yyn; | |
1565 | *++yyvsp = yylval; | |
1566 | ||
1567 | goto yynewstate; | |
1568 | ||
1569 | ||
1570 | /*-----------------------------------------------------------. | |
1571 | | yydefault -- do the default action for the current state. | | |
1572 | `-----------------------------------------------------------*/ | |
1573 | yydefault: | |
1574 | yyn = yydefact[yystate]; | |
1575 | if (yyn == 0) | |
1576 | goto yyerrlab; | |
1577 | goto yyreduce; | |
1578 | ||
1579 | ||
1580 | /*-----------------------------. | |
1581 | | yyreduce -- Do a reduction. | | |
1582 | `-----------------------------*/ | |
1583 | yyreduce: | |
1584 | /* yyn is the number of a rule to reduce with. */ | |
1585 | yylen = yyr2[yyn]; | |
1586 | ||
1587 | /* If YYLEN is nonzero, implement the default value of the action: | |
1588 | `$$ = $1'. | |
1589 | ||
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]; | |
1596 | ||
1597 | ||
1598 | YY_REDUCE_PRINT (yyn); | |
1599 | switch (yyn) | |
1600 | { | |
1601 | case 20: | |
1602 | ||
1603 | /* Line 1806 of yacc.c */ | |
1604 | #line 159 "winprefsyacc.y" | |
1605 | { SetTrayIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } | |
1606 | break; | |
1607 | ||
1608 | case 21: | |
1609 | ||
1610 | /* Line 1806 of yacc.c */ | |
1611 | #line 162 "winprefsyacc.y" | |
1612 | { SetRootMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } | |
1613 | break; | |
1614 | ||
1615 | case 22: | |
1616 | ||
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)); } | |
1620 | break; | |
1621 | ||
1622 | case 23: | |
1623 | ||
1624 | /* Line 1806 of yacc.c */ | |
1625 | #line 168 "winprefsyacc.y" | |
1626 | { SetDefaultIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } | |
1627 | break; | |
1628 | ||
1629 | case 24: | |
1630 | ||
1631 | /* Line 1806 of yacc.c */ | |
1632 | #line 171 "winprefsyacc.y" | |
1633 | { SetIconDirectory((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } | |
1634 | break; | |
1635 | ||
1636 | case 25: | |
1637 | ||
1638 | /* Line 1806 of yacc.c */ | |
1639 | #line 174 "winprefsyacc.y" | |
1640 | { AddMenuLine("-", CMD_SEPARATOR, ""); } | |
1641 | break; | |
1642 | ||
1643 | case 26: | |
1644 | ||
1645 | /* Line 1806 of yacc.c */ | |
1646 | #line 175 "winprefsyacc.y" | |
1647 | { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_ALWAYSONTOP, ""); free((yyvsp[(1) - (4)].sVal)); } | |
1648 | break; | |
1649 | ||
1650 | case 27: | |
1651 | ||
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)); } | |
1655 | break; | |
1656 | ||
1657 | case 28: | |
1658 | ||
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)); } | |
1662 | break; | |
1663 | ||
1664 | case 29: | |
1665 | ||
1666 | /* Line 1806 of yacc.c */ | |
1667 | #line 178 "winprefsyacc.y" | |
1668 | { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_RELOAD, ""); free((yyvsp[(1) - (4)].sVal)); } | |
1669 | break; | |
1670 | ||
1671 | case 32: | |
1672 | ||
1673 | /* Line 1806 of yacc.c */ | |
1674 | #line 185 "winprefsyacc.y" | |
1675 | { OpenMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } | |
1676 | break; | |
1677 | ||
1678 | case 33: | |
1679 | ||
1680 | /* Line 1806 of yacc.c */ | |
1681 | #line 185 "winprefsyacc.y" | |
1682 | {CloseMenu();} | |
1683 | break; | |
1684 | ||
1685 | case 34: | |
1686 | ||
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)); } | |
1690 | break; | |
1691 | ||
1692 | case 37: | |
1693 | ||
1694 | /* Line 1806 of yacc.c */ | |
1695 | #line 195 "winprefsyacc.y" | |
1696 | {OpenIcons();} | |
1697 | break; | |
1698 | ||
1699 | case 38: | |
1700 | ||
1701 | /* Line 1806 of yacc.c */ | |
1702 | #line 195 "winprefsyacc.y" | |
1703 | {CloseIcons();} | |
1704 | break; | |
1705 | ||
1706 | case 39: | |
1707 | ||
1708 | /* Line 1806 of yacc.c */ | |
1709 | #line 198 "winprefsyacc.y" | |
1710 | { (yyval.uVal)=STYLE_TOPMOST; } | |
1711 | break; | |
1712 | ||
1713 | case 40: | |
1714 | ||
1715 | /* Line 1806 of yacc.c */ | |
1716 | #line 199 "winprefsyacc.y" | |
1717 | { (yyval.uVal)=STYLE_MAXIMIZE; } | |
1718 | break; | |
1719 | ||
1720 | case 41: | |
1721 | ||
1722 | /* Line 1806 of yacc.c */ | |
1723 | #line 200 "winprefsyacc.y" | |
1724 | { (yyval.uVal)=STYLE_MINIMIZE; } | |
1725 | break; | |
1726 | ||
1727 | case 42: | |
1728 | ||
1729 | /* Line 1806 of yacc.c */ | |
1730 | #line 201 "winprefsyacc.y" | |
1731 | { (yyval.uVal)=STYLE_BOTTOM; } | |
1732 | break; | |
1733 | ||
1734 | case 43: | |
1735 | ||
1736 | /* Line 1806 of yacc.c */ | |
1737 | #line 204 "winprefsyacc.y" | |
1738 | { (yyval.uVal)=STYLE_NOTITLE; } | |
1739 | break; | |
1740 | ||
1741 | case 44: | |
1742 | ||
1743 | /* Line 1806 of yacc.c */ | |
1744 | #line 205 "winprefsyacc.y" | |
1745 | { (yyval.uVal)=STYLE_OUTLINE; } | |
1746 | break; | |
1747 | ||
1748 | case 45: | |
1749 | ||
1750 | /* Line 1806 of yacc.c */ | |
1751 | #line 206 "winprefsyacc.y" | |
1752 | { (yyval.uVal)=STYLE_NOFRAME; } | |
1753 | break; | |
1754 | ||
1755 | case 46: | |
1756 | ||
1757 | /* Line 1806 of yacc.c */ | |
1758 | #line 209 "winprefsyacc.y" | |
1759 | { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); } | |
1760 | break; | |
1761 | ||
1762 | case 47: | |
1763 | ||
1764 | /* Line 1806 of yacc.c */ | |
1765 | #line 210 "winprefsyacc.y" | |
1766 | { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); } | |
1767 | break; | |
1768 | ||
1769 | case 48: | |
1770 | ||
1771 | /* Line 1806 of yacc.c */ | |
1772 | #line 211 "winprefsyacc.y" | |
1773 | { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); } | |
1774 | break; | |
1775 | ||
1776 | case 49: | |
1777 | ||
1778 | /* Line 1806 of yacc.c */ | |
1779 | #line 212 "winprefsyacc.y" | |
1780 | { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); } | |
1781 | break; | |
1782 | ||
1783 | case 50: | |
1784 | ||
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)); } | |
1788 | break; | |
1789 | ||
1790 | case 53: | |
1791 | ||
1792 | /* Line 1806 of yacc.c */ | |
1793 | #line 222 "winprefsyacc.y" | |
1794 | {OpenStyles();} | |
1795 | break; | |
1796 | ||
1797 | case 54: | |
1798 | ||
1799 | /* Line 1806 of yacc.c */ | |
1800 | #line 222 "winprefsyacc.y" | |
1801 | {CloseStyles();} | |
1802 | break; | |
1803 | ||
1804 | case 55: | |
1805 | ||
1806 | /* Line 1806 of yacc.c */ | |
1807 | #line 225 "winprefsyacc.y" | |
1808 | { (yyval.iVal)=AT_END; } | |
1809 | break; | |
1810 | ||
1811 | case 56: | |
1812 | ||
1813 | /* Line 1806 of yacc.c */ | |
1814 | #line 226 "winprefsyacc.y" | |
1815 | { (yyval.iVal)=AT_START; } | |
1816 | break; | |
1817 | ||
1818 | case 57: | |
1819 | ||
1820 | /* Line 1806 of yacc.c */ | |
1821 | #line 227 "winprefsyacc.y" | |
1822 | { (yyval.iVal)=AT_END; } | |
1823 | break; | |
1824 | ||
1825 | case 58: | |
1826 | ||
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)); } | |
1830 | break; | |
1831 | ||
1832 | case 61: | |
1833 | ||
1834 | /* Line 1806 of yacc.c */ | |
1835 | #line 237 "winprefsyacc.y" | |
1836 | {OpenSysMenu();} | |
1837 | break; | |
1838 | ||
1839 | case 62: | |
1840 | ||
1841 | /* Line 1806 of yacc.c */ | |
1842 | #line 237 "winprefsyacc.y" | |
1843 | {CloseSysMenu();} | |
1844 | break; | |
1845 | ||
1846 | case 63: | |
1847 | ||
1848 | /* Line 1806 of yacc.c */ | |
1849 | #line 240 "winprefsyacc.y" | |
1850 | { pref.fForceExit = TRUE; } | |
1851 | break; | |
1852 | ||
1853 | case 64: | |
1854 | ||
1855 | /* Line 1806 of yacc.c */ | |
1856 | #line 243 "winprefsyacc.y" | |
1857 | { pref.fSilentExit = TRUE; } | |
1858 | break; | |
1859 | ||
1860 | case 65: | |
1861 | ||
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)); } | |
1865 | break; | |
1866 | ||
1867 | ||
1868 | ||
1869 | /* Line 1806 of yacc.c */ | |
1870 | #line 1871 "winprefsyacc.c" | |
1871 | default: break; | |
1872 | } | |
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); | |
1885 | ||
1886 | YYPOPSTACK (yylen); | |
1887 | yylen = 0; | |
1888 | YY_STACK_PRINT (yyss, yyssp); | |
1889 | ||
1890 | *++yyvsp = yyval; | |
1891 | ||
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. */ | |
1895 | ||
1896 | yyn = yyr1[yyn]; | |
1897 | ||
1898 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | |
1899 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
1900 | yystate = yytable[yystate]; | |
1901 | else | |
1902 | yystate = yydefgoto[yyn - YYNTOKENS]; | |
1903 | ||
1904 | goto yynewstate; | |
1905 | ||
1906 | ||
1907 | /*------------------------------------. | |
1908 | | yyerrlab -- here on detecting error | | |
1909 | `------------------------------------*/ | |
1910 | yyerrlab: | |
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); | |
1914 | ||
1915 | /* If not already recovering from an error, report this error. */ | |
1916 | if (!yyerrstatus) | |
1917 | { | |
1918 | ++yynerrs; | |
1919 | #if ! YYERROR_VERBOSE | |
1920 | yyerror (YY_("syntax error")); | |
1921 | #else | |
1922 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ | |
1923 | yyssp, yytoken) | |
1924 | { | |
1925 | char const *yymsgp = YY_("syntax error"); | |
1926 | int yysyntax_error_status; | |
1927 | yysyntax_error_status = YYSYNTAX_ERROR; | |
1928 | if (yysyntax_error_status == 0) | |
1929 | yymsgp = yymsg; | |
1930 | else if (yysyntax_error_status == 1) | |
1931 | { | |
1932 | if (yymsg != yymsgbuf) | |
1933 | YYSTACK_FREE (yymsg); | |
1934 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); | |
1935 | if (!yymsg) | |
1936 | { | |
1937 | yymsg = yymsgbuf; | |
1938 | yymsg_alloc = sizeof yymsgbuf; | |
1939 | yysyntax_error_status = 2; | |
1940 | } | |
1941 | else | |
1942 | { | |
1943 | yysyntax_error_status = YYSYNTAX_ERROR; | |
1944 | yymsgp = yymsg; | |
1945 | } | |
1946 | } | |
1947 | yyerror (yymsgp); | |
1948 | if (yysyntax_error_status == 2) | |
1949 | goto yyexhaustedlab; | |
1950 | } | |
1951 | # undef YYSYNTAX_ERROR | |
1952 | #endif | |
1953 | } | |
1954 | ||
1955 | ||
1956 | ||
1957 | if (yyerrstatus == 3) | |
1958 | { | |
1959 | /* If just tried and failed to reuse lookahead token after an | |
1960 | error, discard it. */ | |
1961 | ||
1962 | if (yychar <= YYEOF) | |
1963 | { | |
1964 | /* Return failure if at end of input. */ | |
1965 | if (yychar == YYEOF) | |
1966 | YYABORT; | |
1967 | } | |
1968 | else | |
1969 | { | |
1970 | yydestruct ("Error: discarding", | |
1971 | yytoken, &yylval); | |
1972 | yychar = YYEMPTY; | |
1973 | } | |
1974 | } | |
1975 | ||
1976 | /* Else will try to reuse lookahead token after shifting the error | |
1977 | token. */ | |
1978 | goto yyerrlab1; | |
1979 | ||
1980 | ||
1981 | /*---------------------------------------------------. | |
1982 | | yyerrorlab -- error raised explicitly by YYERROR. | | |
1983 | `---------------------------------------------------*/ | |
1984 | yyerrorlab: | |
1985 | ||
1986 | /* Pacify compilers like GCC when the user code never invokes | |
1987 | YYERROR and the label yyerrorlab therefore never appears in user | |
1988 | code. */ | |
1989 | if (/*CONSTCOND*/ 0) | |
1990 | goto yyerrorlab; | |
1991 | ||
1992 | /* Do not reclaim the symbols of the rule which action triggered | |
1993 | this YYERROR. */ | |
1994 | YYPOPSTACK (yylen); | |
1995 | yylen = 0; | |
1996 | YY_STACK_PRINT (yyss, yyssp); | |
1997 | yystate = *yyssp; | |
1998 | goto yyerrlab1; | |
1999 | ||
2000 | ||
2001 | /*-------------------------------------------------------------. | |
2002 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
2003 | `-------------------------------------------------------------*/ | |
2004 | yyerrlab1: | |
2005 | yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
2006 | ||
2007 | for (;;) | |
2008 | { | |
2009 | yyn = yypact[yystate]; | |
2010 | if (!yypact_value_is_default (yyn)) | |
2011 | { | |
2012 | yyn += YYTERROR; | |
2013 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
2014 | { | |
2015 | yyn = yytable[yyn]; | |
2016 | if (0 < yyn) | |
2017 | break; | |
2018 | } | |
2019 | } | |
2020 | ||
2021 | /* Pop the current state because it cannot handle the error token. */ | |
2022 | if (yyssp == yyss) | |
2023 | YYABORT; | |
2024 | ||
2025 | ||
2026 | yydestruct ("Error: popping", | |
2027 | yystos[yystate], yyvsp); | |
2028 | YYPOPSTACK (1); | |
2029 | yystate = *yyssp; | |
2030 | YY_STACK_PRINT (yyss, yyssp); | |
2031 | } | |
2032 | ||
2033 | *++yyvsp = yylval; | |
2034 | ||
2035 | ||
2036 | /* Shift the error token. */ | |
2037 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); | |
2038 | ||
2039 | yystate = yyn; | |
2040 | goto yynewstate; | |
2041 | ||
2042 | ||
2043 | /*-------------------------------------. | |
2044 | | yyacceptlab -- YYACCEPT comes here. | | |
2045 | `-------------------------------------*/ | |
2046 | yyacceptlab: | |
2047 | yyresult = 0; | |
2048 | goto yyreturn; | |
2049 | ||
2050 | /*-----------------------------------. | |
2051 | | yyabortlab -- YYABORT comes here. | | |
2052 | `-----------------------------------*/ | |
2053 | yyabortlab: | |
2054 | yyresult = 1; | |
2055 | goto yyreturn; | |
2056 | ||
2057 | #if !defined(yyoverflow) || YYERROR_VERBOSE | |
2058 | /*-------------------------------------------------. | |
2059 | | yyexhaustedlab -- memory exhaustion comes here. | | |
2060 | `-------------------------------------------------*/ | |
2061 | yyexhaustedlab: | |
2062 | yyerror (YY_("memory exhausted")); | |
2063 | yyresult = 2; | |
2064 | /* Fall through. */ | |
2065 | #endif | |
2066 | ||
2067 | yyreturn: | |
2068 | if (yychar != YYEMPTY) | |
2069 | { | |
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", | |
2074 | yytoken, &yylval); | |
2075 | } | |
2076 | /* Do not reclaim the symbols of the rule which action triggered | |
2077 | this YYABORT or YYACCEPT. */ | |
2078 | YYPOPSTACK (yylen); | |
2079 | YY_STACK_PRINT (yyss, yyssp); | |
2080 | while (yyssp != yyss) | |
2081 | { | |
2082 | yydestruct ("Cleanup: popping", | |
2083 | yystos[*yyssp], yyvsp); | |
2084 | YYPOPSTACK (1); | |
2085 | } | |
2086 | #ifndef yyoverflow | |
2087 | if (yyss != yyssa) | |
2088 | YYSTACK_FREE (yyss); | |
2089 | #endif | |
2090 | #if YYERROR_VERBOSE | |
2091 | if (yymsg != yymsgbuf) | |
2092 | YYSTACK_FREE (yymsg); | |
2093 | #endif | |
2094 | /* Make sure YYID is used. */ | |
2095 | return YYID (yyresult); | |
2096 | } | |
2097 | ||
2098 | ||
2099 | ||
2100 | /* Line 2067 of yacc.c */ | |
2101 | #line 250 "winprefsyacc.y" | |
2102 | ||
2103 | /* | |
2104 | * Errors in parsing abort and print log messages | |
2105 | */ | |
2106 | static int | |
2107 | yyerror (char *s) | |
2108 | { | |
2109 | extern int yylineno; /* Handled by flex internally */ | |
2110 | ||
2111 | ErrorF("LoadPreferences: %s line %d\n", s, yylineno); | |
2112 | return 1; | |
2113 | } | |
2114 | ||
2115 | /* Miscellaneous functions to store TOKENs into the structure */ | |
2116 | static void | |
2117 | SetIconDirectory (char *path) | |
2118 | { | |
2119 | strncpy (pref.iconDirectory, path, PATH_MAX); | |
2120 | pref.iconDirectory[PATH_MAX] = 0; | |
2121 | } | |
2122 | ||
2123 | static void | |
2124 | SetDefaultIcon (char *fname) | |
2125 | { | |
2126 | strncpy (pref.defaultIconName, fname, NAME_MAX); | |
2127 | pref.defaultIconName[NAME_MAX] = 0; | |
2128 | } | |
2129 | ||
2130 | static void | |
2131 | SetTrayIcon (char *fname) | |
2132 | { | |
2133 | strncpy (pref.trayIconName, fname, NAME_MAX); | |
2134 | pref.trayIconName[NAME_MAX] = 0; | |
2135 | } | |
2136 | ||
2137 | static void | |
2138 | SetRootMenu (char *menuname) | |
2139 | { | |
2140 | strncpy (pref.rootMenuName, menuname, MENU_MAX); | |
2141 | pref.rootMenuName[MENU_MAX] = 0; | |
2142 | } | |
2143 | ||
2144 | static void | |
2145 | SetDefaultSysMenu (char *menuname, int pos) | |
2146 | { | |
2147 | strncpy (pref.defaultSysMenuName, menuname, MENU_MAX); | |
2148 | pref.defaultSysMenuName[MENU_MAX] = 0; | |
2149 | pref.defaultSysMenuPos = pos; | |
2150 | } | |
2151 | ||
2152 | static void | |
2153 | OpenMenu (char *menuname) | |
2154 | { | |
2155 | if (menu.menuItem) free(menu.menuItem); | |
2156 | menu.menuItem = NULL; | |
2157 | strncpy(menu.menuName, menuname, MENU_MAX); | |
2158 | menu.menuName[MENU_MAX] = 0; | |
2159 | menu.menuItems = 0; | |
2160 | } | |
2161 | ||
2162 | static void | |
2163 | AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param) | |
2164 | { | |
2165 | if (menu.menuItem==NULL) | |
2166 | menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM)); | |
2167 | else | |
2168 | menu.menuItem = (MENUITEM*) | |
2169 | realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1)); | |
2170 | ||
2171 | strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX); | |
2172 | menu.menuItem[menu.menuItems].text[MENU_MAX] = 0; | |
2173 | ||
2174 | menu.menuItem[menu.menuItems].cmd = cmd; | |
2175 | ||
2176 | strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX); | |
2177 | menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0; | |
2178 | ||
2179 | menu.menuItem[menu.menuItems].commandID = 0; | |
2180 | ||
2181 | menu.menuItems++; | |
2182 | } | |
2183 | ||
2184 | static void | |
2185 | CloseMenu (void) | |
2186 | { | |
2187 | if (menu.menuItem==NULL || menu.menuItems==0) | |
2188 | { | |
2189 | ErrorF("LoadPreferences: Empty menu detected\n"); | |
2190 | return; | |
2191 | } | |
2192 | ||
2193 | if (pref.menuItems) | |
2194 | pref.menu = (MENUPARSED*) | |
2195 | realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED)); | |
2196 | else | |
2197 | pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED)); | |
2198 | ||
2199 | memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED)); | |
2200 | pref.menuItems++; | |
2201 | ||
2202 | memset (&menu, 0, sizeof(MENUPARSED)); | |
2203 | } | |
2204 | ||
2205 | static void | |
2206 | OpenIcons (void) | |
2207 | { | |
2208 | if (pref.icon != NULL) { | |
2209 | ErrorF("LoadPreferences: Redefining icon mappings\n"); | |
2210 | free(pref.icon); | |
2211 | pref.icon = NULL; | |
2212 | } | |
2213 | pref.iconItems = 0; | |
2214 | } | |
2215 | ||
2216 | static void | |
2217 | AddIconLine (char *matchstr, char *iconfile) | |
2218 | { | |
2219 | if (pref.icon==NULL) | |
2220 | pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM)); | |
2221 | else | |
2222 | pref.icon = (ICONITEM*) | |
2223 | realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1)); | |
2224 | ||
2225 | strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX); | |
2226 | pref.icon[pref.iconItems].match[MENU_MAX] = 0; | |
2227 | ||
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; | |
2230 | ||
2231 | pref.icon[pref.iconItems].hicon = 0; | |
2232 | ||
2233 | pref.iconItems++; | |
2234 | } | |
2235 | ||
2236 | static void | |
2237 | CloseIcons (void) | |
2238 | { | |
2239 | } | |
2240 | ||
2241 | static void | |
2242 | OpenStyles (void) | |
2243 | { | |
2244 | if (pref.style != NULL) { | |
2245 | ErrorF("LoadPreferences: Redefining window style\n"); | |
2246 | free(pref.style); | |
2247 | pref.style = NULL; | |
2248 | } | |
2249 | pref.styleItems = 0; | |
2250 | } | |
2251 | ||
2252 | static void | |
2253 | AddStyleLine (char *matchstr, unsigned long style) | |
2254 | { | |
2255 | if (pref.style==NULL) | |
2256 | pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM)); | |
2257 | else | |
2258 | pref.style = (STYLEITEM*) | |
2259 | realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1)); | |
2260 | ||
2261 | strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX); | |
2262 | pref.style[pref.styleItems].match[MENU_MAX] = 0; | |
2263 | ||
2264 | pref.style[pref.styleItems].type = style; | |
2265 | ||
2266 | pref.styleItems++; | |
2267 | } | |
2268 | ||
2269 | static void | |
2270 | CloseStyles (void) | |
2271 | { | |
2272 | } | |
2273 | ||
2274 | static void | |
2275 | OpenSysMenu (void) | |
2276 | { | |
2277 | if (pref.sysMenu != NULL) { | |
2278 | ErrorF("LoadPreferences: Redefining system menu\n"); | |
2279 | free(pref.sysMenu); | |
2280 | pref.sysMenu = NULL; | |
2281 | } | |
2282 | pref.sysMenuItems = 0; | |
2283 | } | |
2284 | ||
2285 | static void | |
2286 | AddSysMenuLine (char *matchstr, char *menuname, int pos) | |
2287 | { | |
2288 | if (pref.sysMenu==NULL) | |
2289 | pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM)); | |
2290 | else | |
2291 | pref.sysMenu = (SYSMENUITEM*) | |
2292 | realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1)); | |
2293 | ||
2294 | strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX); | |
2295 | pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0; | |
2296 | ||
2297 | strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX); | |
2298 | pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0; | |
2299 | ||
2300 | pref.sysMenu[pref.sysMenuItems].menuPos = pos; | |
2301 | ||
2302 | pref.sysMenuItems++; | |
2303 | } | |
2304 | ||
2305 | static void | |
2306 | CloseSysMenu (void) | |
2307 | { | |
2308 | } | |
2309 | ||
2310 |