1eb0fc745e5b2e14aed49a8dcc601db4c1d9100b
1 /* A Bison parser, made by GNU Bison 1.875c. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
79 tAUTORADIOBUTTON
= 281,
113 tCHARACTERISTICS
= 315,
119 tPRODUCTVERSION
= 321,
120 tFILEFLAGSMASK
= 322,
145 #define tFILENAME 263
147 #define tACCELERATORS 265
151 #define tDIALOGEX 269
154 #define tMESSAGETABLE 272
156 #define tVERSIONINFO 274
157 #define tSTRINGTABLE 275
161 #define tAUTO3STATE 279
162 #define tAUTOCHECKBOX 280
163 #define tAUTORADIOBUTTON 281
164 #define tCHECKBOX 282
165 #define tDEFPUSHBUTTON 283
166 #define tPUSHBUTTON 284
167 #define tRADIOBUTTON 285
169 #define tGROUPBOX 287
170 #define tCOMBOBOX 288
172 #define tSCROLLBAR 290
174 #define tEDITTEXT 292
186 #define tINACTIVE 304
187 #define tNOINVERT 305
190 #define tDISCARDABLE 308
191 #define tLOADONCALL 309
194 #define tMOVEABLE 312
197 #define tCHARACTERISTICS 315
201 #define tLANGUAGE 319
202 #define tFILEVERSION 320
203 #define tPRODUCTVERSION 321
204 #define tFILEFLAGSMASK 322
206 #define tFILETYPE 324
207 #define tFILEFLAGS 325
208 #define tFILESUBTYPE 326
209 #define tMENUBARBREAK 327
210 #define tMENUBREAK 328
211 #define tMENUITEM 329
213 #define tSEPARATOR 331
226 /* Copy the first part of user declarations. */
230 * Copyright 1994 Martin von Loewis
231 * Copyright 1998-2000 Bertho A. Stultiens (BS)
232 * 1999 Juergen Schmied (JS)
234 * This library is free software; you can redistribute it and/or
235 * modify it under the terms of the GNU Lesser General Public
236 * License as published by the Free Software Foundation; either
237 * version 2.1 of the License, or (at your option) any later version.
239 * This library is distributed in the hope that it will be useful,
240 * but WITHOUT ANY WARRANTY; without even the implied warranty of
241 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
242 * Lesser General Public License for more details.
244 * You should have received a copy of the GNU Lesser General Public
245 * License along with this library; if not, write to the Free Software
246 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
249 * 24-Jul-2000 BS - Made a fix for broken Berkeley yacc on
250 * non-terminals (see cjunk rule).
251 * 21-May-2000 BS - Partial implementation of font resources.
252 * - Corrected language propagation for binary
253 * resources such as bitmaps, icons, cursors,
254 * userres and rcdata. The language is now
255 * correct in .res files.
256 * - Fixed reading the resource name as ident,
257 * so that it may overlap keywords.
258 * 20-May-2000 BS - Implemented animated cursors and icons
260 * 30-Apr-2000 BS - Reintegration into the wine-tree
261 * 14-Jan-2000 BS - Redid the usertype resources so that they
263 * 02-Jan-2000 BS - Removed the preprocessor from the grammar
264 * except for the # command (line numbers).
266 * 06-Nov-1999 JS - see CHANGES
268 * 29-Dec-1998 AdH - Grammar and function extensions.
269 * grammar: TOOLBAR resources, Named ICONs in
271 * functions: semantic actions for the grammar
272 * changes, resource files can now be anywhere
273 * on the include path instead of just in the
276 * 20-Jun-1998 BS - Fixed a bug in load_file() where the name was not
277 * printed out correctly.
279 * 17-Jun-1998 BS - Fixed a bug in CLASS statement parsing which should
280 * also accept a tSTRING as argument.
282 * 25-May-1998 BS - Found out that I need to support language, version
283 * and characteristics in inline resources (bitmap,
284 * cursor, etc) but they can also be specified with
285 * a filename. This renders my filename-scanning scheme
286 * worthless. Need to build newline parsing to solve
288 * It will come with version 1.1.0 (sigh).
290 * 19-May-1998 BS - Started to build a builtin preprocessor
292 * 30-Apr-1998 BS - Redid the stringtable parsing/handling. My previous
293 * ideas had some serious flaws.
295 * 27-Apr-1998 BS - Removed a lot of dead comments and put it in a doc
298 * 21-Apr-1998 BS - Added correct behavior for cursors and icons.
299 * - This file is growing too big. It is time to strip
300 * things and put it in a support file.
302 * 19-Apr-1998 BS - Tagged the stringtable resource so that only one
303 * resource will be created. This because the table
304 * has a different layout than other resources. The
305 * table has to be sorted, and divided into smaller
306 * resource entries (see comment in source).
308 * 17-Apr-1998 BS - Almost all strings, including identifiers, are parsed
309 * as string_t which include unicode strings upon
311 * - Parser now emits a warning when compiling win32
312 * extensions in win16 mode.
314 * 16-Apr-1998 BS - Raw data elements are now *optionally* separated
315 * by commas. Read the comments in file sq2dq.l.
316 * - FIXME: there are instances in the source that rely
317 * on the fact that int==32bit and pointers are int size.
318 * - Fixed the conflict in menuex by changing a rule
319 * back into right recursion. See note in source.
320 * - UserType resources cannot have an expression as its
321 * typeclass. See note in source.
323 * 15-Apr-1998 BS - Changed all right recursion into left recursion to
324 * get reduction of the parsestack.
325 * This also helps communication between bison and flex.
326 * Main advantage is that the Empty rule gets reduced
327 * first, which is used to allocate/link things.
328 * It also added a shift/reduce conflict in the menuex
329 * handling, due to expression/option possibility,
330 * although not serious.
332 * 14-Apr-1998 BS - Redone almost the entire parser. We're not talking
333 * about making it more efficient, but readable (for me)
334 * and slightly easier to expand/change.
335 * This is done primarily by using more reduce states
336 * with many (intuitive) types for the various resource
338 * - Added expression handling for all resources where a
339 * number is accepted (not only for win32). Also added
340 * multiply and division (not MS compatible, but handy).
341 * Unary minus introduced a shift/reduce conflict, but
344 * 13-Apr-1998 BS - Reordered a lot of things
345 * - Made the source more readable
346 * - Added Win32 resource definitions
347 * - Corrected syntax problems with an old yacc (;)
348 * - Added extra comment about grammar
364 #include "newstruc.h"
366 #include "wine/wpp.h"
367 #include "wine/unicode.h"
375 /* Berkeley yacc (byacc) doesn't seem to know about these */
376 /* Some *BSD supplied versions do define these though */
378 # define YYEMPTY (-1) /* Empty lookahead value of yychar */
381 # define YYLEX yylex()
384 #elif defined(YYBISON)
385 /* Bison was used for original development */
386 /* #define YYEMPTY -2 */
387 /* #define YYLEX yylex() */
390 /* No yacc we know yet */
391 # if !defined(YYEMPTY) || !defined(YYLEX)
392 # error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
393 # elif defined(__GNUC__) /* gcc defines the #warning directive */
394 # warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
395 /* #else we just take a chance that it works... */
399 int want_nl
= 0; /* Signal flex that we need the next newline */
400 int want_id
= 0; /* Signal flex that we need the next identifier */
401 stringtable_t
*tagstt
; /* Stringtable tag.
402 * It is set while parsing a stringtable to one of
403 * the stringtables in the sttres list or a new one
404 * if the language was not parsed before.
406 stringtable_t
*sttres
; /* Stringtable resources. This holds the list of
407 * stringtables with different lanuages
409 static int dont_want_id
= 0; /* See language parsing for details */
411 /* Set to the current options of the currently scanning stringtable */
412 static int *tagstt_memopt
;
413 static characts_t
*tagstt_characts
;
414 static version_t
*tagstt_version
;
416 static const char riff
[4] = "RIFF"; /* RIFF file magic for animated cursor/icon */
418 /* Prototypes of here defined functions */
419 static event_t
*get_event_head(event_t
*p
);
420 static control_t
*get_control_head(control_t
*p
);
421 static ver_value_t
*get_ver_value_head(ver_value_t
*p
);
422 static ver_block_t
*get_ver_block_head(ver_block_t
*p
);
423 static resource_t
*get_resource_head(resource_t
*p
);
424 static menuex_item_t
*get_itemex_head(menuex_item_t
*p
);
425 static menu_item_t
*get_item_head(menu_item_t
*p
);
426 static raw_data_t
*merge_raw_data_str(raw_data_t
*r1
, string_t
*str
);
427 static raw_data_t
*merge_raw_data_int(raw_data_t
*r1
, int i
);
428 static raw_data_t
*merge_raw_data_long(raw_data_t
*r1
, int i
);
429 static raw_data_t
*merge_raw_data(raw_data_t
*r1
, raw_data_t
*r2
);
430 static raw_data_t
*str2raw_data(string_t
*str
);
431 static raw_data_t
*int2raw_data(int i
);
432 static raw_data_t
*long2raw_data(int i
);
433 static raw_data_t
*load_file(string_t
*name
, language_t
*lang
);
434 static itemex_opt_t
*new_itemex_opt(int id
, int type
, int state
, int helpid
);
435 static event_t
*add_string_event(string_t
*key
, int id
, int flags
, event_t
*prev
);
436 static event_t
*add_event(int key
, int id
, int flags
, event_t
*prev
);
437 static dialogex_t
*dialogex_version(version_t
*v
, dialogex_t
*dlg
);
438 static dialogex_t
*dialogex_characteristics(characts_t
*c
, dialogex_t
*dlg
);
439 static dialogex_t
*dialogex_language(language_t
*l
, dialogex_t
*dlg
);
440 static dialogex_t
*dialogex_menu(name_id_t
*m
, dialogex_t
*dlg
);
441 static dialogex_t
*dialogex_class(name_id_t
*n
, dialogex_t
*dlg
);
442 static dialogex_t
*dialogex_font(font_id_t
*f
, dialogex_t
*dlg
);
443 static dialogex_t
*dialogex_caption(string_t
*s
, dialogex_t
*dlg
);
444 static dialogex_t
*dialogex_exstyle(style_t
*st
, dialogex_t
*dlg
);
445 static dialogex_t
*dialogex_style(style_t
*st
, dialogex_t
*dlg
);
446 static name_id_t
*convert_ctlclass(name_id_t
*cls
);
447 static control_t
*ins_ctrl(int type
, int special_style
, control_t
*ctrl
, control_t
*prev
);
448 static dialog_t
*dialog_version(version_t
*v
, dialog_t
*dlg
);
449 static dialog_t
*dialog_characteristics(characts_t
*c
, dialog_t
*dlg
);
450 static dialog_t
*dialog_language(language_t
*l
, dialog_t
*dlg
);
451 static dialog_t
*dialog_menu(name_id_t
*m
, dialog_t
*dlg
);
452 static dialog_t
*dialog_class(name_id_t
*n
, dialog_t
*dlg
);
453 static dialog_t
*dialog_font(font_id_t
*f
, dialog_t
*dlg
);
454 static dialog_t
*dialog_caption(string_t
*s
, dialog_t
*dlg
);
455 static dialog_t
*dialog_exstyle(style_t
* st
, dialog_t
*dlg
);
456 static dialog_t
*dialog_style(style_t
* st
, dialog_t
*dlg
);
457 static resource_t
*build_stt_resources(stringtable_t
*stthead
);
458 static stringtable_t
*find_stringtable(lvc_t
*lvc
);
459 static toolbar_item_t
*ins_tlbr_button(toolbar_item_t
*prev
, toolbar_item_t
*idrec
);
460 static toolbar_item_t
*get_tlbr_buttons_head(toolbar_item_t
*p
, int *nitems
);
461 static string_t
*make_filename(string_t
*s
);
462 static resource_t
*build_fontdirs(resource_t
*tail
);
463 static resource_t
*build_fontdir(resource_t
**fnt
, int nfnt
);
464 static int rsrcid_to_token(int lookahead
);
468 /* Enabling traces. */
473 /* Enabling verbose error messages. */
474 #ifdef YYERROR_VERBOSE
475 # undef YYERROR_VERBOSE
476 # define YYERROR_VERBOSE 1
478 # define YYERROR_VERBOSE 0
481 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
483 typedef union YYSTYPE
{
511 menuex_item_t
*menexitm
;
519 toolbar_item_t
*tlbarItems
;
521 style_pair_t
*styles
;
525 /* Line 191 of yacc.c. */
526 #line 527 "parser.tab.c"
527 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
528 # define YYSTYPE_IS_DECLARED 1
529 # define YYSTYPE_IS_TRIVIAL 1
534 /* Copy the second part of user declarations. */
537 /* Line 214 of yacc.c. */
538 #line 539 "parser.tab.c"
540 #if ! defined (yyoverflow) || YYERROR_VERBOSE
546 # define YYMALLOC malloc
549 /* The parser invokes alloca or malloc; define the necessary symbols. */
551 # ifdef YYSTACK_USE_ALLOCA
552 # if YYSTACK_USE_ALLOCA
553 # define YYSTACK_ALLOC alloca
556 # if defined (alloca) || defined (_ALLOCA_H)
557 # define YYSTACK_ALLOC alloca
560 # define YYSTACK_ALLOC __builtin_alloca
565 # ifdef YYSTACK_ALLOC
566 /* Pacify GCC's `empty if-body' warning. */
567 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
569 # if defined (__STDC__) || defined (__cplusplus)
570 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
571 # define YYSIZE_T size_t
573 # define YYSTACK_ALLOC YYMALLOC
574 # define YYSTACK_FREE YYFREE
576 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
579 #if (! defined (yyoverflow) \
580 && (! defined (__cplusplus) \
581 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
583 /* A type that is properly aligned for any stack member. */
590 /* The size of the maximum gap between one aligned stack and the next. */
591 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
593 /* The size of an array large to enough to hold all stacks, each with
595 # define YYSTACK_BYTES(N) \
596 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
597 + YYSTACK_GAP_MAXIMUM)
599 /* Copy COUNT objects from FROM to TO. The source and destination do
602 # if defined (__GNUC__) && 1 < __GNUC__
603 # define YYCOPY(To, From, Count) \
604 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
606 # define YYCOPY(To, From, Count) \
609 register YYSIZE_T yyi; \
610 for (yyi = 0; yyi < (Count); yyi++) \
611 (To)[yyi] = (From)[yyi]; \
617 /* Relocate STACK from its old location to the new one. The
618 local variables YYSIZE and YYSTACKSIZE give the old and new number of
619 elements in the stack, and YYPTR gives the new location of the
620 stack. Advance YYPTR to a properly aligned location for the next
622 # define YYSTACK_RELOCATE(Stack) \
625 YYSIZE_T yynewbytes; \
626 YYCOPY (&yyptr->Stack, Stack, yysize); \
627 Stack = &yyptr->Stack; \
628 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
629 yyptr += yynewbytes / sizeof (*yyptr); \
635 #if defined (__STDC__) || defined (__cplusplus)
636 typedef signed char yysigned_char
;
638 typedef short yysigned_char
;
641 /* YYFINAL -- State number of the termination state. */
643 /* YYLAST -- Last index in YYTABLE. */
646 /* YYNTOKENS -- Number of terminals. */
648 /* YYNNTS -- Number of nonterminals. */
650 /* YYNRULES -- Number of rules. */
652 /* YYNRULES -- Number of states. */
653 #define YYNSTATES 571
655 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
657 #define YYMAXUTOK 339
659 #define YYTRANSLATE(YYX) \
660 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
662 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
663 static const unsigned char yytranslate
[] =
665 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
666 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
667 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
668 2, 2, 2, 2, 2, 2, 2, 2, 85, 2,
669 94, 95, 88, 86, 93, 87, 2, 89, 2, 2,
670 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
671 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
672 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
673 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
674 2, 2, 2, 2, 84, 2, 2, 2, 2, 2,
675 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
676 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
677 2, 2, 2, 2, 83, 2, 90, 2, 2, 2,
678 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
679 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
680 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
682 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
687 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
688 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
690 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
691 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
692 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
693 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
694 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
695 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
696 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
697 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
698 75, 76, 77, 78, 79, 80, 81, 82, 91, 92
702 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
704 static const unsigned short yyprhs
[] =
706 0, 0, 3, 5, 6, 9, 12, 16, 20, 22,
707 23, 29, 30, 32, 34, 36, 38, 40, 42, 44,
708 46, 48, 50, 52, 54, 56, 58, 60, 62, 64,
709 66, 68, 70, 72, 74, 76, 80, 84, 88, 92,
710 96, 100, 104, 108, 112, 114, 116, 123, 124, 130,
711 136, 137, 140, 142, 146, 148, 150, 152, 154, 156,
712 158, 172, 173, 177, 181, 185, 188, 192, 196, 199,
713 202, 205, 206, 210, 214, 218, 222, 226, 230, 234,
714 238, 242, 246, 250, 254, 258, 262, 266, 270, 274,
715 285, 298, 309, 310, 315, 322, 331, 349, 365, 370,
716 371, 374, 379, 383, 387, 389, 392, 394, 396, 411,
717 412, 416, 420, 424, 427, 430, 434, 438, 441, 444,
718 447, 448, 452, 456, 460, 464, 468, 472, 476, 480,
719 484, 488, 492, 496, 500, 504, 508, 512, 516, 527,
720 547, 564, 579, 592, 593, 595, 596, 599, 609, 610,
721 613, 618, 622, 623, 630, 634, 640, 641, 645, 649,
722 653, 657, 661, 665, 670, 674, 675, 680, 684, 690,
723 691, 694, 700, 707, 708, 711, 716, 723, 732, 737,
724 741, 742, 747, 748, 750, 757, 758, 768, 778, 782,
725 786, 790, 794, 798, 799, 802, 808, 809, 812, 814,
726 819, 824, 826, 830, 840, 841, 845, 848, 849, 852,
727 855, 857, 859, 861, 863, 865, 867, 869, 870, 873,
728 876, 879, 884, 887, 890, 895, 897, 899, 902, 904,
729 907, 909, 913, 917, 922, 926, 931, 935, 937, 939,
730 940, 942, 944, 948, 952, 956, 960, 964, 968, 972,
731 975, 978, 981, 985, 987, 989, 992, 994
734 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
735 static const short yyrhs
[] =
737 97, 0, -1, 98, -1, -1, 98, 99, -1, 98,
738 3, -1, 175, 101, 104, -1, 7, 101, 104, -1,
739 151, -1, -1, 64, 100, 175, 93, 175, -1, -1,
740 175, -1, 7, -1, 102, -1, 6, -1, 116, -1,
741 106, -1, 107, -1, 121, -1, 132, -1, 113, -1,
742 109, -1, 110, -1, 108, -1, 142, -1, 146, -1,
743 111, -1, 112, -1, 162, -1, 114, -1, 155, -1,
744 8, -1, 7, -1, 6, -1, 11, 164, 173, -1,
745 12, 164, 173, -1, 23, 164, 173, -1, 21, 164,
746 173, -1, 22, 164, 173, -1, 17, 164, 173, -1,
747 18, 164, 173, -1, 82, 164, 173, -1, 115, 164,
748 173, -1, 4, -1, 7, -1, 10, 164, 167, 80,
749 117, 81, -1, -1, 117, 6, 93, 175, 118, -1,
750 117, 175, 93, 175, 118, -1, -1, 93, 119, -1,
751 120, -1, 119, 93, 120, -1, 50, -1, 43, -1,
752 36, -1, 44, -1, 45, -1, 46, -1, 13, 164,
753 175, 93, 175, 93, 175, 93, 175, 122, 80, 123,
754 81, -1, -1, 122, 62, 130, -1, 122, 61, 130,
755 -1, 122, 59, 6, -1, 122, 128, -1, 122, 58,
756 103, -1, 122, 15, 102, -1, 122, 168, -1, 122,
757 169, -1, 122, 170, -1, -1, 123, 36, 127, -1,
758 123, 37, 125, -1, 123, 34, 125, -1, 123, 33,
759 125, -1, 123, 35, 125, -1, 123, 27, 124, -1,
760 123, 28, 124, -1, 123, 32, 124, -1, 123, 29,
761 124, -1, 123, 30, 124, -1, 123, 24, 124, -1,
762 123, 31, 124, -1, 123, 25, 124, -1, 123, 26,
763 124, -1, 123, 40, 124, -1, 123, 39, 124, -1,
764 123, 38, 124, -1, 123, 23, 103, 154, 175, 93,
765 175, 93, 175, 126, -1, 6, 154, 175, 93, 175,
766 93, 175, 93, 175, 93, 175, 129, -1, 175, 93,
767 175, 93, 175, 93, 175, 93, 175, 129, -1, -1,
768 93, 175, 93, 175, -1, 93, 175, 93, 175, 93,
769 130, -1, 93, 175, 93, 175, 93, 130, 93, 130,
770 -1, 103, 154, 175, 93, 131, 93, 130, 93, 175,
771 93, 175, 93, 175, 93, 175, 93, 130, -1, 103,
772 154, 175, 93, 131, 93, 130, 93, 175, 93, 175,
773 93, 175, 93, 175, -1, 21, 175, 93, 6, -1,
774 -1, 93, 130, -1, 93, 130, 93, 130, -1, 130,
775 83, 130, -1, 94, 130, 95, -1, 176, -1, 91,
776 176, -1, 175, -1, 6, -1, 14, 164, 175, 93,
777 175, 93, 175, 93, 175, 139, 133, 80, 134, 81,
778 -1, -1, 133, 62, 130, -1, 133, 61, 130, -1,
779 133, 59, 6, -1, 133, 128, -1, 133, 140, -1,
780 133, 58, 103, -1, 133, 15, 102, -1, 133, 168,
781 -1, 133, 169, -1, 133, 170, -1, -1, 134, 36,
782 135, -1, 134, 37, 137, -1, 134, 34, 137, -1,
783 134, 33, 137, -1, 134, 35, 137, -1, 134, 27,
784 136, -1, 134, 28, 136, -1, 134, 32, 136, -1,
785 134, 29, 136, -1, 134, 30, 136, -1, 134, 24,
786 136, -1, 134, 31, 136, -1, 134, 25, 136, -1,
787 134, 26, 136, -1, 134, 40, 136, -1, 134, 39,
788 136, -1, 134, 38, 136, -1, 134, 23, 103, 154,
789 175, 93, 175, 93, 175, 126, -1, 103, 154, 175,
790 93, 131, 93, 130, 93, 175, 93, 175, 93, 175,
791 93, 175, 93, 130, 139, 138, -1, 103, 154, 175,
792 93, 131, 93, 130, 93, 175, 93, 175, 93, 175,
793 93, 175, 138, -1, 6, 154, 175, 93, 175, 93,
794 175, 93, 175, 93, 175, 129, 139, 138, -1, 175,
795 93, 175, 93, 175, 93, 175, 93, 175, 129, 139,
796 138, -1, -1, 171, -1, -1, 93, 175, -1, 21,
797 175, 93, 6, 93, 175, 93, 175, 141, -1, -1,
798 93, 175, -1, 15, 164, 167, 143, -1, 80, 144,
799 81, -1, -1, 144, 74, 6, 154, 175, 145, -1,
800 144, 74, 76, -1, 144, 75, 6, 145, 143, -1,
801 -1, 154, 48, 145, -1, 154, 47, 145, -1, 154,
802 77, 145, -1, 154, 49, 145, -1, 154, 72, 145,
803 -1, 154, 73, 145, -1, 16, 164, 167, 147, -1,
804 80, 148, 81, -1, -1, 148, 74, 6, 149, -1,
805 148, 74, 76, -1, 148, 75, 6, 150, 147, -1,
806 -1, 93, 175, -1, 93, 174, 93, 174, 145, -1,
807 93, 174, 93, 174, 93, 175, -1, -1, 93, 175,
808 -1, 93, 174, 93, 175, -1, 93, 174, 93, 174,
809 93, 175, -1, 93, 174, 93, 174, 93, 174, 93,
810 175, -1, 152, 80, 153, 81, -1, 20, 164, 167,
811 -1, -1, 153, 175, 154, 6, -1, -1, 93, -1,
812 19, 164, 156, 80, 157, 81, -1, -1, 156, 65,
813 175, 93, 175, 93, 175, 93, 175, -1, 156, 66,
814 175, 93, 175, 93, 175, 93, 175, -1, 156, 70,
815 175, -1, 156, 67, 175, -1, 156, 68, 175, -1,
816 156, 69, 175, -1, 156, 71, 175, -1, -1, 157,
817 158, -1, 41, 6, 80, 159, 81, -1, -1, 159,
818 160, -1, 158, -1, 42, 6, 93, 6, -1, 42,
819 6, 93, 161, -1, 175, -1, 161, 93, 175, -1,
820 78, 164, 175, 93, 175, 167, 80, 163, 81, -1,
821 -1, 163, 79, 175, -1, 163, 76, -1, -1, 164,
822 165, -1, 164, 166, -1, 55, -1, 57, -1, 53,
823 -1, 51, -1, 54, -1, 56, -1, 52, -1, -1,
824 167, 168, -1, 167, 169, -1, 167, 170, -1, 64,
825 175, 93, 175, -1, 60, 175, -1, 63, 175, -1,
826 167, 80, 172, 81, -1, 9, -1, 4, -1, 87,
827 4, -1, 5, -1, 87, 5, -1, 6, -1, 172,
828 154, 9, -1, 172, 154, 4, -1, 172, 154, 87,
829 4, -1, 172, 154, 5, -1, 172, 154, 87, 5,
830 -1, 172, 154, 6, -1, 105, -1, 171, -1, -1,
831 175, -1, 177, -1, 177, 86, 177, -1, 177, 87,
832 177, -1, 177, 83, 177, -1, 177, 85, 177, -1,
833 177, 88, 177, -1, 177, 89, 177, -1, 177, 84,
834 177, -1, 90, 177, -1, 87, 177, -1, 86, 177,
835 -1, 94, 177, 95, -1, 178, -1, 176, -1, 91,
836 178, -1, 4, -1, 5, -1
839 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
840 static const unsigned short yyrline
[] =
842 0, 361, 361, 395, 396, 466, 472, 484, 494, 502,
843 502, 546, 552, 559, 569, 570, 579, 580, 581, 605,
844 606, 612, 613, 614, 615, 639, 640, 646, 647, 648,
845 649, 650, 654, 655, 656, 660, 664, 680, 702, 712,
846 720, 728, 732, 736, 747, 752, 761, 785, 786, 787,
847 796, 797, 800, 801, 804, 805, 806, 807, 808, 809,
848 814, 849, 850, 851, 852, 853, 854, 855, 856, 857,
849 858, 861, 862, 863, 864, 865, 866, 867, 868, 869,
850 870, 872, 873, 874, 875, 876, 877, 878, 879, 881,
851 891, 916, 938, 940, 945, 952, 963, 977, 992, 997,
852 998, 999, 1003, 1004, 1005, 1006, 1010, 1015, 1023, 1067,
853 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077,
854 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089,
855 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1100, 1110,
856 1135, 1151, 1179, 1202, 1203, 1206, 1207, 1211, 1218, 1219,
857 1223, 1246, 1250, 1251, 1260, 1266, 1285, 1286, 1287, 1288,
858 1289, 1290, 1291, 1295, 1320, 1324, 1325, 1341, 1347, 1367,
859 1368, 1372, 1380, 1391, 1392, 1396, 1402, 1410, 1430, 1471,
860 1482, 1483, 1516, 1518, 1523, 1539, 1540, 1550, 1560, 1567,
861 1574, 1581, 1588, 1598, 1599, 1608, 1616, 1617, 1626, 1631,
862 1637, 1646, 1647, 1651, 1677, 1678, 1683, 1692, 1693, 1703,
863 1718, 1719, 1720, 1721, 1724, 1725, 1726, 1730, 1731, 1739,
864 1747, 1765, 1772, 1776, 1780, 1795, 1796, 1797, 1798, 1799,
865 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1810, 1811, 1818,
866 1819, 1823, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833,
867 1834, 1835, 1836, 1837, 1841, 1842, 1845, 1846
871 #if YYDEBUG || YYERROR_VERBOSE
872 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
873 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
874 static const char *const yytname
[] =
876 "$end", "error", "$undefined", "tNL", "tNUMBER", "tLNUMBER", "tSTRING",
877 "tIDENT", "tFILENAME", "tRAWDATA", "tACCELERATORS", "tBITMAP", "tCURSOR",
878 "tDIALOG", "tDIALOGEX", "tMENU", "tMENUEX", "tMESSAGETABLE", "tRCDATA",
879 "tVERSIONINFO", "tSTRINGTABLE", "tFONT", "tFONTDIR", "tICON",
880 "tAUTO3STATE", "tAUTOCHECKBOX", "tAUTORADIOBUTTON", "tCHECKBOX",
881 "tDEFPUSHBUTTON", "tPUSHBUTTON", "tRADIOBUTTON", "tSTATE3", "tGROUPBOX",
882 "tCOMBOBOX", "tLISTBOX", "tSCROLLBAR", "tCONTROL", "tEDITTEXT", "tRTEXT",
883 "tCTEXT", "tLTEXT", "tBLOCK", "tVALUE", "tSHIFT", "tALT", "tASCII",
884 "tVIRTKEY", "tGRAYED", "tCHECKED", "tINACTIVE", "tNOINVERT", "tPURE",
885 "tIMPURE", "tDISCARDABLE", "tLOADONCALL", "tPRELOAD", "tFIXED",
886 "tMOVEABLE", "tCLASS", "tCAPTION", "tCHARACTERISTICS", "tEXSTYLE",
887 "tSTYLE", "tVERSION", "tLANGUAGE", "tFILEVERSION", "tPRODUCTVERSION",
888 "tFILEFLAGSMASK", "tFILEOS", "tFILETYPE", "tFILEFLAGS", "tFILESUBTYPE",
889 "tMENUBARBREAK", "tMENUBREAK", "tMENUITEM", "tPOPUP", "tSEPARATOR",
890 "tHELP", "tTOOLBAR", "tBUTTON", "tBEGIN", "tEND", "tDLGINIT", "'|'",
891 "'^'", "'&'", "'+'", "'-'", "'*'", "'/'", "'~'", "tNOT", "pUPM", "','",
892 "'('", "')'", "$accept", "resource_file", "resources", "resource", "@1",
893 "usrcvt", "nameid", "nameid_s", "resource_definition", "filename",
894 "bitmap", "cursor", "icon", "font", "fontdir", "messagetable", "rcdata",
895 "dlginit", "userres", "usertype", "accelerators", "events", "acc_opt",
896 "accs", "acc", "dialog", "dlg_attributes", "ctrls", "lab_ctrl",
897 "ctrl_desc", "iconinfo", "gen_ctrl", "opt_font", "optional_style_pair",
898 "style", "ctlclass", "dialogex", "dlgex_attribs", "exctrls",
899 "gen_exctrl", "lab_exctrl", "exctrl_desc", "opt_data", "helpid",
900 "opt_exfont", "opt_expr", "menu", "menu_body", "item_definitions",
901 "item_options", "menuex", "menuex_body", "itemex_definitions",
902 "itemex_options", "itemex_p_options", "stringtable", "stt_head",
903 "strings", "opt_comma", "versioninfo", "fix_version", "ver_blocks",
904 "ver_block", "ver_values", "ver_value", "ver_words", "toolbar",
905 "toolbar_items", "loadmemopts", "lamo", "lama", "opt_lvc",
906 "opt_language", "opt_characts", "opt_version", "raw_data",
907 "raw_elements", "file_raw", "e_expr", "expr", "xpr_no_not", "xpr",
913 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
915 static const unsigned short yytoknum
[] =
917 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
918 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
919 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
920 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
921 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
922 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
923 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
924 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
925 335, 336, 337, 124, 94, 38, 43, 45, 42, 47,
926 126, 338, 339, 44, 40, 41
930 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
931 static const unsigned char yyr1
[] =
933 0, 96, 97, 98, 98, 98, 99, 99, 99, 100,
934 99, 101, 102, 102, 103, 103, 104, 104, 104, 104,
935 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
936 104, 104, 105, 105, 105, 106, 107, 108, 109, 110,
937 111, 112, 113, 114, 115, 115, 116, 117, 117, 117,
938 118, 118, 119, 119, 120, 120, 120, 120, 120, 120,
939 121, 122, 122, 122, 122, 122, 122, 122, 122, 122,
940 122, 123, 123, 123, 123, 123, 123, 123, 123, 123,
941 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
942 124, 125, 126, 126, 126, 126, 127, 127, 128, 129,
943 129, 129, 130, 130, 130, 130, 131, 131, 132, 133,
944 133, 133, 133, 133, 133, 133, 133, 133, 133, 133,
945 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
946 134, 134, 134, 134, 134, 134, 134, 134, 134, 135,
947 135, 136, 137, 138, 138, 139, 139, 140, 141, 141,
948 142, 143, 144, 144, 144, 144, 145, 145, 145, 145,
949 145, 145, 145, 146, 147, 148, 148, 148, 148, 149,
950 149, 149, 149, 150, 150, 150, 150, 150, 151, 152,
951 153, 153, 154, 154, 155, 156, 156, 156, 156, 156,
952 156, 156, 156, 157, 157, 158, 159, 159, 160, 160,
953 160, 161, 161, 162, 163, 163, 163, 164, 164, 164,
954 165, 165, 165, 165, 166, 166, 166, 167, 167, 167,
955 167, 168, 169, 170, 171, 172, 172, 172, 172, 172,
956 172, 172, 172, 172, 172, 172, 172, 173, 173, 174,
957 174, 175, 176, 176, 176, 176, 176, 176, 176, 176,
958 176, 176, 176, 176, 177, 177, 178, 178
961 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
962 static const unsigned char yyr2
[] =
964 0, 2, 1, 0, 2, 2, 3, 3, 1, 0,
965 5, 0, 1, 1, 1, 1, 1, 1, 1, 1,
966 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
967 1, 1, 1, 1, 1, 3, 3, 3, 3, 3,
968 3, 3, 3, 3, 1, 1, 6, 0, 5, 5,
969 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
970 13, 0, 3, 3, 3, 2, 3, 3, 2, 2,
971 2, 0, 3, 3, 3, 3, 3, 3, 3, 3,
972 3, 3, 3, 3, 3, 3, 3, 3, 3, 10,
973 12, 10, 0, 4, 6, 8, 17, 15, 4, 0,
974 2, 4, 3, 3, 1, 2, 1, 1, 14, 0,
975 3, 3, 3, 2, 2, 3, 3, 2, 2, 2,
976 0, 3, 3, 3, 3, 3, 3, 3, 3, 3,
977 3, 3, 3, 3, 3, 3, 3, 3, 10, 19,
978 16, 14, 12, 0, 1, 0, 2, 9, 0, 2,
979 4, 3, 0, 6, 3, 5, 0, 3, 3, 3,
980 3, 3, 3, 4, 3, 0, 4, 3, 5, 0,
981 2, 5, 6, 0, 2, 4, 6, 8, 4, 3,
982 0, 4, 0, 1, 6, 0, 9, 9, 3, 3,
983 3, 3, 3, 0, 2, 5, 0, 2, 1, 4,
984 4, 1, 3, 9, 0, 3, 2, 0, 2, 2,
985 1, 1, 1, 1, 1, 1, 1, 0, 2, 2,
986 2, 4, 2, 2, 4, 1, 1, 2, 1, 2,
987 1, 3, 3, 4, 3, 4, 3, 1, 1, 0,
988 1, 1, 3, 3, 3, 3, 3, 3, 3, 2,
989 2, 2, 3, 1, 1, 2, 1, 1
992 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
993 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
994 means the default is an error. */
995 static const unsigned short yydefact
[] =
997 3, 0, 2, 1, 5, 256, 257, 11, 207, 9,
998 0, 0, 0, 0, 0, 4, 8, 0, 11, 254,
999 241, 253, 0, 217, 0, 251, 250, 249, 255, 0,
1000 180, 0, 0, 0, 0, 0, 0, 0, 0, 44,
1001 45, 207, 207, 207, 207, 207, 207, 207, 207, 207,
1002 207, 207, 207, 207, 207, 207, 7, 17, 18, 24,
1003 22, 23, 27, 28, 21, 30, 207, 16, 19, 20,
1004 25, 26, 31, 29, 213, 216, 212, 214, 210, 215,
1005 211, 208, 209, 179, 0, 252, 0, 6, 244, 248,
1006 245, 242, 243, 246, 247, 217, 217, 217, 0, 0,
1007 217, 217, 217, 217, 185, 217, 217, 217, 0, 217,
1008 217, 0, 0, 0, 218, 219, 220, 0, 178, 182,
1009 0, 34, 33, 32, 237, 0, 238, 35, 36, 0,
1010 0, 0, 0, 40, 41, 0, 38, 39, 37, 0,
1011 42, 43, 222, 223, 0, 10, 183, 0, 47, 0,
1012 0, 0, 152, 150, 165, 163, 0, 0, 0, 0,
1013 0, 0, 0, 193, 0, 0, 181, 0, 226, 228,
1014 230, 225, 0, 182, 0, 0, 0, 0, 0, 0,
1015 189, 190, 191, 188, 192, 0, 217, 221, 0, 46,
1016 0, 227, 229, 224, 0, 0, 0, 0, 0, 151,
1017 0, 0, 164, 0, 0, 0, 184, 194, 0, 0,
1018 0, 232, 234, 236, 231, 0, 0, 0, 182, 154,
1019 182, 169, 167, 173, 0, 0, 0, 204, 50, 50,
1020 233, 235, 0, 0, 0, 0, 0, 239, 166, 239,
1021 0, 0, 0, 196, 0, 0, 48, 49, 61, 145,
1022 182, 155, 182, 182, 182, 182, 182, 182, 0, 170,
1023 0, 174, 168, 0, 0, 0, 206, 0, 203, 56,
1024 55, 57, 58, 59, 54, 51, 52, 0, 0, 109,
1025 153, 158, 157, 160, 161, 162, 159, 239, 239, 0,
1026 0, 0, 195, 198, 197, 205, 0, 0, 0, 0,
1027 0, 0, 0, 71, 65, 68, 69, 70, 146, 0,
1028 182, 240, 0, 175, 186, 187, 0, 53, 13, 67,
1029 12, 0, 15, 14, 66, 64, 0, 0, 63, 104,
1030 0, 62, 0, 0, 0, 0, 0, 0, 0, 120,
1031 113, 114, 117, 118, 119, 183, 171, 239, 0, 0,
1032 105, 253, 0, 0, 0, 0, 0, 0, 0, 0,
1033 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1034 0, 0, 60, 116, 0, 115, 112, 111, 110, 0,
1035 172, 0, 176, 199, 200, 201, 98, 103, 102, 182,
1036 182, 82, 84, 85, 77, 78, 80, 81, 83, 79,
1037 75, 0, 74, 76, 182, 72, 73, 88, 87, 86,
1038 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1039 0, 0, 0, 0, 0, 0, 0, 0, 0, 108,
1040 0, 0, 0, 0, 0, 0, 98, 182, 182, 131,
1041 133, 134, 126, 127, 129, 130, 132, 128, 124, 0,
1042 123, 125, 182, 121, 122, 137, 136, 135, 177, 202,
1043 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1044 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1045 0, 107, 0, 106, 0, 0, 0, 0, 0, 0,
1046 0, 0, 0, 148, 0, 0, 0, 0, 92, 0,
1047 0, 0, 0, 147, 0, 0, 0, 0, 0, 89,
1048 0, 0, 0, 149, 92, 0, 0, 0, 0, 0,
1049 99, 0, 138, 0, 0, 0, 0, 0, 0, 91,
1050 0, 0, 99, 0, 93, 99, 100, 0, 0, 145,
1051 0, 0, 90, 0, 0, 99, 143, 0, 94, 101,
1052 0, 145, 142, 144, 0, 0, 0, 143, 0, 95,
1053 97, 141, 0, 0, 143, 96, 0, 140, 145, 143,
1057 /* YYDEFGOTO[NTERM-NUM]. */
1058 static const short yydefgoto
[] =
1060 -1, 1, 2, 15, 24, 22, 323, 324, 56, 124,
1061 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1062 67, 167, 246, 275, 276, 68, 277, 332, 391, 400,
1063 509, 405, 304, 529, 328, 482, 69, 309, 379, 453,
1064 439, 448, 552, 279, 341, 503, 70, 153, 176, 235,
1065 71, 155, 177, 238, 240, 16, 17, 86, 236, 72,
1066 135, 185, 207, 265, 294, 384, 73, 244, 23, 81,
1067 82, 125, 114, 115, 116, 126, 173, 127, 258, 320,
1071 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1073 #define YYPACT_NINF -487
1074 static const short yypact
[] =
1076 -487, 6, 43, -487, -487, -487, -487, -487, -487, -487,
1077 30, 30, 30, 215, 30, -487, -487, -60, -487, -487,
1078 636, -487, 434, 675, 30, -487, -487, -487, -487, 623,
1079 -487, 434, 30, 30, 30, 30, 30, 30, 30, -487,
1080 -487, -487, -487, -487, -487, -487, -487, -487, -487, -487,
1081 -487, -487, -487, -487, -487, -487, -487, -487, -487, -487,
1082 -487, -487, -487, -487, -487, -487, -487, -487, -487, -487,
1083 -487, -487, -487, -487, -487, -487, -487, -487, -487, -487,
1084 -487, -487, -487, 310, -62, -487, 131, -487, 563, 195,
1085 232, 213, 213, -487, -487, 675, 533, 533, 87, 87,
1086 675, 675, 533, 533, 675, 533, 533, 533, 87, 533,
1087 533, 30, 30, 30, -487, -487, -487, 30, -487, -48,
1088 136, -487, -487, -487, -487, 163, -487, -487, -487, -44,
1089 -25, 199, 231, -487, -487, 410, -487, -487, -487, -3,
1090 -487, -487, -487, -487, 5, -487, -487, 67, -487, 21,
1091 30, 30, -487, -487, -487, -487, 30, 30, 30, 30,
1092 30, 30, 30, -487, 30, 30, -487, 89, -487, -487,
1093 -487, -487, 334, -19, 26, 32, 259, 284, 34, 38,
1094 -487, -487, -487, -487, -487, -24, -487, -487, 57, -487,
1095 68, -487, -487, -487, 60, 30, 30, -4, 161, -487,
1096 3, 176, -487, 30, 30, 191, -487, -487, 308, 30,
1097 30, -487, -487, -487, -487, 356, 113, 116, -48, -487,
1098 -70, 118, -487, 135, 140, 143, 144, -487, 145, 145,
1099 -487, -487, 30, 30, 30, 168, 278, 30, -487, 30,
1100 173, 30, 30, -487, 47, 512, -487, -487, -487, 167,
1101 171, -487, 71, 71, 71, 71, 71, 71, 185, 200,
1102 210, 200, -487, 217, 220, -29, -487, 30, -487, -487,
1103 -487, -487, -487, -487, -487, 243, -487, 354, 30, -487,
1104 -487, -487, -487, -487, -487, -487, -487, 30, 30, 30,
1105 30, 251, -487, -487, -487, -487, 512, 164, 30, 293,
1106 318, 312, 312, -487, -487, -487, -487, -487, -487, 514,
1107 254, -487, 261, 200, -487, -487, 274, -487, -487, -487,
1108 -487, 283, -487, -487, -487, -487, 30, 312, 294, 649,
1109 636, 294, 572, 164, 30, 293, 338, 312, 312, -487,
1110 -487, -487, -487, -487, -487, 30, -487, 30, 262, 372,
1111 649, -487, 17, 312, 293, 375, 375, 375, 375, 375,
1112 375, 375, 375, 375, 30, 30, 30, 293, 30, 375,
1113 375, 375, -487, -487, 289, -487, -487, 294, 294, 590,
1114 -487, 292, 200, -487, 298, -487, -487, -487, -487, -48,
1115 -48, -487, -487, -487, -487, -487, -487, -487, -487, -487,
1116 -487, 299, -487, -487, -48, -487, -487, -487, -487, -487,
1117 380, 293, 389, 389, 389, 389, 389, 389, 389, 389,
1118 389, 30, 30, 30, 293, 30, 389, 389, 389, -487,
1119 30, 30, 30, 30, 30, 30, 307, -48, -48, -487,
1120 -487, -487, -487, -487, -487, -487, -487, -487, -487, 316,
1121 -487, -487, -48, -487, -487, -487, -487, -487, -487, -487,
1122 317, 329, 332, 333, 30, 30, 30, 30, 30, 30,
1123 30, 30, 303, 342, 347, 349, 350, 361, 365, 366,
1124 367, -487, 368, -487, 30, 30, 30, 30, 303, 30,
1125 30, 30, 312, 378, 379, 381, 398, 399, 400, 401,
1126 402, -72, 30, -487, 30, 30, 30, 312, 30, -487,
1127 30, 30, 30, -487, 400, 404, 405, -16, 406, 408,
1128 412, 414, -487, 30, 30, 30, 30, 30, 312, -487,
1129 30, 420, 412, 421, 422, 412, 39, 424, 30, 167,
1130 30, 312, -487, 312, 30, 412, 344, 425, 112, 294,
1131 426, 167, -487, -487, 30, 312, 30, 344, 427, 294,
1132 433, -487, 30, 312, 25, 294, 312, -487, 121, 344,
1136 /* YYPGOTO[NTERM-NUM]. */
1137 static const short yypgoto
[] =
1139 -487, -487, -487, -487, -487, 383, -278, -182, 374, -487,
1140 -487, -487, -487, -487, -487, -487, -487, -487, -487, -487,
1141 -487, -487, 182, -487, 100, -487, -487, -487, 304, -95,
1142 -87, -487, 218, -431, -251, -15, -487, -487, -487, -487,
1143 263, 14, -486, -469, -487, -487, -487, 295, -487, -66,
1144 -487, 291, -487, -487, -487, -487, -487, -487, -115, -487,
1145 -487, -487, 268, -487, -487, -487, -487, -487, 591, -487,
1146 -487, -20, -253, -249, -248, -354, -487, 595, -234, -2,
1150 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1151 positive, shift that token. If negative, reduce the rule which
1152 number is the opposite. If zero, do what YYDEFACT says.
1153 If YYTABLE_NINF, syntax error. */
1154 #define YYTABLE_NINF -255
1155 static const short yytable
[] =
1157 18, 28, 218, 83, 147, 260, 3, 329, 329, 221,
1158 -156, 353, 205, 291, 25, 26, 27, 205, 29, 319,
1159 30, 512, 84, 146, 305, 168, 169, 170, 306, 307,
1160 171, 117, 350, 329, 5, 6, 88, 89, 90, 91,
1161 92, 93, 94, 329, 329, 146, 4, 5, 6, 150,
1162 7, 331, 292, 310, 312, 373, 342, 206, 194, 329,
1163 343, 344, 193, 8, 211, 212, 213, 353, 151, 214,
1164 546, 561, 219, 166, 146, 120, 352, 525, 567, 222,
1165 131, 132, 557, 570, 119, -217, 377, 378, -217, -217,
1166 164, 5, 6, 5, 6, 188, 129, 130, 165, 569,
1167 353, 539, 388, 234, 542, -217, 139, 9, 172, 142,
1168 143, 144, 387, 381, 551, 145, 10, 11, 566, 195,
1169 12, 13, 353, 266, 14, 196, 267, 203, 268, 10,
1170 11, 204, 543, 12, 13, 5, 6, 14, 74, 75,
1171 76, 77, 78, 79, 80, -156, -156, 215, 174, 175,
1172 209, -156, -156, 375, 178, 179, 180, 181, 182, 183,
1173 184, 210, 186, 187, 146, 190, 208, 220, 5, 6,
1174 189, 318, 389, 10, 11, 10, 11, 12, 13, 12,
1175 13, 14, 223, 14, 280, 404, 281, 282, 283, 284,
1176 285, 286, 553, 216, 217, 353, 111, 226, 329, 112,
1177 113, 224, 225, 553, 353, 555, 232, 228, 229, 233,
1178 553, 237, 118, 329, 278, 553, 148, 10, 11, 5,
1179 6, 12, 13, 111, 243, 14, 112, 113, 239, 437,
1180 248, 249, 250, 241, 329, 259, 242, 261, 245, 263,
1181 264, 501, 452, 149, 346, -156, -156, 329, 152, 329,
1182 10, 11, -156, 154, 12, 13, 517, 316, 14, 111,
1183 278, 329, 112, 113, 146, 295, 5, 6, 383, 329,
1184 402, 403, 329, 406, 432, 433, 308, 536, 287, 152,
1185 34, 35, 36, 37, 38, 311, 313, 314, 315, 435,
1186 548, 111, 549, -240, 112, 113, 321, 5, 6, 322,
1187 318, 37, 38, 288, 559, 330, 330, 5, 6, 481,
1188 289, 154, 565, 290, 351, 568, 5, 6, 35, 36,
1189 37, 38, 465, 466, 325, 252, 253, 254, -156, -156,
1190 330, 29, 374, 197, 198, -156, 296, 468, 191, 192,
1191 199, 330, 330, 380, 376, 382, 385, 345, 10, 11,
1192 255, 256, 12, 13, 347, 257, 14, 330, 200, 201,
1193 230, 231, 401, 401, 401, 202, 401, 348, 111, 297,
1194 111, 112, 113, 112, 113, 298, 349, 353, 386, 10,
1195 11, 390, 410, 12, 13, 430, 436, 14, 227, 10,
1196 11, 431, 434, 12, 13, 438, 317, 14, 10, 11,
1197 464, 31, 12, 326, -217, 87, 327, -217, -217, 467,
1198 469, 247, 299, 300, 111, 301, 302, 112, 113, 449,
1199 449, 449, 470, 449, -217, 471, 472, 522, 458, 459,
1200 460, 461, 462, 463, 303, 484, 450, 451, 39, 454,
1201 485, 40, 486, 487, 41, 42, 43, 44, 45, 46,
1202 47, 48, 49, 50, 488, 51, 52, 53, 489, 490,
1203 491, 492, 473, 474, 475, 476, 477, 478, 479, 480,
1204 483, 502, 504, 497, 505, 156, 157, 158, 159, 160,
1205 161, 162, 493, 494, 495, 496, 483, 498, 499, 500,
1206 163, 506, 507, 508, 510, 511, 330, 523, 524, 526,
1207 513, 527, 514, 515, 516, 528, 518, 530, 519, 520,
1208 521, 330, 54, 538, 540, 541, 55, 544, 554, 556,
1209 562, 531, 532, 533, 534, 535, 563, 340, 537, 333,
1210 251, 262, 330, 293, 0, 334, 545, 0, 547, 121,
1211 122, 123, 550, 0, 0, 330, 0, 330, 269, 0,
1212 0, 0, 558, 0, 560, 270, 271, 272, 273, 330,
1213 564, 0, 274, 0, 0, 0, 0, 330, 0, 0,
1214 330, 0, 335, 336, 111, 337, 338, 112, 113, 0,
1215 0, 0, 0, 0, 74, 75, 76, 77, 78, 79,
1216 80, 0, 0, 0, 339, 354, 355, 356, 357, 358,
1217 359, 360, 361, 362, 363, 364, 365, 366, 367, 368,
1218 369, 370, 371, 411, 412, 413, 414, 415, 416, 417,
1219 418, 419, 420, 421, 422, 423, 424, 425, 426, 427,
1220 428, 0, 95, 96, 97, 98, 99, 100, 101, 102,
1221 103, 104, 105, 106, 107, 108, 109, 33, 34, 35,
1222 36, 37, 38, 372, 0, 0, 0, 110, 0, 0,
1223 392, 393, 394, 395, 396, 397, 398, 399, 0, 0,
1224 0, 429, 0, 407, 408, 409, 440, 441, 442, 443,
1225 444, 445, 446, 447, 0, 0, 0, 0, 0, 455,
1226 456, 457, 128, 0, 0, 0, 0, 133, 134, 0,
1227 136, 137, 138, 0, 140, 141, 32, 33, 34, 35,
1228 36, 37, 38, 0, 0, 0, 0, 0, 85, 32,
1229 33, 34, 35, 36, 37, 38, 74, 75, 76, 77,
1230 78, 79, 80, -254, -254, -254, -254, -254, -254
1233 static const short yycheck
[] =
1235 2, 13, 6, 23, 119, 239, 0, 301, 302, 6,
1236 80, 83, 41, 42, 10, 11, 12, 41, 14, 297,
1237 80, 93, 24, 93, 277, 4, 5, 6, 277, 277,
1238 9, 93, 326, 327, 4, 5, 32, 33, 34, 35,
1239 36, 37, 38, 337, 338, 93, 3, 4, 5, 93,
1240 7, 302, 81, 287, 288, 333, 309, 81, 173, 353,
1241 309, 309, 81, 20, 4, 5, 6, 83, 93, 9,
1242 539, 557, 76, 6, 93, 95, 327, 93, 564, 76,
1243 100, 101, 551, 569, 86, 60, 337, 338, 63, 64,
1244 93, 4, 5, 4, 5, 6, 98, 99, 93, 568,
1245 83, 532, 353, 218, 535, 80, 108, 64, 87, 111,
1246 112, 113, 95, 347, 545, 117, 86, 87, 93, 93,
1247 90, 91, 83, 76, 94, 93, 79, 93, 81, 86,
1248 87, 93, 93, 90, 91, 4, 5, 94, 51, 52,
1249 53, 54, 55, 56, 57, 74, 75, 87, 150, 151,
1250 93, 80, 81, 335, 156, 157, 158, 159, 160, 161,
1251 162, 93, 164, 165, 93, 167, 186, 6, 4, 5,
1252 81, 7, 354, 86, 87, 86, 87, 90, 91, 90,
1253 91, 94, 6, 94, 250, 367, 252, 253, 254, 255,
1254 256, 257, 546, 195, 196, 83, 60, 6, 492, 63,
1255 64, 203, 204, 557, 83, 93, 93, 209, 210, 93,
1256 564, 93, 81, 507, 93, 569, 80, 86, 87, 4,
1257 5, 90, 91, 60, 80, 94, 63, 64, 93, 411,
1258 232, 233, 234, 93, 528, 237, 93, 239, 93, 241,
1259 242, 492, 424, 80, 310, 74, 75, 541, 80, 543,
1260 86, 87, 81, 80, 90, 91, 507, 6, 94, 60,
1261 93, 555, 63, 64, 93, 267, 4, 5, 6, 563,
1262 365, 366, 566, 368, 389, 390, 278, 528, 93, 80,
1263 85, 86, 87, 88, 89, 287, 288, 289, 290, 404,
1264 541, 60, 543, 93, 63, 64, 298, 4, 5, 6,
1265 7, 88, 89, 93, 555, 301, 302, 4, 5, 6,
1266 93, 80, 563, 93, 326, 566, 4, 5, 86, 87,
1267 88, 89, 437, 438, 6, 47, 48, 49, 74, 75,
1268 326, 327, 334, 74, 75, 81, 93, 452, 4, 5,
1269 81, 337, 338, 345, 6, 347, 348, 93, 86, 87,
1270 72, 73, 90, 91, 93, 77, 94, 353, 74, 75,
1271 4, 5, 364, 365, 366, 81, 368, 93, 60, 15,
1272 60, 63, 64, 63, 64, 21, 93, 83, 6, 86,
1273 87, 6, 93, 90, 91, 93, 6, 94, 80, 86,
1274 87, 93, 93, 90, 91, 6, 296, 94, 86, 87,
1275 93, 18, 90, 91, 60, 31, 94, 63, 64, 93,
1276 93, 229, 58, 59, 60, 61, 62, 63, 64, 421,
1277 422, 423, 93, 425, 80, 93, 93, 514, 430, 431,
1278 432, 433, 434, 435, 80, 93, 422, 423, 4, 425,
1279 93, 7, 93, 93, 10, 11, 12, 13, 14, 15,
1280 16, 17, 18, 19, 93, 21, 22, 23, 93, 93,
1281 93, 93, 464, 465, 466, 467, 468, 469, 470, 471,
1282 472, 93, 93, 488, 93, 65, 66, 67, 68, 69,
1283 70, 71, 484, 485, 486, 487, 488, 489, 490, 491,
1284 80, 93, 93, 93, 93, 93, 492, 93, 93, 93,
1285 502, 93, 504, 505, 506, 93, 508, 93, 510, 511,
1286 512, 507, 78, 93, 93, 93, 82, 93, 93, 93,
1287 93, 523, 524, 525, 526, 527, 93, 309, 530, 15,
1288 235, 240, 528, 265, -1, 21, 538, -1, 540, 6,
1289 7, 8, 544, -1, -1, 541, -1, 543, 36, -1,
1290 -1, -1, 554, -1, 556, 43, 44, 45, 46, 555,
1291 562, -1, 50, -1, -1, -1, -1, 563, -1, -1,
1292 566, -1, 58, 59, 60, 61, 62, 63, 64, -1,
1293 -1, -1, -1, -1, 51, 52, 53, 54, 55, 56,
1294 57, -1, -1, -1, 80, 23, 24, 25, 26, 27,
1295 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1296 38, 39, 40, 23, 24, 25, 26, 27, 28, 29,
1297 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1298 40, -1, 41, 42, 43, 44, 45, 46, 47, 48,
1299 49, 50, 51, 52, 53, 54, 55, 84, 85, 86,
1300 87, 88, 89, 81, -1, -1, -1, 66, -1, -1,
1301 356, 357, 358, 359, 360, 361, 362, 363, -1, -1,
1302 -1, 81, -1, 369, 370, 371, 413, 414, 415, 416,
1303 417, 418, 419, 420, -1, -1, -1, -1, -1, 426,
1304 427, 428, 97, -1, -1, -1, -1, 102, 103, -1,
1305 105, 106, 107, -1, 109, 110, 83, 84, 85, 86,
1306 87, 88, 89, -1, -1, -1, -1, -1, 95, 83,
1307 84, 85, 86, 87, 88, 89, 51, 52, 53, 54,
1308 55, 56, 57, 84, 85, 86, 87, 88, 89
1311 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1312 symbol of state STATE-NUM. */
1313 static const unsigned char yystos
[] =
1315 0, 97, 98, 0, 3, 4, 5, 7, 20, 64,
1316 86, 87, 90, 91, 94, 99, 151, 152, 175, 176,
1317 177, 178, 101, 164, 100, 177, 177, 177, 178, 177,
1318 80, 101, 83, 84, 85, 86, 87, 88, 89, 4,
1319 7, 10, 11, 12, 13, 14, 15, 16, 17, 18,
1320 19, 21, 22, 23, 78, 82, 104, 106, 107, 108,
1321 109, 110, 111, 112, 113, 114, 115, 116, 121, 132,
1322 142, 146, 155, 162, 51, 52, 53, 54, 55, 56,
1323 57, 165, 166, 167, 175, 95, 153, 104, 177, 177,
1324 177, 177, 177, 177, 177, 164, 164, 164, 164, 164,
1325 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1326 164, 60, 63, 64, 168, 169, 170, 93, 81, 175,
1327 167, 6, 7, 8, 105, 167, 171, 173, 173, 175,
1328 175, 167, 167, 173, 173, 156, 173, 173, 173, 175,
1329 173, 173, 175, 175, 175, 175, 93, 154, 80, 80,
1330 93, 93, 80, 143, 80, 147, 65, 66, 67, 68,
1331 69, 70, 71, 80, 93, 93, 6, 117, 4, 5,
1332 6, 9, 87, 172, 175, 175, 144, 148, 175, 175,
1333 175, 175, 175, 175, 175, 157, 175, 175, 6, 81,
1334 175, 4, 5, 81, 154, 93, 93, 74, 75, 81,
1335 74, 75, 81, 93, 93, 41, 81, 158, 167, 93,
1336 93, 4, 5, 6, 9, 87, 175, 175, 6, 76,
1337 6, 6, 76, 6, 175, 175, 6, 80, 175, 175,
1338 4, 5, 93, 93, 154, 145, 154, 93, 149, 93,
1339 150, 93, 93, 80, 163, 93, 118, 118, 175, 175,
1340 175, 143, 47, 48, 49, 72, 73, 77, 174, 175,
1341 174, 175, 147, 175, 175, 159, 76, 79, 81, 36,
1342 43, 44, 45, 46, 50, 119, 120, 122, 93, 139,
1343 145, 145, 145, 145, 145, 145, 145, 93, 93, 93,
1344 93, 42, 81, 158, 160, 175, 93, 15, 21, 58,
1345 59, 61, 62, 80, 128, 168, 169, 170, 175, 133,
1346 174, 175, 174, 175, 175, 175, 6, 120, 7, 102,
1347 175, 175, 6, 102, 103, 6, 91, 94, 130, 176,
1348 177, 130, 123, 15, 21, 58, 59, 61, 62, 80,
1349 128, 140, 168, 169, 170, 93, 145, 93, 93, 93,
1350 176, 178, 130, 83, 23, 24, 25, 26, 27, 28,
1351 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1352 39, 40, 81, 102, 175, 103, 6, 130, 130, 134,
1353 175, 174, 175, 6, 161, 175, 6, 95, 130, 103,
1354 6, 124, 124, 124, 124, 124, 124, 124, 124, 124,
1355 125, 175, 125, 125, 103, 127, 125, 124, 124, 124,
1356 93, 23, 24, 25, 26, 27, 28, 29, 30, 31,
1357 32, 33, 34, 35, 36, 37, 38, 39, 40, 81,
1358 93, 93, 154, 154, 93, 154, 6, 103, 6, 136,
1359 136, 136, 136, 136, 136, 136, 136, 136, 137, 175,
1360 137, 137, 103, 135, 137, 136, 136, 136, 175, 175,
1361 175, 175, 175, 175, 93, 154, 154, 93, 154, 93,
1362 93, 93, 93, 175, 175, 175, 175, 175, 175, 175,
1363 175, 6, 131, 175, 93, 93, 93, 93, 93, 93,
1364 93, 93, 93, 175, 175, 175, 175, 131, 175, 175,
1365 175, 130, 93, 141, 93, 93, 93, 93, 93, 126,
1366 93, 93, 93, 175, 175, 175, 175, 130, 175, 175,
1367 175, 175, 126, 93, 93, 93, 93, 93, 93, 129,
1368 93, 175, 175, 175, 175, 175, 130, 175, 93, 129,
1369 93, 93, 129, 93, 93, 175, 139, 175, 130, 130,
1370 175, 129, 138, 171, 93, 93, 93, 139, 175, 130,
1371 175, 138, 93, 93, 175, 130, 93, 138, 130, 139,
1375 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1376 # define YYSIZE_T __SIZE_TYPE__
1378 #if ! defined (YYSIZE_T) && defined (size_t)
1379 # define YYSIZE_T size_t
1381 #if ! defined (YYSIZE_T)
1382 # if defined (__STDC__) || defined (__cplusplus)
1383 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1384 # define YYSIZE_T size_t
1387 #if ! defined (YYSIZE_T)
1388 # define YYSIZE_T unsigned int
1391 #define yyerrok (yyerrstatus = 0)
1392 #define yyclearin (yychar = YYEMPTY)
1393 #define YYEMPTY (-2)
1396 #define YYACCEPT goto yyacceptlab
1397 #define YYABORT goto yyabortlab
1398 #define YYERROR goto yyerrorlab
1401 /* Like YYERROR except do call yyerror. This remains here temporarily
1402 to ease the transition to the new meaning of YYERROR, for GCC.
1403 Once GCC version 2 has supplanted version 1, this can go. */
1405 #define YYFAIL goto yyerrlab
1407 #define YYRECOVERING() (!!yyerrstatus)
1409 #define YYBACKUP(Token, Value) \
1411 if (yychar == YYEMPTY && yylen == 1) \
1415 yytoken = YYTRANSLATE (yychar); \
1421 yyerror ("syntax error: cannot back up");\
1427 #define YYERRCODE 256
1429 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1432 #ifndef YYLLOC_DEFAULT
1433 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1434 ((Current).first_line = (Rhs)[1].first_line, \
1435 (Current).first_column = (Rhs)[1].first_column, \
1436 (Current).last_line = (Rhs)[N].last_line, \
1437 (Current).last_column = (Rhs)[N].last_column)
1440 /* YYLEX -- calling `yylex' with the right arguments. */
1443 # define YYLEX yylex (YYLEX_PARAM)
1445 # define YYLEX yylex ()
1448 /* Enable debugging if requested. */
1452 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1453 # define YYFPRINTF fprintf
1456 # define YYDPRINTF(Args) \
1462 # define YYDSYMPRINT(Args) \
1468 # define YYDSYMPRINTF(Title, Token, Value, Location) \
1472 YYFPRINTF (stderr, "%s ", Title); \
1473 yysymprint (stderr, \
1475 YYFPRINTF (stderr, "\n"); \
1479 /*------------------------------------------------------------------.
1480 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1482 `------------------------------------------------------------------*/
1484 #if defined (__STDC__) || defined (__cplusplus)
1486 yy_stack_print (short *bottom
, short *top
)
1489 yy_stack_print (bottom
, top
)
1494 YYFPRINTF (stderr
, "Stack now");
1495 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1496 YYFPRINTF (stderr
, " %d", *bottom
);
1497 YYFPRINTF (stderr
, "\n");
1500 # define YY_STACK_PRINT(Bottom, Top) \
1503 yy_stack_print ((Bottom), (Top)); \
1507 /*------------------------------------------------.
1508 | Report that the YYRULE is going to be reduced. |
1509 `------------------------------------------------*/
1511 #if defined (__STDC__) || defined (__cplusplus)
1513 yy_reduce_print (int yyrule
)
1516 yy_reduce_print (yyrule
)
1521 unsigned int yylno
= yyrline
[yyrule
];
1522 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %u), ",
1524 /* Print the symbols being reduced, and their result. */
1525 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1526 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1527 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1530 # define YY_REDUCE_PRINT(Rule) \
1533 yy_reduce_print (Rule); \
1536 /* Nonzero means print parse trace. It is left uninitialized so that
1537 multiple parsers can coexist. */
1539 #else /* !YYDEBUG */
1540 # define YYDPRINTF(Args)
1541 # define YYDSYMPRINT(Args)
1542 # define YYDSYMPRINTF(Title, Token, Value, Location)
1543 # define YY_STACK_PRINT(Bottom, Top)
1544 # define YY_REDUCE_PRINT(Rule)
1545 #endif /* !YYDEBUG */
1548 /* YYINITDEPTH -- initial size of the parser's stacks. */
1550 # define YYINITDEPTH 200
1553 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1554 if the built-in stack extension method is used).
1556 Do not make this value too large; the results are undefined if
1557 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1558 evaluated with infinite-precision integer arithmetic. */
1560 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1565 # define YYMAXDEPTH 10000
1573 # if defined (__GLIBC__) && defined (_STRING_H)
1574 # define yystrlen strlen
1576 /* Return the length of YYSTR. */
1578 # if defined (__STDC__) || defined (__cplusplus)
1579 yystrlen (const char *yystr
)
1585 register const char *yys
= yystr
;
1587 while (*yys
++ != '\0')
1590 return yys
- yystr
- 1;
1596 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1597 # define yystpcpy stpcpy
1599 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1602 # if defined (__STDC__) || defined (__cplusplus)
1603 yystpcpy (char *yydest
, const char *yysrc
)
1605 yystpcpy (yydest
, yysrc
)
1610 register char *yyd
= yydest
;
1611 register const char *yys
= yysrc
;
1613 while ((*yyd
++ = *yys
++) != '\0')
1621 #endif /* !YYERROR_VERBOSE */
1626 /*--------------------------------.
1627 | Print this symbol on YYOUTPUT. |
1628 `--------------------------------*/
1630 #if defined (__STDC__) || defined (__cplusplus)
1632 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1635 yysymprint (yyoutput
, yytype
, yyvaluep
)
1641 /* Pacify ``unused variable'' warnings. */
1644 if (yytype
< YYNTOKENS
)
1646 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1648 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1652 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1659 YYFPRINTF (yyoutput
, ")");
1662 #endif /* ! YYDEBUG */
1663 /*-----------------------------------------------.
1664 | Release the memory associated to this symbol. |
1665 `-----------------------------------------------*/
1667 #if defined (__STDC__) || defined (__cplusplus)
1669 yydestruct (int yytype
, YYSTYPE
*yyvaluep
)
1672 yydestruct (yytype
, yyvaluep
)
1677 /* Pacify ``unused variable'' warnings. */
1689 /* Prevent warnings from -Wmissing-prototypes. */
1691 #ifdef YYPARSE_PARAM
1692 # if defined (__STDC__) || defined (__cplusplus)
1693 int yyparse (void *YYPARSE_PARAM
);
1697 #else /* ! YYPARSE_PARAM */
1698 #if defined (__STDC__) || defined (__cplusplus)
1703 #endif /* ! YYPARSE_PARAM */
1707 /* The lookahead symbol. */
1710 /* The semantic value of the lookahead symbol. */
1713 /* Number of syntax errors so far. */
1722 #ifdef YYPARSE_PARAM
1723 # if defined (__STDC__) || defined (__cplusplus)
1724 int yyparse (void *YYPARSE_PARAM
)
1726 int yyparse (YYPARSE_PARAM
)
1727 void *YYPARSE_PARAM
;
1729 #else /* ! YYPARSE_PARAM */
1730 #if defined (__STDC__) || defined (__cplusplus)
1741 register int yystate
;
1744 /* Number of tokens to shift before error messages enabled. */
1746 /* Lookahead token as an internal (translated) token number. */
1749 /* Three stacks and their tools:
1750 `yyss': related to states,
1751 `yyvs': related to semantic values,
1752 `yyls': related to locations.
1754 Refer to the stacks thru separate pointers, to allow yyoverflow
1755 to reallocate them elsewhere. */
1757 /* The state stack. */
1758 short yyssa
[YYINITDEPTH
];
1759 short *yyss
= yyssa
;
1760 register short *yyssp
;
1762 /* The semantic value stack. */
1763 YYSTYPE yyvsa
[YYINITDEPTH
];
1764 YYSTYPE
*yyvs
= yyvsa
;
1765 register YYSTYPE
*yyvsp
;
1769 #define YYPOPSTACK (yyvsp--, yyssp--)
1771 YYSIZE_T yystacksize
= YYINITDEPTH
;
1773 /* The variables used to return semantic value and location from the
1778 /* When reducing, the number of symbols on the RHS of the reduced
1782 YYDPRINTF ((stderr
, "Starting parse\n"));
1787 yychar
= YYEMPTY
; /* Cause a token to be read. */
1789 /* Initialize stack pointers.
1790 Waste one element of value and location stack
1791 so that they stay on the same level as the state stack.
1792 The wasted elements are never initialized. */
1799 /*------------------------------------------------------------.
1800 | yynewstate -- Push a new state, which is found in yystate. |
1801 `------------------------------------------------------------*/
1803 /* In all cases, when you get here, the value and location stacks
1804 have just been pushed. so pushing a state here evens the stacks.
1811 if (yyss
+ yystacksize
- 1 <= yyssp
)
1813 /* Get the current used size of the three stacks, in elements. */
1814 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1818 /* Give user a chance to reallocate the stack. Use copies of
1819 these so that the &'s don't force the real ones into
1821 YYSTYPE
*yyvs1
= yyvs
;
1822 short *yyss1
= yyss
;
1825 /* Each stack pointer address is followed by the size of the
1826 data in use in that stack, in bytes. This used to be a
1827 conditional around just the two extra args, but that might
1828 be undefined if yyoverflow is a macro. */
1829 yyoverflow ("parser stack overflow",
1830 &yyss1
, yysize
* sizeof (*yyssp
),
1831 &yyvs1
, yysize
* sizeof (*yyvsp
),
1838 #else /* no yyoverflow */
1839 # ifndef YYSTACK_RELOCATE
1842 /* Extend the stack our own way. */
1843 if (YYMAXDEPTH
<= yystacksize
)
1846 if (YYMAXDEPTH
< yystacksize
)
1847 yystacksize
= YYMAXDEPTH
;
1850 short *yyss1
= yyss
;
1851 union yyalloc
*yyptr
=
1852 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1855 YYSTACK_RELOCATE (yyss
);
1856 YYSTACK_RELOCATE (yyvs
);
1858 # undef YYSTACK_RELOCATE
1860 YYSTACK_FREE (yyss1
);
1863 #endif /* no yyoverflow */
1865 yyssp
= yyss
+ yysize
- 1;
1866 yyvsp
= yyvs
+ yysize
- 1;
1869 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1870 (unsigned long int) yystacksize
));
1872 if (yyss
+ yystacksize
- 1 <= yyssp
)
1876 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1885 /* Do appropriate processing given the current state. */
1886 /* Read a lookahead token if we need one and don't already have one. */
1889 /* First try to decide what to do without reference to lookahead token. */
1891 yyn
= yypact
[yystate
];
1892 if (yyn
== YYPACT_NINF
)
1895 /* Not known => get a lookahead token if don't already have one. */
1897 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1898 if (yychar
== YYEMPTY
)
1900 YYDPRINTF ((stderr
, "Reading a token: "));
1904 if (yychar
<= YYEOF
)
1906 yychar
= yytoken
= YYEOF
;
1907 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1911 yytoken
= YYTRANSLATE (yychar
);
1912 YYDSYMPRINTF ("Next token is", yytoken
, &yylval
, &yylloc
);
1915 /* If the proper action on seeing token YYTOKEN is to reduce or to
1916 detect an error, take that action. */
1918 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1923 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1932 /* Shift the lookahead token. */
1933 YYDPRINTF ((stderr
, "Shifting token %s, ", yytname
[yytoken
]));
1935 /* Discard the token being shifted unless it is eof. */
1936 if (yychar
!= YYEOF
)
1942 /* Count tokens shifted since error; after three, turn off error
1951 /*-----------------------------------------------------------.
1952 | yydefault -- do the default action for the current state. |
1953 `-----------------------------------------------------------*/
1955 yyn
= yydefact
[yystate
];
1961 /*-----------------------------.
1962 | yyreduce -- Do a reduction. |
1963 `-----------------------------*/
1965 /* yyn is the number of a rule to reduce with. */
1968 /* If YYLEN is nonzero, implement the default value of the action:
1971 Otherwise, the following line sets YYVAL to garbage.
1972 This behavior is undocumented and Bison
1973 users should not rely upon it. Assigning to YYVAL
1974 unconditionally makes the parser a bit smaller, and it avoids a
1975 GCC warning that YYVAL may be used uninitialized. */
1976 yyval
= yyvsp
[1-yylen
];
1979 YY_REDUCE_PRINT (yyn
);
1983 #line 361 "parser.y"
1986 /* First add stringtables to the resource-list */
1987 rsc
= build_stt_resources(sttres
);
1988 /* 'build_stt_resources' returns a head and $1 is a tail */
1991 yyvsp
[0].res
->next
= rsc
;
1993 rsc
->prev
= yyvsp
[0].res
;
1997 /* Find the tail again */
1998 while(yyvsp
[0].res
&& yyvsp
[0].res
->next
)
1999 yyvsp
[0].res
= yyvsp
[0].res
->next
;
2000 /* Now add any fontdirecory */
2001 rsc
= build_fontdirs(yyvsp
[0].res
);
2002 /* 'build_fontdir' returns a head and $1 is a tail */
2005 yyvsp
[0].res
->next
= rsc
;
2007 rsc
->prev
= yyvsp
[0].res
;
2011 /* Final statement before were done */
2012 resource_top
= get_resource_head(yyvsp
[0].res
);
2017 #line 395 "parser.y"
2018 { yyval
.res
= NULL
; want_id
= 1; ;}
2022 #line 396 "parser.y"
2026 resource_t
*tail
= yyvsp
[0].res
;
2027 resource_t
*head
= yyvsp
[0].res
;
2032 head
->prev
= yyvsp
[-1].res
;
2034 yyvsp
[-1].res
->next
= head
;
2036 /* Check for duplicate identifiers */
2037 while(yyvsp
[-1].res
&& head
)
2039 resource_t
*rsc
= yyvsp
[-1].res
;
2042 if(rsc
->type
== head
->type
2043 && rsc
->lan
->id
== head
->lan
->id
2044 && rsc
->lan
->sub
== head
->lan
->sub
2045 && !compare_name_id(rsc
->name
, head
->name
))
2047 yyerror("Duplicate resource name '%s'", get_nameid_str(rsc
->name
));
2054 else if(yyvsp
[-1].res
)
2056 resource_t
*tail
= yyvsp
[-1].res
;
2064 if(!dont_want_id
) /* See comments in language parsing below */
2071 #line 472 "parser.y"
2073 yyval
.res
= yyvsp
[0].res
;
2076 if(yyvsp
[-2].num
> 65535 || yyvsp
[-2].num
< -32768)
2077 yyerror("Resource's ID out of range (%d)", yyvsp
[-2].num
);
2078 yyval
.res
->name
= new_name_id();
2079 yyval
.res
->name
->type
= name_ord
;
2080 yyval
.res
->name
->name
.i_name
= yyvsp
[-2].num
;
2081 chat("Got %s (%d)", get_typename(yyvsp
[0].res
), yyval
.res
->name
->name
.i_name
);
2087 #line 484 "parser.y"
2089 yyval
.res
= yyvsp
[0].res
;
2092 yyval
.res
->name
= new_name_id();
2093 yyval
.res
->name
->type
= name_str
;
2094 yyval
.res
->name
->name
.s_name
= yyvsp
[-2].str
;
2095 chat("Got %s (%s)", get_typename(yyvsp
[0].res
), yyval
.res
->name
->name
.s_name
->str
.cstr
);
2101 #line 494 "parser.y"
2103 /* Don't do anything, stringtables are converted to
2104 * resource_t structures when we are finished parsing and
2105 * the final rule of the parser is reduced (see above)
2108 chat("Got STRINGTABLE");
2113 #line 502 "parser.y"
2118 #line 502 "parser.y"
2120 /* We *NEED* the newline to delimit the expression.
2121 * Otherwise, we would not be able to set the next
2122 * want_id anymore because of the token-lookahead.
2124 * However, we can test the lookahead-token for
2125 * being "non-expression" type, in which case we
2126 * continue. Fortunately, tNL is the only token that
2127 * will break expression parsing and is implicitely
2128 * void, so we just remove it. This scheme makes it
2129 * possible to do some (not all) fancy preprocessor
2131 * BTW, we also need to make sure that the next
2132 * reduction of 'resources' above will *not* set
2133 * want_id because we already have a lookahead that
2136 if(yychar
!= YYEMPTY
&& yychar
!= tNL
)
2140 yychar
= YYEMPTY
; /* Could use 'yyclearin', but we already need the*/
2141 /* direct access to yychar in rule 'usrcvt' below. */
2142 else if(yychar
== tIDENT
)
2143 yywarning("LANGUAGE statement not delimited with newline; next identifier might be wrong");
2145 want_nl
= 0; /* We don't want it anymore if we didn't get it */
2148 yywarning("LANGUAGE not supported in 16-bit mode");
2150 free(currentlanguage
);
2151 if (get_language_codepage(yyvsp
[-2].num
, yyvsp
[0].num
) == -1)
2152 yyerror( "Language %04x is not supported", (yyvsp
[0].num
<<10) + yyvsp
[-2].num
);
2153 currentlanguage
= new_language(yyvsp
[-2].num
, yyvsp
[0].num
);
2155 chat("Got LANGUAGE %d,%d (0x%04x)", yyvsp
[-2].num
, yyvsp
[0].num
, (yyvsp
[0].num
<<10) + yyvsp
[-2].num
);
2160 #line 546 "parser.y"
2161 { yychar
= rsrcid_to_token(yychar
); ;}
2165 #line 552 "parser.y"
2167 if(yyvsp
[0].num
> 65535 || yyvsp
[0].num
< -32768)
2168 yyerror("Resource's ID out of range (%d)", yyvsp
[0].num
);
2169 yyval
.nid
= new_name_id();
2170 yyval
.nid
->type
= name_ord
;
2171 yyval
.nid
->name
.i_name
= yyvsp
[0].num
;
2176 #line 559 "parser.y"
2178 yyval
.nid
= new_name_id();
2179 yyval
.nid
->type
= name_str
;
2180 yyval
.nid
->name
.s_name
= yyvsp
[0].str
;
2185 #line 569 "parser.y"
2186 { yyval
.nid
= yyvsp
[0].nid
; ;}
2190 #line 570 "parser.y"
2192 yyval
.nid
= new_name_id();
2193 yyval
.nid
->type
= name_str
;
2194 yyval
.nid
->name
.s_name
= yyvsp
[0].str
;
2199 #line 579 "parser.y"
2200 { yyval
.res
= new_resource(res_acc
, yyvsp
[0].acc
, yyvsp
[0].acc
->memopt
, yyvsp
[0].acc
->lvc
.language
); ;}
2204 #line 580 "parser.y"
2205 { yyval
.res
= new_resource(res_bmp
, yyvsp
[0].bmp
, yyvsp
[0].bmp
->memopt
, yyvsp
[0].bmp
->data
->lvc
.language
); ;}
2209 #line 581 "parser.y"
2212 if(yyvsp
[0].ani
->type
== res_anicur
)
2214 yyval
.res
= rsc
= new_resource(res_anicur
, yyvsp
[0].ani
->u
.ani
, yyvsp
[0].ani
->u
.ani
->memopt
, yyvsp
[0].ani
->u
.ani
->data
->lvc
.language
);
2216 else if(yyvsp
[0].ani
->type
== res_curg
)
2219 yyval
.res
= rsc
= new_resource(res_curg
, yyvsp
[0].ani
->u
.curg
, yyvsp
[0].ani
->u
.curg
->memopt
, yyvsp
[0].ani
->u
.curg
->lvc
.language
);
2220 for(cur
= yyvsp
[0].ani
->u
.curg
->cursorlist
; cur
; cur
= cur
->next
)
2222 rsc
->prev
= new_resource(res_cur
, cur
, yyvsp
[0].ani
->u
.curg
->memopt
, yyvsp
[0].ani
->u
.curg
->lvc
.language
);
2223 rsc
->prev
->next
= rsc
;
2225 rsc
->name
= new_name_id();
2226 rsc
->name
->type
= name_ord
;
2227 rsc
->name
->name
.i_name
= cur
->id
;
2231 internal_error(__FILE__
, __LINE__
, "Invalid top-level type %d in cursor resource", yyvsp
[0].ani
->type
);
2237 #line 605 "parser.y"
2238 { yyval
.res
= new_resource(res_dlg
, yyvsp
[0].dlg
, yyvsp
[0].dlg
->memopt
, yyvsp
[0].dlg
->lvc
.language
); ;}
2242 #line 606 "parser.y"
2245 yyval
.res
= new_resource(res_dlgex
, yyvsp
[0].dlgex
, yyvsp
[0].dlgex
->memopt
, yyvsp
[0].dlgex
->lvc
.language
);
2252 #line 612 "parser.y"
2253 { yyval
.res
= new_resource(res_dlginit
, yyvsp
[0].dginit
, yyvsp
[0].dginit
->memopt
, yyvsp
[0].dginit
->data
->lvc
.language
); ;}
2257 #line 613 "parser.y"
2258 { yyval
.res
= new_resource(res_fnt
, yyvsp
[0].fnt
, yyvsp
[0].fnt
->memopt
, yyvsp
[0].fnt
->data
->lvc
.language
); ;}
2262 #line 614 "parser.y"
2263 { yyval
.res
= new_resource(res_fntdir
, yyvsp
[0].fnd
, yyvsp
[0].fnd
->memopt
, yyvsp
[0].fnd
->data
->lvc
.language
); ;}
2267 #line 615 "parser.y"
2270 if(yyvsp
[0].ani
->type
== res_aniico
)
2272 yyval
.res
= rsc
= new_resource(res_aniico
, yyvsp
[0].ani
->u
.ani
, yyvsp
[0].ani
->u
.ani
->memopt
, yyvsp
[0].ani
->u
.ani
->data
->lvc
.language
);
2274 else if(yyvsp
[0].ani
->type
== res_icog
)
2277 yyval
.res
= rsc
= new_resource(res_icog
, yyvsp
[0].ani
->u
.icog
, yyvsp
[0].ani
->u
.icog
->memopt
, yyvsp
[0].ani
->u
.icog
->lvc
.language
);
2278 for(ico
= yyvsp
[0].ani
->u
.icog
->iconlist
; ico
; ico
= ico
->next
)
2280 rsc
->prev
= new_resource(res_ico
, ico
, yyvsp
[0].ani
->u
.icog
->memopt
, yyvsp
[0].ani
->u
.icog
->lvc
.language
);
2281 rsc
->prev
->next
= rsc
;
2283 rsc
->name
= new_name_id();
2284 rsc
->name
->type
= name_ord
;
2285 rsc
->name
->name
.i_name
= ico
->id
;
2289 internal_error(__FILE__
, __LINE__
, "Invalid top-level type %d in icon resource", yyvsp
[0].ani
->type
);
2295 #line 639 "parser.y"
2296 { yyval
.res
= new_resource(res_men
, yyvsp
[0].men
, yyvsp
[0].men
->memopt
, yyvsp
[0].men
->lvc
.language
); ;}
2300 #line 640 "parser.y"
2303 yyval
.res
= new_resource(res_menex
, yyvsp
[0].menex
, yyvsp
[0].menex
->memopt
, yyvsp
[0].menex
->lvc
.language
);
2310 #line 646 "parser.y"
2311 { yyval
.res
= new_resource(res_msg
, yyvsp
[0].msg
, WRC_MO_MOVEABLE
| WRC_MO_DISCARDABLE
, yyvsp
[0].msg
->data
->lvc
.language
); ;}
2315 #line 647 "parser.y"
2316 { yyval
.res
= new_resource(res_rdt
, yyvsp
[0].rdt
, yyvsp
[0].rdt
->memopt
, yyvsp
[0].rdt
->data
->lvc
.language
); ;}
2320 #line 648 "parser.y"
2321 { yyval
.res
= new_resource(res_toolbar
, yyvsp
[0].tlbar
, yyvsp
[0].tlbar
->memopt
, yyvsp
[0].tlbar
->lvc
.language
); ;}
2325 #line 649 "parser.y"
2326 { yyval
.res
= new_resource(res_usr
, yyvsp
[0].usr
, yyvsp
[0].usr
->memopt
, yyvsp
[0].usr
->data
->lvc
.language
); ;}
2330 #line 650 "parser.y"
2331 { yyval
.res
= new_resource(res_ver
, yyvsp
[0].veri
, WRC_MO_MOVEABLE
| WRC_MO_DISCARDABLE
, yyvsp
[0].veri
->lvc
.language
); ;}
2335 #line 654 "parser.y"
2336 { yyval
.str
= make_filename(yyvsp
[0].str
); ;}
2340 #line 655 "parser.y"
2341 { yyval
.str
= make_filename(yyvsp
[0].str
); ;}
2345 #line 656 "parser.y"
2346 { yyval
.str
= make_filename(yyvsp
[0].str
); ;}
2350 #line 660 "parser.y"
2351 { yyval
.bmp
= new_bitmap(yyvsp
[0].raw
, yyvsp
[-1].iptr
); ;}
2355 #line 664 "parser.y"
2357 yyval
.ani
= new_ani_any();
2358 if(yyvsp
[0].raw
->size
> 4 && !memcmp(yyvsp
[0].raw
->data
, riff
, sizeof(riff
)))
2360 yyval
.ani
->type
= res_anicur
;
2361 yyval
.ani
->u
.ani
= new_ani_curico(res_anicur
, yyvsp
[0].raw
, yyvsp
[-1].iptr
);
2365 yyval
.ani
->type
= res_curg
;
2366 yyval
.ani
->u
.curg
= new_cursor_group(yyvsp
[0].raw
, yyvsp
[-1].iptr
);
2372 #line 680 "parser.y"
2374 yyval
.ani
= new_ani_any();
2375 if(yyvsp
[0].raw
->size
> 4 && !memcmp(yyvsp
[0].raw
->data
, riff
, sizeof(riff
)))
2377 yyval
.ani
->type
= res_aniico
;
2378 yyval
.ani
->u
.ani
= new_ani_curico(res_aniico
, yyvsp
[0].raw
, yyvsp
[-1].iptr
);
2382 yyval
.ani
->type
= res_icog
;
2383 yyval
.ani
->u
.icog
= new_icon_group(yyvsp
[0].raw
, yyvsp
[-1].iptr
);
2389 #line 702 "parser.y"
2390 { yyval
.fnt
= new_font(yyvsp
[0].raw
, yyvsp
[-1].iptr
); ;}
2394 #line 712 "parser.y"
2395 { yyval
.fnd
= new_fontdir(yyvsp
[0].raw
, yyvsp
[-1].iptr
); ;}
2399 #line 720 "parser.y"
2402 yywarning("MESSAGETABLE not supported in 16-bit mode");
2403 yyval
.msg
= new_messagetable(yyvsp
[0].raw
, yyvsp
[-1].iptr
);
2408 #line 728 "parser.y"
2409 { yyval
.rdt
= new_rcdata(yyvsp
[0].raw
, yyvsp
[-1].iptr
); ;}
2413 #line 732 "parser.y"
2414 { yyval
.dginit
= new_dlginit(yyvsp
[0].raw
, yyvsp
[-1].iptr
); ;}
2418 #line 736 "parser.y"
2420 #ifdef WORDS_BIGENDIAN
2421 if(pedantic
&& byteorder
!= WRC_BO_LITTLE
)
2423 if(pedantic
&& byteorder
== WRC_BO_BIG
)
2425 yywarning("Byteordering is not little-endian and type cannot be interpreted");
2426 yyval
.usr
= new_user(yyvsp
[-2].nid
, yyvsp
[0].raw
, yyvsp
[-1].iptr
);
2431 #line 747 "parser.y"
2433 yyval
.nid
= new_name_id();
2434 yyval
.nid
->type
= name_ord
;
2435 yyval
.nid
->name
.i_name
= yyvsp
[0].num
;
2440 #line 752 "parser.y"
2442 yyval
.nid
= new_name_id();
2443 yyval
.nid
->type
= name_str
;
2444 yyval
.nid
->name
.s_name
= yyvsp
[0].str
;
2449 #line 761 "parser.y"
2451 yyval
.acc
= new_accelerator();
2454 yyval
.acc
->memopt
= *(yyvsp
[-4].iptr
);
2455 free(yyvsp
[-4].iptr
);
2459 yyval
.acc
->memopt
= WRC_MO_MOVEABLE
| WRC_MO_PURE
;
2461 if(!yyvsp
[-1].event
)
2462 yyerror("Accelerator table must have at least one entry");
2463 yyval
.acc
->events
= get_event_head(yyvsp
[-1].event
);
2466 yyval
.acc
->lvc
= *(yyvsp
[-3].lvc
);
2467 free(yyvsp
[-3].lvc
);
2469 if(!yyval
.acc
->lvc
.language
)
2470 yyval
.acc
->lvc
.language
= dup_language(currentlanguage
);
2475 #line 785 "parser.y"
2476 { yyval
.event
=NULL
; ;}
2480 #line 786 "parser.y"
2481 { yyval
.event
=add_string_event(yyvsp
[-3].str
, yyvsp
[-1].num
, yyvsp
[0].num
, yyvsp
[-4].event
); ;}
2485 #line 787 "parser.y"
2486 { yyval
.event
=add_event(yyvsp
[-3].num
, yyvsp
[-1].num
, yyvsp
[0].num
, yyvsp
[-4].event
); ;}
2490 #line 796 "parser.y"
2495 #line 797 "parser.y"
2496 { yyval
.num
= yyvsp
[0].num
; ;}
2500 #line 800 "parser.y"
2501 { yyval
.num
= yyvsp
[0].num
; ;}
2505 #line 801 "parser.y"
2506 { yyval
.num
= yyvsp
[-2].num
| yyvsp
[0].num
; ;}
2510 #line 804 "parser.y"
2511 { yyval
.num
= WRC_AF_NOINVERT
; ;}
2515 #line 805 "parser.y"
2516 { yyval
.num
= WRC_AF_SHIFT
; ;}
2520 #line 806 "parser.y"
2521 { yyval
.num
= WRC_AF_CONTROL
; ;}
2525 #line 807 "parser.y"
2526 { yyval
.num
= WRC_AF_ALT
; ;}
2530 #line 808 "parser.y"
2531 { yyval
.num
= WRC_AF_ASCII
; ;}
2535 #line 809 "parser.y"
2536 { yyval
.num
= WRC_AF_VIRTKEY
; ;}
2540 #line 815 "parser.y"
2544 yyvsp
[-3].dlg
->memopt
= *(yyvsp
[-11].iptr
);
2545 free(yyvsp
[-11].iptr
);
2548 yyvsp
[-3].dlg
->memopt
= WRC_MO_MOVEABLE
| WRC_MO_PURE
| WRC_MO_DISCARDABLE
;
2549 yyvsp
[-3].dlg
->x
= yyvsp
[-10].num
;
2550 yyvsp
[-3].dlg
->y
= yyvsp
[-8].num
;
2551 yyvsp
[-3].dlg
->width
= yyvsp
[-6].num
;
2552 yyvsp
[-3].dlg
->height
= yyvsp
[-4].num
;
2553 yyvsp
[-3].dlg
->controls
= get_control_head(yyvsp
[-1].ctl
);
2554 yyval
.dlg
= yyvsp
[-3].dlg
;
2555 if(!yyval
.dlg
->gotstyle
)
2557 yyval
.dlg
->style
= new_style(0,0);
2558 yyval
.dlg
->style
->or_mask
= WS_POPUP
;
2559 yyval
.dlg
->gotstyle
= TRUE
;
2561 if(yyval
.dlg
->title
)
2562 yyval
.dlg
->style
->or_mask
|= WS_CAPTION
;
2564 yyval
.dlg
->style
->or_mask
|= DS_SETFONT
;
2566 yyval
.dlg
->style
->or_mask
&= ~(yyval
.dlg
->style
->and_mask
);
2567 yyval
.dlg
->style
->and_mask
= 0;
2569 if(!yyval
.dlg
->lvc
.language
)
2570 yyval
.dlg
->lvc
.language
= dup_language(currentlanguage
);
2575 #line 849 "parser.y"
2576 { yyval
.dlg
=new_dialog(); ;}
2580 #line 850 "parser.y"
2581 { yyval
.dlg
=dialog_style(yyvsp
[0].style
,yyvsp
[-2].dlg
); ;}
2585 #line 851 "parser.y"
2586 { yyval
.dlg
=dialog_exstyle(yyvsp
[0].style
,yyvsp
[-2].dlg
); ;}
2590 #line 852 "parser.y"
2591 { yyval
.dlg
=dialog_caption(yyvsp
[0].str
,yyvsp
[-2].dlg
); ;}
2595 #line 853 "parser.y"
2596 { yyval
.dlg
=dialog_font(yyvsp
[0].fntid
,yyvsp
[-1].dlg
); ;}
2600 #line 854 "parser.y"
2601 { yyval
.dlg
=dialog_class(yyvsp
[0].nid
,yyvsp
[-2].dlg
); ;}
2605 #line 855 "parser.y"
2606 { yyval
.dlg
=dialog_menu(yyvsp
[0].nid
,yyvsp
[-2].dlg
); ;}
2610 #line 856 "parser.y"
2611 { yyval
.dlg
=dialog_language(yyvsp
[0].lan
,yyvsp
[-1].dlg
); ;}
2615 #line 857 "parser.y"
2616 { yyval
.dlg
=dialog_characteristics(yyvsp
[0].chars
,yyvsp
[-1].dlg
); ;}
2620 #line 858 "parser.y"
2621 { yyval
.dlg
=dialog_version(yyvsp
[0].ver
,yyvsp
[-1].dlg
); ;}
2625 #line 861 "parser.y"
2626 { yyval
.ctl
= NULL
; ;}
2630 #line 862 "parser.y"
2631 { yyval
.ctl
=ins_ctrl(-1, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2635 #line 863 "parser.y"
2636 { yyval
.ctl
=ins_ctrl(CT_EDIT
, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2640 #line 864 "parser.y"
2641 { yyval
.ctl
=ins_ctrl(CT_LISTBOX
, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2645 #line 865 "parser.y"
2646 { yyval
.ctl
=ins_ctrl(CT_COMBOBOX
, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2650 #line 866 "parser.y"
2651 { yyval
.ctl
=ins_ctrl(CT_SCROLLBAR
, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2655 #line 867 "parser.y"
2656 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_CHECKBOX
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2660 #line 868 "parser.y"
2661 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_DEFPUSHBUTTON
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2665 #line 869 "parser.y"
2666 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_GROUPBOX
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
);;}
2670 #line 870 "parser.y"
2671 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_PUSHBUTTON
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2675 #line 872 "parser.y"
2676 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_RADIOBUTTON
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2680 #line 873 "parser.y"
2681 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_AUTO3STATE
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2685 #line 874 "parser.y"
2686 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_3STATE
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2690 #line 875 "parser.y"
2691 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_AUTOCHECKBOX
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2695 #line 876 "parser.y"
2696 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_AUTORADIOBUTTON
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2700 #line 877 "parser.y"
2701 { yyval
.ctl
=ins_ctrl(CT_STATIC
, SS_LEFT
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2705 #line 878 "parser.y"
2706 { yyval
.ctl
=ins_ctrl(CT_STATIC
, SS_CENTER
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2710 #line 879 "parser.y"
2711 { yyval
.ctl
=ins_ctrl(CT_STATIC
, SS_RIGHT
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
2715 #line 881 "parser.y"
2717 yyvsp
[0].ctl
->title
= yyvsp
[-7].nid
;
2718 yyvsp
[0].ctl
->id
= yyvsp
[-5].num
;
2719 yyvsp
[0].ctl
->x
= yyvsp
[-3].num
;
2720 yyvsp
[0].ctl
->y
= yyvsp
[-1].num
;
2721 yyval
.ctl
= ins_ctrl(CT_STATIC
, SS_ICON
, yyvsp
[0].ctl
, yyvsp
[-9].ctl
);
2726 #line 891 "parser.y"
2728 yyval
.ctl
=new_control();
2729 yyval
.ctl
->title
= new_name_id();
2730 yyval
.ctl
->title
->type
= name_str
;
2731 yyval
.ctl
->title
->name
.s_name
= yyvsp
[-11].str
;
2732 yyval
.ctl
->id
= yyvsp
[-9].num
;
2733 yyval
.ctl
->x
= yyvsp
[-7].num
;
2734 yyval
.ctl
->y
= yyvsp
[-5].num
;
2735 yyval
.ctl
->width
= yyvsp
[-3].num
;
2736 yyval
.ctl
->height
= yyvsp
[-1].num
;
2739 yyval
.ctl
->style
= yyvsp
[0].styles
->style
;
2740 yyval
.ctl
->gotstyle
= TRUE
;
2741 if (yyvsp
[0].styles
->exstyle
)
2743 yyval
.ctl
->exstyle
= yyvsp
[0].styles
->exstyle
;
2744 yyval
.ctl
->gotexstyle
= TRUE
;
2746 free(yyvsp
[0].styles
);
2752 #line 916 "parser.y"
2754 yyval
.ctl
= new_control();
2755 yyval
.ctl
->id
= yyvsp
[-9].num
;
2756 yyval
.ctl
->x
= yyvsp
[-7].num
;
2757 yyval
.ctl
->y
= yyvsp
[-5].num
;
2758 yyval
.ctl
->width
= yyvsp
[-3].num
;
2759 yyval
.ctl
->height
= yyvsp
[-1].num
;
2762 yyval
.ctl
->style
= yyvsp
[0].styles
->style
;
2763 yyval
.ctl
->gotstyle
= TRUE
;
2764 if (yyvsp
[0].styles
->exstyle
)
2766 yyval
.ctl
->exstyle
= yyvsp
[0].styles
->exstyle
;
2767 yyval
.ctl
->gotexstyle
= TRUE
;
2769 free(yyvsp
[0].styles
);
2775 #line 938 "parser.y"
2776 { yyval
.ctl
= new_control(); ;}
2780 #line 940 "parser.y"
2782 yyval
.ctl
= new_control();
2783 yyval
.ctl
->width
= yyvsp
[-2].num
;
2784 yyval
.ctl
->height
= yyvsp
[0].num
;
2789 #line 945 "parser.y"
2791 yyval
.ctl
= new_control();
2792 yyval
.ctl
->width
= yyvsp
[-4].num
;
2793 yyval
.ctl
->height
= yyvsp
[-2].num
;
2794 yyval
.ctl
->style
= yyvsp
[0].style
;
2795 yyval
.ctl
->gotstyle
= TRUE
;
2800 #line 952 "parser.y"
2802 yyval
.ctl
= new_control();
2803 yyval
.ctl
->width
= yyvsp
[-6].num
;
2804 yyval
.ctl
->height
= yyvsp
[-4].num
;
2805 yyval
.ctl
->style
= yyvsp
[-2].style
;
2806 yyval
.ctl
->gotstyle
= TRUE
;
2807 yyval
.ctl
->exstyle
= yyvsp
[0].style
;
2808 yyval
.ctl
->gotexstyle
= TRUE
;
2813 #line 963 "parser.y"
2815 yyval
.ctl
=new_control();
2816 yyval
.ctl
->title
= yyvsp
[-16].nid
;
2817 yyval
.ctl
->id
= yyvsp
[-14].num
;
2818 yyval
.ctl
->ctlclass
= convert_ctlclass(yyvsp
[-12].nid
);
2819 yyval
.ctl
->style
= yyvsp
[-10].style
;
2820 yyval
.ctl
->gotstyle
= TRUE
;
2821 yyval
.ctl
->x
= yyvsp
[-8].num
;
2822 yyval
.ctl
->y
= yyvsp
[-6].num
;
2823 yyval
.ctl
->width
= yyvsp
[-4].num
;
2824 yyval
.ctl
->height
= yyvsp
[-2].num
;
2825 yyval
.ctl
->exstyle
= yyvsp
[0].style
;
2826 yyval
.ctl
->gotexstyle
= TRUE
;
2831 #line 977 "parser.y"
2833 yyval
.ctl
=new_control();
2834 yyval
.ctl
->title
= yyvsp
[-14].nid
;
2835 yyval
.ctl
->id
= yyvsp
[-12].num
;
2836 yyval
.ctl
->ctlclass
= convert_ctlclass(yyvsp
[-10].nid
);
2837 yyval
.ctl
->style
= yyvsp
[-8].style
;
2838 yyval
.ctl
->gotstyle
= TRUE
;
2839 yyval
.ctl
->x
= yyvsp
[-6].num
;
2840 yyval
.ctl
->y
= yyvsp
[-4].num
;
2841 yyval
.ctl
->width
= yyvsp
[-2].num
;
2842 yyval
.ctl
->height
= yyvsp
[0].num
;
2847 #line 992 "parser.y"
2848 { yyval
.fntid
= new_font_id(yyvsp
[-2].num
, yyvsp
[0].str
, 0, 0); ;}
2852 #line 997 "parser.y"
2853 { yyval
.styles
= NULL
; ;}
2857 #line 998 "parser.y"
2858 { yyval
.styles
= new_style_pair(yyvsp
[0].style
, 0); ;}
2862 #line 999 "parser.y"
2863 { yyval
.styles
= new_style_pair(yyvsp
[-2].style
, yyvsp
[0].style
); ;}
2867 #line 1003 "parser.y"
2868 { yyval
.style
= new_style(yyvsp
[-2].style
->or_mask
| yyvsp
[0].style
->or_mask
, yyvsp
[-2].style
->and_mask
| yyvsp
[0].style
->and_mask
); free(yyvsp
[-2].style
); free(yyvsp
[0].style
);;}
2872 #line 1004 "parser.y"
2873 { yyval
.style
= yyvsp
[-1].style
; ;}
2877 #line 1005 "parser.y"
2878 { yyval
.style
= new_style(yyvsp
[0].num
, 0); ;}
2882 #line 1006 "parser.y"
2883 { yyval
.style
= new_style(0, yyvsp
[0].num
); ;}
2887 #line 1010 "parser.y"
2889 yyval
.nid
= new_name_id();
2890 yyval
.nid
->type
= name_ord
;
2891 yyval
.nid
->name
.i_name
= yyvsp
[0].num
;
2896 #line 1015 "parser.y"
2898 yyval
.nid
= new_name_id();
2899 yyval
.nid
->type
= name_str
;
2900 yyval
.nid
->name
.s_name
= yyvsp
[0].str
;
2905 #line 1024 "parser.y"
2908 yywarning("DIALOGEX not supported in 16-bit mode");
2911 yyvsp
[-3].dlgex
->memopt
= *(yyvsp
[-12].iptr
);
2912 free(yyvsp
[-12].iptr
);
2915 yyvsp
[-3].dlgex
->memopt
= WRC_MO_MOVEABLE
| WRC_MO_PURE
| WRC_MO_DISCARDABLE
;
2916 yyvsp
[-3].dlgex
->x
= yyvsp
[-11].num
;
2917 yyvsp
[-3].dlgex
->y
= yyvsp
[-9].num
;
2918 yyvsp
[-3].dlgex
->width
= yyvsp
[-7].num
;
2919 yyvsp
[-3].dlgex
->height
= yyvsp
[-5].num
;
2922 yyvsp
[-3].dlgex
->helpid
= *(yyvsp
[-4].iptr
);
2923 yyvsp
[-3].dlgex
->gothelpid
= TRUE
;
2924 free(yyvsp
[-4].iptr
);
2926 yyvsp
[-3].dlgex
->controls
= get_control_head(yyvsp
[-1].ctl
);
2927 yyval
.dlgex
= yyvsp
[-3].dlgex
;
2929 assert(yyval
.dlgex
->style
!= NULL
);
2930 if(!yyval
.dlgex
->gotstyle
)
2932 yyval
.dlgex
->style
->or_mask
= WS_POPUP
;
2933 yyval
.dlgex
->gotstyle
= TRUE
;
2935 if(yyval
.dlgex
->title
)
2936 yyval
.dlgex
->style
->or_mask
|= WS_CAPTION
;
2937 if(yyval
.dlgex
->font
)
2938 yyval
.dlgex
->style
->or_mask
|= DS_SETFONT
;
2940 yyval
.dlgex
->style
->or_mask
&= ~(yyval
.dlgex
->style
->and_mask
);
2941 yyval
.dlgex
->style
->and_mask
= 0;
2943 if(!yyval
.dlgex
->lvc
.language
)
2944 yyval
.dlgex
->lvc
.language
= dup_language(currentlanguage
);
2949 #line 1067 "parser.y"
2950 { yyval
.dlgex
=new_dialogex(); ;}
2954 #line 1068 "parser.y"
2955 { yyval
.dlgex
=dialogex_style(yyvsp
[0].style
,yyvsp
[-2].dlgex
); ;}
2959 #line 1069 "parser.y"
2960 { yyval
.dlgex
=dialogex_exstyle(yyvsp
[0].style
,yyvsp
[-2].dlgex
); ;}
2964 #line 1070 "parser.y"
2965 { yyval
.dlgex
=dialogex_caption(yyvsp
[0].str
,yyvsp
[-2].dlgex
); ;}
2969 #line 1071 "parser.y"
2970 { yyval
.dlgex
=dialogex_font(yyvsp
[0].fntid
,yyvsp
[-1].dlgex
); ;}
2974 #line 1072 "parser.y"
2975 { yyval
.dlgex
=dialogex_font(yyvsp
[0].fntid
,yyvsp
[-1].dlgex
); ;}
2979 #line 1073 "parser.y"
2980 { yyval
.dlgex
=dialogex_class(yyvsp
[0].nid
,yyvsp
[-2].dlgex
); ;}
2984 #line 1074 "parser.y"
2985 { yyval
.dlgex
=dialogex_menu(yyvsp
[0].nid
,yyvsp
[-2].dlgex
); ;}
2989 #line 1075 "parser.y"
2990 { yyval
.dlgex
=dialogex_language(yyvsp
[0].lan
,yyvsp
[-1].dlgex
); ;}
2994 #line 1076 "parser.y"
2995 { yyval
.dlgex
=dialogex_characteristics(yyvsp
[0].chars
,yyvsp
[-1].dlgex
); ;}
2999 #line 1077 "parser.y"
3000 { yyval
.dlgex
=dialogex_version(yyvsp
[0].ver
,yyvsp
[-1].dlgex
); ;}
3004 #line 1080 "parser.y"
3005 { yyval
.ctl
= NULL
; ;}
3009 #line 1081 "parser.y"
3010 { yyval
.ctl
=ins_ctrl(-1, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3014 #line 1082 "parser.y"
3015 { yyval
.ctl
=ins_ctrl(CT_EDIT
, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3019 #line 1083 "parser.y"
3020 { yyval
.ctl
=ins_ctrl(CT_LISTBOX
, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3024 #line 1084 "parser.y"
3025 { yyval
.ctl
=ins_ctrl(CT_COMBOBOX
, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3029 #line 1085 "parser.y"
3030 { yyval
.ctl
=ins_ctrl(CT_SCROLLBAR
, 0, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3034 #line 1086 "parser.y"
3035 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_CHECKBOX
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3039 #line 1087 "parser.y"
3040 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_DEFPUSHBUTTON
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3044 #line 1088 "parser.y"
3045 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_GROUPBOX
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
);;}
3049 #line 1089 "parser.y"
3050 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_PUSHBUTTON
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3054 #line 1091 "parser.y"
3055 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_RADIOBUTTON
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3059 #line 1092 "parser.y"
3060 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_AUTO3STATE
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3064 #line 1093 "parser.y"
3065 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_3STATE
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3069 #line 1094 "parser.y"
3070 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_AUTOCHECKBOX
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3074 #line 1095 "parser.y"
3075 { yyval
.ctl
=ins_ctrl(CT_BUTTON
, BS_AUTORADIOBUTTON
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3079 #line 1096 "parser.y"
3080 { yyval
.ctl
=ins_ctrl(CT_STATIC
, SS_LEFT
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3084 #line 1097 "parser.y"
3085 { yyval
.ctl
=ins_ctrl(CT_STATIC
, SS_CENTER
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3089 #line 1098 "parser.y"
3090 { yyval
.ctl
=ins_ctrl(CT_STATIC
, SS_RIGHT
, yyvsp
[0].ctl
, yyvsp
[-2].ctl
); ;}
3094 #line 1100 "parser.y"
3096 yyvsp
[0].ctl
->title
= yyvsp
[-7].nid
;
3097 yyvsp
[0].ctl
->id
= yyvsp
[-5].num
;
3098 yyvsp
[0].ctl
->x
= yyvsp
[-3].num
;
3099 yyvsp
[0].ctl
->y
= yyvsp
[-1].num
;
3100 yyval
.ctl
= ins_ctrl(CT_STATIC
, SS_ICON
, yyvsp
[0].ctl
, yyvsp
[-9].ctl
);
3105 #line 1111 "parser.y"
3107 yyval
.ctl
=new_control();
3108 yyval
.ctl
->title
= yyvsp
[-18].nid
;
3109 yyval
.ctl
->id
= yyvsp
[-16].num
;
3110 yyval
.ctl
->ctlclass
= convert_ctlclass(yyvsp
[-14].nid
);
3111 yyval
.ctl
->style
= yyvsp
[-12].style
;
3112 yyval
.ctl
->gotstyle
= TRUE
;
3113 yyval
.ctl
->x
= yyvsp
[-10].num
;
3114 yyval
.ctl
->y
= yyvsp
[-8].num
;
3115 yyval
.ctl
->width
= yyvsp
[-6].num
;
3116 yyval
.ctl
->height
= yyvsp
[-4].num
;
3119 yyval
.ctl
->exstyle
= yyvsp
[-2].style
;
3120 yyval
.ctl
->gotexstyle
= TRUE
;
3124 yyval
.ctl
->helpid
= *(yyvsp
[-1].iptr
);
3125 yyval
.ctl
->gothelpid
= TRUE
;
3126 free(yyvsp
[-1].iptr
);
3128 yyval
.ctl
->extra
= yyvsp
[0].raw
;
3133 #line 1135 "parser.y"
3135 yyval
.ctl
=new_control();
3136 yyval
.ctl
->title
= yyvsp
[-15].nid
;
3137 yyval
.ctl
->id
= yyvsp
[-13].num
;
3138 yyval
.ctl
->style
= yyvsp
[-9].style
;
3139 yyval
.ctl
->gotstyle
= TRUE
;
3140 yyval
.ctl
->ctlclass
= convert_ctlclass(yyvsp
[-11].nid
);
3141 yyval
.ctl
->x
= yyvsp
[-7].num
;
3142 yyval
.ctl
->y
= yyvsp
[-5].num
;
3143 yyval
.ctl
->width
= yyvsp
[-3].num
;
3144 yyval
.ctl
->height
= yyvsp
[-1].num
;
3145 yyval
.ctl
->extra
= yyvsp
[0].raw
;
3150 #line 1151 "parser.y"
3152 yyval
.ctl
=new_control();
3153 yyval
.ctl
->title
= new_name_id();
3154 yyval
.ctl
->title
->type
= name_str
;
3155 yyval
.ctl
->title
->name
.s_name
= yyvsp
[-13].str
;
3156 yyval
.ctl
->id
= yyvsp
[-11].num
;
3157 yyval
.ctl
->x
= yyvsp
[-9].num
;
3158 yyval
.ctl
->y
= yyvsp
[-7].num
;
3159 yyval
.ctl
->width
= yyvsp
[-5].num
;
3160 yyval
.ctl
->height
= yyvsp
[-3].num
;
3161 if(yyvsp
[-2].styles
)
3163 yyval
.ctl
->style
= yyvsp
[-2].styles
->style
;
3164 yyval
.ctl
->gotstyle
= TRUE
;
3166 if (yyvsp
[-2].styles
->exstyle
)
3168 yyval
.ctl
->exstyle
= yyvsp
[-2].styles
->exstyle
;
3169 yyval
.ctl
->gotexstyle
= TRUE
;
3171 free(yyvsp
[-2].styles
);
3174 yyval
.ctl
->extra
= yyvsp
[0].raw
;
3179 #line 1179 "parser.y"
3181 yyval
.ctl
= new_control();
3182 yyval
.ctl
->id
= yyvsp
[-11].num
;
3183 yyval
.ctl
->x
= yyvsp
[-9].num
;
3184 yyval
.ctl
->y
= yyvsp
[-7].num
;
3185 yyval
.ctl
->width
= yyvsp
[-5].num
;
3186 yyval
.ctl
->height
= yyvsp
[-3].num
;
3187 if(yyvsp
[-2].styles
)
3189 yyval
.ctl
->style
= yyvsp
[-2].styles
->style
;
3190 yyval
.ctl
->gotstyle
= TRUE
;
3192 if (yyvsp
[-2].styles
->exstyle
)
3194 yyval
.ctl
->exstyle
= yyvsp
[-2].styles
->exstyle
;
3195 yyval
.ctl
->gotexstyle
= TRUE
;
3197 free(yyvsp
[-2].styles
);
3199 yyval
.ctl
->extra
= yyvsp
[0].raw
;
3204 #line 1202 "parser.y"
3205 { yyval
.raw
= NULL
; ;}
3209 #line 1203 "parser.y"
3210 { yyval
.raw
= yyvsp
[0].raw
; ;}
3214 #line 1206 "parser.y"
3215 { yyval
.iptr
= NULL
; ;}
3219 #line 1207 "parser.y"
3220 { yyval
.iptr
= new_int(yyvsp
[0].num
); ;}
3224 #line 1211 "parser.y"
3225 { yyval
.fntid
= new_font_id(yyvsp
[-7].num
, yyvsp
[-5].str
, yyvsp
[-3].num
, yyvsp
[-1].num
); ;}
3229 #line 1218 "parser.y"
3230 { yyval
.fntid
= NULL
; ;}
3234 #line 1219 "parser.y"
3235 { yyval
.fntid
= NULL
; ;}
3239 #line 1223 "parser.y"
3241 if(!yyvsp
[0].menitm
)
3242 yyerror("Menu must contain items");
3243 yyval
.men
= new_menu();
3246 yyval
.men
->memopt
= *(yyvsp
[-2].iptr
);
3247 free(yyvsp
[-2].iptr
);
3250 yyval
.men
->memopt
= WRC_MO_MOVEABLE
| WRC_MO_PURE
| WRC_MO_DISCARDABLE
;
3251 yyval
.men
->items
= get_item_head(yyvsp
[0].menitm
);
3254 yyval
.men
->lvc
= *(yyvsp
[-1].lvc
);
3255 free(yyvsp
[-1].lvc
);
3257 if(!yyval
.men
->lvc
.language
)
3258 yyval
.men
->lvc
.language
= dup_language(currentlanguage
);
3263 #line 1246 "parser.y"
3264 { yyval
.menitm
= yyvsp
[-1].menitm
; ;}
3268 #line 1250 "parser.y"
3269 {yyval
.menitm
= NULL
;;}
3273 #line 1251 "parser.y"
3275 yyval
.menitm
=new_menu_item();
3276 yyval
.menitm
->prev
= yyvsp
[-5].menitm
;
3277 if(yyvsp
[-5].menitm
)
3278 yyvsp
[-5].menitm
->next
= yyval
.menitm
;
3279 yyval
.menitm
->id
= yyvsp
[-1].num
;
3280 yyval
.menitm
->state
= yyvsp
[0].num
;
3281 yyval
.menitm
->name
= yyvsp
[-3].str
;
3286 #line 1260 "parser.y"
3288 yyval
.menitm
=new_menu_item();
3289 yyval
.menitm
->prev
= yyvsp
[-2].menitm
;
3290 if(yyvsp
[-2].menitm
)
3291 yyvsp
[-2].menitm
->next
= yyval
.menitm
;
3296 #line 1266 "parser.y"
3298 yyval
.menitm
= new_menu_item();
3299 yyval
.menitm
->prev
= yyvsp
[-4].menitm
;
3300 if(yyvsp
[-4].menitm
)
3301 yyvsp
[-4].menitm
->next
= yyval
.menitm
;
3302 yyval
.menitm
->popup
= get_item_head(yyvsp
[0].menitm
);
3303 yyval
.menitm
->name
= yyvsp
[-2].str
;
3308 #line 1285 "parser.y"
3313 #line 1286 "parser.y"
3314 { yyval
.num
= yyvsp
[0].num
| MF_CHECKED
; ;}
3318 #line 1287 "parser.y"
3319 { yyval
.num
= yyvsp
[0].num
| MF_GRAYED
; ;}
3323 #line 1288 "parser.y"
3324 { yyval
.num
= yyvsp
[0].num
| MF_HELP
; ;}
3328 #line 1289 "parser.y"
3329 { yyval
.num
= yyvsp
[0].num
| MF_DISABLED
; ;}
3333 #line 1290 "parser.y"
3334 { yyval
.num
= yyvsp
[0].num
| MF_MENUBARBREAK
; ;}
3338 #line 1291 "parser.y"
3339 { yyval
.num
= yyvsp
[0].num
| MF_MENUBREAK
; ;}
3343 #line 1295 "parser.y"
3346 yywarning("MENUEX not supported in 16-bit mode");
3347 if(!yyvsp
[0].menexitm
)
3348 yyerror("MenuEx must contain items");
3349 yyval
.menex
= new_menuex();
3352 yyval
.menex
->memopt
= *(yyvsp
[-2].iptr
);
3353 free(yyvsp
[-2].iptr
);
3356 yyval
.menex
->memopt
= WRC_MO_MOVEABLE
| WRC_MO_PURE
| WRC_MO_DISCARDABLE
;
3357 yyval
.menex
->items
= get_itemex_head(yyvsp
[0].menexitm
);
3360 yyval
.menex
->lvc
= *(yyvsp
[-1].lvc
);
3361 free(yyvsp
[-1].lvc
);
3363 if(!yyval
.menex
->lvc
.language
)
3364 yyval
.menex
->lvc
.language
= dup_language(currentlanguage
);
3369 #line 1320 "parser.y"
3370 { yyval
.menexitm
= yyvsp
[-1].menexitm
; ;}
3374 #line 1324 "parser.y"
3375 {yyval
.menexitm
= NULL
; ;}
3379 #line 1325 "parser.y"
3381 yyval
.menexitm
= new_menuex_item();
3382 yyval
.menexitm
->prev
= yyvsp
[-3].menexitm
;
3383 if(yyvsp
[-3].menexitm
)
3384 yyvsp
[-3].menexitm
->next
= yyval
.menexitm
;
3385 yyval
.menexitm
->name
= yyvsp
[-1].str
;
3386 yyval
.menexitm
->id
= yyvsp
[0].exopt
->id
;
3387 yyval
.menexitm
->type
= yyvsp
[0].exopt
->type
;
3388 yyval
.menexitm
->state
= yyvsp
[0].exopt
->state
;
3389 yyval
.menexitm
->helpid
= yyvsp
[0].exopt
->helpid
;
3390 yyval
.menexitm
->gotid
= yyvsp
[0].exopt
->gotid
;
3391 yyval
.menexitm
->gottype
= yyvsp
[0].exopt
->gottype
;
3392 yyval
.menexitm
->gotstate
= yyvsp
[0].exopt
->gotstate
;
3393 yyval
.menexitm
->gothelpid
= yyvsp
[0].exopt
->gothelpid
;
3394 free(yyvsp
[0].exopt
);
3399 #line 1341 "parser.y"
3401 yyval
.menexitm
= new_menuex_item();
3402 yyval
.menexitm
->prev
= yyvsp
[-2].menexitm
;
3403 if(yyvsp
[-2].menexitm
)
3404 yyvsp
[-2].menexitm
->next
= yyval
.menexitm
;
3409 #line 1347 "parser.y"
3411 yyval
.menexitm
= new_menuex_item();
3412 yyval
.menexitm
->prev
= yyvsp
[-4].menexitm
;
3413 if(yyvsp
[-4].menexitm
)
3414 yyvsp
[-4].menexitm
->next
= yyval
.menexitm
;
3415 yyval
.menexitm
->popup
= get_itemex_head(yyvsp
[0].menexitm
);
3416 yyval
.menexitm
->name
= yyvsp
[-2].str
;
3417 yyval
.menexitm
->id
= yyvsp
[-1].exopt
->id
;
3418 yyval
.menexitm
->type
= yyvsp
[-1].exopt
->type
;
3419 yyval
.menexitm
->state
= yyvsp
[-1].exopt
->state
;
3420 yyval
.menexitm
->helpid
= yyvsp
[-1].exopt
->helpid
;
3421 yyval
.menexitm
->gotid
= yyvsp
[-1].exopt
->gotid
;
3422 yyval
.menexitm
->gottype
= yyvsp
[-1].exopt
->gottype
;
3423 yyval
.menexitm
->gotstate
= yyvsp
[-1].exopt
->gotstate
;
3424 yyval
.menexitm
->gothelpid
= yyvsp
[-1].exopt
->gothelpid
;
3425 free(yyvsp
[-1].exopt
);
3430 #line 1367 "parser.y"
3431 { yyval
.exopt
= new_itemex_opt(0, 0, 0, 0); ;}
3435 #line 1368 "parser.y"
3437 yyval
.exopt
= new_itemex_opt(yyvsp
[0].num
, 0, 0, 0);
3438 yyval
.exopt
->gotid
= TRUE
;
3443 #line 1372 "parser.y"
3445 yyval
.exopt
= new_itemex_opt(yyvsp
[-3].iptr
? *(yyvsp
[-3].iptr
) : 0, yyvsp
[-1].iptr
? *(yyvsp
[-1].iptr
) : 0, yyvsp
[0].num
, 0);
3446 yyval
.exopt
->gotid
= TRUE
;
3447 yyval
.exopt
->gottype
= TRUE
;
3448 yyval
.exopt
->gotstate
= TRUE
;
3449 if(yyvsp
[-3].iptr
) free(yyvsp
[-3].iptr
);
3450 if(yyvsp
[-1].iptr
) free(yyvsp
[-1].iptr
);
3455 #line 1380 "parser.y"
3457 yyval
.exopt
= new_itemex_opt(yyvsp
[-4].iptr
? *(yyvsp
[-4].iptr
) : 0, yyvsp
[-2].iptr
? *(yyvsp
[-2].iptr
) : 0, yyvsp
[0].num
, 0);
3458 yyval
.exopt
->gotid
= TRUE
;
3459 yyval
.exopt
->gottype
= TRUE
;
3460 yyval
.exopt
->gotstate
= TRUE
;
3461 if(yyvsp
[-4].iptr
) free(yyvsp
[-4].iptr
);
3462 if(yyvsp
[-2].iptr
) free(yyvsp
[-2].iptr
);
3467 #line 1391 "parser.y"
3468 { yyval
.exopt
= new_itemex_opt(0, 0, 0, 0); ;}
3472 #line 1392 "parser.y"
3474 yyval
.exopt
= new_itemex_opt(yyvsp
[0].num
, 0, 0, 0);
3475 yyval
.exopt
->gotid
= TRUE
;
3480 #line 1396 "parser.y"
3482 yyval
.exopt
= new_itemex_opt(yyvsp
[-2].iptr
? *(yyvsp
[-2].iptr
) : 0, yyvsp
[0].num
, 0, 0);
3483 if(yyvsp
[-2].iptr
) free(yyvsp
[-2].iptr
);
3484 yyval
.exopt
->gotid
= TRUE
;
3485 yyval
.exopt
->gottype
= TRUE
;
3490 #line 1402 "parser.y"
3492 yyval
.exopt
= new_itemex_opt(yyvsp
[-4].iptr
? *(yyvsp
[-4].iptr
) : 0, yyvsp
[-2].iptr
? *(yyvsp
[-2].iptr
) : 0, yyvsp
[0].num
, 0);
3493 if(yyvsp
[-4].iptr
) free(yyvsp
[-4].iptr
);
3494 if(yyvsp
[-2].iptr
) free(yyvsp
[-2].iptr
);
3495 yyval
.exopt
->gotid
= TRUE
;
3496 yyval
.exopt
->gottype
= TRUE
;
3497 yyval
.exopt
->gotstate
= TRUE
;
3502 #line 1410 "parser.y"
3504 yyval
.exopt
= new_itemex_opt(yyvsp
[-6].iptr
? *(yyvsp
[-6].iptr
) : 0, yyvsp
[-4].iptr
? *(yyvsp
[-4].iptr
) : 0, yyvsp
[-2].iptr
? *(yyvsp
[-2].iptr
) : 0, yyvsp
[0].num
);
3505 if(yyvsp
[-6].iptr
) free(yyvsp
[-6].iptr
);
3506 if(yyvsp
[-4].iptr
) free(yyvsp
[-4].iptr
);
3507 if(yyvsp
[-2].iptr
) free(yyvsp
[-2].iptr
);
3508 yyval
.exopt
->gotid
= TRUE
;
3509 yyval
.exopt
->gottype
= TRUE
;
3510 yyval
.exopt
->gotstate
= TRUE
;
3511 yyval
.exopt
->gothelpid
= TRUE
;
3516 #line 1430 "parser.y"
3520 yyerror("Stringtable must have at least one entry");
3525 /* Check if we added to a language table or created
3528 for(stt
= sttres
; stt
; stt
= stt
->next
)
3535 /* It is a new one */
3538 sttres
->prev
= tagstt
;
3539 tagstt
->next
= sttres
;
3545 /* Else were done */
3549 free(tagstt_memopt
);
3550 tagstt_memopt
= NULL
;
3558 #line 1471 "parser.y"
3560 if((tagstt
= find_stringtable(yyvsp
[0].lvc
)) == NULL
)
3561 tagstt
= new_stringtable(yyvsp
[0].lvc
);
3562 tagstt_memopt
= yyvsp
[-1].iptr
;
3563 tagstt_version
= yyvsp
[0].lvc
->version
;
3564 tagstt_characts
= yyvsp
[0].lvc
->characts
;
3571 #line 1482 "parser.y"
3572 { yyval
.stt
= NULL
; ;}
3576 #line 1483 "parser.y"
3579 assert(tagstt
!= NULL
);
3580 if(yyvsp
[-2].num
> 65535 || yyvsp
[-2].num
< -32768)
3581 yyerror("Stringtable entry's ID out of range (%d)", yyvsp
[-2].num
);
3582 /* Search for the ID */
3583 for(i
= 0; i
< tagstt
->nentries
; i
++)
3585 if(tagstt
->entries
[i
].id
== yyvsp
[-2].num
)
3586 yyerror("Stringtable ID %d already in use", yyvsp
[-2].num
);
3588 /* If we get here, then we have a new unique entry */
3590 tagstt
->entries
= xrealloc(tagstt
->entries
, sizeof(tagstt
->entries
[0]) * tagstt
->nentries
);
3591 tagstt
->entries
[tagstt
->nentries
-1].id
= yyvsp
[-2].num
;
3592 tagstt
->entries
[tagstt
->nentries
-1].str
= yyvsp
[0].str
;
3594 tagstt
->entries
[tagstt
->nentries
-1].memopt
= *tagstt_memopt
;
3596 tagstt
->entries
[tagstt
->nentries
-1].memopt
= WRC_MO_MOVEABLE
| WRC_MO_DISCARDABLE
| WRC_MO_PURE
;
3597 tagstt
->entries
[tagstt
->nentries
-1].version
= tagstt_version
;
3598 tagstt
->entries
[tagstt
->nentries
-1].characts
= tagstt_characts
;
3600 if(pedantic
&& !yyvsp
[0].str
->size
)
3601 yywarning("Zero length strings make no sense");
3602 if(!win32
&& yyvsp
[0].str
->size
> 254)
3603 yyerror("Stringtable entry more than 254 characters");
3604 if(win32
&& yyvsp
[0].str
->size
> 65534) /* Hmm..., does this happen? */
3605 yyerror("Stringtable entry more than 65534 characters (probably something else that went wrong)");
3611 #line 1523 "parser.y"
3613 yyval
.veri
= yyvsp
[-3].veri
;
3616 yyval
.veri
->memopt
= *(yyvsp
[-4].iptr
);
3617 free(yyvsp
[-4].iptr
);
3620 yyval
.veri
->memopt
= WRC_MO_MOVEABLE
| (win32
? WRC_MO_PURE
: 0);
3621 yyval
.veri
->blocks
= get_ver_block_head(yyvsp
[-1].blk
);
3622 /* Set language; there is no version or characteristics */
3623 yyval
.veri
->lvc
.language
= dup_language(currentlanguage
);
3628 #line 1539 "parser.y"
3629 { yyval
.veri
= new_versioninfo(); ;}
3633 #line 1540 "parser.y"
3635 if(yyvsp
[-8].veri
->gotit
.fv
)
3636 yyerror("FILEVERSION already defined");
3637 yyval
.veri
= yyvsp
[-8].veri
;
3638 yyval
.veri
->filever_maj1
= yyvsp
[-6].num
;
3639 yyval
.veri
->filever_maj2
= yyvsp
[-4].num
;
3640 yyval
.veri
->filever_min1
= yyvsp
[-2].num
;
3641 yyval
.veri
->filever_min2
= yyvsp
[0].num
;
3642 yyval
.veri
->gotit
.fv
= 1;
3647 #line 1550 "parser.y"
3649 if(yyvsp
[-8].veri
->gotit
.pv
)
3650 yyerror("PRODUCTVERSION already defined");
3651 yyval
.veri
= yyvsp
[-8].veri
;
3652 yyval
.veri
->prodver_maj1
= yyvsp
[-6].num
;
3653 yyval
.veri
->prodver_maj2
= yyvsp
[-4].num
;
3654 yyval
.veri
->prodver_min1
= yyvsp
[-2].num
;
3655 yyval
.veri
->prodver_min2
= yyvsp
[0].num
;
3656 yyval
.veri
->gotit
.pv
= 1;
3661 #line 1560 "parser.y"
3663 if(yyvsp
[-2].veri
->gotit
.ff
)
3664 yyerror("FILEFLAGS already defined");
3665 yyval
.veri
= yyvsp
[-2].veri
;
3666 yyval
.veri
->fileflags
= yyvsp
[0].num
;
3667 yyval
.veri
->gotit
.ff
= 1;
3672 #line 1567 "parser.y"
3674 if(yyvsp
[-2].veri
->gotit
.ffm
)
3675 yyerror("FILEFLAGSMASK already defined");
3676 yyval
.veri
= yyvsp
[-2].veri
;
3677 yyval
.veri
->fileflagsmask
= yyvsp
[0].num
;
3678 yyval
.veri
->gotit
.ffm
= 1;
3683 #line 1574 "parser.y"
3685 if(yyvsp
[-2].veri
->gotit
.fo
)
3686 yyerror("FILEOS already defined");
3687 yyval
.veri
= yyvsp
[-2].veri
;
3688 yyval
.veri
->fileos
= yyvsp
[0].num
;
3689 yyval
.veri
->gotit
.fo
= 1;
3694 #line 1581 "parser.y"
3696 if(yyvsp
[-2].veri
->gotit
.ft
)
3697 yyerror("FILETYPE already defined");
3698 yyval
.veri
= yyvsp
[-2].veri
;
3699 yyval
.veri
->filetype
= yyvsp
[0].num
;
3700 yyval
.veri
->gotit
.ft
= 1;
3705 #line 1588 "parser.y"
3707 if(yyvsp
[-2].veri
->gotit
.fst
)
3708 yyerror("FILESUBTYPE already defined");
3709 yyval
.veri
= yyvsp
[-2].veri
;
3710 yyval
.veri
->filesubtype
= yyvsp
[0].num
;
3711 yyval
.veri
->gotit
.fst
= 1;
3716 #line 1598 "parser.y"
3717 { yyval
.blk
= NULL
; ;}
3721 #line 1599 "parser.y"
3723 yyval
.blk
= yyvsp
[0].blk
;
3724 yyval
.blk
->prev
= yyvsp
[-1].blk
;
3726 yyvsp
[-1].blk
->next
= yyval
.blk
;
3731 #line 1608 "parser.y"
3733 yyval
.blk
= new_ver_block();
3734 yyval
.blk
->name
= yyvsp
[-3].str
;
3735 yyval
.blk
->values
= get_ver_value_head(yyvsp
[-1].val
);
3740 #line 1616 "parser.y"
3741 { yyval
.val
= NULL
; ;}
3745 #line 1617 "parser.y"
3747 yyval
.val
= yyvsp
[0].val
;
3748 yyval
.val
->prev
= yyvsp
[-1].val
;
3750 yyvsp
[-1].val
->next
= yyval
.val
;
3755 #line 1626 "parser.y"
3757 yyval
.val
= new_ver_value();
3758 yyval
.val
->type
= val_block
;
3759 yyval
.val
->value
.block
= yyvsp
[0].blk
;
3764 #line 1631 "parser.y"
3766 yyval
.val
= new_ver_value();
3767 yyval
.val
->type
= val_str
;
3768 yyval
.val
->key
= yyvsp
[-2].str
;
3769 yyval
.val
->value
.str
= yyvsp
[0].str
;
3774 #line 1637 "parser.y"
3776 yyval
.val
= new_ver_value();
3777 yyval
.val
->type
= val_words
;
3778 yyval
.val
->key
= yyvsp
[-2].str
;
3779 yyval
.val
->value
.words
= yyvsp
[0].verw
;
3784 #line 1646 "parser.y"
3785 { yyval
.verw
= new_ver_words(yyvsp
[0].num
); ;}
3789 #line 1647 "parser.y"
3790 { yyval
.verw
= add_ver_words(yyvsp
[-2].verw
, yyvsp
[0].num
); ;}
3794 #line 1651 "parser.y"
3797 toolbar_item_t
*items
= get_tlbr_buttons_head(yyvsp
[-1].tlbarItems
, &nitems
);
3798 yyval
.tlbar
= new_toolbar(yyvsp
[-6].num
, yyvsp
[-4].num
, items
, nitems
);
3801 yyval
.tlbar
->memopt
= *(yyvsp
[-7].iptr
);
3802 free(yyvsp
[-7].iptr
);
3806 yyval
.tlbar
->memopt
= WRC_MO_MOVEABLE
| WRC_MO_PURE
;
3810 yyval
.tlbar
->lvc
= *(yyvsp
[-3].lvc
);
3811 free(yyvsp
[-3].lvc
);
3813 if(!yyval
.tlbar
->lvc
.language
)
3815 yyval
.tlbar
->lvc
.language
= dup_language(currentlanguage
);
3821 #line 1677 "parser.y"
3822 { yyval
.tlbarItems
= NULL
; ;}
3826 #line 1678 "parser.y"
3828 toolbar_item_t
*idrec
= new_toolbar_item();
3829 idrec
->id
= yyvsp
[0].num
;
3830 yyval
.tlbarItems
= ins_tlbr_button(yyvsp
[-2].tlbarItems
, idrec
);
3835 #line 1683 "parser.y"
3837 toolbar_item_t
*idrec
= new_toolbar_item();
3839 yyval
.tlbarItems
= ins_tlbr_button(yyvsp
[-1].tlbarItems
, idrec
);
3844 #line 1692 "parser.y"
3845 { yyval
.iptr
= NULL
; ;}
3849 #line 1693 "parser.y"
3853 *(yyvsp
[-1].iptr
) |= *(yyvsp
[0].iptr
);
3854 yyval
.iptr
= yyvsp
[-1].iptr
;
3855 free(yyvsp
[0].iptr
);
3858 yyval
.iptr
= yyvsp
[0].iptr
;
3863 #line 1703 "parser.y"
3867 *(yyvsp
[-1].iptr
) &= *(yyvsp
[0].iptr
);
3868 yyval
.iptr
= yyvsp
[-1].iptr
;
3869 free(yyvsp
[0].iptr
);
3873 *yyvsp
[0].iptr
&= WRC_MO_MOVEABLE
| WRC_MO_DISCARDABLE
| WRC_MO_PURE
;
3874 yyval
.iptr
= yyvsp
[0].iptr
;
3880 #line 1718 "parser.y"
3881 { yyval
.iptr
= new_int(WRC_MO_PRELOAD
); ;}
3885 #line 1719 "parser.y"
3886 { yyval
.iptr
= new_int(WRC_MO_MOVEABLE
); ;}
3890 #line 1720 "parser.y"
3891 { yyval
.iptr
= new_int(WRC_MO_DISCARDABLE
); ;}
3895 #line 1721 "parser.y"
3896 { yyval
.iptr
= new_int(WRC_MO_PURE
); ;}
3900 #line 1724 "parser.y"
3901 { yyval
.iptr
= new_int(~WRC_MO_PRELOAD
); ;}
3905 #line 1725 "parser.y"
3906 { yyval
.iptr
= new_int(~WRC_MO_MOVEABLE
); ;}
3910 #line 1726 "parser.y"
3911 { yyval
.iptr
= new_int(~WRC_MO_PURE
); ;}
3915 #line 1730 "parser.y"
3916 { yyval
.lvc
= new_lvc(); ;}
3920 #line 1731 "parser.y"
3923 yywarning("LANGUAGE not supported in 16-bit mode");
3924 if(yyvsp
[-1].lvc
->language
)
3925 yyerror("Language already defined");
3926 yyval
.lvc
= yyvsp
[-1].lvc
;
3927 yyvsp
[-1].lvc
->language
= yyvsp
[0].lan
;
3932 #line 1739 "parser.y"
3935 yywarning("CHARACTERISTICS not supported in 16-bit mode");
3936 if(yyvsp
[-1].lvc
->characts
)
3937 yyerror("Characteristics already defined");
3938 yyval
.lvc
= yyvsp
[-1].lvc
;
3939 yyvsp
[-1].lvc
->characts
= yyvsp
[0].chars
;
3944 #line 1747 "parser.y"
3947 yywarning("VERSION not supported in 16-bit mode");
3948 if(yyvsp
[-1].lvc
->version
)
3949 yyerror("Version already defined");
3950 yyval
.lvc
= yyvsp
[-1].lvc
;
3951 yyvsp
[-1].lvc
->version
= yyvsp
[0].ver
;
3956 #line 1765 "parser.y"
3957 { yyval
.lan
= new_language(yyvsp
[-2].num
, yyvsp
[0].num
);
3958 if (get_language_codepage(yyvsp
[-2].num
, yyvsp
[0].num
) == -1)
3959 yyerror( "Language %04x is not supported", (yyvsp
[0].num
<<10) + yyvsp
[-2].num
);
3964 #line 1772 "parser.y"
3965 { yyval
.chars
= new_characts(yyvsp
[0].num
); ;}
3969 #line 1776 "parser.y"
3970 { yyval
.ver
= new_version(yyvsp
[0].num
); ;}
3974 #line 1780 "parser.y"
3978 yyvsp
[-1].raw
->lvc
= *(yyvsp
[-3].lvc
);
3979 free(yyvsp
[-3].lvc
);
3982 if(!yyvsp
[-1].raw
->lvc
.language
)
3983 yyvsp
[-1].raw
->lvc
.language
= dup_language(currentlanguage
);
3985 yyval
.raw
= yyvsp
[-1].raw
;
3990 #line 1795 "parser.y"
3991 { yyval
.raw
= yyvsp
[0].raw
; ;}
3995 #line 1796 "parser.y"
3996 { yyval
.raw
= int2raw_data(yyvsp
[0].num
); ;}
4000 #line 1797 "parser.y"
4001 { yyval
.raw
= int2raw_data(-(yyvsp
[0].num
)); ;}
4005 #line 1798 "parser.y"
4006 { yyval
.raw
= long2raw_data(yyvsp
[0].num
); ;}
4010 #line 1799 "parser.y"
4011 { yyval
.raw
= long2raw_data(-(yyvsp
[0].num
)); ;}
4015 #line 1800 "parser.y"
4016 { yyval
.raw
= str2raw_data(yyvsp
[0].str
); ;}
4020 #line 1801 "parser.y"
4021 { yyval
.raw
= merge_raw_data(yyvsp
[-2].raw
, yyvsp
[0].raw
); free(yyvsp
[0].raw
->data
); free(yyvsp
[0].raw
); ;}
4025 #line 1802 "parser.y"
4026 { yyval
.raw
= merge_raw_data_int(yyvsp
[-2].raw
, yyvsp
[0].num
); ;}
4030 #line 1803 "parser.y"
4031 { yyval
.raw
= merge_raw_data_int(yyvsp
[-3].raw
, -(yyvsp
[0].num
)); ;}
4035 #line 1804 "parser.y"
4036 { yyval
.raw
= merge_raw_data_long(yyvsp
[-2].raw
, yyvsp
[0].num
); ;}
4040 #line 1805 "parser.y"
4041 { yyval
.raw
= merge_raw_data_long(yyvsp
[-3].raw
, -(yyvsp
[0].num
)); ;}
4045 #line 1806 "parser.y"
4046 { yyval
.raw
= merge_raw_data_str(yyvsp
[-2].raw
, yyvsp
[0].str
); ;}
4050 #line 1810 "parser.y"
4051 { yyval
.raw
= load_file(yyvsp
[0].str
,dup_language(currentlanguage
)); ;}
4055 #line 1811 "parser.y"
4056 { yyval
.raw
= yyvsp
[0].raw
; ;}
4060 #line 1818 "parser.y"
4061 { yyval
.iptr
= 0; ;}
4065 #line 1819 "parser.y"
4066 { yyval
.iptr
= new_int(yyvsp
[0].num
); ;}
4070 #line 1823 "parser.y"
4071 { yyval
.num
= (yyvsp
[0].num
); ;}
4075 #line 1826 "parser.y"
4076 { yyval
.num
= (yyvsp
[-2].num
) + (yyvsp
[0].num
); ;}
4080 #line 1827 "parser.y"
4081 { yyval
.num
= (yyvsp
[-2].num
) - (yyvsp
[0].num
); ;}
4085 #line 1828 "parser.y"
4086 { yyval
.num
= (yyvsp
[-2].num
) | (yyvsp
[0].num
); ;}
4090 #line 1829 "parser.y"
4091 { yyval
.num
= (yyvsp
[-2].num
) & (yyvsp
[0].num
); ;}
4095 #line 1830 "parser.y"
4096 { yyval
.num
= (yyvsp
[-2].num
) * (yyvsp
[0].num
); ;}
4100 #line 1831 "parser.y"
4101 { yyval
.num
= (yyvsp
[-2].num
) / (yyvsp
[0].num
); ;}
4105 #line 1832 "parser.y"
4106 { yyval
.num
= (yyvsp
[-2].num
) ^ (yyvsp
[0].num
); ;}
4110 #line 1833 "parser.y"
4111 { yyval
.num
= ~(yyvsp
[0].num
); ;}
4115 #line 1834 "parser.y"
4116 { yyval
.num
= -(yyvsp
[0].num
); ;}
4120 #line 1835 "parser.y"
4121 { yyval
.num
= yyvsp
[0].num
; ;}
4125 #line 1836 "parser.y"
4126 { yyval
.num
= yyvsp
[-1].num
; ;}
4130 #line 1837 "parser.y"
4131 { yyval
.num
= yyvsp
[0].num
; ;}
4135 #line 1841 "parser.y"
4136 { yyval
.num
= (yyvsp
[0].num
); ;}
4140 #line 1842 "parser.y"
4141 { yyval
.num
= ~(yyvsp
[0].num
); ;}
4145 #line 1845 "parser.y"
4146 { yyval
.num
= yyvsp
[0].num
; ;}
4150 #line 1846 "parser.y"
4151 { yyval
.num
= yyvsp
[0].num
; ;}
4157 /* Line 1000 of yacc.c. */
4158 #line 4159 "parser.tab.c"
4164 YY_STACK_PRINT (yyss
, yyssp
);
4169 /* Now `shift' the result of the reduction. Determine what state
4170 that goes to, based on the state we popped back to and the rule
4171 number reduced by. */
4175 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4176 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4177 yystate
= yytable
[yystate
];
4179 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4184 /*------------------------------------.
4185 | yyerrlab -- here on detecting error |
4186 `------------------------------------*/
4188 /* If not already recovering from an error, report this error. */
4193 yyn
= yypact
[yystate
];
4195 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
4197 YYSIZE_T yysize
= 0;
4198 int yytype
= YYTRANSLATE (yychar
);
4199 const char* yyprefix
;
4203 /* Start YYX at -YYN if negative to avoid negative indexes in
4205 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
4207 /* Stay within bounds of both yycheck and yytname. */
4208 int yychecklim
= YYLAST
- yyn
;
4209 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
4212 yyprefix
= ", expecting ";
4213 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
4214 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
4216 yysize
+= yystrlen (yyprefix
) + yystrlen (yytname
[yyx
]);
4224 yysize
+= (sizeof ("syntax error, unexpected ")
4225 + yystrlen (yytname
[yytype
]));
4226 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
4229 char *yyp
= yystpcpy (yymsg
, "syntax error, unexpected ");
4230 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
4234 yyprefix
= ", expecting ";
4235 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
4236 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
4238 yyp
= yystpcpy (yyp
, yyprefix
);
4239 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
4244 YYSTACK_FREE (yymsg
);
4247 yyerror ("syntax error; also virtual memory exhausted");
4250 #endif /* YYERROR_VERBOSE */
4251 yyerror ("syntax error");
4256 if (yyerrstatus
== 3)
4258 /* If just tried and failed to reuse lookahead token after an
4259 error, discard it. */
4261 if (yychar
<= YYEOF
)
4263 /* If at end of input, pop the error token,
4264 then the rest of the stack, then return failure. */
4265 if (yychar
== YYEOF
)
4271 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
4272 yydestruct (yystos
[*yyssp
], yyvsp
);
4277 YYDSYMPRINTF ("Error: discarding", yytoken
, &yylval
, &yylloc
);
4278 yydestruct (yytoken
, &yylval
);
4284 /* Else will try to reuse lookahead token after shifting the error
4289 /*---------------------------------------------------.
4290 | yyerrorlab -- error raised explicitly by YYERROR. |
4291 `---------------------------------------------------*/
4295 /* Pacify GCC when the user code never invokes YYERROR and the label
4296 yyerrorlab therefore never appears in user code. */
4307 /*-------------------------------------------------------------.
4308 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4309 `-------------------------------------------------------------*/
4311 yyerrstatus
= 3; /* Each real token shifted decrements this. */
4315 yyn
= yypact
[yystate
];
4316 if (yyn
!= YYPACT_NINF
)
4319 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
4327 /* Pop the current state because it cannot handle the error token. */
4331 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
4332 yydestruct (yystos
[yystate
], yyvsp
);
4335 YY_STACK_PRINT (yyss
, yyssp
);
4341 YYDPRINTF ((stderr
, "Shifting error token, "));
4350 /*-------------------------------------.
4351 | yyacceptlab -- YYACCEPT comes here. |
4352 `-------------------------------------*/
4357 /*-----------------------------------.
4358 | yyabortlab -- YYABORT comes here. |
4359 `-----------------------------------*/
4365 /*----------------------------------------------.
4366 | yyoverflowlab -- parser overflow comes here. |
4367 `----------------------------------------------*/
4369 yyerror ("parser stack overflow");
4377 YYSTACK_FREE (yyss
);
4383 #line 1849 "parser.y"
4385 /* Dialog specific functions */
4386 static dialog_t
*dialog_style(style_t
* st
, dialog_t
*dlg
)
4388 assert(dlg
!= NULL
);
4389 if(dlg
->style
== NULL
)
4391 dlg
->style
= new_style(0,0);
4396 yywarning("Style already defined, or-ing together");
4400 dlg
->style
->or_mask
= 0;
4401 dlg
->style
->and_mask
= 0;
4403 dlg
->style
->or_mask
|= st
->or_mask
;
4404 dlg
->style
->and_mask
|= st
->and_mask
;
4405 dlg
->gotstyle
= TRUE
;
4410 static dialog_t
*dialog_exstyle(style_t
*st
, dialog_t
*dlg
)
4412 assert(dlg
!= NULL
);
4413 if(dlg
->exstyle
== NULL
)
4415 dlg
->exstyle
= new_style(0,0);
4420 yywarning("ExStyle already defined, or-ing together");
4424 dlg
->exstyle
->or_mask
= 0;
4425 dlg
->exstyle
->and_mask
= 0;
4427 dlg
->exstyle
->or_mask
|= st
->or_mask
;
4428 dlg
->exstyle
->and_mask
|= st
->and_mask
;
4429 dlg
->gotexstyle
= TRUE
;
4434 static dialog_t
*dialog_caption(string_t
*s
, dialog_t
*dlg
)
4436 assert(dlg
!= NULL
);
4438 yyerror("Caption already defined");
4443 static dialog_t
*dialog_font(font_id_t
*f
, dialog_t
*dlg
)
4445 assert(dlg
!= NULL
);
4447 yyerror("Font already defined");
4452 static dialog_t
*dialog_class(name_id_t
*n
, dialog_t
*dlg
)
4454 assert(dlg
!= NULL
);
4456 yyerror("Class already defined");
4461 static dialog_t
*dialog_menu(name_id_t
*m
, dialog_t
*dlg
)
4463 assert(dlg
!= NULL
);
4465 yyerror("Menu already defined");
4470 static dialog_t
*dialog_language(language_t
*l
, dialog_t
*dlg
)
4472 assert(dlg
!= NULL
);
4473 if(dlg
->lvc
.language
)
4474 yyerror("Language already defined");
4475 dlg
->lvc
.language
= l
;
4479 static dialog_t
*dialog_characteristics(characts_t
*c
, dialog_t
*dlg
)
4481 assert(dlg
!= NULL
);
4482 if(dlg
->lvc
.characts
)
4483 yyerror("Characteristics already defined");
4484 dlg
->lvc
.characts
= c
;
4488 static dialog_t
*dialog_version(version_t
*v
, dialog_t
*dlg
)
4490 assert(dlg
!= NULL
);
4491 if(dlg
->lvc
.version
)
4492 yyerror("Version already defined");
4493 dlg
->lvc
.version
= v
;
4497 /* Controls specific functions */
4498 static control_t
*ins_ctrl(int type
, int special_style
, control_t
*ctrl
, control_t
*prev
)
4500 /* Hm... this seems to be jammed in at all time... */
4501 int defaultstyle
= WS_CHILD
| WS_VISIBLE
;
4503 assert(ctrl
!= NULL
);
4511 ctrl
->ctlclass
= new_name_id();
4512 ctrl
->ctlclass
->type
= name_ord
;
4513 ctrl
->ctlclass
->name
.i_name
= type
;
4519 if(special_style
!= BS_GROUPBOX
&& special_style
!= BS_RADIOBUTTON
)
4520 defaultstyle
|= WS_TABSTOP
;
4523 defaultstyle
|= WS_TABSTOP
| WS_BORDER
;
4526 defaultstyle
|= LBS_NOTIFY
| WS_BORDER
;
4529 if (!(ctrl
->style
->or_mask
& (CBS_SIMPLE
| CBS_DROPDOWN
| CBS_DROPDOWNLIST
)))
4530 defaultstyle
|= CBS_SIMPLE
;
4533 if(special_style
== SS_CENTER
|| special_style
== SS_LEFT
|| special_style
== SS_RIGHT
)
4534 defaultstyle
|= WS_GROUP
;
4538 if(!ctrl
->gotstyle
) /* Handle default style setting */
4543 defaultstyle
|= ES_LEFT
;
4546 defaultstyle
|= LBS_NOTIFY
;
4549 defaultstyle
|= CBS_SIMPLE
| WS_TABSTOP
;
4552 defaultstyle
|= SBS_HORZ
;
4555 switch(special_style
)
4558 case BS_DEFPUSHBUTTON
:
4560 /* case BS_PUSHBOX: */
4561 case BS_AUTORADIOBUTTON
:
4564 case BS_AUTOCHECKBOX
:
4565 defaultstyle
|= WS_TABSTOP
;
4568 yywarning("Unknown default button control-style 0x%08x", special_style
);
4570 case BS_RADIOBUTTON
:
4576 switch(special_style
)
4581 defaultstyle
|= WS_GROUP
;
4583 case SS_ICON
: /* Special case */
4586 yywarning("Unknown default static control-style 0x%08x", special_style
);
4590 case -1: /* Generic control */
4594 yyerror("Internal error (report this): Got weird control type 0x%08x", type
);
4598 /* The SS_ICON flag is always forced in for icon controls */
4599 if(type
== CT_STATIC
&& special_style
== SS_ICON
)
4600 defaultstyle
|= SS_ICON
;
4602 if (!ctrl
->gotstyle
)
4603 ctrl
->style
= new_style(0,0);
4605 /* combine all styles */
4606 ctrl
->style
->or_mask
= ctrl
->style
->or_mask
| defaultstyle
| special_style
;
4607 ctrl
->gotstyle
= TRUE
;
4609 /* combine with NOT mask */
4612 ctrl
->style
->or_mask
&= ~(ctrl
->style
->and_mask
);
4613 ctrl
->style
->and_mask
= 0;
4615 if (ctrl
->gotexstyle
)
4617 ctrl
->exstyle
->or_mask
&= ~(ctrl
->exstyle
->and_mask
);
4618 ctrl
->exstyle
->and_mask
= 0;
4623 static name_id_t
*convert_ctlclass(name_id_t
*cls
)
4628 if(cls
->type
== name_ord
)
4630 assert(cls
->type
== name_str
);
4631 if(cls
->type
== str_unicode
)
4633 yyerror("Don't yet support unicode class comparison");
4636 cc
= cls
->name
.s_name
->str
.cstr
;
4638 if(!strcasecmp("BUTTON", cc
))
4640 else if(!strcasecmp("COMBOBOX", cc
))
4641 iclass
= CT_COMBOBOX
;
4642 else if(!strcasecmp("LISTBOX", cc
))
4643 iclass
= CT_LISTBOX
;
4644 else if(!strcasecmp("EDIT", cc
))
4646 else if(!strcasecmp("STATIC", cc
))
4648 else if(!strcasecmp("SCROLLBAR", cc
))
4649 iclass
= CT_SCROLLBAR
;
4651 return cls
; /* No default, return user controlclass */
4653 free(cls
->name
.s_name
->str
.cstr
);
4654 free(cls
->name
.s_name
);
4655 cls
->type
= name_ord
;
4656 cls
->name
.i_name
= iclass
;
4660 /* DialogEx specific functions */
4661 static dialogex_t
*dialogex_style(style_t
* st
, dialogex_t
*dlg
)
4663 assert(dlg
!= NULL
);
4664 if(dlg
->style
== NULL
)
4666 dlg
->style
= new_style(0,0);
4671 yywarning("Style already defined, or-ing together");
4675 dlg
->style
->or_mask
= 0;
4676 dlg
->style
->and_mask
= 0;
4678 dlg
->style
->or_mask
|= st
->or_mask
;
4679 dlg
->style
->and_mask
|= st
->and_mask
;
4680 dlg
->gotstyle
= TRUE
;
4685 static dialogex_t
*dialogex_exstyle(style_t
* st
, dialogex_t
*dlg
)
4687 assert(dlg
!= NULL
);
4688 if(dlg
->exstyle
== NULL
)
4690 dlg
->exstyle
= new_style(0,0);
4695 yywarning("ExStyle already defined, or-ing together");
4699 dlg
->exstyle
->or_mask
= 0;
4700 dlg
->exstyle
->and_mask
= 0;
4702 dlg
->exstyle
->or_mask
|= st
->or_mask
;
4703 dlg
->exstyle
->and_mask
|= st
->and_mask
;
4704 dlg
->gotexstyle
= TRUE
;
4709 static dialogex_t
*dialogex_caption(string_t
*s
, dialogex_t
*dlg
)
4711 assert(dlg
!= NULL
);
4713 yyerror("Caption already defined");
4718 static dialogex_t
*dialogex_font(font_id_t
*f
, dialogex_t
*dlg
)
4720 assert(dlg
!= NULL
);
4722 yyerror("Font already defined");
4727 static dialogex_t
*dialogex_class(name_id_t
*n
, dialogex_t
*dlg
)
4729 assert(dlg
!= NULL
);
4731 yyerror("Class already defined");
4736 static dialogex_t
*dialogex_menu(name_id_t
*m
, dialogex_t
*dlg
)
4738 assert(dlg
!= NULL
);
4740 yyerror("Menu already defined");
4745 static dialogex_t
*dialogex_language(language_t
*l
, dialogex_t
*dlg
)
4747 assert(dlg
!= NULL
);
4748 if(dlg
->lvc
.language
)
4749 yyerror("Language already defined");
4750 dlg
->lvc
.language
= l
;
4754 static dialogex_t
*dialogex_characteristics(characts_t
*c
, dialogex_t
*dlg
)
4756 assert(dlg
!= NULL
);
4757 if(dlg
->lvc
.characts
)
4758 yyerror("Characteristics already defined");
4759 dlg
->lvc
.characts
= c
;
4763 static dialogex_t
*dialogex_version(version_t
*v
, dialogex_t
*dlg
)
4765 assert(dlg
!= NULL
);
4766 if(dlg
->lvc
.version
)
4767 yyerror("Version already defined");
4768 dlg
->lvc
.version
= v
;
4772 /* Accelerator specific functions */
4773 static event_t
*add_event(int key
, int id
, int flags
, event_t
*prev
)
4775 event_t
*ev
= new_event();
4777 if((flags
& (WRC_AF_VIRTKEY
| WRC_AF_ASCII
)) == (WRC_AF_VIRTKEY
| WRC_AF_ASCII
))
4778 yyerror("Cannot use both ASCII and VIRTKEY");
4782 ev
->flags
= flags
& ~WRC_AF_ASCII
;
4789 static event_t
*add_string_event(string_t
*key
, int id
, int flags
, event_t
*prev
)
4791 int keycode
= 0, keysym
= 0;
4792 event_t
*ev
= new_event();
4794 if(key
->type
== str_char
)
4795 keysym
= key
->str
.cstr
[0];
4797 keysym
= key
->str
.wstr
[0];
4799 if((flags
& WRC_AF_VIRTKEY
) && (!isupper(keysym
& 0xff) && !isdigit(keysym
& 0xff)))
4800 yyerror("VIRTKEY code is not equal to ascii value");
4802 if(keysym
== '^' && (flags
& WRC_AF_CONTROL
) != 0)
4804 yyerror("Cannot use both '^' and CONTROL modifier");
4806 else if(keysym
== '^')
4808 if(key
->type
== str_char
)
4809 keycode
= toupper(key
->str
.cstr
[1]) - '@';
4811 keycode
= toupper(key
->str
.wstr
[1]) - '@';
4813 yyerror("Control-code out of range");
4819 ev
->flags
= flags
& ~WRC_AF_ASCII
;
4826 /* MenuEx specific functions */
4827 static itemex_opt_t
*new_itemex_opt(int id
, int type
, int state
, int helpid
)
4829 itemex_opt_t
*opt
= (itemex_opt_t
*)xmalloc(sizeof(itemex_opt_t
));
4833 opt
->helpid
= helpid
;
4837 /* Raw data functions */
4838 static raw_data_t
*load_file(string_t
*filename
, language_t
*lang
)
4844 int codepage
= get_language_codepage(lang
->id
, lang
->sub
);
4846 /* FIXME: we may want to use utf-8 here */
4847 if (codepage
<= 0 && filename
->type
!= str_char
)
4848 yyerror("Cannot convert filename to ASCII string");
4849 name
= convert_string( filename
, str_char
, codepage
);
4850 if (!(path
= wpp_find_include(name
->str
.cstr
, 1)))
4851 yyerror("Cannot open file %s", name
->str
.cstr
);
4852 if (!(fp
= fopen( path
, "rb" )))
4853 yyerror("Cannot open file %s", name
->str
.cstr
);
4855 rd
= new_raw_data();
4856 fseek(fp
, 0, SEEK_END
);
4857 rd
->size
= ftell(fp
);
4858 fseek(fp
, 0, SEEK_SET
);
4861 rd
->data
= (char *)xmalloc(rd
->size
);
4862 fread(rd
->data
, rd
->size
, 1, fp
);
4864 else rd
->data
= NULL
;
4866 rd
->lvc
.language
= lang
;
4871 static raw_data_t
*int2raw_data(int i
)
4875 if( ( i
>= 0 && (int)((unsigned short)i
) != i
) ||
4876 ( i
< 0 && (int)((short)i
) != i
) )
4877 yywarning("Integer constant out of 16bit range (%d), truncated to %d\n", i
, (short)i
);
4879 rd
= new_raw_data();
4880 rd
->size
= sizeof(short);
4881 rd
->data
= (char *)xmalloc(rd
->size
);
4884 #ifdef WORDS_BIGENDIAN
4888 rd
->data
[0] = HIBYTE(i
);
4889 rd
->data
[1] = LOBYTE(i
);
4892 #ifndef WORDS_BIGENDIAN
4896 rd
->data
[1] = HIBYTE(i
);
4897 rd
->data
[0] = LOBYTE(i
);
4903 static raw_data_t
*long2raw_data(int i
)
4906 rd
= new_raw_data();
4907 rd
->size
= sizeof(int);
4908 rd
->data
= (char *)xmalloc(rd
->size
);
4911 #ifdef WORDS_BIGENDIAN
4915 rd
->data
[0] = HIBYTE(HIWORD(i
));
4916 rd
->data
[1] = LOBYTE(HIWORD(i
));
4917 rd
->data
[2] = HIBYTE(LOWORD(i
));
4918 rd
->data
[3] = LOBYTE(LOWORD(i
));
4921 #ifndef WORDS_BIGENDIAN
4925 rd
->data
[3] = HIBYTE(HIWORD(i
));
4926 rd
->data
[2] = LOBYTE(HIWORD(i
));
4927 rd
->data
[1] = HIBYTE(LOWORD(i
));
4928 rd
->data
[0] = LOBYTE(LOWORD(i
));
4934 static raw_data_t
*str2raw_data(string_t
*str
)
4937 rd
= new_raw_data();
4938 rd
->size
= str
->size
* (str
->type
== str_char
? 1 : 2);
4939 rd
->data
= (char *)xmalloc(rd
->size
);
4940 if(str
->type
== str_char
)
4941 memcpy(rd
->data
, str
->str
.cstr
, rd
->size
);
4942 else if(str
->type
== str_unicode
)
4947 #ifdef WORDS_BIGENDIAN
4951 for(i
= 0; i
< str
->size
; i
++)
4953 rd
->data
[2*i
+ 0] = HIBYTE((WORD
)str
->str
.wstr
[i
]);
4954 rd
->data
[2*i
+ 1] = LOBYTE((WORD
)str
->str
.wstr
[i
]);
4957 #ifndef WORDS_BIGENDIAN
4961 for(i
= 0; i
< str
->size
; i
++)
4963 rd
->data
[2*i
+ 1] = HIBYTE((WORD
)str
->str
.wstr
[i
]);
4964 rd
->data
[2*i
+ 0] = LOBYTE((WORD
)str
->str
.wstr
[i
]);
4970 internal_error(__FILE__
, __LINE__
, "Invalid stringtype");
4974 static raw_data_t
*merge_raw_data(raw_data_t
*r1
, raw_data_t
*r2
)
4976 r1
->data
= xrealloc(r1
->data
, r1
->size
+ r2
->size
);
4977 memcpy(r1
->data
+ r1
->size
, r2
->data
, r2
->size
);
4978 r1
->size
+= r2
->size
;
4982 static raw_data_t
*merge_raw_data_int(raw_data_t
*r1
, int i
)
4984 raw_data_t
*t
= int2raw_data(i
);
4985 merge_raw_data(r1
, t
);
4991 static raw_data_t
*merge_raw_data_long(raw_data_t
*r1
, int i
)
4993 raw_data_t
*t
= long2raw_data(i
);
4994 merge_raw_data(r1
, t
);
5000 static raw_data_t
*merge_raw_data_str(raw_data_t
*r1
, string_t
*str
)
5002 raw_data_t
*t
= str2raw_data(str
);
5003 merge_raw_data(r1
, t
);
5009 /* Function the go back in a list to get the head */
5010 static menu_item_t
*get_item_head(menu_item_t
*p
)
5019 static menuex_item_t
*get_itemex_head(menuex_item_t
*p
)
5028 static resource_t
*get_resource_head(resource_t
*p
)
5037 static ver_block_t
*get_ver_block_head(ver_block_t
*p
)
5046 static ver_value_t
*get_ver_value_head(ver_value_t
*p
)
5055 static control_t
*get_control_head(control_t
*p
)
5064 static event_t
*get_event_head(event_t
*p
)
5073 /* Find a stringtable with given language */
5074 static stringtable_t
*find_stringtable(lvc_t
*lvc
)
5078 assert(lvc
!= NULL
);
5081 lvc
->language
= dup_language(currentlanguage
);
5083 for(stt
= sttres
; stt
; stt
= stt
->next
)
5085 if(stt
->lvc
.language
->id
== lvc
->language
->id
5086 && stt
->lvc
.language
->sub
== lvc
->language
->sub
)
5088 /* Found a table with the same language */
5089 /* The version and characteristics are now handled
5090 * in the generation of the individual stringtables.
5091 * This enables localized analysis.
5092 if((stt->lvc.version && lvc->version && *(stt->lvc.version) != *(lvc->version))
5093 || (!stt->lvc.version && lvc->version)
5094 || (stt->lvc.version && !lvc->version))
5095 yywarning("Stringtable's versions are not the same, using first definition");
5097 if((stt->lvc.characts && lvc->characts && *(stt->lvc.characts) != *(lvc->characts))
5098 || (!stt->lvc.characts && lvc->characts)
5099 || (stt->lvc.characts && !lvc->characts))
5100 yywarning("Stringtable's characteristics are not the same, using first definition");
5108 /* qsort sorting function for string table entries */
5109 #define STE(p) ((const stt_entry_t *)(p))
5110 static int sort_stt_entry(const void *e1
, const void *e2
)
5112 return STE(e1
)->id
- STE(e2
)->id
;
5116 static resource_t
*build_stt_resources(stringtable_t
*stthead
)
5119 stringtable_t
*newstt
;
5121 resource_t
*rsclist
= NULL
;
5122 resource_t
*rsctail
= NULL
;
5127 characts_t
*characts
;
5133 /* For all languages defined */
5134 for(stt
= stthead
; stt
; stt
= stt
->next
)
5136 assert(stt
->nentries
> 0);
5138 /* Sort the entries */
5139 if(stt
->nentries
> 1)
5140 qsort(stt
->entries
, stt
->nentries
, sizeof(stt
->entries
[0]), sort_stt_entry
);
5142 for(i
= 0; i
< stt
->nentries
; )
5144 newstt
= new_stringtable(&stt
->lvc
);
5145 newstt
->entries
= (stt_entry_t
*)xmalloc(16 * sizeof(stt_entry_t
));
5146 newstt
->nentries
= 16;
5147 newstt
->idbase
= stt
->entries
[i
].id
& ~0xf;
5148 for(j
= 0; j
< 16 && i
< stt
->nentries
; j
++)
5150 if(stt
->entries
[i
].id
- newstt
->idbase
== j
)
5152 newstt
->entries
[j
] = stt
->entries
[i
];
5160 /* Check individual memory options and get
5161 * the first characteristics/version
5163 for(j
= 0; j
< 16; j
++)
5165 if(!newstt
->entries
[j
].str
)
5167 andsum
&= newstt
->entries
[j
].memopt
;
5168 orsum
|= newstt
->entries
[j
].memopt
;
5170 characts
= newstt
->entries
[j
].characts
;
5172 version
= newstt
->entries
[j
].version
;
5176 warning("Stringtable's memory options are not equal (idbase: %d)", newstt
->idbase
);
5178 /* Check version and characteristics */
5179 for(j
= 0; j
< 16; j
++)
5182 && newstt
->entries
[j
].characts
5183 && *newstt
->entries
[j
].characts
!= *characts
)
5184 warning("Stringtable's characteristics are not the same (idbase: %d)", newstt
->idbase
);
5186 && newstt
->entries
[j
].version
5187 && *newstt
->entries
[j
].version
!= *version
)
5188 warning("Stringtable's versions are not the same (idbase: %d)", newstt
->idbase
);
5190 rsc
= new_resource(res_stt
, newstt
, newstt
->memopt
, newstt
->lvc
.language
);
5191 rsc
->name
= new_name_id();
5192 rsc
->name
->type
= name_ord
;
5193 rsc
->name
->name
.i_name
= (newstt
->idbase
>> 4) + 1;
5194 rsc
->memopt
= andsum
; /* Set to least common denominator */
5195 newstt
->memopt
= andsum
;
5196 newstt
->lvc
.characts
= characts
;
5197 newstt
->lvc
.version
= version
;
5205 rsctail
->next
= rsc
;
5206 rsc
->prev
= rsctail
;
5215 static toolbar_item_t
*ins_tlbr_button(toolbar_item_t
*prev
, toolbar_item_t
*idrec
)
5224 static toolbar_item_t
*get_tlbr_buttons_head(toolbar_item_t
*p
, int *nitems
)
5243 static string_t
*make_filename(string_t
*str
)
5245 if(str
->type
== str_char
)
5249 /* Remove escaped backslash and convert to forward */
5250 for(cptr
= str
->str
.cstr
; (cptr
= strchr(cptr
, '\\')) != NULL
; cptr
++)
5254 memmove(cptr
, cptr
+1, strlen(cptr
));
5264 /* Remove escaped backslash and convert to forward */
5265 for(wptr
= str
->str
.wstr
; (wptr
= strchrW(wptr
, '\\')) != NULL
; wptr
++)
5269 memmove(wptr
, wptr
+1, strlenW(wptr
));
5279 * Process all resources to extract fonts and build
5280 * a fontdir resource.
5282 * Note: MS' resource compiler (build 1472) does not
5283 * handle font resources with different languages.
5284 * The fontdir is generated in the last active language
5285 * and font identifiers must be unique across the entire
5287 * This is not logical considering the localization
5288 * constraints of all other resource types. MS has,
5289 * most probably, never testet localized fonts. However,
5290 * using fontresources is rare, so it might not occur
5291 * in normal applications.
5292 * Wine does require better localization because a lot
5293 * of languages are coded into the same executable.
5294 * Therefore, I will generate fontdirs for *each*
5295 * localized set of fonts.
5297 static resource_t
*build_fontdir(resource_t
**fnt
, int nfnt
)
5299 static int once
= 0;
5302 warning("Need to parse fonts, not yet implemented (fnt: %p, nfnt: %d)", fnt
, nfnt
);
5308 static resource_t
*build_fontdirs(resource_t
*tail
)
5311 resource_t
*lst
= NULL
;
5312 resource_t
**fnt
= NULL
; /* List of all fonts */
5314 resource_t
**fnd
= NULL
; /* List of all fontdirs */
5316 resource_t
**lanfnt
= NULL
;
5323 nid
.type
= name_str
;
5324 nid
.name
.s_name
= &str
;
5325 str
.type
= str_char
;
5326 str
.str
.cstr
= xstrdup("FONTDIR");
5329 /* Extract all fonts and fontdirs */
5330 for(rsc
= tail
; rsc
; rsc
= rsc
->prev
)
5332 if(rsc
->type
== res_fnt
)
5335 fnt
= xrealloc(fnt
, nfnt
* sizeof(*fnt
));
5338 else if(rsc
->type
== res_fntdir
)
5341 fnd
= xrealloc(fnd
, nfnd
* sizeof(*fnd
));
5346 /* Verify the name of the present fontdirs */
5347 for(i
= 0; i
< nfnd
; i
++)
5349 if(compare_name_id(&nid
, fnd
[i
]->name
))
5351 warning("User supplied FONTDIR entry has an invalid name '%s', ignored",
5352 get_nameid_str(fnd
[i
]->name
));
5361 warning("Found %d FONTDIR entries without any fonts present", nfnd
);
5366 lanfnt
= xmalloc(nfnt
* sizeof(*lanfnt
));
5368 /* Get all fonts covered by fontdirs */
5369 for(i
= 0; i
< nfnd
; i
++)
5377 for(j
= 0; j
< nfnt
; j
++)
5381 if(fnt
[j
]->lan
->id
== fnd
[i
]->lan
->id
&& fnt
[j
]->lan
->sub
== fnd
[i
]->lan
->sub
)
5383 lanfnt
[nlanfnt
] = fnt
[j
];
5389 cnt
= *(WORD
*)fnd
[i
]->res
.fnd
->data
->data
;
5392 else if(nlanfnt
== BYTESWAP_WORD(cnt
))
5395 error("FONTDIR for language %d,%d has wrong count (%d, expected %d)",
5396 fnd
[i
]->lan
->id
, fnd
[i
]->lan
->sub
, cnt
, nlanfnt
);
5397 #ifdef WORDS_BIGENDIAN
5398 if((byteorder
== WRC_BO_LITTLE
&& !isswapped
) || (byteorder
!= WRC_BO_LITTLE
&& isswapped
))
5400 if((byteorder
== WRC_BO_BIG
&& !isswapped
) || (byteorder
!= WRC_BO_BIG
&& isswapped
))
5403 internal_error(__FILE__
, __LINE__
, "User supplied FONTDIR needs byteswapping");
5407 /* We now have fonts left where we need to make a fontdir resource */
5408 for(i
= fntleft
= 0; i
< nfnt
; i
++)
5415 /* Get fonts of same language in lanfnt[] */
5416 for(i
= nlanfnt
= 0; i
< nfnt
; i
++)
5423 lanfnt
[nlanfnt
] = fnt
[i
];
5428 else if(fnt
[i
]->lan
->id
== lanfnt
[0]->lan
->id
&& fnt
[i
]->lan
->sub
== lanfnt
[0]->lan
->sub
)
5432 /* and build a fontdir */
5433 rsc
= build_fontdir(lanfnt
, nlanfnt
);
5456 * This gets invoked to determine whether the next resource
5457 * is to be of a standard-type (e.g. bitmaps etc.), or should
5458 * be a user-type resource. This function is required because
5459 * there is the _possibility_ of a lookahead token in the
5460 * parser, which is generated from the "expr" state in the
5463 * The general resource format is:
5464 * <identifier> <type> <flags> <resourcebody>
5466 * The <identifier> can either be tIDENT or "expr". The latter
5467 * will always generate a lookahead, which is the <type> of the
5468 * resource to parse. Otherwise, we need to get a new token from
5469 * the scanner to determine the next step.
5471 * The problem arrises when <type> is numerical. This case should
5472 * map onto default resource-types and be parsed as such instead
5473 * of being mapped onto user-type resources.
5475 * The trick lies in the fact that yacc (bison) doesn't care about
5476 * intermediate changes of the lookahead while reducing a rule. We
5477 * simply replace the lookahead with a token that will result in
5478 * a shift to the appropriate rule for the specific resource-type.
5480 static int rsrcid_to_token(int lookahead
)
5483 const char *type
= "?";
5485 /* Get a token if we don't have one yet */
5486 if(lookahead
== YYEMPTY
)
5489 /* Only numbers are possibly interesting */
5519 case WRC_RT_FONTDIR
:
5527 case WRC_RT_MESSAGETABLE
:
5528 type
= "MESSAGETABLE";
5529 token
= tMESSAGETABLE
;
5531 case WRC_RT_DLGINIT
:
5535 case WRC_RT_ACCELERATOR
:
5536 type
= "ACCELERATOR";
5537 token
= tACCELERATORS
;
5547 case WRC_RT_VERSION
:
5549 token
= tVERSIONINFO
;
5551 case WRC_RT_TOOLBAR
:
5557 type
= "STRINGTABLE";
5560 case WRC_RT_ANICURSOR
:
5561 case WRC_RT_ANIICON
:
5562 case WRC_RT_GROUP_CURSOR
:
5563 case WRC_RT_GROUP_ICON
:
5564 yywarning("Usertype uses reserved type ID %d, which is auto-generated", yylval
.num
);
5567 case WRC_RT_DLGINCLUDE
:
5568 case WRC_RT_PLUGPLAY
:
5571 yywarning("Usertype uses reserved type ID %d, which is not supported by wrc yet", yylval
.num
);