source: trunk/tools/wrc/y.tab.c@ 3426

Last change on this file since 3426 was 3426, checked in by sandervl, 25 years ago

update with latest wine code

File size: 134.0 KB
Line 
1
2/* A Bison parser, made from parser.y
3 by GNU Bison version 1.25
4 */
5
6#define YYBISON 1 /* Identify Bison output. */
7
8#define tIF 258
9#define tIFDEF 259
10#define tIFNDEF 260
11#define tELSE 261
12#define tELIF 262
13#define tENDIF 263
14#define tDEFINED 264
15#define tNL 265
16#define tTYPEDEF 266
17#define tEXTERN 267
18#define NUMBER 268
19#define LNUMBER 269
20#define tSTRING 270
21#define IDENT 271
22#define FILENAME 272
23#define RAWDATA 273
24#define ACCELERATORS 274
25#define tBITMAP 275
26#define CURSOR 276
27#define DIALOG 277
28#define DIALOGEX 278
29#define MENU 279
30#define MENUEX 280
31#define MESSAGETABLE 281
32#define RCDATA 282
33#define VERSIONINFO 283
34#define STRINGTABLE 284
35#define FONT 285
36#define ICON 286
37#define AUTO3STATE 287
38#define AUTOCHECKBOX 288
39#define AUTORADIOBUTTON 289
40#define CHECKBOX 290
41#define DEFPUSHBUTTON 291
42#define PUSHBUTTON 292
43#define RADIOBUTTON 293
44#define STATE3 294
45#define GROUPBOX 295
46#define COMBOBOX 296
47#define LISTBOX 297
48#define SCROLLBAR 298
49#define CONTROL 299
50#define EDITTEXT 300
51#define RTEXT 301
52#define CTEXT 302
53#define LTEXT 303
54#define BLOCK 304
55#define VALUE 305
56#define SHIFT 306
57#define ALT 307
58#define ASCII 308
59#define VIRTKEY 309
60#define GRAYED 310
61#define CHECKED 311
62#define INACTIVE 312
63#define NOINVERT 313
64#define tPURE 314
65#define IMPURE 315
66#define DISCARDABLE 316
67#define LOADONCALL 317
68#define PRELOAD 318
69#define tFIXED 319
70#define MOVEABLE 320
71#define CLASS 321
72#define CAPTION 322
73#define CHARACTERISTICS 323
74#define EXSTYLE 324
75#define STYLE 325
76#define VERSION 326
77#define LANGUAGE 327
78#define FILEVERSION 328
79#define PRODUCTVERSION 329
80#define FILEFLAGSMASK 330
81#define FILEOS 331
82#define FILETYPE 332
83#define FILEFLAGS 333
84#define FILESUBTYPE 334
85#define MENUBARBREAK 335
86#define MENUBREAK 336
87#define MENUITEM 337
88#define POPUP 338
89#define SEPARATOR 339
90#define HELP 340
91#define TOOLBAR 341
92#define BUTTON 342
93#define tBEGIN 343
94#define tEND 344
95#define DLGINIT 345
96#define LOGOR 346
97#define LOGAND 347
98#define EQ 348
99#define NE 349
100#define LTE 350
101#define GTE 351
102#define NOT 352
103
104#line 1 "parser.y"
105
106/*
107 * Copyright Martin von Loewis, 1994
108 * Copyright 1998 Bertho A. Stultiens (BS)
109 * 1999 Juergen Schmied (JS)
110 *
111 * 6-Nov-1999 JS - see CHANGES
112 *
113 * 29-Dec-1998 AdH - Grammar and function extensions.
114 * grammar: TOOLBAR resources, Named ICONs in
115 * DIALOGS
116 * functions: semantic actions for the grammar
117 * changes, resource files can now be anywhere
118 * on the include path instead of just in the
119 * current directory
120 *
121 * 20-Jun-1998 BS - Fixed a bug in load_file() where the name was not
122 * printed out correctly.
123 *
124 * 17-Jun-1998 BS - Fixed a bug in CLASS statement parsing which should
125 * also accept a tSTRING as argument.
126 *
127 * 25-May-1998 BS - Found out that I need to support language, version
128 * and characteristics in inline resources (bitmap,
129 * cursor, etc) but they can also be specified with
130 * a filename. This renders my filename-scanning scheme
131 * worthless. Need to build newline parsing to solve
132 * this one.
133 * It will come with version 1.1.0 (sigh).
134 *
135 * 19-May-1998 BS - Started to build a builtin preprocessor
136 *
137 * 30-Apr-1998 BS - Redid the stringtable parsing/handling. My previous
138 * ideas had some serious flaws.
139 *
140 * 27-Apr-1998 BS - Removed a lot of dead comments and put it in a doc
141 * file.
142 *
143 * 21-Apr-1998 BS - Added correct behavior for cursors and icons.
144 * - This file is growing too big. It is time to strip
145 * things and put it in a support file.
146 *
147 * 19-Apr-1998 BS - Tagged the stringtable resource so that only one
148 * resource will be created. This because the table
149 * has a different layout than other resources. The
150 * table has to be sorted, and divided into smaller
151 * resource entries (see comment in source).
152 *
153 * 17-Apr-1998 BS - Almost all strings, including identifiers, are parsed
154 * as string_t which include unicode strings upon
155 * input.
156 * - Parser now emits a warning when compiling win32
157 * extensions in win16 mode.
158 *
159 * 16-Apr-1998 BS - Raw data elements are now *optionally* seperated
160 * by commas. Read the comments in file sq2dq.l.
161 * - FIXME: there are instances in the source that rely
162 * on the fact that int==32bit and pointers are int size.
163 * - Fixed the conflict in menuex by changing a rule
164 * back into right recursion. See note in source.
165 * - UserType resources cannot have an expression as its
166 * typeclass. See note in source.
167 *
168 * 15-Apr-1998 BS - Changed all right recursion into left recursion to
169 * get reduction of the parsestack.
170 * This also helps communication between bison and flex.
171 * Main advantage is that the Empty rule gets reduced
172 * first, which is used to allocate/link things.
173 * It also added a shift/reduce conflict in the menuex
174 * handling, due to expression/option possibility,
175 * although not serious.
176 *
177 * 14-Apr-1998 BS - Redone almost the entire parser. We're not talking
178 * about making it more efficient, but readable (for me)
179 * and slightly easier to expand/change.
180 * This is done primarily by using more reduce states
181 * with many (intuitive) types for the various resource
182 * statements.
183 * - Added expression handling for all resources where a
184 * number is accepted (not only for win32). Also added
185 * multiply and division (not MS compatible, but handy).
186 * Unary minus introduced a shift/reduce conflict, but
187 * it is not serious.
188 *
189 * 13-Apr-1998 BS - Reordered a lot of things
190 * - Made the source more readable
191 * - Added Win32 resource definitions
192 * - Corrected syntax problems with an old yacc (;)
193 * - Added extra comment about grammar
194 */
195#include "config.h"
196
197#include <stdio.h>
198#include <stdlib.h>
199#include <stdarg.h>
200#include <assert.h>
201#include <ctype.h>
202#include <string.h>
203#ifdef HAVE_ALLOCA_H
204#include <alloca.h>
205#endif
206
207#include "wrc.h"
208#include "utils.h"
209#include "newstruc.h"
210#include "dumpres.h"
211#include "preproc.h"
212#include "parser.h"
213#include "windef.h"
214#include "wingdi.h"
215#include "winuser.h"
216
217#ifdef __BORLANDC__
218#pragma warn -sig
219#endif
220
221int indialog = 0; /* Signal flex that we're parsing a dialog */
222int want_rscname = 0; /* Set when a resource's name is required */
223stringtable_t *tagstt; /* Stringtable tag.
224 * It is set while parsing a stringtable to one of
225 * the stringtables in the sttres list or a new one
226 * if the language was not parsed before.
227 */
228stringtable_t *sttres; /* Stringtable resources. This holds the list of
229 * stringtables with different lanuages
230 */
231/* Set to the current options of the currently scanning stringtable */
232static int *tagstt_memopt;
233static characts_t *tagstt_characts;
234static version_t *tagstt_version;
235
236/* Prototypes of here defined functions */
237void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur);
238void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico);
239int alloc_cursor_id(language_t *);
240int alloc_icon_id(language_t *);
241void ins_stt_entry(stt_entry_t *ste);
242int check_stt_entry(stringtable_t *tabs, stt_entry_t *ste);
243event_t *get_event_head(event_t *p);
244control_t *get_control_head(control_t *p);
245ver_value_t *get_ver_value_head(ver_value_t *p);
246ver_block_t *get_ver_block_head(ver_block_t *p);
247resource_t *get_resource_head(resource_t *p);
248menuex_item_t *get_itemex_head(menuex_item_t *p);
249menu_item_t *get_item_head(menu_item_t *p);
250raw_data_t *merge_raw_data_str(raw_data_t *r1, string_t *str);
251raw_data_t *merge_raw_data_int(raw_data_t *r1, int i);
252raw_data_t *merge_raw_data_long(raw_data_t *r1, int i);
253raw_data_t *merge_raw_data(raw_data_t *r1, raw_data_t *r2);
254raw_data_t *str2raw_data(string_t *str);
255raw_data_t *int2raw_data(int i);
256raw_data_t *long2raw_data(int i);
257raw_data_t *load_file(string_t *name);
258itemex_opt_t *new_itemex_opt(int id, int type, int state, int helpid);
259event_t *add_string_event(string_t *key, int id, int flags, event_t *prev);
260event_t *add_event(int key, int id, int flags, event_t *prev);
261dialogex_t *dialogex_version(version_t *v, dialogex_t *dlg);
262dialogex_t *dialogex_characteristics(characts_t *c, dialogex_t *dlg);
263dialogex_t *dialogex_language(language_t *l, dialogex_t *dlg);
264dialogex_t *dialogex_menu(name_id_t *m, dialogex_t *dlg);
265dialogex_t *dialogex_class(name_id_t *n, dialogex_t *dlg);
266dialogex_t *dialogex_font(font_id_t *f, dialogex_t *dlg);
267dialogex_t *dialogex_caption(string_t *s, dialogex_t *dlg);
268dialogex_t *dialogex_exstyle(style_t *st, dialogex_t *dlg);
269dialogex_t *dialogex_style(style_t *st, dialogex_t *dlg);
270name_id_t *convert_ctlclass(name_id_t *cls);
271control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control_t *prev);
272dialog_t *dialog_version(version_t *v, dialog_t *dlg);
273dialog_t *dialog_characteristics(characts_t *c, dialog_t *dlg);
274dialog_t *dialog_language(language_t *l, dialog_t *dlg);
275dialog_t *dialog_menu(name_id_t *m, dialog_t *dlg);
276dialog_t *dialog_class(name_id_t *n, dialog_t *dlg);
277dialog_t *dialog_font(font_id_t *f, dialog_t *dlg);
278dialog_t *dialog_caption(string_t *s, dialog_t *dlg);
279dialog_t *dialog_exstyle(style_t * st, dialog_t *dlg);
280dialog_t *dialog_style(style_t * st, dialog_t *dlg);
281resource_t *build_stt_resources(stringtable_t *stthead);
282stringtable_t *find_stringtable(lvc_t *lvc);
283toolbar_item_t *ins_tlbr_button(toolbar_item_t *prev, toolbar_item_t *idrec);
284toolbar_item_t *get_tlbr_buttons_head(toolbar_item_t *p, int *nitems);
285
286
287#line 183 "parser.y"
288typedef union{
289 string_t *str;
290 int num;
291 int *iptr;
292 resource_t *res;
293 accelerator_t *acc;
294 bitmap_t *bmp;
295 cursor_t *cur;
296 cursor_group_t *curg;
297 dialog_t *dlg;
298 dialogex_t *dlgex;
299 font_t *fnt;
300 icon_t *ico;
301 icon_group_t *icog;
302 menu_t *men;
303 menuex_t *menex;
304 rcdata_t *rdt;
305 stringtable_t *stt;
306 stt_entry_t *stte;
307 user_t *usr;
308 messagetable_t *msg;
309 versioninfo_t *veri;
310 control_t *ctl;
311 name_id_t *nid;
312 font_id_t *fntid;
313 language_t *lan;
314 version_t *ver;
315 characts_t *chars;
316 event_t *event;
317 menu_item_t *menitm;
318 menuex_item_t *menexitm;
319 itemex_opt_t *exopt;
320 raw_data_t *raw;
321 lvc_t *lvc;
322 ver_value_t *val;
323 ver_block_t *blk;
324 ver_words_t *verw;
325 toolbar_t *tlbar;
326 toolbar_item_t *tlbarItems;
327 dlginit_t *dginit;
328 style_pair_t *styles;
329 style_t *style;
330} YYSTYPE;
331#ifndef YYDEBUG
332#define YYDEBUG 1
333#endif
334
335#include <stdio.h>
336
337#ifndef __cplusplus
338#ifndef __STDC__
339#define const
340#endif
341#endif
342
343
344
345#define YYFINAL 604
346#define YYFLAG -32768
347#define YYNTBASE 112
348
349#define YYTRANSLATE(x) ((unsigned)(x) <= 352 ? yytranslate[x] : 191)
350
351static const char yytranslate[] = { 0,
352 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
353 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
354 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
355 2, 2, 107, 2, 2, 2, 2, 95, 2, 109,
356 110, 104, 102, 111, 103, 2, 105, 2, 2, 2,
357 2, 2, 2, 2, 2, 2, 2, 2, 2, 98,
358 2, 100, 2, 2, 2, 2, 2, 2, 2, 2,
359 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
360 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
361 2, 2, 2, 94, 2, 2, 2, 2, 2, 2,
362 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
363 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
364 2, 2, 2, 93, 2, 106, 2, 2, 2, 2,
365 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
366 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
367 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
368 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
369 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
374 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
375 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
377 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
378 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
379 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
380 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
381 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
382 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
383 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
384 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
385 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
386 86, 87, 88, 89, 90, 91, 92, 96, 97, 99,
387 101, 108
388};
389
390#if YYDEBUG != 0
391static const short yyprhs[] = { 0,
392 0, 2, 3, 6, 9, 12, 16, 20, 24, 28,
393 31, 34, 36, 40, 44, 48, 52, 56, 60, 64,
394 68, 72, 76, 80, 83, 86, 89, 92, 96, 98,
395 100, 103, 108, 110, 112, 115, 118, 121, 124, 126,
396 128, 130, 132, 134, 136, 138, 140, 142, 144, 146,
397 148, 150, 152, 154, 156, 158, 160, 162, 164, 166,
398 170, 174, 178, 182, 186, 190, 194, 197, 202, 207,
399 211, 215, 217, 219, 226, 227, 233, 239, 240, 244,
400 248, 252, 256, 260, 264, 278, 279, 283, 287, 291,
401 294, 298, 302, 305, 308, 311, 312, 316, 320, 324,
402 328, 332, 336, 340, 344, 348, 352, 356, 360, 364,
403 368, 372, 376, 380, 391, 404, 415, 416, 421, 428,
404 437, 455, 471, 476, 477, 480, 481, 484, 489, 493,
405 497, 499, 502, 504, 506, 521, 522, 526, 530, 534,
406 537, 540, 544, 548, 551, 554, 557, 558, 562, 566,
407 570, 574, 578, 582, 586, 590, 594, 598, 602, 606,
408 610, 614, 618, 622, 626, 637, 657, 674, 688, 700,
409 701, 703, 704, 707, 717, 718, 721, 726, 730, 731,
410 738, 742, 748, 749, 753, 757, 761, 765, 769, 773,
411 778, 782, 783, 788, 792, 798, 799, 802, 808, 815,
412 816, 819, 824, 831, 840, 845, 849, 850, 855, 856,
413 858, 864, 865, 875, 885, 889, 893, 897, 901, 905,
414 906, 909, 915, 916, 919, 921, 926, 931, 933, 937,
415 947, 948, 952, 955, 956, 959, 962, 964, 966, 968,
416 970, 972, 974, 976, 977, 980, 983, 986, 991, 994,
417 997, 1001, 1003, 1005, 1007, 1009, 1013, 1017, 1021, 1025,
418 1026, 1028, 1030, 1034, 1038, 1042, 1046, 1050, 1054, 1057,
419 1060, 1064, 1066, 1069, 1071
420};
421
422static const short yyrhs[] = { 113,
423 0, 0, 113, 118, 0, 113, 114, 0, 113, 117,
424 0, 3, 115, 10, 0, 4, 16, 10, 0, 5,
425 16, 10, 0, 7, 115, 10, 0, 6, 10, 0,
426 8, 10, 0, 116, 0, 115, 91, 115, 0, 115,
427 92, 115, 0, 115, 102, 115, 0, 115, 103, 115,
428 0, 115, 94, 115, 0, 115, 96, 115, 0, 115,
429 97, 115, 0, 115, 98, 115, 0, 115, 100, 115,
430 0, 115, 99, 115, 0, 115, 101, 115, 0, 106,
431 115, 0, 102, 115, 0, 103, 115, 0, 107, 115,
432 0, 109, 115, 110, 0, 190, 0, 16, 0, 9,
433 16, 0, 9, 109, 16, 110, 0, 11, 0, 12,
434 0, 16, 16, 0, 16, 109, 0, 16, 104, 0,
435 119, 121, 0, 165, 0, 182, 0, 188, 0, 16,
436 0, 119, 0, 15, 0, 131, 0, 122, 0, 123,
437 0, 134, 0, 146, 0, 128, 0, 124, 0, 125,
438 0, 156, 0, 160, 0, 126, 0, 127, 0, 176,
439 0, 129, 0, 169, 0, 20, 178, 17, 0, 20,
440 178, 185, 0, 21, 178, 17, 0, 21, 178, 185,
441 0, 30, 178, 17, 0, 31, 178, 17, 0, 31,
442 178, 185, 0, 26, 17, 0, 27, 178, 181, 185,
443 0, 90, 178, 181, 185, 0, 130, 178, 17, 0,
444 130, 178, 185, 0, 13, 0, 15, 0, 19, 178,
445 181, 88, 132, 89, 0, 0, 132, 15, 111, 188,
446 133, 0, 132, 188, 111, 188, 133, 0, 0, 133,
447 111, 58, 0, 133, 111, 51, 0, 133, 111, 44,
448 0, 133, 111, 52, 0, 133, 111, 53, 0, 133,
449 111, 54, 0, 22, 178, 188, 111, 188, 111, 188,
450 111, 188, 135, 88, 136, 89, 0, 0, 135, 70,
451 144, 0, 135, 69, 144, 0, 135, 67, 15, 0,
452 135, 141, 0, 135, 66, 120, 0, 135, 24, 119,
453 0, 135, 182, 0, 135, 183, 0, 135, 184, 0,
454 0, 136, 44, 140, 0, 136, 45, 138, 0, 136,
455 42, 138, 0, 136, 41, 138, 0, 136, 43, 138,
456 0, 136, 35, 137, 0, 136, 36, 137, 0, 136,
457 40, 137, 0, 136, 37, 137, 0, 136, 38, 137,
458 0, 136, 32, 137, 0, 136, 39, 137, 0, 136,
459 33, 137, 0, 136, 34, 137, 0, 136, 48, 137,
460 0, 136, 47, 137, 0, 136, 46, 137, 0, 136,
461 31, 120, 168, 188, 111, 188, 111, 188, 139, 0,
462 15, 168, 188, 111, 188, 111, 188, 111, 188, 111,
463 188, 142, 0, 188, 111, 188, 111, 188, 111, 188,
464 111, 188, 142, 0, 0, 111, 188, 111, 188, 0,
465 111, 188, 111, 188, 111, 144, 0, 111, 188, 111,
466 188, 111, 144, 111, 144, 0, 120, 168, 188, 111,
467 145, 111, 144, 111, 188, 111, 188, 111, 188, 111,
468 188, 111, 144, 0, 120, 168, 188, 111, 145, 111,
469 144, 111, 188, 111, 188, 111, 188, 111, 188, 0,
470 30, 188, 111, 15, 0, 0, 111, 144, 0, 0,
471 111, 144, 0, 111, 144, 111, 144, 0, 144, 93,
472 144, 0, 109, 144, 110, 0, 190, 0, 108, 190,
473 0, 188, 0, 15, 0, 23, 178, 188, 111, 188,
474 111, 188, 111, 188, 153, 147, 88, 148, 89, 0,
475 0, 147, 70, 144, 0, 147, 69, 144, 0, 147,
476 67, 15, 0, 147, 141, 0, 147, 154, 0, 147,
477 66, 120, 0, 147, 24, 119, 0, 147, 182, 0,
478 147, 183, 0, 147, 184, 0, 0, 148, 44, 149,
479 0, 148, 45, 151, 0, 148, 42, 151, 0, 148,
480 41, 151, 0, 148, 43, 151, 0, 148, 35, 150,
481 0, 148, 36, 150, 0, 148, 40, 150, 0, 148,
482 37, 150, 0, 148, 38, 150, 0, 148, 32, 150,
483 0, 148, 39, 150, 0, 148, 33, 150, 0, 148,
484 34, 150, 0, 148, 48, 150, 0, 148, 47, 150,
485 0, 148, 46, 150, 0, 148, 31, 120, 168, 188,
486 111, 188, 111, 188, 139, 0, 120, 168, 188, 111,
487 145, 111, 144, 111, 188, 111, 188, 111, 188, 111,
488 188, 111, 144, 153, 152, 0, 120, 168, 188, 111,
489 145, 111, 144, 111, 188, 111, 188, 111, 188, 111,
490 188, 152, 0, 15, 168, 188, 111, 188, 111, 188,
491 111, 188, 111, 188, 143, 152, 0, 188, 111, 188,
492 111, 188, 111, 188, 111, 188, 143, 152, 0, 0,
493 185, 0, 0, 111, 188, 0, 30, 188, 111, 15,
494 111, 188, 111, 188, 155, 0, 0, 111, 188, 0,
495 24, 178, 181, 157, 0, 88, 158, 89, 0, 0,
496 158, 82, 15, 168, 188, 159, 0, 158, 82, 84,
497 0, 158, 83, 15, 159, 157, 0, 0, 111, 56,
498 159, 0, 111, 55, 159, 0, 111, 85, 159, 0,
499 111, 57, 159, 0, 111, 80, 159, 0, 111, 81,
500 159, 0, 25, 178, 181, 161, 0, 88, 162, 89,
501 0, 0, 162, 82, 15, 163, 0, 162, 82, 84,
502 0, 162, 83, 15, 164, 161, 0, 0, 111, 188,
503 0, 111, 187, 111, 187, 159, 0, 111, 187, 111,
504 187, 111, 188, 0, 0, 111, 188, 0, 111, 187,
505 111, 188, 0, 111, 187, 111, 187, 111, 188, 0,
506 111, 187, 111, 187, 111, 187, 111, 188, 0, 166,
507 88, 167, 89, 0, 29, 178, 181, 0, 0, 167,
508 188, 168, 15, 0, 0, 111, 0, 28, 170, 88,
509 171, 89, 0, 0, 170, 73, 188, 111, 188, 111,
510 188, 111, 188, 0, 170, 74, 188, 111, 188, 111,
511 188, 111, 188, 0, 170, 78, 188, 0, 170, 75,
512 188, 0, 170, 76, 188, 0, 170, 77, 188, 0,
513 170, 79, 188, 0, 0, 171, 172, 0, 49, 15,
514 88, 173, 89, 0, 0, 173, 174, 0, 172, 0,
515 50, 15, 111, 15, 0, 50, 15, 111, 175, 0,
516 188, 0, 175, 111, 188, 0, 86, 178, 188, 111,
517 188, 181, 88, 177, 89, 0, 0, 177, 87, 188,
518 0, 177, 84, 0, 0, 178, 179, 0, 178, 180,
519 0, 63, 0, 65, 0, 61, 0, 59, 0, 62,
520 0, 64, 0, 60, 0, 0, 181, 182, 0, 181,
521 183, 0, 181, 184, 0, 72, 188, 111, 188, 0,
522 68, 188, 0, 71, 188, 0, 88, 186, 89, 0,
523 18, 0, 13, 0, 14, 0, 15, 0, 186, 168,
524 18, 0, 186, 168, 13, 0, 186, 168, 14, 0,
525 186, 168, 15, 0, 0, 188, 0, 189, 0, 189,
526 102, 189, 0, 189, 103, 189, 0, 189, 93, 189,
527 0, 189, 95, 189, 0, 189, 104, 189, 0, 189,
528 105, 189, 0, 106, 189, 0, 103, 189, 0, 109,
529 189, 110, 0, 190, 0, 108, 190, 0, 13, 0,
530 14, 0
531};
532
533#endif
534
535#if YYDEBUG != 0
536static const short yyrline[] = { 0,
537 310, 330, 331, 356, 357, 362, 363, 364, 365, 366,
538 367, 370, 371, 372, 373, 374, 375, 376, 377, 378,
539 379, 380, 381, 382, 383, 384, 385, 386, 390, 391,
540 392, 393, 397, 398, 399, 400, 401, 406, 421, 429,
541 442, 450, 461, 462, 472, 473, 474, 488, 489, 495,
542 496, 497, 511, 512, 518, 519, 520, 521, 522, 526,
543 527, 531, 532, 537, 541, 542, 550, 558, 571, 584,
544 585, 604, 616, 626, 650, 651, 652, 655, 656, 657,
545 658, 659, 660, 661, 666, 701, 702, 703, 704, 705,
546 706, 707, 708, 709, 710, 713, 714, 715, 716, 717,
547 718, 719, 720, 721, 722, 724, 725, 726, 727, 728,
548 729, 730, 731, 733, 743, 762, 777, 780, 785, 792,
549 803, 817, 832, 837, 838, 842, 843, 844, 848, 849,
550 850, 851, 855, 860, 868, 913, 914, 915, 916, 917,
551 918, 919, 920, 921, 922, 923, 926, 927, 928, 929,
552 930, 931, 932, 933, 934, 935, 937, 938, 939, 940,
553 941, 942, 943, 944, 946, 956, 981, 997, 1025, 1048,
554 1049, 1052, 1053, 1057, 1064, 1065, 1069, 1092, 1096, 1097,
555 1106, 1112, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1141,
556 1166, 1170, 1171, 1187, 1193, 1213, 1214, 1218, 1226, 1237,
557 1238, 1242, 1248, 1256, 1276, 1317, 1328, 1329, 1361, 1362,
558 1367, 1374, 1375, 1385, 1395, 1402, 1409, 1416, 1423, 1433,
559 1434, 1443, 1451, 1452, 1461, 1466, 1472, 1481, 1482, 1486,
560 1512, 1513, 1518, 1527, 1528, 1538, 1553, 1554, 1555, 1556,
561 1559, 1560, 1561, 1565, 1566, 1574, 1582, 1593, 1597, 1601,
562 1605, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1623,
563 1624, 1626, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636,
564 1638, 1639, 1640, 1643, 1644
565};
566#endif
567
568
569#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
570
571static const char * const yytname[] = { "$","error","$undefined.","tIF","tIFDEF",
572"tIFNDEF","tELSE","tELIF","tENDIF","tDEFINED","tNL","tTYPEDEF","tEXTERN","NUMBER",
573"LNUMBER","tSTRING","IDENT","FILENAME","RAWDATA","ACCELERATORS","tBITMAP","CURSOR",
574"DIALOG","DIALOGEX","MENU","MENUEX","MESSAGETABLE","RCDATA","VERSIONINFO","STRINGTABLE",
575"FONT","ICON","AUTO3STATE","AUTOCHECKBOX","AUTORADIOBUTTON","CHECKBOX","DEFPUSHBUTTON",
576"PUSHBUTTON","RADIOBUTTON","STATE3","GROUPBOX","COMBOBOX","LISTBOX","SCROLLBAR",
577"CONTROL","EDITTEXT","RTEXT","CTEXT","LTEXT","BLOCK","VALUE","SHIFT","ALT","ASCII",
578"VIRTKEY","GRAYED","CHECKED","INACTIVE","NOINVERT","tPURE","IMPURE","DISCARDABLE",
579"LOADONCALL","PRELOAD","tFIXED","MOVEABLE","CLASS","CAPTION","CHARACTERISTICS",
580"EXSTYLE","STYLE","VERSION","LANGUAGE","FILEVERSION","PRODUCTVERSION","FILEFLAGSMASK",
581"FILEOS","FILETYPE","FILEFLAGS","FILESUBTYPE","MENUBARBREAK","MENUBREAK","MENUITEM",
582"POPUP","SEPARATOR","HELP","TOOLBAR","BUTTON","tBEGIN","tEND","DLGINIT","LOGOR",
583"LOGAND","'|'","'^'","'&'","EQ","NE","'<'","LTE","'>'","GTE","'+'","'-'","'*'",
584"'/'","'~'","'!'","NOT","'('","')'","','","resource_file","resources","preprocessor",
585"pp_expr","pp_constant","cjunk","resource","nameid","nameid_s","resource_definition",
586"bitmap","cursor","font","icon","messagetable","rcdata","dlginit","userres",
587"usertype","accelerators","events","acc_opt","dialog","dlg_attributes","ctrls",
588"lab_ctrl","ctrl_desc","iconinfo","gen_ctrl","opt_font","optional_style","optional_style_pair",
589"style","ctlclass","dialogex","dlgex_attribs","exctrls","gen_exctrl","lab_exctrl",
590"exctrl_desc","opt_data","helpid","opt_exfont","opt_expr","menu","menu_body",
591"item_definitions","item_options","menuex","menuex_body","itemex_definitions",
592"itemex_options","itemex_p_options","stringtable","stt_head","strings","opt_comma",
593"versioninfo","fix_version","ver_blocks","ver_block","ver_values","ver_value",
594"ver_words","toolbar","toolbar_items","loadmemopts","lamo","lama","opt_lvc",
595"opt_language","opt_characts","opt_version","raw_data","raw_elements","e_expr",
596"expr","xpr","any_num", NULL
597};
598#endif
599
600static const short yyr1[] = { 0,
601 112, 113, 113, 113, 113, 114, 114, 114, 114, 114,
602 114, 115, 115, 115, 115, 115, 115, 115, 115, 115,
603 115, 115, 115, 115, 115, 115, 115, 115, 116, 116,
604 116, 116, 117, 117, 117, 117, 117, 118, 118, 118,
605 119, 119, 120, 120, 121, 121, 121, 121, 121, 121,
606 121, 121, 121, 121, 121, 121, 121, 121, 121, 122,
607 122, 123, 123, 124, 125, 125, 126, 127, 128, 129,
608 129, 130, 130, 131, 132, 132, 132, 133, 133, 133,
609 133, 133, 133, 133, 134, 135, 135, 135, 135, 135,
610 135, 135, 135, 135, 135, 136, 136, 136, 136, 136,
611 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
612 136, 136, 136, 136, 137, 138, 139, 139, 139, 139,
613 140, 140, 141, 142, 142, 143, 143, 143, 144, 144,
614 144, 144, 145, 145, 146, 147, 147, 147, 147, 147,
615 147, 147, 147, 147, 147, 147, 148, 148, 148, 148,
616 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
617 148, 148, 148, 148, 148, 149, 149, 150, 151, 152,
618 152, 153, 153, 154, 155, 155, 156, 157, 158, 158,
619 158, 158, 159, 159, 159, 159, 159, 159, 159, 160,
620 161, 162, 162, 162, 162, 163, 163, 163, 163, 164,
621 164, 164, 164, 164, 165, 166, 167, 167, 168, 168,
622 169, 170, 170, 170, 170, 170, 170, 170, 170, 171,
623 171, 172, 173, 173, 174, 174, 174, 175, 175, 176,
624 177, 177, 177, 178, 178, 178, 179, 179, 179, 179,
625 180, 180, 180, 181, 181, 181, 181, 182, 183, 184,
626 185, 186, 186, 186, 186, 186, 186, 186, 186, 187,
627 187, 188, 189, 189, 189, 189, 189, 189, 189, 189,
628 189, 189, 189, 190, 190
629};
630
631static const short yyr2[] = { 0,
632 1, 0, 2, 2, 2, 3, 3, 3, 3, 2,
633 2, 1, 3, 3, 3, 3, 3, 3, 3, 3,
634 3, 3, 3, 2, 2, 2, 2, 3, 1, 1,
635 2, 4, 1, 1, 2, 2, 2, 2, 1, 1,
636 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
637 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
638 3, 3, 3, 3, 3, 3, 2, 4, 4, 3,
639 3, 1, 1, 6, 0, 5, 5, 0, 3, 3,
640 3, 3, 3, 3, 13, 0, 3, 3, 3, 2,
641 3, 3, 2, 2, 2, 0, 3, 3, 3, 3,
642 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
643 3, 3, 3, 10, 12, 10, 0, 4, 6, 8,
644 17, 15, 4, 0, 2, 0, 2, 4, 3, 3,
645 1, 2, 1, 1, 14, 0, 3, 3, 3, 2,
646 2, 3, 3, 2, 2, 2, 0, 3, 3, 3,
647 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
648 3, 3, 3, 3, 10, 19, 16, 13, 11, 0,
649 1, 0, 2, 9, 0, 2, 4, 3, 0, 6,
650 3, 5, 0, 3, 3, 3, 3, 3, 3, 4,
651 3, 0, 4, 3, 5, 0, 2, 5, 6, 0,
652 2, 4, 6, 8, 4, 3, 0, 4, 0, 1,
653 5, 0, 9, 9, 3, 3, 3, 3, 3, 0,
654 2, 5, 0, 2, 1, 4, 4, 1, 3, 9,
655 0, 3, 2, 0, 2, 2, 1, 1, 1, 1,
656 1, 1, 1, 0, 2, 2, 2, 4, 2, 2,
657 3, 1, 1, 1, 1, 3, 3, 3, 3, 0,
658 1, 1, 3, 3, 3, 3, 3, 3, 2, 2,
659 3, 1, 2, 1, 1
660};
661
662static const short yydefact[] = { 2,
663 1, 0, 0, 0, 0, 0, 0, 33, 34, 274,
664 275, 42, 234, 0, 0, 0, 0, 0, 4, 5,
665 3, 0, 39, 0, 40, 41, 262, 272, 0, 30,
666 0, 0, 0, 0, 0, 0, 12, 29, 0, 0,
667 10, 0, 11, 35, 37, 36, 244, 0, 270, 269,
668 273, 0, 72, 73, 234, 234, 234, 234, 234, 234,
669 234, 0, 234, 212, 234, 234, 234, 234, 38, 46,
670 47, 51, 52, 55, 56, 50, 58, 234, 45, 48,
671 49, 53, 54, 59, 57, 207, 0, 0, 0, 0,
672 0, 0, 31, 0, 25, 26, 24, 27, 0, 6,
673 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
674 0, 7, 8, 9, 240, 243, 239, 241, 237, 242,
675 238, 235, 236, 206, 0, 271, 244, 0, 0, 0,
676 0, 244, 244, 67, 244, 0, 0, 0, 0, 244,
677 0, 0, 265, 266, 263, 264, 267, 268, 0, 28,
678 13, 14, 17, 18, 19, 20, 22, 21, 23, 15,
679 16, 0, 0, 245, 246, 247, 248, 0, 60, 0,
680 61, 62, 63, 0, 0, 0, 0, 0, 0, 0,
681 0, 0, 0, 0, 0, 220, 64, 65, 66, 0,
682 0, 70, 71, 205, 209, 32, 249, 250, 75, 253,
683 254, 255, 252, 209, 0, 0, 179, 177, 192, 190,
684 68, 0, 0, 216, 217, 218, 215, 219, 0, 0,
685 69, 210, 0, 0, 251, 0, 0, 0, 0, 0,
686 0, 0, 0, 211, 221, 244, 208, 0, 74, 0,
687 257, 258, 259, 256, 0, 0, 0, 0, 178, 0,
688 0, 191, 0, 0, 0, 0, 0, 0, 0, 0,
689 209, 181, 183, 196, 194, 200, 0, 0, 223, 231,
690 78, 78, 0, 0, 0, 0, 0, 260, 193, 260,
691 0, 0, 0, 0, 0, 76, 77, 86, 172, 183,
692 183, 183, 183, 183, 183, 183, 182, 0, 197, 0,
693 201, 195, 0, 0, 0, 222, 225, 224, 233, 0,
694 230, 0, 0, 0, 136, 180, 185, 184, 187, 188,
695 189, 186, 260, 260, 213, 214, 0, 232, 81, 80,
696 82, 83, 84, 79, 0, 0, 0, 0, 0, 0,
697 96, 90, 93, 94, 95, 173, 0, 183, 261, 0,
698 202, 0, 42, 92, 0, 44, 43, 91, 89, 0,
699 0, 88, 131, 87, 0, 0, 0, 0, 0, 0,
700 0, 147, 140, 141, 144, 145, 146, 0, 198, 260,
701 226, 227, 228, 0, 132, 0, 0, 0, 0, 0,
702 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
703 0, 0, 0, 0, 0, 85, 143, 0, 142, 139,
704 138, 137, 0, 199, 0, 203, 0, 123, 130, 129,
705 209, 209, 107, 109, 110, 102, 103, 105, 106, 108,
706 104, 100, 0, 99, 101, 209, 97, 98, 113, 112,
707 111, 0, 0, 0, 0, 0, 0, 0, 0, 0,
708 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
709 135, 0, 229, 0, 0, 0, 0, 123, 209, 209,
710 158, 160, 161, 153, 154, 156, 157, 159, 155, 151,
711 0, 150, 152, 209, 148, 149, 164, 163, 162, 204,
712 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
713 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
714 0, 134, 0, 133, 0, 0, 0, 0, 0, 0,
715 0, 0, 0, 175, 0, 0, 0, 0, 117, 0,
716 0, 0, 0, 174, 0, 0, 0, 0, 0, 114,
717 0, 0, 0, 176, 117, 0, 0, 0, 0, 0,
718 124, 0, 165, 0, 0, 0, 0, 0, 0, 116,
719 0, 0, 126, 0, 118, 124, 125, 0, 0, 0,
720 170, 0, 0, 115, 0, 126, 127, 169, 171, 0,
721 119, 0, 170, 0, 0, 0, 0, 168, 128, 0,
722 120, 122, 0, 0, 170, 121, 0, 167, 172, 170,
723 166, 0, 0, 0
724};
725
726static const short yydefgoto[] = { 602,
727 1, 19, 36, 37, 20, 21, 357, 358, 69, 70,
728 71, 72, 73, 74, 75, 76, 77, 78, 79, 224,
729 286, 80, 313, 365, 423, 432, 540, 437, 342, 560,
730 571, 362, 513, 81, 347, 413, 485, 471, 480, 578,
731 315, 374, 534, 82, 208, 229, 277, 83, 210, 230,
732 279, 281, 23, 24, 142, 223, 84, 136, 219, 235,
733 284, 308, 382, 85, 285, 47, 122, 123, 124, 164,
734 165, 166, 579, 204, 298, 26, 27, 28
735};
736
737static const short yypact[] = {-32768,
738 39, 10, -4, 0, -1, 10, 15,-32768,-32768,-32768,
739-32768, -15,-32768, 197, 197, 197, 82, 197,-32768,-32768,
740-32768, 442,-32768, -68,-32768,-32768, 390,-32768, 6,-32768,
741 10, 10, 10, 10, 10, 298,-32768,-32768, 31, 56,
742-32768, 351,-32768,-32768,-32768,-32768, 611, -41, 50,-32768,
743-32768, 483,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
744-32768, 55,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
745-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
746-32768,-32768,-32768,-32768,-32768,-32768, 197, 197, 197, 197,
747 197, 197,-32768, 58,-32768,-32768,-32768,-32768, 449,-32768,
748 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
749 10,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
750-32768,-32768,-32768, 349, 197,-32768, 611, 345, 417, 110,
751 110, 611, 611,-32768, 611, 558, 19, 439, 110, 611,
752 454, 114, 517, 125, 50, 50,-32768,-32768, -25,-32768,
753 690, 700, 556, 706, 706, 85, 85, 85, 85,-32768,
754-32768, 197, 197,-32768,-32768,-32768,-32768, 153,-32768, 401,
755-32768,-32768,-32768, -14, 7, 195, 255, 262, 197, 197,
756 197, 197, 197, 197, 197,-32768,-32768,-32768,-32768, 53,
757 262,-32768,-32768,-32768, 78,-32768,-32768,-32768,-32768,-32768,
758-32768,-32768,-32768, -13, 197, 197,-32768,-32768,-32768,-32768,
759-32768, 88, 123,-32768,-32768,-32768,-32768,-32768, -22, 197,
760-32768,-32768, 135, 73,-32768, 516, 132, 148, 74, 95,
761 197, 197, 178,-32768,-32768,-32768,-32768, 154,-32768, 157,
762-32768,-32768,-32768,-32768, 197, 197, -9, 254,-32768, -7,
763 257,-32768, 173, 184, 22, 276, 197, 197, 214, 220,
764 78,-32768, 224, 230,-32768, 234, 197, 197,-32768,-32768,
765-32768,-32768, 197, 197, 197, 111, 209, 197,-32768, 197,
766 258, 240, 245, 76, 268, 252, 252,-32768, 267, 224,
767 224, 224, 224, 224, 224, 224,-32768, 269, 273, 280,
768 273,-32768, 197, 197, 297,-32768,-32768,-32768,-32768, 197,
769-32768, 723, 530, 197,-32768,-32768,-32768,-32768,-32768,-32768,
770-32768,-32768, 197, 197,-32768,-32768, 282,-32768,-32768,-32768,
771-32768,-32768,-32768,-32768, 193, 197, 77, 364, 35, 35,
772-32768,-32768,-32768,-32768,-32768,-32768, 618, 291,-32768, 292,
773 273, 43,-32768,-32768, 302,-32768,-32768,-32768,-32768, 82,
774 35, 294,-32768, 294, 676, 193, 197, 77, 420, 35,
775 35,-32768,-32768,-32768,-32768,-32768,-32768, 201,-32768, 197,
776-32768, 328,-32768, 425,-32768, 48, 35, 77, 426, 426,
777 426, 426, 426, 426, 426, 426, 426, 197, 197, 197,
778 77, 197, 426, 426, 426,-32768,-32768, 335,-32768,-32768,
779 294, 294, 694,-32768, 347, 273, 197,-32768,-32768,-32768,
780 78, 78,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
781-32768,-32768, 348,-32768,-32768, 78,-32768,-32768,-32768,-32768,
782-32768, 459, 77, 469, 469, 469, 469, 469, 469, 469,
783 469, 469, 197, 197, 197, 77, 197, 469, 469, 469,
784-32768, 197,-32768, 197, 197, 197, 197, 376, 78, 78,
785-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
786 378,-32768,-32768, 78,-32768,-32768,-32768,-32768,-32768,-32768,
787 379, 380, 385, 386, 197, 197, 197, 197, 197, 197,
788 197, 197, 146, 398, 400, 409, 411, 412, 413, 415,
789 422,-32768, 424,-32768, 197, 197, 197, 197, 146, 197,
790 197, 197, 35, 427, 428, 433, 444, 445, 447, 453,
791 455, 101, 197,-32768, 197, 197, 197, 35, 197,-32768,
792 197, 197, 197,-32768, 447, 456, 458, 149, 466, 468,
793 470, 472,-32768, 197, 197, 197, 197, 197, 35,-32768,
794 197, 478, 479, 480, 502, 470, 294, 503, 197, 35,
795 465, 197, 35,-32768, 197, 479, 151,-32768,-32768, 504,
796 218, 505, 465, 35, 197, 35, 197,-32768, 294, 506,
797 294, 527, 197, 35, -71, 294, 35,-32768, 231, 465,
798-32768, 512, 537,-32768
799};
800
801static const short yypgoto[] = {-32768,
802-32768,-32768, 28,-32768,-32768,-32768, 1, -248,-32768,-32768,
803-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
804 308,-32768,-32768,-32768, 33, -202, 49,-32768, 293, 94,
805 63, -333, 142,-32768,-32768,-32768,-32768, 312, -84, -223,
806 68,-32768,-32768,-32768, 391,-32768, 26,-32768, 397,-32768,
807-32768,-32768,-32768,-32768,-32768, -190,-32768,-32768,-32768, 395,
808-32768,-32768,-32768,-32768,-32768, 688,-32768,-32768, -122, 2,
809 -278, -274, 107,-32768, -259, 108, 186, -2
810};
811
812
813#define YYLAST 809
814
815
816static const short yytable[] = { 38,
817 44, 22, 25, 38, 168, 261, 364, 264, 41, 176,
818 177, 39, 178, 226, 51, 40, 170, 191, 29, 86,
819 300, 93, 10, 11, 43, 30, 233, 386, 38, 38,
820 38, 38, 38, 42, 344, 187, 411, 412, 345, 597,
821 112, 2, 3, 4, 5, 6, 7, 10, 11, 8,
822 9, 10, 11, 420, 12, 10, 11, 381, 95, 96,
823 97, 98, 99, 348, 350, 113, 234, 13, 376, 125,
824 275, 134, 377, 149, 262, 225, 265, 115, 116, 117,
825 118, 119, 120, 121, 196, 10, 11, 238, 45, 10,
826 11, 356, 353, 46, 10, 11, 205, 222, 38, 38,
827 38, 38, 38, 38, 38, 38, 38, 38, 38, 269,
828 14, 31, 32, 256, 94, 33, 34, 206, 35, 409,
829 415, 48, 10, 11, 233, 305, 10, 11, 151, 152,
830 153, 154, 155, 156, 157, 158, 159, 160, 161, 421,
831 387, 15, 360, 361, 16, 15, 17, 18, 16, 237,
832 17, 18, 436, 91, 92, 247, 248, 419, 10, 11,
833 512, 239, 249, 220, 306, 291, 292, 293, 115, 116,
834 117, 118, 119, 120, 121, 15, 250, 251, 16, 15,
835 17, 18, 16, 252, 17, 18, 110, 111, 222, 532,
836 294, 295, 255, 387, 469, 296, 434, 435, 231, 438,
837 49, 50, 194, 52, 548, 10, 11, 484, 353, 10,
838 11, 543, 15, 10, 11, 16, 15, 17, 18, 16,
839 162, 17, 18, 163, 14, 567, 89, 90, 91, 92,
840 464, 465, 167, 232, 171, 173, 577, 174, 175, 581,
841 199, 387, 245, 387, 189, 467, 190, 193, 15, 195,
842 589, 16, 591, 17, 18, 291, 292, 293, 246, 556,
843 596, 584, 162, 599, 257, 163, 14, 258, 263, 197,
844 198, 266, 143, 144, 145, 146, 147, 148, 496, 497,
845 294, 295, 207, 267, 211, 296, 212, 213, 214, 215,
846 216, 217, 218, 499, 268, 15, 207, 221, 16, 15,
847 17, 18, 16, 15, 17, 18, 16, 100, 17, 18,
848 387, 327, 227, 228, 343, 316, 317, 318, 319, 320,
849 321, 322, 162, 387, 273, 163, 14, 236, 586, 162,
850 274, 240, 163, 14, 276, 354, 363, 363, 253, 254,
851 278, 314, 209, 162, 280, 209, 163, 14, 375, 170,
852 303, 309, 259, 260, 310, 304, 311, 385, 363, 588,
853 114, 169, 312, 270, 271, 272, 407, 363, 363, 482,
854 483, 598, 486, 379, 282, 283, 601, 314, 359, 323,
855 288, 289, 290, -261, 363, 299, 387, 301, 101, 102,
856 324, 103, 352, 104, 105, 106, 107, 108, 109, 110,
857 111, 378, 380, 115, 116, 117, 118, 119, 120, 121,
858 325, 326, 384, 200, 201, 202, 162, 328, 203, 163,
859 14, 346, 424, 425, 426, 427, 428, 429, 430, 431,
860 349, 351, 170, 172, 410, 439, 440, 441, 417, 418,
861 422, 101, 102, 355, 103, 442, 104, 105, 106, 107,
862 108, 109, 110, 111, 53, 188, 54, 462, 466, 383,
863 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
864 192, 65, 66, 468, 408, 115, 116, 117, 118, 119,
865 120, 121, 87, 470, 88, 414, 495, 416, 498, 500,
866 501, 89, 90, 91, 92, 502, 503, 115, 116, 117,
867 118, 119, 120, 121, 170, 433, 433, 433, 515, 433,
868 516, 603, 115, 116, 117, 118, 119, 120, 121, 517,
869 363, 518, 519, 520, 463, 521, 170, 67, 241, 242,
870 243, 68, 522, 244, 523, 363, 604, 533, 535, 101,
871 102, 170, 103, 536, 104, 105, 106, 107, 108, 109,
872 110, 111, 170, 335, 537, 538, 363, 539, 150, 336,
873 481, 481, 481, 541, 481, 542, 554, 363, 555, 490,
874 363, 491, 492, 493, 494, 87, 557, 88, 558, 287,
875 559, 363, 561, 363, 89, 90, 91, 92, 569, 570,
876 572, 363, 126, 553, 363, 337, 338, 162, 339, 340,
877 163, 14, 504, 505, 506, 507, 508, 509, 510, 511,
878 514, 88, 573, 575, 585, 587, 593, 341, 89, 90,
879 91, 92, 524, 525, 526, 527, 514, 529, 530, 531,
880 179, 180, 181, 182, 183, 184, 185, 594, 583, 373,
881 544, 366, 545, 546, 547, 186, 549, 367, 550, 551,
882 552, 104, 105, 106, 107, 108, 109, 110, 111, 574,
883 528, 562, 563, 564, 565, 566, 600, 297, 568, 115,
884 116, 117, 118, 119, 120, 121, 576, 302, 307, 580,
885 0, 0, 582, 368, 369, 162, 370, 371, 163, 14,
886 0, 0, 590, 0, 592, 0, 0, 0, 0, 0,
887 595, 0, 0, 0, 0, 372, 388, 389, 390, 391,
888 392, 393, 394, 395, 396, 397, 398, 399, 400, 401,
889 402, 403, 404, 405, 443, 444, 445, 446, 447, 448,
890 449, 450, 451, 452, 453, 454, 455, 456, 457, 458,
891 459, 460, 127, 128, 129, 130, 131, 132, 133, 0,
892 135, 0, 137, 138, 139, 140, 472, 473, 474, 475,
893 476, 477, 478, 479, 406, 141, 329, 0, 0, 487,
894 488, 489, 0, 330, 331, 332, 333, 0, 0, 0,
895 334, 102, 461, 103, 0, 104, 105, 106, 107, 108,
896 109, 110, 111, 103, 0, 104, 105, 106, 107, 108,
897 109, 110, 111, 106, 107, 108, 109, 110, 111
898};
899
900static const short yycheck[] = { 2,
901 16, 1, 1, 6, 127, 15, 340, 15, 10, 132,
902 133, 16, 135, 204, 17, 16, 88, 140, 9, 88,
903 280, 16, 13, 14, 10, 16, 49, 361, 31, 32,
904 33, 34, 35, 6, 313, 17, 370, 371, 313, 111,
905 10, 3, 4, 5, 6, 7, 8, 13, 14, 11,
906 12, 13, 14, 387, 16, 13, 14, 15, 31, 32,
907 33, 34, 35, 323, 324, 10, 89, 29, 347, 111,
908 261, 17, 347, 16, 84, 89, 84, 59, 60, 61,
909 62, 63, 64, 65, 110, 13, 14, 15, 104, 13,
910 14, 15, 16, 109, 13, 14, 111, 111, 101, 102,
911 103, 104, 105, 106, 107, 108, 109, 110, 111, 88,
912 72, 102, 103, 236, 109, 106, 107, 111, 109, 368,
913 380, 14, 13, 14, 49, 50, 13, 14, 101, 102,
914 103, 104, 105, 106, 107, 108, 109, 110, 111, 388,
915 93, 103, 108, 109, 106, 103, 108, 109, 106, 15,
916 108, 109, 401, 104, 105, 82, 83, 110, 13, 14,
917 15, 89, 89, 111, 89, 55, 56, 57, 59, 60,
918 61, 62, 63, 64, 65, 103, 82, 83, 106, 103,
919 108, 109, 106, 89, 108, 109, 102, 103, 111, 523,
920 80, 81, 15, 93, 443, 85, 399, 400, 111, 402,
921 15, 16, 89, 18, 538, 13, 14, 456, 16, 13,
922 14, 111, 103, 13, 14, 106, 103, 108, 109, 106,
923 68, 108, 109, 71, 72, 559, 102, 103, 104, 105,
924 421, 422, 125, 111, 128, 129, 570, 130, 131, 573,
925 88, 93, 111, 93, 138, 436, 139, 141, 103, 142,
926 584, 106, 586, 108, 109, 55, 56, 57, 111, 111,
927 594, 111, 68, 597, 111, 71, 72, 111, 15, 162,
928 163, 15, 87, 88, 89, 90, 91, 92, 469, 470,
929 80, 81, 88, 111, 178, 85, 179, 180, 181, 182,
930 183, 184, 185, 484, 111, 103, 88, 191, 106, 103,
931 108, 109, 106, 103, 108, 109, 106, 10, 108, 109,
932 93, 15, 205, 206, 313, 290, 291, 292, 293, 294,
933 295, 296, 68, 93, 111, 71, 72, 220, 111, 68,
934 111, 224, 71, 72, 111, 335, 339, 340, 231, 232,
935 111, 111, 88, 68, 111, 88, 71, 72, 347, 88,
936 111, 84, 245, 246, 87, 111, 89, 360, 361, 583,
937 10, 17, 111, 88, 257, 258, 366, 370, 371, 454,
938 455, 595, 457, 348, 267, 268, 600, 111, 15, 111,
939 273, 274, 275, 111, 387, 278, 93, 280, 91, 92,
940 111, 94, 111, 96, 97, 98, 99, 100, 101, 102,
941 103, 111, 111, 59, 60, 61, 62, 63, 64, 65,
942 303, 304, 111, 13, 14, 15, 68, 310, 18, 71,
943 72, 314, 390, 391, 392, 393, 394, 395, 396, 397,
944 323, 324, 88, 17, 15, 403, 404, 405, 111, 15,
945 15, 91, 92, 336, 94, 111, 96, 97, 98, 99,
946 100, 101, 102, 103, 13, 17, 15, 111, 111, 352,
947 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
948 17, 30, 31, 15, 367, 59, 60, 61, 62, 63,
949 64, 65, 93, 15, 95, 378, 111, 380, 111, 111,
950 111, 102, 103, 104, 105, 111, 111, 59, 60, 61,
951 62, 63, 64, 65, 88, 398, 399, 400, 111, 402,
952 111, 0, 59, 60, 61, 62, 63, 64, 65, 111,
953 523, 111, 111, 111, 417, 111, 88, 86, 13, 14,
954 15, 90, 111, 18, 111, 538, 0, 111, 111, 91,
955 92, 88, 94, 111, 96, 97, 98, 99, 100, 101,
956 102, 103, 88, 24, 111, 111, 559, 111, 110, 30,
957 453, 454, 455, 111, 457, 111, 111, 570, 111, 462,
958 573, 464, 465, 466, 467, 93, 111, 95, 111, 272,
959 111, 584, 111, 586, 102, 103, 104, 105, 111, 111,
960 111, 594, 110, 545, 597, 66, 67, 68, 69, 70,
961 71, 72, 495, 496, 497, 498, 499, 500, 501, 502,
962 503, 95, 111, 111, 111, 111, 111, 88, 102, 103,
963 104, 105, 515, 516, 517, 518, 519, 520, 521, 522,
964 73, 74, 75, 76, 77, 78, 79, 111, 576, 347,
965 533, 24, 535, 536, 537, 88, 539, 30, 541, 542,
966 543, 96, 97, 98, 99, 100, 101, 102, 103, 566,
967 519, 554, 555, 556, 557, 558, 599, 277, 561, 59,
968 60, 61, 62, 63, 64, 65, 569, 281, 284, 572,
969 -1, -1, 575, 66, 67, 68, 69, 70, 71, 72,
970 -1, -1, 585, -1, 587, -1, -1, -1, -1, -1,
971 593, -1, -1, -1, -1, 88, 31, 32, 33, 34,
972 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
973 45, 46, 47, 48, 31, 32, 33, 34, 35, 36,
974 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
975 47, 48, 55, 56, 57, 58, 59, 60, 61, -1,
976 63, -1, 65, 66, 67, 68, 445, 446, 447, 448,
977 449, 450, 451, 452, 89, 78, 44, -1, -1, 458,
978 459, 460, -1, 51, 52, 53, 54, -1, -1, -1,
979 58, 92, 89, 94, -1, 96, 97, 98, 99, 100,
980 101, 102, 103, 94, -1, 96, 97, 98, 99, 100,
981 101, 102, 103, 98, 99, 100, 101, 102, 103
982};
983/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
984#line 3 "bison.simple"
985
986/* Skeleton output parser for bison,
987 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
988
989 This program is free software; you can redistribute it and/or modify
990 it under the terms of the GNU General Public License as published by
991 the Free Software Foundation; either version 2, or (at your option)
992 any later version.
993
994 This program is distributed in the hope that it will be useful,
995 but WITHOUT ANY WARRANTY; without even the implied warranty of
996 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
997 GNU General Public License for more details.
998
999 You should have received a copy of the GNU General Public License
1000 along with this program; if not, write to the Free Software
1001 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
1002
1003/* As a special exception, when this file is copied by Bison into a
1004 Bison output file, you may use that output file without restriction.
1005 This special exception was added by the Free Software Foundation
1006 in version 1.24 of Bison. */
1007
1008#ifndef alloca
1009#ifdef __GNUC__
1010#define alloca __builtin_alloca
1011#else /* not GNU C. */
1012#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
1013#include <alloca.h>
1014#else /* not sparc */
1015#if defined (MSDOS) && !defined (__TURBOC__)
1016#include <malloc.h>
1017#else /* not MSDOS, or __TURBOC__ */
1018#if defined(_AIX)
1019#include <malloc.h>
1020 #pragma alloca
1021#else /* not MSDOS, __TURBOC__, or _AIX */
1022#ifdef __hpux
1023#ifdef __cplusplus
1024extern "C" {
1025void *alloca (unsigned int);
1026};
1027#else /* not __cplusplus */
1028void *alloca ();
1029#endif /* not __cplusplus */
1030#endif /* __hpux */
1031#endif /* not _AIX */
1032#endif /* not MSDOS, or __TURBOC__ */
1033#endif /* not sparc. */
1034#endif /* not GNU C. */
1035#endif /* alloca not defined. */
1036
1037/* This is the parser code that is written into each bison parser
1038 when the %semantic_parser declaration is not specified in the grammar.
1039 It was written by Richard Stallman by simplifying the hairy parser
1040 used when %semantic_parser is specified. */
1041
1042/* Note: there must be only one dollar sign in this file.
1043 It is replaced by the list of actions, each action
1044 as one case of the switch. */
1045
1046#define yyerrok (yyerrstatus = 0)
1047#define yyclearin (yychar = YYEMPTY)
1048#define YYEMPTY -2
1049#define YYEOF 0
1050#define YYACCEPT return(0)
1051#define YYABORT return(1)
1052#define YYERROR goto yyerrlab1
1053/* Like YYERROR except do call yyerror.
1054 This remains here temporarily to ease the
1055 transition to the new meaning of YYERROR, for GCC.
1056 Once GCC version 2 has supplanted version 1, this can go. */
1057#define YYFAIL goto yyerrlab
1058#define YYRECOVERING() (!!yyerrstatus)
1059#define YYBACKUP(token, value) \
1060do \
1061 if (yychar == YYEMPTY && yylen == 1) \
1062 { yychar = (token), yylval = (value); \
1063 yychar1 = YYTRANSLATE (yychar); \
1064 YYPOPSTACK; \
1065 goto yybackup; \
1066 } \
1067 else \
1068 { yyerror ("syntax error: cannot back up"); YYERROR; } \
1069while (0)
1070
1071#define YYTERROR 1
1072#define YYERRCODE 256
1073
1074#ifndef YYPURE
1075#define YYLEX yylex()
1076#endif
1077
1078#ifdef YYPURE
1079#ifdef YYLSP_NEEDED
1080#ifdef YYLEX_PARAM
1081#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
1082#else
1083#define YYLEX yylex(&yylval, &yylloc)
1084#endif
1085#else /* not YYLSP_NEEDED */
1086#ifdef YYLEX_PARAM
1087#define YYLEX yylex(&yylval, YYLEX_PARAM)
1088#else
1089#define YYLEX yylex(&yylval)
1090#endif
1091#endif /* not YYLSP_NEEDED */
1092#endif
1093
1094/* If nonreentrant, generate the variables here */
1095
1096#ifndef YYPURE
1097
1098int yychar; /* the lookahead symbol */
1099YYSTYPE yylval; /* the semantic value of the */
1100 /* lookahead symbol */
1101
1102#ifdef YYLSP_NEEDED
1103YYLTYPE yylloc; /* location data for the lookahead */
1104 /* symbol */
1105#endif
1106
1107int yynerrs; /* number of parse errors so far */
1108#endif /* not YYPURE */
1109
1110#if YYDEBUG != 0
1111int yydebug; /* nonzero means print parse trace */
1112/* Since this is uninitialized, it does not stop multiple parsers
1113 from coexisting. */
1114#endif
1115
1116/* YYINITDEPTH indicates the initial size of the parser's stacks */
1117
1118#ifndef YYINITDEPTH
1119#define YYINITDEPTH 200
1120#endif
1121
1122/* YYMAXDEPTH is the maximum size the stacks can grow to
1123 (effective only if the built-in stack extension method is used). */
1124
1125#if YYMAXDEPTH == 0
1126#undef YYMAXDEPTH
1127#endif
1128
1129#ifndef YYMAXDEPTH
1130#define YYMAXDEPTH 10000
1131#endif
1132
1133/* Prevent warning if -Wstrict-prototypes. */
1134#ifdef __GNUC__
1135int yyparse (void);
1136#endif
1137
1138
1139#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1140#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1141#else /* not GNU C or C++ */
1142#ifndef __cplusplus
1143
1144/* This is the most reliable way to avoid incompatibilities
1145 in available built-in functions on various systems. */
1146static void
1147__yy_memcpy (to, from, count)
1148 char *to;
1149 char *from;
1150 int count;
1151{
1152 register char *f = from;
1153 register char *t = to;
1154 register int i = count;
1155
1156 while (i-- > 0)
1157 *t++ = *f++;
1158}
1159
1160#else /* __cplusplus */
1161
1162/* This is the most reliable way to avoid incompatibilities
1163 in available built-in functions on various systems. */
1164static void
1165__yy_memcpy (char *to, char *from, int count)
1166{
1167 register char *f = from;
1168 register char *t = to;
1169 register int i = count;
1170
1171 while (i-- > 0)
1172 *t++ = *f++;
1173}
1174
1175#endif
1176#endif
1177
1178
1179#line 196 "bison.simple"
1180
1181/* The user can define YYPARSE_PARAM as the name of an argument to be passed
1182 into yyparse. The argument should have type void *.
1183 It should actually point to an object.
1184 Grammar actions can access the variable by casting it
1185 to the proper pointer type. */
1186
1187#ifdef YYPARSE_PARAM
1188#ifdef __cplusplus
1189#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1190#define YYPARSE_PARAM_DECL
1191#else /* not __cplusplus */
1192#define YYPARSE_PARAM_ARG YYPARSE_PARAM
1193#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1194#endif /* not __cplusplus */
1195#else /* not YYPARSE_PARAM */
1196#define YYPARSE_PARAM_ARG
1197#define YYPARSE_PARAM_DECL
1198#endif /* not YYPARSE_PARAM */
1199
1200int
1201yyparse(YYPARSE_PARAM_ARG)
1202 YYPARSE_PARAM_DECL
1203{
1204 register int yystate;
1205 register int yyn;
1206 register short *yyssp;
1207 register YYSTYPE *yyvsp;
1208 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1209 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1210
1211 short yyssa[YYINITDEPTH]; /* the state stack */
1212 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1213
1214 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1215 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1216
1217#ifdef YYLSP_NEEDED
1218 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1219 YYLTYPE *yyls = yylsa;
1220 YYLTYPE *yylsp;
1221
1222#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1223#else
1224#define YYPOPSTACK (yyvsp--, yyssp--)
1225#endif
1226
1227 int yystacksize = YYINITDEPTH;
1228
1229#ifdef YYPURE
1230 int yychar;
1231 YYSTYPE yylval;
1232 int yynerrs;
1233#ifdef YYLSP_NEEDED
1234 YYLTYPE yylloc;
1235#endif
1236#endif
1237
1238 YYSTYPE yyval; /* the variable used to return */
1239 /* semantic values from the action */
1240 /* routines */
1241
1242 int yylen;
1243
1244#if YYDEBUG != 0
1245 if (yydebug)
1246 fprintf(stderr, "Starting parse\n");
1247#endif
1248
1249 yystate = 0;
1250 yyerrstatus = 0;
1251 yynerrs = 0;
1252 yychar = YYEMPTY; /* Cause a token to be read. */
1253
1254 /* Initialize stack pointers.
1255 Waste one element of value and location stack
1256 so that they stay on the same level as the state stack.
1257 The wasted elements are never initialized. */
1258
1259 yyssp = yyss - 1;
1260 yyvsp = yyvs;
1261#ifdef YYLSP_NEEDED
1262 yylsp = yyls;
1263#endif
1264
1265/* Push a new state, which is found in yystate . */
1266/* In all cases, when you get here, the value and location stacks
1267 have just been pushed. so pushing a state here evens the stacks. */
1268yynewstate:
1269
1270 *++yyssp = yystate;
1271
1272 if (yyssp >= yyss + yystacksize - 1)
1273 {
1274 /* Give user a chance to reallocate the stack */
1275 /* Use copies of these so that the &'s don't force the real ones into memory. */
1276 YYSTYPE *yyvs1 = yyvs;
1277 short *yyss1 = yyss;
1278#ifdef YYLSP_NEEDED
1279 YYLTYPE *yyls1 = yyls;
1280#endif
1281
1282 /* Get the current used size of the three stacks, in elements. */
1283 int size = yyssp - yyss + 1;
1284
1285#ifdef yyoverflow
1286 /* Each stack pointer address is followed by the size of
1287 the data in use in that stack, in bytes. */
1288#ifdef YYLSP_NEEDED
1289 /* This used to be a conditional around just the two extra args,
1290 but that might be undefined if yyoverflow is a macro. */
1291 yyoverflow("parser stack overflow",
1292 &yyss1, size * sizeof (*yyssp),
1293 &yyvs1, size * sizeof (*yyvsp),
1294 &yyls1, size * sizeof (*yylsp),
1295 &yystacksize);
1296#else
1297 yyoverflow("parser stack overflow",
1298 &yyss1, size * sizeof (*yyssp),
1299 &yyvs1, size * sizeof (*yyvsp),
1300 &yystacksize);
1301#endif
1302
1303 yyss = yyss1; yyvs = yyvs1;
1304#ifdef YYLSP_NEEDED
1305 yyls = yyls1;
1306#endif
1307#else /* no yyoverflow */
1308 /* Extend the stack our own way. */
1309 if (yystacksize >= YYMAXDEPTH)
1310 {
1311 yyerror("parser stack overflow");
1312 return 2;
1313 }
1314 yystacksize *= 2;
1315 if (yystacksize > YYMAXDEPTH)
1316 yystacksize = YYMAXDEPTH;
1317 yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
1318 __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
1319 yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
1320 __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
1321#ifdef YYLSP_NEEDED
1322 yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
1323 __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
1324#endif
1325#endif /* no yyoverflow */
1326
1327 yyssp = yyss + size - 1;
1328 yyvsp = yyvs + size - 1;
1329#ifdef YYLSP_NEEDED
1330 yylsp = yyls + size - 1;
1331#endif
1332
1333#if YYDEBUG != 0
1334 if (yydebug)
1335 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1336#endif
1337
1338 if (yyssp >= yyss + yystacksize - 1)
1339 YYABORT;
1340 }
1341
1342#if YYDEBUG != 0
1343 if (yydebug)
1344 fprintf(stderr, "Entering state %d\n", yystate);
1345#endif
1346
1347 goto yybackup;
1348 yybackup:
1349
1350/* Do appropriate processing given the current state. */
1351/* Read a lookahead token if we need one and don't already have one. */
1352/* yyresume: */
1353
1354 /* First try to decide what to do without reference to lookahead token. */
1355
1356 yyn = yypact[yystate];
1357 if (yyn == YYFLAG)
1358 goto yydefault;
1359
1360 /* Not known => get a lookahead token if don't already have one. */
1361
1362 /* yychar is either YYEMPTY or YYEOF
1363 or a valid token in external form. */
1364
1365 if (yychar == YYEMPTY)
1366 {
1367#if YYDEBUG != 0
1368 if (yydebug)
1369 fprintf(stderr, "Reading a token: ");
1370#endif
1371 yychar = YYLEX;
1372 }
1373
1374 /* Convert token to internal form (in yychar1) for indexing tables with */
1375
1376 if (yychar <= 0) /* This means end of input. */
1377 {
1378 yychar1 = 0;
1379 yychar = YYEOF; /* Don't call YYLEX any more */
1380
1381#if YYDEBUG != 0
1382 if (yydebug)
1383 fprintf(stderr, "Now at end of input.\n");
1384#endif
1385 }
1386 else
1387 {
1388 yychar1 = YYTRANSLATE(yychar);
1389
1390#if YYDEBUG != 0
1391 if (yydebug)
1392 {
1393 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1394 /* Give the individual parser a way to print the precise meaning
1395 of a token, for further debugging info. */
1396#ifdef YYPRINT
1397 YYPRINT (stderr, yychar, yylval);
1398#endif
1399 fprintf (stderr, ")\n");
1400 }
1401#endif
1402 }
1403
1404 yyn += yychar1;
1405 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1406 goto yydefault;
1407
1408 yyn = yytable[yyn];
1409
1410 /* yyn is what to do for this token type in this state.
1411 Negative => reduce, -yyn is rule number.
1412 Positive => shift, yyn is new state.
1413 New state is final state => don't bother to shift,
1414 just return success.
1415 0, or most negative number => error. */
1416
1417 if (yyn < 0)
1418 {
1419 if (yyn == YYFLAG)
1420 goto yyerrlab;
1421 yyn = -yyn;
1422 goto yyreduce;
1423 }
1424 else if (yyn == 0)
1425 goto yyerrlab;
1426
1427 if (yyn == YYFINAL)
1428 YYACCEPT;
1429
1430 /* Shift the lookahead token. */
1431
1432#if YYDEBUG != 0
1433 if (yydebug)
1434 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1435#endif
1436
1437 /* Discard the token being shifted unless it is eof. */
1438 if (yychar != YYEOF)
1439 yychar = YYEMPTY;
1440
1441 *++yyvsp = yylval;
1442#ifdef YYLSP_NEEDED
1443 *++yylsp = yylloc;
1444#endif
1445
1446 /* count tokens shifted since error; after three, turn off error status. */
1447 if (yyerrstatus) yyerrstatus--;
1448
1449 yystate = yyn;
1450 goto yynewstate;
1451
1452/* Do the default action for the current state. */
1453yydefault:
1454
1455 yyn = yydefact[yystate];
1456 if (yyn == 0)
1457 goto yyerrlab;
1458
1459/* Do a reduction. yyn is the number of a rule to reduce with. */
1460yyreduce:
1461 yylen = yyr2[yyn];
1462 if (yylen > 0)
1463 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1464
1465#if YYDEBUG != 0
1466 if (yydebug)
1467 {
1468 int i;
1469
1470 fprintf (stderr, "Reducing via rule %d (line %d), ",
1471 yyn, yyrline[yyn]);
1472
1473 /* Print the symbols being reduced, and their result. */
1474 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1475 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1476 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1477 }
1478#endif
1479
1480
1481 switch (yyn) {
1482
1483case 1:
1484#line 310 "parser.y"
1485{
1486 resource_t *rsc;
1487 /* First add stringtables to the resource-list */
1488 rsc = build_stt_resources(sttres);
1489 /* 'build_stt_resources' returns a head and $1 is a tail */
1490 if(yyvsp[0].res)
1491 {
1492 yyvsp[0].res->next = rsc;
1493 if(rsc)
1494 rsc->prev = yyvsp[0].res;
1495 }
1496 else
1497 yyvsp[0].res = rsc;
1498 /* Final statement before were done */
1499 resource_top = get_resource_head(yyvsp[0].res);
1500 ;
1501 break;}
1502case 2:
1503#line 330 "parser.y"
1504{ yyval.res = NULL; want_rscname = 1; ;
1505 break;}
1506case 3:
1507#line 331 "parser.y"
1508{
1509 if(yyvsp[0].res)
1510 {
1511 resource_t *tail = yyvsp[0].res;
1512 resource_t *head = yyvsp[0].res;
1513 while(tail->next)
1514 tail = tail->next;
1515 while(head->prev)
1516 head = head->prev;
1517 head->prev = yyvsp[-1].res;
1518 if(yyvsp[-1].res)
1519 yyvsp[-1].res->next = head;
1520 yyval.res = tail;
1521 }
1522 else if(yyvsp[-1].res)
1523 {
1524 resource_t *tail = yyvsp[-1].res;
1525 while(tail->next)
1526 tail = tail->next;
1527 yyval.res = tail;
1528 }
1529 else
1530 yyval.res = NULL;
1531 want_rscname = 1;
1532 ;
1533 break;}
1534case 4:
1535#line 356 "parser.y"
1536{ yyval.res = yyvsp[-1].res; want_rscname = 1; ;
1537 break;}
1538case 5:
1539#line 357 "parser.y"
1540{ yyval.res = yyvsp[-1].res; want_rscname = 1; ;
1541 break;}
1542case 6:
1543#line 362 "parser.y"
1544{ pop_start(); push_if(yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, 0, 0); if(yyvsp[-1].iptr) free(yyvsp[-1].iptr);;
1545 break;}
1546case 7:
1547#line 363 "parser.y"
1548{ pop_start(); push_if(pp_lookup(yyvsp[-1].str->str.cstr) != NULL, 0, 0); ;
1549 break;}
1550case 8:
1551#line 364 "parser.y"
1552{ pop_start(); push_if(pp_lookup(yyvsp[-1].str->str.cstr) == NULL, 0, 0); ;
1553 break;}
1554case 9:
1555#line 365 "parser.y"
1556{ pop_start(); push_if(yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, pop_if(), 0); if(yyvsp[-1].iptr) free(yyvsp[-1].iptr); ;
1557 break;}
1558case 10:
1559#line 366 "parser.y"
1560{ pop_start(); push_if(1, pop_if(), 0); ;
1561 break;}
1562case 11:
1563#line 367 "parser.y"
1564{ pop_if(); ;
1565 break;}
1566case 12:
1567#line 370 "parser.y"
1568{ yyval.iptr = yyvsp[0].iptr; ;
1569 break;}
1570case 13:
1571#line 371 "parser.y"
1572{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr || *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1573 break;}
1574case 14:
1575#line 372 "parser.y"
1576{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr && *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1577 break;}
1578case 15:
1579#line 373 "parser.y"
1580{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr + *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1581 break;}
1582case 16:
1583#line 374 "parser.y"
1584{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr - *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1585 break;}
1586case 17:
1587#line 375 "parser.y"
1588{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr ^ *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1589 break;}
1590case 18:
1591#line 376 "parser.y"
1592{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr == *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1593 break;}
1594case 19:
1595#line 377 "parser.y"
1596{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr != *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1597 break;}
1598case 20:
1599#line 378 "parser.y"
1600{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr < *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1601 break;}
1602case 21:
1603#line 379 "parser.y"
1604{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr > *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1605 break;}
1606case 22:
1607#line 380 "parser.y"
1608{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr <= *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1609 break;}
1610case 23:
1611#line 381 "parser.y"
1612{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr >= *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1613 break;}
1614case 24:
1615#line 382 "parser.y"
1616{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = ~(*yyvsp[0].iptr); ;
1617 break;}
1618case 25:
1619#line 383 "parser.y"
1620{ yyval.iptr = yyvsp[0].iptr; ;
1621 break;}
1622case 26:
1623#line 384 "parser.y"
1624{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = -(*yyvsp[0].iptr); ;
1625 break;}
1626case 27:
1627#line 385 "parser.y"
1628{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = !(*yyvsp[0].iptr); ;
1629 break;}
1630case 28:
1631#line 386 "parser.y"
1632{ yyval.iptr = yyvsp[-1].iptr; ;
1633 break;}
1634case 29:
1635#line 390 "parser.y"
1636{ yyval.iptr = new_int(yyvsp[0].num); ;
1637 break;}
1638case 30:
1639#line 391 "parser.y"
1640{ yyval.iptr = NULL; ;
1641 break;}
1642case 31:
1643#line 392 "parser.y"
1644{ yyval.iptr = new_int(pp_lookup(yyvsp[0].str->str.cstr) != NULL); ;
1645 break;}
1646case 32:
1647#line 393 "parser.y"
1648{ yyval.iptr = new_int(pp_lookup(yyvsp[-1].str->str.cstr) != NULL); ;
1649 break;}
1650case 33:
1651#line 397 "parser.y"
1652{ strip_til_semicolon(); ;
1653 break;}
1654case 34:
1655#line 398 "parser.y"
1656{ strip_extern(); ;
1657 break;}
1658case 35:
1659#line 399 "parser.y"
1660{ strip_til_semicolon(); ;
1661 break;}
1662case 36:
1663#line 400 "parser.y"
1664{ strip_til_parenthesis(); ;
1665 break;}
1666case 37:
1667#line 401 "parser.y"
1668{ strip_til_semicolon(); ;
1669 break;}
1670case 38:
1671#line 406 "parser.y"
1672{
1673 yyval.res = yyvsp[0].res;
1674 if(yyval.res)
1675 {
1676 yyval.res->name = yyvsp[-1].nid;
1677 if(yyvsp[-1].nid->type == name_ord)
1678 {
1679 chat("Got %s (%d)",get_typename(yyvsp[0].res),yyvsp[-1].nid->name.i_name);
1680 }
1681 else if(yyvsp[-1].nid->type == name_str)
1682 {
1683 chat("Got %s (%s)",get_typename(yyvsp[0].res),yyvsp[-1].nid->name.s_name->str.cstr);
1684 }
1685 }
1686 ;
1687 break;}
1688case 39:
1689#line 421 "parser.y"
1690{
1691 /* Don't do anything, stringtables are converted to
1692 * resource_t structures when we are finished parsing and
1693 * the final rule of the parser is reduced (see above)
1694 */
1695 yyval.res = NULL;
1696 chat("Got STRINGTABLE");
1697 ;
1698 break;}
1699case 40:
1700#line 429 "parser.y"
1701{
1702 if(!win32)
1703 yywarning("LANGUAGE not supported in 16-bit mode");
1704 if(currentlanguage)
1705 free(currentlanguage);
1706 currentlanguage = yyvsp[0].lan;
1707 yyval.res = NULL;
1708 ;
1709 break;}
1710case 41:
1711#line 442 "parser.y"
1712{
1713 if(yyvsp[0].num > 65535 || yyvsp[0].num < -32768)
1714 yyerror("Resource's ID out of range (%d)", yyvsp[0].num);
1715 yyval.nid = new_name_id();
1716 yyval.nid->type = name_ord;
1717 yyval.nid->name.i_name = yyvsp[0].num;
1718 want_rscname = 0;
1719 ;
1720 break;}
1721case 42:
1722#line 450 "parser.y"
1723{
1724 yyval.nid = new_name_id();
1725 yyval.nid->type = name_str;
1726 yyval.nid->name.s_name = yyvsp[0].str;
1727 want_rscname = 0;
1728 ;
1729 break;}
1730case 43:
1731#line 461 "parser.y"
1732{ yyval.nid = yyvsp[0].nid; ;
1733 break;}
1734case 44:
1735#line 462 "parser.y"
1736{
1737 yyval.nid = new_name_id();
1738 yyval.nid->type = name_str;
1739 yyval.nid->name.s_name = yyvsp[0].str;
1740 want_rscname = 0;
1741 ;
1742 break;}
1743case 45:
1744#line 472 "parser.y"
1745{ yyval.res = new_resource(res_acc, yyvsp[0].acc, yyvsp[0].acc->memopt, yyvsp[0].acc->lvc.language); ;
1746 break;}
1747case 46:
1748#line 473 "parser.y"
1749{ yyval.res = new_resource(res_bmp, yyvsp[0].bmp, yyvsp[0].bmp->memopt, dup_language(currentlanguage)); ;
1750 break;}
1751case 47:
1752#line 474 "parser.y"
1753{
1754 resource_t *rsc;
1755 cursor_t *cur;
1756 yyval.res = rsc = new_resource(res_curg, yyvsp[0].curg, yyvsp[0].curg->memopt, dup_language(currentlanguage));
1757 for(cur = yyvsp[0].curg->cursorlist; cur; cur = cur->next)
1758 {
1759 rsc->prev = new_resource(res_cur, cur, yyvsp[0].curg->memopt, dup_language(currentlanguage));
1760 rsc->prev->next = rsc;
1761 rsc = rsc->prev;
1762 rsc->name = new_name_id();
1763 rsc->name->type = name_ord;
1764 rsc->name->name.i_name = cur->id;
1765 }
1766 ;
1767 break;}
1768case 48:
1769#line 488 "parser.y"
1770{ yyval.res = new_resource(res_dlg, yyvsp[0].dlg, yyvsp[0].dlg->memopt, yyvsp[0].dlg->lvc.language); ;
1771 break;}
1772case 49:
1773#line 489 "parser.y"
1774{
1775 if(win32)
1776 yyval.res = new_resource(res_dlgex, yyvsp[0].dlgex, yyvsp[0].dlgex->memopt, yyvsp[0].dlgex->lvc.language);
1777 else
1778 yyval.res = NULL;
1779 ;
1780 break;}
1781case 50:
1782#line 495 "parser.y"
1783{ yyval.res = new_resource(res_dlginit, yyvsp[0].dginit, yyvsp[0].dginit->memopt, yyvsp[0].dginit->lvc.language); ;
1784 break;}
1785case 51:
1786#line 496 "parser.y"
1787{ yyval.res = new_resource(res_fnt, yyvsp[0].fnt, yyvsp[0].fnt->memopt, dup_language(currentlanguage)); ;
1788 break;}
1789case 52:
1790#line 497 "parser.y"
1791{
1792 resource_t *rsc;
1793 icon_t *ico;
1794 yyval.res = rsc = new_resource(res_icog, yyvsp[0].icog, yyvsp[0].icog->memopt, dup_language(currentlanguage));
1795 for(ico = yyvsp[0].icog->iconlist; ico; ico = ico->next)
1796 {
1797 rsc->prev = new_resource(res_ico, ico, yyvsp[0].icog->memopt, dup_language(currentlanguage));
1798 rsc->prev->next = rsc;
1799 rsc = rsc->prev;
1800 rsc->name = new_name_id();
1801 rsc->name->type = name_ord;
1802 rsc->name->name.i_name = ico->id;
1803 }
1804 ;
1805 break;}
1806case 53:
1807#line 511 "parser.y"
1808{ yyval.res = new_resource(res_men, yyvsp[0].men, yyvsp[0].men->memopt, yyvsp[0].men->lvc.language); ;
1809 break;}
1810case 54:
1811#line 512 "parser.y"
1812{
1813 if(win32)
1814 yyval.res = new_resource(res_menex, yyvsp[0].menex, yyvsp[0].menex->memopt, yyvsp[0].menex->lvc.language);
1815 else
1816 yyval.res = NULL;
1817 ;
1818 break;}
1819case 55:
1820#line 518 "parser.y"
1821{ yyval.res = new_resource(res_msg, yyvsp[0].msg, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, dup_language(currentlanguage)); ;
1822 break;}
1823case 56:
1824#line 519 "parser.y"
1825{ yyval.res = new_resource(res_rdt, yyvsp[0].rdt, yyvsp[0].rdt->memopt, yyvsp[0].rdt->lvc.language); ;
1826 break;}
1827case 57:
1828#line 520 "parser.y"
1829{ yyval.res = new_resource(res_toolbar, yyvsp[0].tlbar, yyvsp[0].tlbar->memopt, yyvsp[0].tlbar->lvc.language); ;
1830 break;}
1831case 58:
1832#line 521 "parser.y"
1833{ yyval.res = new_resource(res_usr, yyvsp[0].usr, yyvsp[0].usr->memopt, dup_language(currentlanguage)); ;
1834 break;}
1835case 59:
1836#line 522 "parser.y"
1837{ yyval.res = new_resource(res_ver, yyvsp[0].veri, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, dup_language(currentlanguage)); ;
1838 break;}
1839case 60:
1840#line 526 "parser.y"
1841{ yyval.bmp = new_bitmap(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1842 break;}
1843case 61:
1844#line 527 "parser.y"
1845{ yyval.bmp = new_bitmap(yyvsp[0].raw, yyvsp[-1].iptr); ;
1846 break;}
1847case 62:
1848#line 531 "parser.y"
1849{ yyval.curg = new_cursor_group(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1850 break;}
1851case 63:
1852#line 532 "parser.y"
1853{ yyval.curg = new_cursor_group(yyvsp[0].raw, yyvsp[-1].iptr); ;
1854 break;}
1855case 64:
1856#line 537 "parser.y"
1857{ yyval.fnt = new_font(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1858 break;}
1859case 65:
1860#line 541 "parser.y"
1861{ yyval.icog = new_icon_group(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1862 break;}
1863case 66:
1864#line 542 "parser.y"
1865{ yyval.icog = new_icon_group(yyvsp[0].raw, yyvsp[-1].iptr); ;
1866 break;}
1867case 67:
1868#line 550 "parser.y"
1869{
1870 if(!win32)
1871 yywarning("MESSAGETABLE not supported in 16-bit mode");
1872 yyval.msg = new_messagetable(load_file(yyvsp[0].str));
1873 ;
1874 break;}
1875case 68:
1876#line 558 "parser.y"
1877{
1878 yyval.rdt = new_rcdata(yyvsp[0].raw, yyvsp[-2].iptr);
1879 if(yyvsp[-1].lvc)
1880 {
1881 yyval.rdt->lvc = *(yyvsp[-1].lvc);
1882 free(yyvsp[-1].lvc);
1883 }
1884 if(!yyval.rdt->lvc.language)
1885 yyval.rdt->lvc.language = dup_language(currentlanguage);
1886 ;
1887 break;}
1888case 69:
1889#line 571 "parser.y"
1890{
1891 yyval.dginit = new_dlginit(yyvsp[0].raw, yyvsp[-2].iptr);
1892 if(yyvsp[-1].lvc)
1893 {
1894 yyval.dginit->lvc = *(yyvsp[-1].lvc);
1895 free(yyvsp[-1].lvc);
1896 }
1897 if(!yyval.dginit->lvc.language)
1898 yyval.dginit->lvc.language = dup_language(currentlanguage);
1899 ;
1900 break;}
1901case 70:
1902#line 584 "parser.y"
1903{ yyval.usr = new_user(yyvsp[-2].nid, load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1904 break;}
1905case 71:
1906#line 585 "parser.y"
1907{ yyval.usr = new_user(yyvsp[-2].nid, yyvsp[0].raw, yyvsp[-1].iptr); ;
1908 break;}
1909case 72:
1910#line 604 "parser.y"
1911{
1912 yyval.nid = new_name_id();
1913 yyval.nid->type = name_ord;
1914 yyval.nid->name.i_name = yyvsp[0].num;
1915 set_yywf();
1916 ;
1917 break;}
1918case 73:
1919#line 616 "parser.y"
1920{
1921 yyval.nid = new_name_id();
1922 yyval.nid->type = name_str;
1923 yyval.nid->name.s_name = yyvsp[0].str;
1924 set_yywf();
1925 ;
1926 break;}
1927case 74:
1928#line 626 "parser.y"
1929{
1930 yyval.acc = new_accelerator();
1931 if(yyvsp[-4].iptr)
1932 {
1933 yyval.acc->memopt = *(yyvsp[-4].iptr);
1934 free(yyvsp[-4].iptr);
1935 }
1936 else
1937 {
1938 yyval.acc->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE;
1939 }
1940 if(!yyvsp[-1].event)
1941 yyerror("Accelerator table must have at least one entry");
1942 yyval.acc->events = get_event_head(yyvsp[-1].event);
1943 if(yyvsp[-3].lvc)
1944 {
1945 yyval.acc->lvc = *(yyvsp[-3].lvc);
1946 free(yyvsp[-3].lvc);
1947 }
1948 if(!yyval.acc->lvc.language)
1949 yyval.acc->lvc.language = dup_language(currentlanguage);
1950 ;
1951 break;}
1952case 75:
1953#line 650 "parser.y"
1954{ yyval.event=NULL; ;
1955 break;}
1956case 76:
1957#line 651 "parser.y"
1958{ yyval.event=add_string_event(yyvsp[-3].str, yyvsp[-1].num, yyvsp[0].num, yyvsp[-4].event); ;
1959 break;}
1960case 77:
1961#line 652 "parser.y"
1962{ yyval.event=add_event(yyvsp[-3].num, yyvsp[-1].num, yyvsp[0].num, yyvsp[-4].event); ;
1963 break;}
1964case 78:
1965#line 655 "parser.y"
1966{ yyval.num=0; ;
1967 break;}
1968case 79:
1969#line 656 "parser.y"
1970{ yyval.num=yyvsp[-2].num | WRC_AF_NOINVERT; ;
1971 break;}
1972case 80:
1973#line 657 "parser.y"
1974{ yyval.num=yyvsp[-2].num | WRC_AF_SHIFT; ;
1975 break;}
1976case 81:
1977#line 658 "parser.y"
1978{ yyval.num=yyvsp[-2].num | WRC_AF_CONTROL; ;
1979 break;}
1980case 82:
1981#line 659 "parser.y"
1982{ yyval.num=yyvsp[-2].num | WRC_AF_ALT; ;
1983 break;}
1984case 83:
1985#line 660 "parser.y"
1986{ yyval.num=yyvsp[-2].num | WRC_AF_ASCII; ;
1987 break;}
1988case 84:
1989#line 661 "parser.y"
1990{ yyval.num=yyvsp[-2].num | WRC_AF_VIRTKEY; ;
1991 break;}
1992case 85:
1993#line 667 "parser.y"
1994{
1995 if(yyvsp[-11].iptr)
1996 {
1997 yyvsp[-3].dlg->memopt = *(yyvsp[-11].iptr);
1998 free(yyvsp[-11].iptr);
1999 }
2000 else
2001 yyvsp[-3].dlg->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
2002 yyvsp[-3].dlg->x = yyvsp[-10].num;
2003 yyvsp[-3].dlg->y = yyvsp[-8].num;
2004 yyvsp[-3].dlg->width = yyvsp[-6].num;
2005 yyvsp[-3].dlg->height = yyvsp[-4].num;
2006 yyvsp[-3].dlg->controls = get_control_head(yyvsp[-1].ctl);
2007 yyval.dlg = yyvsp[-3].dlg;
2008 if(!yyval.dlg->gotstyle)
2009 {
2010 yyval.dlg->style->or_mask = WS_POPUP;
2011 yyval.dlg->gotstyle = TRUE;
2012 }
2013 if(yyval.dlg->title)
2014 yyval.dlg->style->or_mask |= WS_CAPTION;
2015 if(yyval.dlg->font)
2016 yyval.dlg->style->or_mask |= DS_SETFONT;
2017
2018 yyval.dlg->style->or_mask &= ~(yyval.dlg->style->and_mask);
2019 yyval.dlg->style->and_mask = 0;
2020
2021 indialog = FALSE;
2022 if(!yyval.dlg->lvc.language)
2023 yyval.dlg->lvc.language = dup_language(currentlanguage);
2024 ;
2025 break;}
2026case 86:
2027#line 701 "parser.y"
2028{ yyval.dlg=new_dialog(); ;
2029 break;}
2030case 87:
2031#line 702 "parser.y"
2032{ yyval.dlg=dialog_style(yyvsp[0].style,yyvsp[-2].dlg); ;
2033 break;}
2034case 88:
2035#line 703 "parser.y"
2036{ yyval.dlg=dialog_exstyle(yyvsp[0].style,yyvsp[-2].dlg); ;
2037 break;}
2038case 89:
2039#line 704 "parser.y"
2040{ yyval.dlg=dialog_caption(yyvsp[0].str,yyvsp[-2].dlg); ;
2041 break;}
2042case 90:
2043#line 705 "parser.y"
2044{ yyval.dlg=dialog_font(yyvsp[0].fntid,yyvsp[-1].dlg); ;
2045 break;}
2046case 91:
2047#line 706 "parser.y"
2048{ yyval.dlg=dialog_class(yyvsp[0].nid,yyvsp[-2].dlg); ;
2049 break;}
2050case 92:
2051#line 707 "parser.y"
2052{ yyval.dlg=dialog_menu(yyvsp[0].nid,yyvsp[-2].dlg); ;
2053 break;}
2054case 93:
2055#line 708 "parser.y"
2056{ yyval.dlg=dialog_language(yyvsp[0].lan,yyvsp[-1].dlg); ;
2057 break;}
2058case 94:
2059#line 709 "parser.y"
2060{ yyval.dlg=dialog_characteristics(yyvsp[0].chars,yyvsp[-1].dlg); ;
2061 break;}
2062case 95:
2063#line 710 "parser.y"
2064{ yyval.dlg=dialog_version(yyvsp[0].ver,yyvsp[-1].dlg); ;
2065 break;}
2066case 96:
2067#line 713 "parser.y"
2068{ yyval.ctl = NULL; ;
2069 break;}
2070case 97:
2071#line 714 "parser.y"
2072{ yyval.ctl=ins_ctrl(-1, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2073 break;}
2074case 98:
2075#line 715 "parser.y"
2076{ yyval.ctl=ins_ctrl(CT_EDIT, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2077 break;}
2078case 99:
2079#line 716 "parser.y"
2080{ yyval.ctl=ins_ctrl(CT_LISTBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2081 break;}
2082case 100:
2083#line 717 "parser.y"
2084{ yyval.ctl=ins_ctrl(CT_COMBOBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2085 break;}
2086case 101:
2087#line 718 "parser.y"
2088{ yyval.ctl=ins_ctrl(CT_SCROLLBAR, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2089 break;}
2090case 102:
2091#line 719 "parser.y"
2092{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_CHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2093 break;}
2094case 103:
2095#line 720 "parser.y"
2096{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2097 break;}
2098case 104:
2099#line 721 "parser.y"
2100{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_GROUPBOX, yyvsp[0].ctl, yyvsp[-2].ctl);;
2101 break;}
2102case 105:
2103#line 722 "parser.y"
2104{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2105 break;}
2106case 106:
2107#line 724 "parser.y"
2108{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2109 break;}
2110case 107:
2111#line 725 "parser.y"
2112{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2113 break;}
2114case 108:
2115#line 726 "parser.y"
2116{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2117 break;}
2118case 109:
2119#line 727 "parser.y"
2120{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2121 break;}
2122case 110:
2123#line 728 "parser.y"
2124{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2125 break;}
2126case 111:
2127#line 729 "parser.y"
2128{ yyval.ctl=ins_ctrl(CT_STATIC, SS_LEFT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2129 break;}
2130case 112:
2131#line 730 "parser.y"
2132{ yyval.ctl=ins_ctrl(CT_STATIC, SS_CENTER, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2133 break;}
2134case 113:
2135#line 731 "parser.y"
2136{ yyval.ctl=ins_ctrl(CT_STATIC, SS_RIGHT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2137 break;}
2138case 114:
2139#line 733 "parser.y"
2140{
2141 yyvsp[0].ctl->title = yyvsp[-7].nid;
2142 yyvsp[0].ctl->id = yyvsp[-5].num;
2143 yyvsp[0].ctl->x = yyvsp[-3].num;
2144 yyvsp[0].ctl->y = yyvsp[-1].num;
2145 yyval.ctl = ins_ctrl(CT_STATIC, SS_ICON, yyvsp[0].ctl, yyvsp[-9].ctl);
2146 ;
2147 break;}
2148case 115:
2149#line 743 "parser.y"
2150{
2151 yyval.ctl=new_control();
2152 yyval.ctl->title = new_name_id();
2153 yyval.ctl->title->type = name_str;
2154 yyval.ctl->title->name.s_name = yyvsp[-11].str;
2155 yyval.ctl->id = yyvsp[-9].num;
2156 yyval.ctl->x = yyvsp[-7].num;
2157 yyval.ctl->y = yyvsp[-5].num;
2158 yyval.ctl->width = yyvsp[-3].num;
2159 yyval.ctl->height = yyvsp[-1].num;
2160 if(yyvsp[0].style)
2161 {
2162 yyval.ctl->style = yyvsp[0].style;
2163 yyval.ctl->gotstyle = TRUE;
2164 }
2165 ;
2166 break;}
2167case 116:
2168#line 762 "parser.y"
2169{
2170 yyval.ctl = new_control();
2171 yyval.ctl->id = yyvsp[-9].num;
2172 yyval.ctl->x = yyvsp[-7].num;
2173 yyval.ctl->y = yyvsp[-5].num;
2174 yyval.ctl->width = yyvsp[-3].num;
2175 yyval.ctl->height = yyvsp[-1].num;
2176 if(yyvsp[0].style)
2177 {
2178 yyval.ctl->style = yyvsp[0].style;
2179 yyval.ctl->gotstyle = TRUE;
2180 }
2181 ;
2182 break;}
2183case 117:
2184#line 778 "parser.y"
2185{ yyval.ctl = new_control(); ;
2186 break;}
2187case 118:
2188#line 780 "parser.y"
2189{
2190 yyval.ctl = new_control();
2191 yyval.ctl->width = yyvsp[-2].num;
2192 yyval.ctl->height = yyvsp[0].num;
2193 ;
2194 break;}
2195case 119:
2196#line 785 "parser.y"
2197{
2198 yyval.ctl = new_control();
2199 yyval.ctl->width = yyvsp[-4].num;
2200 yyval.ctl->height = yyvsp[-2].num;
2201 yyval.ctl->style = yyvsp[0].style;
2202 yyval.ctl->gotstyle = TRUE;
2203 ;
2204 break;}
2205case 120:
2206#line 792 "parser.y"
2207{
2208 yyval.ctl = new_control();
2209 yyval.ctl->width = yyvsp[-6].num;
2210 yyval.ctl->height = yyvsp[-4].num;
2211 yyval.ctl->style = yyvsp[-2].style;
2212 yyval.ctl->gotstyle = TRUE;
2213 yyval.ctl->exstyle = yyvsp[0].style;
2214 yyval.ctl->gotexstyle = TRUE;
2215 ;
2216 break;}
2217case 121:
2218#line 803 "parser.y"
2219{
2220 yyval.ctl=new_control();
2221 yyval.ctl->title = yyvsp[-16].nid;
2222 yyval.ctl->id = yyvsp[-14].num;
2223 yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-12].nid);
2224 yyval.ctl->style = yyvsp[-10].style;
2225 yyval.ctl->gotstyle = TRUE;
2226 yyval.ctl->x = yyvsp[-8].num;
2227 yyval.ctl->y = yyvsp[-6].num;
2228 yyval.ctl->width = yyvsp[-4].num;
2229 yyval.ctl->height = yyvsp[-2].num;
2230 yyval.ctl->exstyle = yyvsp[0].style;
2231 yyval.ctl->gotexstyle = TRUE;
2232 ;
2233 break;}
2234case 122:
2235#line 817 "parser.y"
2236{
2237 yyval.ctl=new_control();
2238 yyval.ctl->title = yyvsp[-14].nid;
2239 yyval.ctl->id = yyvsp[-12].num;
2240 yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-10].nid);
2241 yyval.ctl->style = yyvsp[-8].style;
2242 yyval.ctl->gotstyle = TRUE;
2243 yyval.ctl->x = yyvsp[-6].num;
2244 yyval.ctl->y = yyvsp[-4].num;
2245 yyval.ctl->width = yyvsp[-2].num;
2246 yyval.ctl->height = yyvsp[0].num;
2247 ;
2248 break;}
2249case 123:
2250#line 832 "parser.y"
2251{ yyval.fntid = new_font_id(yyvsp[-2].num, yyvsp[0].str, 0, 0); ;
2252 break;}
2253case 124:
2254#line 837 "parser.y"
2255{ yyval.style = NULL; ;
2256 break;}
2257case 125:
2258#line 838 "parser.y"
2259{ yyval.style = yyvsp[0].style; ;
2260 break;}
2261case 126:
2262#line 842 "parser.y"
2263{ yyval.styles = NULL; ;
2264 break;}
2265case 127:
2266#line 843 "parser.y"
2267{ yyval.styles = new_style_pair(yyvsp[0].style, 0); ;
2268 break;}
2269case 128:
2270#line 844 "parser.y"
2271{ yyval.styles = new_style_pair(yyvsp[-2].style, yyvsp[0].style); ;
2272 break;}
2273case 129:
2274#line 848 "parser.y"
2275{ 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);;
2276 break;}
2277case 130:
2278#line 849 "parser.y"
2279{ yyval.style = yyvsp[-1].style; ;
2280 break;}
2281case 131:
2282#line 850 "parser.y"
2283{ yyval.style = new_style(yyvsp[0].num, 0); ;
2284 break;}
2285case 132:
2286#line 851 "parser.y"
2287{ yyval.style = new_style(0, yyvsp[0].num); ;
2288 break;}
2289case 133:
2290#line 855 "parser.y"
2291{
2292 yyval.nid = new_name_id();
2293 yyval.nid->type = name_ord;
2294 yyval.nid->name.i_name = yyvsp[0].num;
2295 ;
2296 break;}
2297case 134:
2298#line 860 "parser.y"
2299{
2300 yyval.nid = new_name_id();
2301 yyval.nid->type = name_str;
2302 yyval.nid->name.s_name = yyvsp[0].str;
2303 ;
2304 break;}
2305case 135:
2306#line 869 "parser.y"
2307{
2308 if(!win32)
2309 yywarning("DIALOGEX not supported in 16-bit mode");
2310 if(yyvsp[-12].iptr)
2311 {
2312 yyvsp[-3].dlgex->memopt = *(yyvsp[-12].iptr);
2313 free(yyvsp[-12].iptr);
2314 }
2315 else
2316 yyvsp[-3].dlgex->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
2317 yyvsp[-3].dlgex->x = yyvsp[-11].num;
2318 yyvsp[-3].dlgex->y = yyvsp[-9].num;
2319 yyvsp[-3].dlgex->width = yyvsp[-7].num;
2320 yyvsp[-3].dlgex->height = yyvsp[-5].num;
2321 if(yyvsp[-4].iptr)
2322 {
2323 yyvsp[-3].dlgex->helpid = *(yyvsp[-4].iptr);
2324 yyvsp[-3].dlgex->gothelpid = TRUE;
2325 free(yyvsp[-4].iptr);
2326 }
2327 yyvsp[-3].dlgex->controls = get_control_head(yyvsp[-1].ctl);
2328 yyval.dlgex = yyvsp[-3].dlgex;
2329
2330 assert(yyval.dlgex->style != NULL);
2331 if(!yyval.dlgex->gotstyle)
2332 {
2333 yyval.dlgex->style->or_mask = WS_POPUP;
2334 yyval.dlgex->gotstyle = TRUE;
2335 }
2336 if(yyval.dlgex->title)
2337 yyval.dlgex->style->or_mask |= WS_CAPTION;
2338 if(yyval.dlgex->font)
2339 yyval.dlgex->style->or_mask |= DS_SETFONT;
2340
2341 yyval.dlgex->style->or_mask &= ~(yyval.dlgex->style->and_mask);
2342 yyval.dlgex->style->and_mask = 0;
2343
2344 indialog = FALSE;
2345 if(!yyval.dlgex->lvc.language)
2346 yyval.dlgex->lvc.language = dup_language(currentlanguage);
2347 ;
2348 break;}
2349case 136:
2350#line 913 "parser.y"
2351{ yyval.dlgex=new_dialogex(); ;
2352 break;}
2353case 137:
2354#line 914 "parser.y"
2355{ yyval.dlgex=dialogex_style(yyvsp[0].style,yyvsp[-2].dlgex); ;
2356 break;}
2357case 138:
2358#line 915 "parser.y"
2359{ yyval.dlgex=dialogex_exstyle(yyvsp[0].style,yyvsp[-2].dlgex); ;
2360 break;}
2361case 139:
2362#line 916 "parser.y"
2363{ yyval.dlgex=dialogex_caption(yyvsp[0].str,yyvsp[-2].dlgex); ;
2364 break;}
2365case 140:
2366#line 917 "parser.y"
2367{ yyval.dlgex=dialogex_font(yyvsp[0].fntid,yyvsp[-1].dlgex); ;
2368 break;}
2369case 141:
2370#line 918 "parser.y"
2371{ yyval.dlgex=dialogex_font(yyvsp[0].fntid,yyvsp[-1].dlgex); ;
2372 break;}
2373case 142:
2374#line 919 "parser.y"
2375{ yyval.dlgex=dialogex_class(yyvsp[0].nid,yyvsp[-2].dlgex); ;
2376 break;}
2377case 143:
2378#line 920 "parser.y"
2379{ yyval.dlgex=dialogex_menu(yyvsp[0].nid,yyvsp[-2].dlgex); ;
2380 break;}
2381case 144:
2382#line 921 "parser.y"
2383{ yyval.dlgex=dialogex_language(yyvsp[0].lan,yyvsp[-1].dlgex); ;
2384 break;}
2385case 145:
2386#line 922 "parser.y"
2387{ yyval.dlgex=dialogex_characteristics(yyvsp[0].chars,yyvsp[-1].dlgex); ;
2388 break;}
2389case 146:
2390#line 923 "parser.y"
2391{ yyval.dlgex=dialogex_version(yyvsp[0].ver,yyvsp[-1].dlgex); ;
2392 break;}
2393case 147:
2394#line 926 "parser.y"
2395{ yyval.ctl = NULL; ;
2396 break;}
2397case 148:
2398#line 927 "parser.y"
2399{ yyval.ctl=ins_ctrl(-1, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2400 break;}
2401case 149:
2402#line 928 "parser.y"
2403{ yyval.ctl=ins_ctrl(CT_EDIT, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2404 break;}
2405case 150:
2406#line 929 "parser.y"
2407{ yyval.ctl=ins_ctrl(CT_LISTBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2408 break;}
2409case 151:
2410#line 930 "parser.y"
2411{ yyval.ctl=ins_ctrl(CT_COMBOBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2412 break;}
2413case 152:
2414#line 931 "parser.y"
2415{ yyval.ctl=ins_ctrl(CT_SCROLLBAR, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2416 break;}
2417case 153:
2418#line 932 "parser.y"
2419{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_CHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2420 break;}
2421case 154:
2422#line 933 "parser.y"
2423{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2424 break;}
2425case 155:
2426#line 934 "parser.y"
2427{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_GROUPBOX, yyvsp[0].ctl, yyvsp[-2].ctl);;
2428 break;}
2429case 156:
2430#line 935 "parser.y"
2431{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2432 break;}
2433case 157:
2434#line 937 "parser.y"
2435{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2436 break;}
2437case 158:
2438#line 938 "parser.y"
2439{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2440 break;}
2441case 159:
2442#line 939 "parser.y"
2443{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2444 break;}
2445case 160:
2446#line 940 "parser.y"
2447{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2448 break;}
2449case 161:
2450#line 941 "parser.y"
2451{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2452 break;}
2453case 162:
2454#line 942 "parser.y"
2455{ yyval.ctl=ins_ctrl(CT_STATIC, SS_LEFT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2456 break;}
2457case 163:
2458#line 943 "parser.y"
2459{ yyval.ctl=ins_ctrl(CT_STATIC, SS_CENTER, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2460 break;}
2461case 164:
2462#line 944 "parser.y"
2463{ yyval.ctl=ins_ctrl(CT_STATIC, SS_RIGHT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2464 break;}
2465case 165:
2466#line 946 "parser.y"
2467{
2468 yyvsp[0].ctl->title = yyvsp[-7].nid;
2469 yyvsp[0].ctl->id = yyvsp[-5].num;
2470 yyvsp[0].ctl->x = yyvsp[-3].num;
2471 yyvsp[0].ctl->y = yyvsp[-1].num;
2472 yyval.ctl = ins_ctrl(CT_STATIC, SS_ICON, yyvsp[0].ctl, yyvsp[-9].ctl);
2473 ;
2474 break;}
2475case 166:
2476#line 957 "parser.y"
2477{
2478 yyval.ctl=new_control();
2479 yyval.ctl->title = yyvsp[-18].nid;
2480 yyval.ctl->id = yyvsp[-16].num;
2481 yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-14].nid);
2482 yyval.ctl->style = yyvsp[-12].style;
2483 yyval.ctl->gotstyle = TRUE;
2484 yyval.ctl->x = yyvsp[-10].num;
2485 yyval.ctl->y = yyvsp[-8].num;
2486 yyval.ctl->width = yyvsp[-6].num;
2487 yyval.ctl->height = yyvsp[-4].num;
2488 if(yyvsp[-2].style)
2489 {
2490 yyval.ctl->exstyle = yyvsp[-2].style;
2491 yyval.ctl->gotexstyle = TRUE;
2492 }
2493 if(yyvsp[-1].iptr)
2494 {
2495 yyval.ctl->helpid = *(yyvsp[-1].iptr);
2496 yyval.ctl->gothelpid = TRUE;
2497 free(yyvsp[-1].iptr);
2498 }
2499 yyval.ctl->extra = yyvsp[0].raw;
2500 ;
2501 break;}
2502case 167:
2503#line 981 "parser.y"
2504{
2505 yyval.ctl=new_control();
2506 yyval.ctl->title = yyvsp[-15].nid;
2507 yyval.ctl->id = yyvsp[-13].num;
2508 yyval.ctl->style = yyvsp[-9].style;
2509 yyval.ctl->gotstyle = TRUE;
2510 yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-11].nid);
2511 yyval.ctl->x = yyvsp[-7].num;
2512 yyval.ctl->y = yyvsp[-5].num;
2513 yyval.ctl->width = yyvsp[-3].num;
2514 yyval.ctl->height = yyvsp[-1].num;
2515 yyval.ctl->extra = yyvsp[0].raw;
2516 ;
2517 break;}
2518case 168:
2519#line 997 "parser.y"
2520{
2521 yyval.ctl=new_control();
2522 yyval.ctl->title = new_name_id();
2523 yyval.ctl->title->type = name_str;
2524 yyval.ctl->title->name.s_name = yyvsp[-12].str;
2525 yyval.ctl->id = yyvsp[-10].num;
2526 yyval.ctl->x = yyvsp[-8].num;
2527 yyval.ctl->y = yyvsp[-6].num;
2528 yyval.ctl->width = yyvsp[-4].num;
2529 yyval.ctl->height = yyvsp[-2].num;
2530 if(yyvsp[-1].styles)
2531 {
2532 yyval.ctl->style = yyvsp[-1].styles->style;
2533 yyval.ctl->gotstyle = TRUE;
2534
2535 if (yyvsp[-1].styles->exstyle)
2536 {
2537 yyval.ctl->exstyle = yyvsp[-1].styles->exstyle;
2538 yyval.ctl->gotexstyle = TRUE;
2539 }
2540 free(yyvsp[-1].styles);
2541 }
2542
2543 yyval.ctl->extra = yyvsp[0].raw;
2544 ;
2545 break;}
2546case 169:
2547#line 1025 "parser.y"
2548{
2549 yyval.ctl = new_control();
2550 yyval.ctl->id = yyvsp[-10].num;
2551 yyval.ctl->x = yyvsp[-8].num;
2552 yyval.ctl->y = yyvsp[-6].num;
2553 yyval.ctl->width = yyvsp[-4].num;
2554 yyval.ctl->height = yyvsp[-2].num;
2555 if(yyvsp[-1].styles)
2556 {
2557 yyval.ctl->style = yyvsp[-1].styles->style;
2558 yyval.ctl->gotstyle = TRUE;
2559
2560 if (yyvsp[-1].styles->exstyle)
2561 {
2562 yyval.ctl->exstyle = yyvsp[-1].styles->exstyle;
2563 yyval.ctl->gotexstyle = TRUE;
2564 }
2565 free(yyvsp[-1].styles);
2566 }
2567 yyval.ctl->extra = yyvsp[0].raw;
2568 ;
2569 break;}
2570case 170:
2571#line 1048 "parser.y"
2572{ yyval.raw = NULL; ;
2573 break;}
2574case 171:
2575#line 1049 "parser.y"
2576{ yyval.raw = yyvsp[0].raw; ;
2577 break;}
2578case 172:
2579#line 1052 "parser.y"
2580{ yyval.iptr = NULL; ;
2581 break;}
2582case 173:
2583#line 1053 "parser.y"
2584{ yyval.iptr = new_int(yyvsp[0].num); ;
2585 break;}
2586case 174:
2587#line 1057 "parser.y"
2588{ yyval.fntid = new_font_id(yyvsp[-7].num, yyvsp[-5].str, yyvsp[-3].num, yyvsp[-1].num); ;
2589 break;}
2590case 175:
2591#line 1064 "parser.y"
2592{ yyval.fntid = NULL; ;
2593 break;}
2594case 176:
2595#line 1065 "parser.y"
2596{ yyval.fntid = NULL; ;
2597 break;}
2598case 177:
2599#line 1069 "parser.y"
2600{
2601 if(!yyvsp[0].menitm)
2602 yyerror("Menu must contain items");
2603 yyval.men = new_menu();
2604 if(yyvsp[-2].iptr)
2605 {
2606 yyval.men->memopt = *(yyvsp[-2].iptr);
2607 free(yyvsp[-2].iptr);
2608 }
2609 else
2610 yyval.men->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
2611 yyval.men->items = get_item_head(yyvsp[0].menitm);
2612 if(yyvsp[-1].lvc)
2613 {
2614 yyval.men->lvc = *(yyvsp[-1].lvc);
2615 free(yyvsp[-1].lvc);
2616 }
2617 if(!yyval.men->lvc.language)
2618 yyval.men->lvc.language = dup_language(currentlanguage);
2619 ;
2620 break;}
2621case 178:
2622#line 1092 "parser.y"
2623{ yyval.menitm = yyvsp[-1].menitm; ;
2624 break;}
2625case 179:
2626#line 1096 "parser.y"
2627{yyval.menitm = NULL;;
2628 break;}
2629case 180:
2630#line 1097 "parser.y"
2631{
2632 yyval.menitm=new_menu_item();
2633 yyval.menitm->prev = yyvsp[-5].menitm;
2634 if(yyvsp[-5].menitm)
2635 yyvsp[-5].menitm->next = yyval.menitm;
2636 yyval.menitm->id = yyvsp[-1].num;
2637 yyval.menitm->state = yyvsp[0].num;
2638 yyval.menitm->name = yyvsp[-3].str;
2639 ;
2640 break;}
2641case 181:
2642#line 1106 "parser.y"
2643{
2644 yyval.menitm=new_menu_item();
2645 yyval.menitm->prev = yyvsp[-2].menitm;
2646 if(yyvsp[-2].menitm)
2647 yyvsp[-2].menitm->next = yyval.menitm;
2648 ;
2649 break;}
2650case 182:
2651#line 1112 "parser.y"
2652{
2653 yyval.menitm = new_menu_item();
2654 yyval.menitm->prev = yyvsp[-4].menitm;
2655 if(yyvsp[-4].menitm)
2656 yyvsp[-4].menitm->next = yyval.menitm;
2657 yyval.menitm->popup = get_item_head(yyvsp[0].menitm);
2658 yyval.menitm->name = yyvsp[-2].str;
2659 ;
2660 break;}
2661case 183:
2662#line 1131 "parser.y"
2663{ yyval.num = 0; ;
2664 break;}
2665case 184:
2666#line 1132 "parser.y"
2667{ yyval.num = yyvsp[0].num | MF_CHECKED; ;
2668 break;}
2669case 185:
2670#line 1133 "parser.y"
2671{ yyval.num = yyvsp[0].num | MF_GRAYED; ;
2672 break;}
2673case 186:
2674#line 1134 "parser.y"
2675{ yyval.num = yyvsp[0].num | MF_HELP; ;
2676 break;}
2677case 187:
2678#line 1135 "parser.y"
2679{ yyval.num = yyvsp[0].num | MF_DISABLED; ;
2680 break;}
2681case 188:
2682#line 1136 "parser.y"
2683{ yyval.num = yyvsp[0].num | MF_MENUBARBREAK; ;
2684 break;}
2685case 189:
2686#line 1137 "parser.y"
2687{ yyval.num = yyvsp[0].num | MF_MENUBREAK; ;
2688 break;}
2689case 190:
2690#line 1141 "parser.y"
2691{
2692 if(!win32)
2693 yywarning("MENUEX not supported in 16-bit mode");
2694 if(!yyvsp[0].menexitm)
2695 yyerror("MenuEx must contain items");
2696 yyval.menex = new_menuex();
2697 if(yyvsp[-2].iptr)
2698 {
2699 yyval.menex->memopt = *(yyvsp[-2].iptr);
2700 free(yyvsp[-2].iptr);
2701 }
2702 else
2703 yyval.menex->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
2704 yyval.menex->items = get_itemex_head(yyvsp[0].menexitm);
2705 if(yyvsp[-1].lvc)
2706 {
2707 yyval.menex->lvc = *(yyvsp[-1].lvc);
2708 free(yyvsp[-1].lvc);
2709 }
2710 if(!yyval.menex->lvc.language)
2711 yyval.menex->lvc.language = dup_language(currentlanguage);
2712 ;
2713 break;}
2714case 191:
2715#line 1166 "parser.y"
2716{ yyval.menexitm = yyvsp[-1].menexitm; ;
2717 break;}
2718case 192:
2719#line 1170 "parser.y"
2720{yyval.menexitm = NULL; ;
2721 break;}
2722case 193:
2723#line 1171 "parser.y"
2724{
2725 yyval.menexitm = new_menuex_item();
2726 yyval.menexitm->prev = yyvsp[-3].menexitm;
2727 if(yyvsp[-3].menexitm)
2728 yyvsp[-3].menexitm->next = yyval.menexitm;
2729 yyval.menexitm->name = yyvsp[-1].str;
2730 yyval.menexitm->id = yyvsp[0].exopt->id;
2731 yyval.menexitm->type = yyvsp[0].exopt->type;
2732 yyval.menexitm->state = yyvsp[0].exopt->state;
2733 yyval.menexitm->helpid = yyvsp[0].exopt->helpid;
2734 yyval.menexitm->gotid = yyvsp[0].exopt->gotid;
2735 yyval.menexitm->gottype = yyvsp[0].exopt->gottype;
2736 yyval.menexitm->gotstate = yyvsp[0].exopt->gotstate;
2737 yyval.menexitm->gothelpid = yyvsp[0].exopt->gothelpid;
2738 free(yyvsp[0].exopt);
2739 ;
2740 break;}
2741case 194:
2742#line 1187 "parser.y"
2743{
2744 yyval.menexitm = new_menuex_item();
2745 yyval.menexitm->prev = yyvsp[-2].menexitm;
2746 if(yyvsp[-2].menexitm)
2747 yyvsp[-2].menexitm->next = yyval.menexitm;
2748 ;
2749 break;}
2750case 195:
2751#line 1193 "parser.y"
2752{
2753 yyval.menexitm = new_menuex_item();
2754 yyval.menexitm->prev = yyvsp[-4].menexitm;
2755 if(yyvsp[-4].menexitm)
2756 yyvsp[-4].menexitm->next = yyval.menexitm;
2757 yyval.menexitm->popup = get_itemex_head(yyvsp[0].menexitm);
2758 yyval.menexitm->name = yyvsp[-2].str;
2759 yyval.menexitm->id = yyvsp[-1].exopt->id;
2760 yyval.menexitm->type = yyvsp[-1].exopt->type;
2761 yyval.menexitm->state = yyvsp[-1].exopt->state;
2762 yyval.menexitm->helpid = yyvsp[-1].exopt->helpid;
2763 yyval.menexitm->gotid = yyvsp[-1].exopt->gotid;
2764 yyval.menexitm->gottype = yyvsp[-1].exopt->gottype;
2765 yyval.menexitm->gotstate = yyvsp[-1].exopt->gotstate;
2766 yyval.menexitm->gothelpid = yyvsp[-1].exopt->gothelpid;
2767 free(yyvsp[-1].exopt);
2768 ;
2769 break;}
2770case 196:
2771#line 1213 "parser.y"
2772{ yyval.exopt = new_itemex_opt(0, 0, 0, 0); ;
2773 break;}
2774case 197:
2775#line 1214 "parser.y"
2776{
2777 yyval.exopt = new_itemex_opt(yyvsp[0].num, 0, 0, 0);
2778 yyval.exopt->gotid = TRUE;
2779 ;
2780 break;}
2781case 198:
2782#line 1218 "parser.y"
2783{
2784 yyval.exopt = new_itemex_opt(yyvsp[-3].iptr ? *(yyvsp[-3].iptr) : 0, yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, yyvsp[0].num, 0);
2785 yyval.exopt->gotid = TRUE;
2786 yyval.exopt->gottype = TRUE;
2787 yyval.exopt->gotstate = TRUE;
2788 if(yyvsp[-3].iptr) free(yyvsp[-3].iptr);
2789 if(yyvsp[-1].iptr) free(yyvsp[-1].iptr);
2790 ;
2791 break;}
2792case 199:
2793#line 1226 "parser.y"
2794{
2795 yyval.exopt = new_itemex_opt(yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0);
2796 yyval.exopt->gotid = TRUE;
2797 yyval.exopt->gottype = TRUE;
2798 yyval.exopt->gotstate = TRUE;
2799 if(yyvsp[-4].iptr) free(yyvsp[-4].iptr);
2800 if(yyvsp[-2].iptr) free(yyvsp[-2].iptr);
2801 ;
2802 break;}
2803case 200:
2804#line 1237 "parser.y"
2805{ yyval.exopt = new_itemex_opt(0, 0, 0, 0); ;
2806 break;}
2807case 201:
2808#line 1238 "parser.y"
2809{
2810 yyval.exopt = new_itemex_opt(yyvsp[0].num, 0, 0, 0);
2811 yyval.exopt->gotid = TRUE;
2812 ;
2813 break;}
2814case 202:
2815#line 1242 "parser.y"
2816{
2817 yyval.exopt = new_itemex_opt(yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0, 0);
2818 if(yyvsp[-2].iptr) free(yyvsp[-2].iptr);
2819 yyval.exopt->gotid = TRUE;
2820 yyval.exopt->gottype = TRUE;
2821 ;
2822 break;}
2823case 203:
2824#line 1248 "parser.y"
2825{
2826 yyval.exopt = new_itemex_opt(yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0);
2827 if(yyvsp[-4].iptr) free(yyvsp[-4].iptr);
2828 if(yyvsp[-2].iptr) free(yyvsp[-2].iptr);
2829 yyval.exopt->gotid = TRUE;
2830 yyval.exopt->gottype = TRUE;
2831 yyval.exopt->gotstate = TRUE;
2832 ;
2833 break;}
2834case 204:
2835#line 1256 "parser.y"
2836{
2837 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);
2838 if(yyvsp[-6].iptr) free(yyvsp[-6].iptr);
2839 if(yyvsp[-4].iptr) free(yyvsp[-4].iptr);
2840 if(yyvsp[-2].iptr) free(yyvsp[-2].iptr);
2841 yyval.exopt->gotid = TRUE;
2842 yyval.exopt->gottype = TRUE;
2843 yyval.exopt->gotstate = TRUE;
2844 yyval.exopt->gothelpid = TRUE;
2845 ;
2846 break;}
2847case 205:
2848#line 1276 "parser.y"
2849{
2850 if(!yyvsp[-1].stt)
2851 {
2852 yyerror("Stringtable must have at least one entry");
2853 }
2854 else
2855 {
2856 stringtable_t *stt;
2857 /* Check if we added to a language table or created
2858 * a new one.
2859 */
2860 for(stt = sttres; stt; stt = stt->next)
2861 {
2862 if(stt == tagstt)
2863 break;
2864 }
2865 if(!stt)
2866 {
2867 /* It is a new one */
2868 if(sttres)
2869 {
2870 sttres->prev = tagstt;
2871 tagstt->next = sttres;
2872 sttres = tagstt;
2873 }
2874 else
2875 sttres = tagstt;
2876 }
2877 /* Else were done */
2878 }
2879 if(tagstt_memopt)
2880 {
2881 free(tagstt_memopt);
2882 tagstt_memopt = NULL;
2883 }
2884
2885 yyval.stt = tagstt;
2886 ;
2887 break;}
2888case 206:
2889#line 1317 "parser.y"
2890{
2891 if((tagstt = find_stringtable(yyvsp[0].lvc)) == NULL)
2892 tagstt = new_stringtable(yyvsp[0].lvc);
2893 tagstt_memopt = yyvsp[-1].iptr;
2894 tagstt_version = yyvsp[0].lvc->version;
2895 tagstt_characts = yyvsp[0].lvc->characts;
2896 if(yyvsp[0].lvc)
2897 free(yyvsp[0].lvc);
2898 ;
2899 break;}
2900case 207:
2901#line 1328 "parser.y"
2902{ yyval.stt = NULL; ;
2903 break;}
2904case 208:
2905#line 1329 "parser.y"
2906{
2907 int i;
2908 assert(tagstt != NULL);
2909 if(yyvsp[-2].num > 65535 || yyvsp[-2].num < -32768)
2910 yyerror("Stringtable entry's ID out of range (%d)", yyvsp[-2].num);
2911 /* Search for the ID */
2912 for(i = 0; i < tagstt->nentries; i++)
2913 {
2914 if(tagstt->entries[i].id == yyvsp[-2].num)
2915 yyerror("Stringtable ID %d already in use", yyvsp[-2].num);
2916 }
2917 /* If we get here, then we have a new unique entry */
2918 tagstt->nentries++;
2919 tagstt->entries = xrealloc(tagstt->entries, sizeof(tagstt->entries[0]) * tagstt->nentries);
2920 tagstt->entries[tagstt->nentries-1].id = yyvsp[-2].num;
2921 tagstt->entries[tagstt->nentries-1].str = yyvsp[0].str;
2922 if(tagstt_memopt)
2923 tagstt->entries[tagstt->nentries-1].memopt = *tagstt_memopt;
2924 else
2925 tagstt->entries[tagstt->nentries-1].memopt = WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE | WRC_MO_PURE;
2926 tagstt->entries[tagstt->nentries-1].version = tagstt_version;
2927 tagstt->entries[tagstt->nentries-1].characts = tagstt_characts;
2928
2929 if(!win32 && yyvsp[0].str->size > 254)
2930 yyerror("Stringtable entry more than 254 characters");
2931 if(win32 && yyvsp[0].str->size > 65534) /* Hmm..., does this happen? */
2932 yyerror("Stringtable entry more than 65534 characters (probably something else that went wrong)");
2933 yyval.stt = tagstt;
2934 ;
2935 break;}
2936case 211:
2937#line 1367 "parser.y"
2938{
2939 yyval.veri = yyvsp[-3].veri;
2940 yyvsp[-3].veri->blocks = get_ver_block_head(yyvsp[-1].blk);
2941 ;
2942 break;}
2943case 212:
2944#line 1374 "parser.y"
2945{ yyval.veri = new_versioninfo(); ;
2946 break;}
2947case 213:
2948#line 1375 "parser.y"
2949{
2950 if(yyvsp[-8].veri->gotit.fv)
2951 yyerror("FILEVERSION already defined");
2952 yyval.veri = yyvsp[-8].veri;
2953 yyval.veri->filever_maj1 = yyvsp[-6].num;
2954 yyval.veri->filever_maj2 = yyvsp[-4].num;
2955 yyval.veri->filever_min1 = yyvsp[-2].num;
2956 yyval.veri->filever_min2 = yyvsp[0].num;
2957 yyval.veri->gotit.fv = 1;
2958 ;
2959 break;}
2960case 214:
2961#line 1385 "parser.y"
2962{
2963 if(yyvsp[-8].veri->gotit.pv)
2964 yyerror("PRODUCTVERSION already defined");
2965 yyval.veri = yyvsp[-8].veri;
2966 yyval.veri->prodver_maj1 = yyvsp[-6].num;
2967 yyval.veri->prodver_maj2 = yyvsp[-4].num;
2968 yyval.veri->prodver_min1 = yyvsp[-2].num;
2969 yyval.veri->prodver_min2 = yyvsp[0].num;
2970 yyval.veri->gotit.pv = 1;
2971 ;
2972 break;}
2973case 215:
2974#line 1395 "parser.y"
2975{
2976 if(yyvsp[-2].veri->gotit.ff)
2977 yyerror("FILEFLAGS already defined");
2978 yyval.veri = yyvsp[-2].veri;
2979 yyval.veri->fileflags = yyvsp[0].num;
2980 yyval.veri->gotit.ff = 1;
2981 ;
2982 break;}
2983case 216:
2984#line 1402 "parser.y"
2985{
2986 if(yyvsp[-2].veri->gotit.ffm)
2987 yyerror("FILEFLAGSMASK already defined");
2988 yyval.veri = yyvsp[-2].veri;
2989 yyval.veri->fileflagsmask = yyvsp[0].num;
2990 yyval.veri->gotit.ffm = 1;
2991 ;
2992 break;}
2993case 217:
2994#line 1409 "parser.y"
2995{
2996 if(yyvsp[-2].veri->gotit.fo)
2997 yyerror("FILEOS already defined");
2998 yyval.veri = yyvsp[-2].veri;
2999 yyval.veri->fileos = yyvsp[0].num;
3000 yyval.veri->gotit.fo = 1;
3001 ;
3002 break;}
3003case 218:
3004#line 1416 "parser.y"
3005{
3006 if(yyvsp[-2].veri->gotit.ft)
3007 yyerror("FILETYPE already defined");
3008 yyval.veri = yyvsp[-2].veri;
3009 yyval.veri->filetype = yyvsp[0].num;
3010 yyval.veri->gotit.ft = 1;
3011 ;
3012 break;}
3013case 219:
3014#line 1423 "parser.y"
3015{
3016 if(yyvsp[-2].veri->gotit.fst)
3017 yyerror("FILESUBTYPE already defined");
3018 yyval.veri = yyvsp[-2].veri;
3019 yyval.veri->filesubtype = yyvsp[0].num;
3020 yyval.veri->gotit.fst = 1;
3021 ;
3022 break;}
3023case 220:
3024#line 1433 "parser.y"
3025{ yyval.blk = NULL; ;
3026 break;}
3027case 221:
3028#line 1434 "parser.y"
3029{
3030 yyval.blk = yyvsp[0].blk;
3031 yyval.blk->prev = yyvsp[-1].blk;
3032 if(yyvsp[-1].blk)
3033 yyvsp[-1].blk->next = yyval.blk;
3034 ;
3035 break;}
3036case 222:
3037#line 1443 "parser.y"
3038{
3039 yyval.blk = new_ver_block();
3040 yyval.blk->name = yyvsp[-3].str;
3041 yyval.blk->values = get_ver_value_head(yyvsp[-1].val);
3042 ;
3043 break;}
3044case 223:
3045#line 1451 "parser.y"
3046{ yyval.val = NULL; ;
3047 break;}
3048case 224:
3049#line 1452 "parser.y"
3050{
3051 yyval.val = yyvsp[0].val;
3052 yyval.val->prev = yyvsp[-1].val;
3053 if(yyvsp[-1].val)
3054 yyvsp[-1].val->next = yyval.val;
3055 ;
3056 break;}
3057case 225:
3058#line 1461 "parser.y"
3059{
3060 yyval.val = new_ver_value();
3061 yyval.val->type = val_block;
3062 yyval.val->value.block = yyvsp[0].blk;
3063 ;
3064 break;}
3065case 226:
3066#line 1466 "parser.y"
3067{
3068 yyval.val = new_ver_value();
3069 yyval.val->type = val_str;
3070 yyval.val->key = yyvsp[-2].str;
3071 yyval.val->value.str = yyvsp[0].str;
3072 ;
3073 break;}
3074case 227:
3075#line 1472 "parser.y"
3076{
3077 yyval.val = new_ver_value();
3078 yyval.val->type = val_words;
3079 yyval.val->key = yyvsp[-2].str;
3080 yyval.val->value.words = yyvsp[0].verw;
3081 ;
3082 break;}
3083case 228:
3084#line 1481 "parser.y"
3085{ yyval.verw = new_ver_words(yyvsp[0].num); ;
3086 break;}
3087case 229:
3088#line 1482 "parser.y"
3089{ yyval.verw = add_ver_words(yyvsp[-2].verw, yyvsp[0].num); ;
3090 break;}
3091case 230:
3092#line 1486 "parser.y"
3093{
3094 int nitems;
3095 toolbar_item_t *items = get_tlbr_buttons_head(yyvsp[-1].tlbarItems, &nitems);
3096 yyval.tlbar = new_toolbar(yyvsp[-6].num, yyvsp[-4].num, items, nitems);
3097 if(yyvsp[-7].iptr)
3098 {
3099 yyval.tlbar->memopt = *(yyvsp[-7].iptr);
3100 free(yyvsp[-7].iptr);
3101 }
3102 else
3103 {
3104 yyval.tlbar->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE;
3105 }
3106 if(yyvsp[-3].lvc)
3107 {
3108 yyval.tlbar->lvc = *(yyvsp[-3].lvc);
3109 free(yyvsp[-3].lvc);
3110 }
3111 if(!yyval.tlbar->lvc.language)
3112 {
3113 yyval.tlbar->lvc.language = dup_language(currentlanguage);
3114 }
3115 ;
3116 break;}
3117case 231:
3118#line 1512 "parser.y"
3119{ yyval.tlbarItems = NULL; ;
3120 break;}
3121case 232:
3122#line 1513 "parser.y"
3123{
3124 toolbar_item_t *idrec = new_toolbar_item();
3125 idrec->id = yyvsp[0].num;
3126 yyval.tlbarItems = ins_tlbr_button(yyvsp[-2].tlbarItems, idrec);
3127 ;
3128 break;}
3129case 233:
3130#line 1518 "parser.y"
3131{
3132 toolbar_item_t *idrec = new_toolbar_item();
3133 idrec->id = 0;
3134 yyval.tlbarItems = ins_tlbr_button(yyvsp[-1].tlbarItems, idrec);
3135 ;
3136 break;}
3137case 234:
3138#line 1527 "parser.y"
3139{ yyval.iptr = NULL; ;
3140 break;}
3141case 235:
3142#line 1528 "parser.y"
3143{
3144 if(yyvsp[-1].iptr)
3145 {
3146 *(yyvsp[-1].iptr) |= *(yyvsp[0].iptr);
3147 yyval.iptr = yyvsp[-1].iptr;
3148 free(yyvsp[0].iptr);
3149 }
3150 else
3151 yyval.iptr = yyvsp[0].iptr;
3152 ;
3153 break;}
3154case 236:
3155#line 1538 "parser.y"
3156{
3157 if(yyvsp[-1].iptr)
3158 {
3159 *(yyvsp[-1].iptr) &= *(yyvsp[0].iptr);
3160 yyval.iptr = yyvsp[-1].iptr;
3161 free(yyvsp[0].iptr);
3162 }
3163 else
3164 {
3165 *yyvsp[0].iptr &= WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE | WRC_MO_PURE;
3166 yyval.iptr = yyvsp[0].iptr;
3167 }
3168 ;
3169 break;}
3170case 237:
3171#line 1553 "parser.y"
3172{ yyval.iptr = new_int(WRC_MO_PRELOAD); ;
3173 break;}
3174case 238:
3175#line 1554 "parser.y"
3176{ yyval.iptr = new_int(WRC_MO_MOVEABLE); ;
3177 break;}
3178case 239:
3179#line 1555 "parser.y"
3180{ yyval.iptr = new_int(WRC_MO_DISCARDABLE); ;
3181 break;}
3182case 240:
3183#line 1556 "parser.y"
3184{ yyval.iptr = new_int(WRC_MO_PURE); ;
3185 break;}
3186case 241:
3187#line 1559 "parser.y"
3188{ yyval.iptr = new_int(~WRC_MO_PRELOAD); ;
3189 break;}
3190case 242:
3191#line 1560 "parser.y"
3192{ yyval.iptr = new_int(~WRC_MO_MOVEABLE); ;
3193 break;}
3194case 243:
3195#line 1561 "parser.y"
3196{ yyval.iptr = new_int(~WRC_MO_PURE); ;
3197 break;}
3198case 244:
3199#line 1565 "parser.y"
3200{ yyval.lvc = new_lvc(); ;
3201 break;}
3202case 245:
3203#line 1566 "parser.y"
3204{
3205 if(!win32)
3206 yywarning("LANGUAGE not supported in 16-bit mode");
3207 if(yyvsp[-1].lvc->language)
3208 yyerror("Language already defined");
3209 yyval.lvc = yyvsp[-1].lvc;
3210 yyvsp[-1].lvc->language = yyvsp[0].lan;
3211 ;
3212 break;}
3213case 246:
3214#line 1574 "parser.y"
3215{
3216 if(!win32)
3217 yywarning("CHARACTERISTICS not supported in 16-bit mode");
3218 if(yyvsp[-1].lvc->characts)
3219 yyerror("Characteristics already defined");
3220 yyval.lvc = yyvsp[-1].lvc;
3221 yyvsp[-1].lvc->characts = yyvsp[0].chars;
3222 ;
3223 break;}
3224case 247:
3225#line 1582 "parser.y"
3226{
3227 if(!win32)
3228 yywarning("VERSION not supported in 16-bit mode");
3229 if(yyvsp[-1].lvc->version)
3230 yyerror("Version already defined");
3231 yyval.lvc = yyvsp[-1].lvc;
3232 yyvsp[-1].lvc->version = yyvsp[0].ver;
3233 ;
3234 break;}
3235case 248:
3236#line 1593 "parser.y"
3237{ yyval.lan = new_language(yyvsp[-2].num, yyvsp[0].num); ;
3238 break;}
3239case 249:
3240#line 1597 "parser.y"
3241{ yyval.chars = new_characts(yyvsp[0].num); ;
3242 break;}
3243case 250:
3244#line 1601 "parser.y"
3245{ yyval.ver = new_version(yyvsp[0].num); ;
3246 break;}
3247case 251:
3248#line 1605 "parser.y"
3249{ yyval.raw = yyvsp[-1].raw; ;
3250 break;}
3251case 252:
3252#line 1609 "parser.y"
3253{ yyval.raw = yyvsp[0].raw; ;
3254 break;}
3255case 253:
3256#line 1610 "parser.y"
3257{ yyval.raw = int2raw_data(yyvsp[0].num); ;
3258 break;}
3259case 254:
3260#line 1611 "parser.y"
3261{ yyval.raw = long2raw_data(yyvsp[0].num); ;
3262 break;}
3263case 255:
3264#line 1612 "parser.y"
3265{ yyval.raw = str2raw_data(yyvsp[0].str); ;
3266 break;}
3267case 256:
3268#line 1613 "parser.y"
3269{ yyval.raw = merge_raw_data(yyvsp[-2].raw, yyvsp[0].raw); free(yyvsp[0].raw->data); free(yyvsp[0].raw); ;
3270 break;}
3271case 257:
3272#line 1614 "parser.y"
3273{ yyval.raw = merge_raw_data_int(yyvsp[-2].raw, yyvsp[0].num); ;
3274 break;}
3275case 258:
3276#line 1615 "parser.y"
3277{ yyval.raw = merge_raw_data_long(yyvsp[-2].raw, yyvsp[0].num); ;
3278 break;}
3279case 259:
3280#line 1616 "parser.y"
3281{ yyval.raw = merge_raw_data_str(yyvsp[-2].raw, yyvsp[0].str); ;
3282 break;}
3283case 260:
3284#line 1623 "parser.y"
3285{ yyval.iptr = 0; ;
3286 break;}
3287case 261:
3288#line 1624 "parser.y"
3289{ yyval.iptr = new_int(yyvsp[0].num); ;
3290 break;}
3291case 262:
3292#line 1626 "parser.y"
3293{ yyval.num = (yyvsp[0].num); ;
3294 break;}
3295case 263:
3296#line 1629 "parser.y"
3297{ yyval.num = (yyvsp[-2].num) + (yyvsp[0].num); ;
3298 break;}
3299case 264:
3300#line 1630 "parser.y"
3301{ yyval.num = (yyvsp[-2].num) - (yyvsp[0].num); ;
3302 break;}
3303case 265:
3304#line 1631 "parser.y"
3305{ yyval.num = (yyvsp[-2].num) | (yyvsp[0].num); ;
3306 break;}
3307case 266:
3308#line 1632 "parser.y"
3309{ yyval.num = (yyvsp[-2].num) & (yyvsp[0].num); ;
3310 break;}
3311case 267:
3312#line 1633 "parser.y"
3313{ yyval.num = (yyvsp[-2].num) * (yyvsp[0].num); ;
3314 break;}
3315case 268:
3316#line 1634 "parser.y"
3317{ yyval.num = (yyvsp[-2].num) / (yyvsp[0].num); ;
3318 break;}
3319case 269:
3320#line 1635 "parser.y"
3321{ yyval.num = ~(yyvsp[0].num); ;
3322 break;}
3323case 270:
3324#line 1636 "parser.y"
3325{ yyval.num = -(yyvsp[0].num); ;
3326 break;}
3327case 271:
3328#line 1638 "parser.y"
3329{ yyval.num = yyvsp[-1].num; ;
3330 break;}
3331case 272:
3332#line 1639 "parser.y"
3333{ yyval.num = yyvsp[0].num; want_rscname = 0; ;
3334 break;}
3335case 273:
3336#line 1640 "parser.y"
3337{ yyval.num = ~(yyvsp[0].num); ;
3338 break;}
3339case 274:
3340#line 1643 "parser.y"
3341{ yyval.num = yyvsp[0].num; ;
3342 break;}
3343case 275:
3344#line 1644 "parser.y"
3345{ yyval.num = yyvsp[0].num; ;
3346 break;}
3347}
3348 /* the action file gets copied in in place of this dollarsign */
3349#line 498 "bison.simple"
3350
3351
3352 yyvsp -= yylen;
3353 yyssp -= yylen;
3354#ifdef YYLSP_NEEDED
3355 yylsp -= yylen;
3356#endif
3357
3358#if YYDEBUG != 0
3359 if (yydebug)
3360 {
3361 short *ssp1 = yyss - 1;
3362 fprintf (stderr, "state stack now");
3363 while (ssp1 != yyssp)
3364 fprintf (stderr, " %d", *++ssp1);
3365 fprintf (stderr, "\n");
3366 }
3367#endif
3368
3369 *++yyvsp = yyval;
3370
3371#ifdef YYLSP_NEEDED
3372 yylsp++;
3373 if (yylen == 0)
3374 {
3375 yylsp->first_line = yylloc.first_line;
3376 yylsp->first_column = yylloc.first_column;
3377 yylsp->last_line = (yylsp-1)->last_line;
3378 yylsp->last_column = (yylsp-1)->last_column;
3379 yylsp->text = 0;
3380 }
3381 else
3382 {
3383 yylsp->last_line = (yylsp+yylen-1)->last_line;
3384 yylsp->last_column = (yylsp+yylen-1)->last_column;
3385 }
3386#endif
3387
3388 /* Now "shift" the result of the reduction.
3389 Determine what state that goes to,
3390 based on the state we popped back to
3391 and the rule number reduced by. */
3392
3393 yyn = yyr1[yyn];
3394
3395 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3396 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3397 yystate = yytable[yystate];
3398 else
3399 yystate = yydefgoto[yyn - YYNTBASE];
3400
3401 goto yynewstate;
3402
3403yyerrlab: /* here on detecting error */
3404
3405 if (! yyerrstatus)
3406 /* If not already recovering from an error, report this error. */
3407 {
3408 ++yynerrs;
3409
3410#ifdef YYERROR_VERBOSE
3411 yyn = yypact[yystate];
3412
3413 if (yyn > YYFLAG && yyn < YYLAST)
3414 {
3415 int size = 0;
3416 char *msg;
3417 int x, count;
3418
3419 count = 0;
3420 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3421 for (x = (yyn < 0 ? -yyn : 0);
3422 x < (sizeof(yytname) / sizeof(char *)); x++)
3423 if (yycheck[x + yyn] == x)
3424 size += strlen(yytname[x]) + 15, count++;
3425 msg = (char *) malloc(size + 15);
3426 if (msg != 0)
3427 {
3428 strcpy(msg, "parse error");
3429
3430 if (count < 5)
3431 {
3432 count = 0;
3433 for (x = (yyn < 0 ? -yyn : 0);
3434 x < (sizeof(yytname) / sizeof(char *)); x++)
3435 if (yycheck[x + yyn] == x)
3436 {
3437 strcat(msg, count == 0 ? ", expecting `" : " or `");
3438 strcat(msg, yytname[x]);
3439 strcat(msg, "'");
3440 count++;
3441 }
3442 }
3443 yyerror(msg);
3444 free(msg);
3445 }
3446 else
3447 yyerror ("parse error; also virtual memory exceeded");
3448 }
3449 else
3450#endif /* YYERROR_VERBOSE */
3451 yyerror("parse error");
3452 }
3453
3454 goto yyerrlab1;
3455yyerrlab1: /* here on error raised explicitly by an action */
3456
3457 if (yyerrstatus == 3)
3458 {
3459 /* if just tried and failed to reuse lookahead token after an error, discard it. */
3460
3461 /* return failure if at end of input */
3462 if (yychar == YYEOF)
3463 YYABORT;
3464
3465#if YYDEBUG != 0
3466 if (yydebug)
3467 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3468#endif
3469
3470 yychar = YYEMPTY;
3471 }
3472
3473 /* Else will try to reuse lookahead token
3474 after shifting the error token. */
3475
3476 yyerrstatus = 3; /* Each real token shifted decrements this */
3477
3478 goto yyerrhandle;
3479
3480yyerrdefault: /* current state does not do anything special for the error token. */
3481
3482#if 0
3483 /* This is wrong; only states that explicitly want error tokens
3484 should shift them. */
3485 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3486 if (yyn) goto yydefault;
3487#endif
3488
3489yyerrpop: /* pop the current state because it cannot handle the error token */
3490
3491 if (yyssp == yyss) YYABORT;
3492 yyvsp--;
3493 yystate = *--yyssp;
3494#ifdef YYLSP_NEEDED
3495 yylsp--;
3496#endif
3497
3498#if YYDEBUG != 0
3499 if (yydebug)
3500 {
3501 short *ssp1 = yyss - 1;
3502 fprintf (stderr, "Error: state stack now");
3503 while (ssp1 != yyssp)
3504 fprintf (stderr, " %d", *++ssp1);
3505 fprintf (stderr, "\n");
3506 }
3507#endif
3508
3509yyerrhandle:
3510
3511 yyn = yypact[yystate];
3512 if (yyn == YYFLAG)
3513 goto yyerrdefault;
3514
3515 yyn += YYTERROR;
3516 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3517 goto yyerrdefault;
3518
3519 yyn = yytable[yyn];
3520 if (yyn < 0)
3521 {
3522 if (yyn == YYFLAG)
3523 goto yyerrpop;
3524 yyn = -yyn;
3525 goto yyreduce;
3526 }
3527 else if (yyn == 0)
3528 goto yyerrpop;
3529
3530 if (yyn == YYFINAL)
3531 YYACCEPT;
3532
3533#if YYDEBUG != 0
3534 if (yydebug)
3535 fprintf(stderr, "Shifting error token, ");
3536#endif
3537
3538 *++yyvsp = yylval;
3539#ifdef YYLSP_NEEDED
3540 *++yylsp = yylloc;
3541#endif
3542
3543 yystate = yyn;
3544 goto yynewstate;
3545}
3546#line 1647 "parser.y"
3547
3548/* Dialog specific functions */
3549dialog_t *dialog_style(style_t * st, dialog_t *dlg)
3550{
3551 assert(dlg != NULL);
3552 if(dlg->style == NULL)
3553 {
3554 dlg->style = new_style(0,0);
3555 }
3556
3557 if(dlg->gotstyle)
3558 {
3559 yywarning("Style already defined, or-ing together");
3560 }
3561 else
3562 {
3563 dlg->style->or_mask = 0;
3564 dlg->style->and_mask = 0;
3565 }
3566 dlg->style->or_mask |= st->or_mask;
3567 dlg->style->and_mask |= st->and_mask;
3568 dlg->gotstyle = TRUE;
3569 free(st);
3570 return dlg;
3571}
3572
3573dialog_t *dialog_exstyle(style_t *st, dialog_t *dlg)
3574{
3575 assert(dlg != NULL);
3576 if(dlg->exstyle == NULL)
3577 {
3578 dlg->exstyle = new_style(0,0);
3579 }
3580
3581 if(dlg->gotexstyle)
3582 {
3583 yywarning("ExStyle already defined, or-ing together");
3584 }
3585 else
3586 {
3587 dlg->exstyle->or_mask = 0;
3588 dlg->exstyle->and_mask = 0;
3589 }
3590 dlg->exstyle->or_mask |= st->or_mask;
3591 dlg->exstyle->and_mask |= st->and_mask;
3592 dlg->gotexstyle = TRUE;
3593 free(st);
3594 return dlg;
3595}
3596
3597dialog_t *dialog_caption(string_t *s, dialog_t *dlg)
3598{
3599 assert(dlg != NULL);
3600 if(dlg->title)
3601 yyerror("Caption already defined");
3602 dlg->title = s;
3603 return dlg;
3604}
3605
3606dialog_t *dialog_font(font_id_t *f, dialog_t *dlg)
3607{
3608 assert(dlg != NULL);
3609 if(dlg->font)
3610 yyerror("Font already defined");
3611 dlg->font = f;
3612 return dlg;
3613}
3614
3615dialog_t *dialog_class(name_id_t *n, dialog_t *dlg)
3616{
3617 assert(dlg != NULL);
3618 if(dlg->dlgclass)
3619 yyerror("Class already defined");
3620 dlg->dlgclass = n;
3621 return dlg;
3622}
3623
3624dialog_t *dialog_menu(name_id_t *m, dialog_t *dlg)
3625{
3626 assert(dlg != NULL);
3627 if(dlg->menu)
3628 yyerror("Menu already defined");
3629 dlg->menu = m;
3630 return dlg;
3631}
3632
3633dialog_t *dialog_language(language_t *l, dialog_t *dlg)
3634{
3635 assert(dlg != NULL);
3636 if(dlg->lvc.language)
3637 yyerror("Language already defined");
3638 dlg->lvc.language = l;
3639 return dlg;
3640}
3641
3642dialog_t *dialog_characteristics(characts_t *c, dialog_t *dlg)
3643{
3644 assert(dlg != NULL);
3645 if(dlg->lvc.characts)
3646 yyerror("Characteristics already defined");
3647 dlg->lvc.characts = c;
3648 return dlg;
3649}
3650
3651dialog_t *dialog_version(version_t *v, dialog_t *dlg)
3652{
3653 assert(dlg != NULL);
3654 if(dlg->lvc.version)
3655 yyerror("Version already defined");
3656 dlg->lvc.version = v;
3657 return dlg;
3658}
3659
3660/* Controls specific functions */
3661control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control_t *prev)
3662{
3663 /* Hm... this seems to be jammed in at all time... */
3664 int defaultstyle = WS_CHILD | WS_VISIBLE;
3665
3666 assert(ctrl != NULL);
3667 ctrl->prev = prev;
3668
3669 if(prev)
3670 prev->next = ctrl;
3671
3672 if(type != -1)
3673 {
3674 ctrl->ctlclass = new_name_id();
3675 ctrl->ctlclass->type = name_ord;
3676 ctrl->ctlclass->name.i_name = type;
3677 }
3678
3679 switch(type)
3680 {
3681 case CT_BUTTON:
3682 if(special_style != BS_GROUPBOX && special_style != BS_RADIOBUTTON)
3683 defaultstyle |= WS_TABSTOP;
3684 break;
3685 case CT_EDIT:
3686 defaultstyle |= WS_TABSTOP | WS_BORDER;
3687 break;
3688 case CT_LISTBOX:
3689 defaultstyle |= LBS_NOTIFY | WS_BORDER;
3690 break;
3691 case CT_COMBOBOX:
3692 defaultstyle |= CBS_SIMPLE;
3693 break;
3694 case CT_STATIC:
3695 if(special_style == SS_CENTER || special_style == SS_LEFT || special_style == SS_RIGHT)
3696 defaultstyle |= WS_GROUP;
3697 break;
3698 }
3699
3700 if(!ctrl->gotstyle) /* Handle default style setting */
3701 {
3702 switch(type)
3703 {
3704 case CT_EDIT:
3705 defaultstyle |= ES_LEFT;
3706 break;
3707 case CT_LISTBOX:
3708 defaultstyle |= LBS_NOTIFY;
3709 break;
3710 case CT_COMBOBOX:
3711 defaultstyle |= CBS_SIMPLE | WS_TABSTOP;
3712 break;
3713 case CT_SCROLLBAR:
3714 defaultstyle |= SBS_HORZ;
3715 break;
3716 case CT_BUTTON:
3717 switch(special_style)
3718 {
3719 case BS_CHECKBOX:
3720 case BS_DEFPUSHBUTTON:
3721 case BS_PUSHBUTTON:
3722 case BS_GROUPBOX:
3723/* case BS_PUSHBOX: */
3724 case BS_AUTORADIOBUTTON:
3725 case BS_AUTO3STATE:
3726 case BS_3STATE:
3727 case BS_AUTOCHECKBOX:
3728 defaultstyle |= WS_TABSTOP;
3729 break;
3730 default:
3731 yywarning("Unknown default button control-style 0x%08x", special_style);
3732 case BS_RADIOBUTTON:
3733 break;
3734 }
3735 break;
3736
3737 case CT_STATIC:
3738 switch(special_style)
3739 {
3740 case SS_LEFT:
3741 case SS_RIGHT:
3742 case SS_CENTER:
3743 defaultstyle |= WS_GROUP;
3744 break;
3745 case SS_ICON: /* Special case */
3746 break;
3747 default:
3748 yywarning("Unknown default static control-style 0x%08x", special_style);
3749 break;
3750 }
3751 break;
3752 case -1: /* Generic control */
3753 goto byebye;
3754
3755 default:
3756 yyerror("Internal error (report this): Got weird control type 0x%08x", type);
3757 }
3758 }
3759
3760 /* The SS_ICON flag is always forced in for icon controls */
3761 if(type == CT_STATIC && special_style == SS_ICON)
3762 defaultstyle |= SS_ICON;
3763
3764 if (!ctrl->gotstyle)
3765 ctrl->style = new_style(0,0);
3766
3767 /* combine all styles */
3768 ctrl->style->or_mask = ctrl->style->or_mask | defaultstyle | special_style;
3769 ctrl->gotstyle = TRUE;
3770byebye:
3771 /* combine with NOT mask */
3772 if (ctrl->gotstyle)
3773 {
3774 ctrl->style->or_mask &= ~(ctrl->style->and_mask);
3775 ctrl->style->and_mask = 0;
3776 }
3777 if (ctrl->gotexstyle)
3778 {
3779 ctrl->exstyle->or_mask &= ~(ctrl->exstyle->and_mask);
3780 ctrl->exstyle->and_mask = 0;
3781 }
3782 return ctrl;
3783}
3784
3785name_id_t *convert_ctlclass(name_id_t *cls)
3786{
3787 char *cc;
3788 int iclass;
3789
3790 if(cls->type == name_ord)
3791 return cls;
3792 assert(cls->type == name_str);
3793 if(cls->type == str_unicode)
3794 {
3795 yyerror("Don't yet support unicode class comparison");
3796 }
3797 else
3798 cc = cls->name.s_name->str.cstr;
3799
3800 if(!strcasecmp("BUTTON", cc))
3801 iclass = CT_BUTTON;
3802 else if(!strcasecmp("COMBOBOX", cc))
3803 iclass = CT_COMBOBOX;
3804 else if(!strcasecmp("LISTBOX", cc))
3805 iclass = CT_LISTBOX;
3806 else if(!strcasecmp("EDIT", cc))
3807 iclass = CT_EDIT;
3808 else if(!strcasecmp("STATIC", cc))
3809 iclass = CT_STATIC;
3810 else if(!strcasecmp("SCROLLBAR", cc))
3811 iclass = CT_SCROLLBAR;
3812 else
3813 return cls; /* No default, return user controlclass */
3814
3815 free(cls->name.s_name->str.cstr);
3816 free(cls->name.s_name);
3817 cls->type = name_ord;
3818 cls->name.i_name = iclass;
3819 return cls;
3820}
3821
3822/* DialogEx specific functions */
3823dialogex_t *dialogex_style(style_t * st, dialogex_t *dlg)
3824{
3825 assert(dlg != NULL);
3826 if(dlg->style == NULL)
3827 {
3828 dlg->style = new_style(0,0);
3829 }
3830
3831 if(dlg->gotstyle)
3832 {
3833 yywarning("Style already defined, or-ing together");
3834 }
3835 else
3836 {
3837 dlg->style->or_mask = 0;
3838 dlg->style->and_mask = 0;
3839 }
3840 dlg->style->or_mask |= st->or_mask;
3841 dlg->style->and_mask |= st->and_mask;
3842 dlg->gotstyle = TRUE;
3843 free(st);
3844 return dlg;
3845}
3846
3847dialogex_t *dialogex_exstyle(style_t * st, dialogex_t *dlg)
3848{
3849 assert(dlg != NULL);
3850 if(dlg->exstyle == NULL)
3851 {
3852 dlg->exstyle = new_style(0,0);
3853 }
3854
3855 if(dlg->gotexstyle)
3856 {
3857 yywarning("ExStyle already defined, or-ing together");
3858 }
3859 else
3860 {
3861 dlg->exstyle->or_mask = 0;
3862 dlg->exstyle->and_mask = 0;
3863 }
3864 dlg->exstyle->or_mask |= st->or_mask;
3865 dlg->exstyle->and_mask |= st->and_mask;
3866 dlg->gotexstyle = TRUE;
3867 free(st);
3868 return dlg;
3869}
3870
3871dialogex_t *dialogex_caption(string_t *s, dialogex_t *dlg)
3872{
3873 assert(dlg != NULL);
3874 if(dlg->title)
3875 yyerror("Caption already defined");
3876 dlg->title = s;
3877 return dlg;
3878}
3879
3880dialogex_t *dialogex_font(font_id_t *f, dialogex_t *dlg)
3881{
3882 assert(dlg != NULL);
3883 if(dlg->font)
3884 yyerror("Font already defined");
3885 dlg->font = f;
3886 return dlg;
3887}
3888
3889dialogex_t *dialogex_class(name_id_t *n, dialogex_t *dlg)
3890{
3891 assert(dlg != NULL);
3892 if(dlg->dlgclass)
3893 yyerror("Class already defined");
3894 dlg->dlgclass = n;
3895 return dlg;
3896}
3897
3898dialogex_t *dialogex_menu(name_id_t *m, dialogex_t *dlg)
3899{
3900 assert(dlg != NULL);
3901 if(dlg->menu)
3902 yyerror("Menu already defined");
3903 dlg->menu = m;
3904 return dlg;
3905}
3906
3907dialogex_t *dialogex_language(language_t *l, dialogex_t *dlg)
3908{
3909 assert(dlg != NULL);
3910 if(dlg->lvc.language)
3911 yyerror("Language already defined");
3912 dlg->lvc.language = l;
3913 return dlg;
3914}
3915
3916dialogex_t *dialogex_characteristics(characts_t *c, dialogex_t *dlg)
3917{
3918 assert(dlg != NULL);
3919 if(dlg->lvc.characts)
3920 yyerror("Characteristics already defined");
3921 dlg->lvc.characts = c;
3922 return dlg;
3923}
3924
3925dialogex_t *dialogex_version(version_t *v, dialogex_t *dlg)
3926{
3927 assert(dlg != NULL);
3928 if(dlg->lvc.version)
3929 yyerror("Version already defined");
3930 dlg->lvc.version = v;
3931 return dlg;
3932}
3933
3934/* Accelerator specific functions */
3935event_t *add_event(int key, int id, int flags, event_t *prev)
3936{
3937 event_t *ev = new_event();
3938
3939 if((flags & (WRC_AF_VIRTKEY | WRC_AF_ASCII)) == (WRC_AF_VIRTKEY | WRC_AF_ASCII))
3940 yyerror("Cannot use both ASCII and VIRTKEY");
3941
3942 ev->key = key;
3943 ev->id = id;
3944 ev->flags = flags & ~WRC_AF_ASCII;
3945 ev->prev = prev;
3946 if(prev)
3947 prev->next = ev;
3948 return ev;
3949}
3950
3951event_t *add_string_event(string_t *key, int id, int flags, event_t *prev)
3952{
3953 int keycode = 0;
3954 event_t *ev = new_event();
3955
3956 if(key->type != str_char)
3957 yyerror("Key code must be an ascii string");
3958
3959 if((flags & WRC_AF_VIRTKEY) && (!isupper(key->str.cstr[0]) && !isdigit(key->str.cstr[0])))
3960 yyerror("VIRTKEY code is not equal to ascii value");
3961
3962 if(key->str.cstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0)
3963 {
3964 yyerror("Cannot use both '^' and CONTROL modifier");
3965 }
3966 else if(key->str.cstr[0] == '^')
3967 {
3968 keycode = toupper(key->str.cstr[1]) - '@';
3969 if(keycode >= ' ')
3970 yyerror("Control-code out of range");
3971 }
3972 else
3973 keycode = key->str.cstr[0];
3974 ev->key = keycode;
3975 ev->id = id;
3976 ev->flags = flags & ~WRC_AF_ASCII;
3977 ev->prev = prev;
3978 if(prev)
3979 prev->next = ev;
3980 return ev;
3981}
3982
3983/* MenuEx specific functions */
3984itemex_opt_t *new_itemex_opt(int id, int type, int state, int helpid)
3985{
3986 itemex_opt_t *opt = (itemex_opt_t *)xmalloc(sizeof(itemex_opt_t));
3987 opt->id = id;
3988 opt->type = type;
3989 opt->state = state;
3990 opt->helpid = helpid;
3991 return opt;
3992}
3993
3994/* Raw data functions */
3995raw_data_t *load_file(string_t *name)
3996{
3997 FILE *fp;
3998 raw_data_t *rd;
3999 if(name->type != str_char)
4000 yyerror("Filename must be ASCII string");
4001
4002 fp = open_include(name->str.cstr, 1);
4003 if(!fp)
4004 yyerror("Cannot open file %s", name->str.cstr);
4005 rd = new_raw_data();
4006 fseek(fp, 0, SEEK_END);
4007 rd->size = ftell(fp);
4008 fseek(fp, 0, SEEK_SET);
4009 rd->data = (char *)xmalloc(rd->size);
4010 fread(rd->data, rd->size, 1, fp);
4011 fclose(fp);
4012 HEAPCHECK();
4013 return rd;
4014}
4015
4016raw_data_t *int2raw_data(int i)
4017{
4018 raw_data_t *rd;
4019
4020 if((int)((short)i) != i)
4021 yywarning("Integer constant out of 16bit range (%d), truncated to %d\n", i, (short)i);
4022
4023 rd = new_raw_data();
4024 rd->size = sizeof(short);
4025 rd->data = (char *)xmalloc(rd->size);
4026 *(short *)(rd->data) = (short)i;
4027 return rd;
4028}
4029
4030raw_data_t *long2raw_data(int i)
4031{
4032 raw_data_t *rd;
4033 rd = new_raw_data();
4034 rd->size = sizeof(int);
4035 rd->data = (char *)xmalloc(rd->size);
4036 *(int *)(rd->data) = i;
4037 return rd;
4038}
4039
4040raw_data_t *str2raw_data(string_t *str)
4041{
4042 raw_data_t *rd;
4043 rd = new_raw_data();
4044 rd->size = str->size * (str->type == str_char ? 1 : 2);
4045 rd->data = (char *)xmalloc(rd->size);
4046 memcpy(rd->data, str->str.cstr, rd->size);
4047 return rd;
4048}
4049
4050raw_data_t *merge_raw_data(raw_data_t *r1, raw_data_t *r2)
4051{
4052 r1->data = xrealloc(r1->data, r1->size + r2->size);
4053 memcpy(r1->data + r1->size, r2->data, r2->size);
4054 r1->size += r2->size;
4055 return r1;
4056}
4057
4058raw_data_t *merge_raw_data_int(raw_data_t *r1, int i)
4059{
4060 raw_data_t *t = int2raw_data(i);
4061 merge_raw_data(r1, t);
4062 free(t->data);
4063 free(t);
4064 return r1;
4065}
4066
4067raw_data_t *merge_raw_data_long(raw_data_t *r1, int i)
4068{
4069 raw_data_t *t = long2raw_data(i);
4070 merge_raw_data(r1, t);
4071 free(t->data);
4072 free(t);
4073 return r1;
4074}
4075
4076raw_data_t *merge_raw_data_str(raw_data_t *r1, string_t *str)
4077{
4078 raw_data_t *t = str2raw_data(str);
4079 merge_raw_data(r1, t);
4080 free(t->data);
4081 free(t);
4082 return r1;
4083}
4084
4085/* Function the go back in a list to get the head */
4086menu_item_t *get_item_head(menu_item_t *p)
4087{
4088 if(!p)
4089 return NULL;
4090 while(p->prev)
4091 p = p->prev;
4092 return p;
4093}
4094
4095menuex_item_t *get_itemex_head(menuex_item_t *p)
4096{
4097 if(!p)
4098 return NULL;
4099 while(p->prev)
4100 p = p->prev;
4101 return p;
4102}
4103
4104resource_t *get_resource_head(resource_t *p)
4105{
4106 if(!p)
4107 return NULL;
4108 while(p->prev)
4109 p = p->prev;
4110 return p;
4111}
4112
4113ver_block_t *get_ver_block_head(ver_block_t *p)
4114{
4115 if(!p)
4116 return NULL;
4117 while(p->prev)
4118 p = p->prev;
4119 return p;
4120}
4121
4122ver_value_t *get_ver_value_head(ver_value_t *p)
4123{
4124 if(!p)
4125 return NULL;
4126 while(p->prev)
4127 p = p->prev;
4128 return p;
4129}
4130
4131control_t *get_control_head(control_t *p)
4132{
4133 if(!p)
4134 return NULL;
4135 while(p->prev)
4136 p = p->prev;
4137 return p;
4138}
4139
4140event_t *get_event_head(event_t *p)
4141{
4142 if(!p)
4143 return NULL;
4144 while(p->prev)
4145 p = p->prev;
4146 return p;
4147}
4148
4149/* Find a stringtable with given language */
4150stringtable_t *find_stringtable(lvc_t *lvc)
4151{
4152 stringtable_t *stt;
4153
4154 assert(lvc != NULL);
4155
4156 if(!lvc->language)
4157 lvc->language = dup_language(currentlanguage);
4158
4159 for(stt = sttres; stt; stt = stt->next)
4160 {
4161 if(stt->lvc.language->id == lvc->language->id
4162 && stt->lvc.language->id == lvc->language->id)
4163 {
4164 /* Found a table with the same language */
4165 /* The version and characteristics are now handled
4166 * in the generation of the individual stringtables.
4167 * This enables localized analysis.
4168 if((stt->lvc.version && lvc->version && *(stt->lvc.version) != *(lvc->version))
4169 || (!stt->lvc.version && lvc->version)
4170 || (stt->lvc.version && !lvc->version))
4171 yywarning("Stringtable's versions are not the same, using first definition");
4172
4173 if((stt->lvc.characts && lvc->characts && *(stt->lvc.characts) != *(lvc->characts))
4174 || (!stt->lvc.characts && lvc->characts)
4175 || (stt->lvc.characts && !lvc->characts))
4176 yywarning("Stringtable's characteristics are not the same, using first definition");
4177 */
4178 return stt;
4179 }
4180 }
4181 return NULL;
4182}
4183
4184/* qsort sorting function for string table entries */
4185#define STE(p) ((stt_entry_t *)(p))
4186int sort_stt_entry(const void *e1, const void *e2)
4187{
4188 return STE(e1)->id - STE(e2)->id;
4189}
4190#undef STE
4191
4192resource_t *build_stt_resources(stringtable_t *stthead)
4193{
4194 stringtable_t *stt;
4195 stringtable_t *newstt;
4196 resource_t *rsc;
4197 resource_t *rsclist = NULL;
4198 resource_t *rsctail = NULL;
4199 int i;
4200 int j;
4201 DWORD andsum;
4202 DWORD orsum;
4203 characts_t *characts;
4204 version_t *version;
4205
4206 if(!stthead)
4207 return NULL;
4208
4209 /* For all languages defined */
4210 for(stt = stthead; stt; stt = stt->next)
4211 {
4212 assert(stt->nentries > 0);
4213
4214 /* Sort the entries */
4215 if(stt->nentries > 1)
4216 qsort(stt->entries, stt->nentries, sizeof(stt->entries[0]), sort_stt_entry);
4217
4218 for(i = 0; i < stt->nentries; )
4219 {
4220 newstt = new_stringtable(&stt->lvc);
4221 newstt->entries = (stt_entry_t *)xmalloc(16 * sizeof(stt_entry_t));
4222 newstt->nentries = 16;
4223 newstt->idbase = stt->entries[i].id & ~0xf;
4224 for(j = 0; j < 16 && i < stt->nentries; j++)
4225 {
4226 if(stt->entries[i].id - newstt->idbase == j)
4227 {
4228 newstt->entries[j] = stt->entries[i];
4229 i++;
4230 }
4231 }
4232 andsum = ~0;
4233 orsum = 0;
4234 characts = NULL;
4235 version = NULL;
4236 /* Check individual memory options and get
4237 * the first characteristics/version
4238 */
4239 for(j = 0; j < 16; j++)
4240 {
4241 if(!newstt->entries[j].str)
4242 continue;
4243 andsum &= newstt->entries[j].memopt;
4244 orsum |= newstt->entries[j].memopt;
4245 if(!characts)
4246 characts = newstt->entries[j].characts;
4247 if(!version)
4248 version = newstt->entries[j].version;
4249 }
4250 if(andsum != orsum)
4251 {
4252 warning("Stringtable's memory options are not equal (idbase: %d)", newstt->idbase);
4253 }
4254 /* Check version and characteristics */
4255 for(j = 0; j < 16; j++)
4256 {
4257 if(characts
4258 && newstt->entries[j].characts
4259 && *newstt->entries[j].characts != *characts)
4260 warning("Stringtable's characteristics are not the same (idbase: %d)", newstt->idbase);
4261 if(version
4262 && newstt->entries[j].version
4263 && *newstt->entries[j].version != *version)
4264 warning("Stringtable's versions are not the same (idbase: %d)", newstt->idbase);
4265 }
4266 rsc = new_resource(res_stt, newstt, newstt->memopt, newstt->lvc.language);
4267 rsc->name = new_name_id();
4268 rsc->name->type = name_ord;
4269 rsc->name->name.i_name = (newstt->idbase >> 4) + 1;
4270 rsc->memopt = andsum; /* Set to least common denominator */
4271 newstt->memopt = andsum;
4272 newstt->lvc.characts = characts;
4273 newstt->lvc.version = version;
4274 if(!rsclist)
4275 {
4276 rsclist = rsc;
4277 rsctail = rsc;
4278 }
4279 else
4280 {
4281 rsctail->next = rsc;
4282 rsc->prev = rsctail;
4283 rsctail = rsc;
4284 }
4285 }
4286 }
4287 return rsclist;
4288}
4289
4290/* Cursor and icon splitter functions */
4291typedef struct {
4292 language_t lan;
4293 int id;
4294} id_alloc_t;
4295
4296static int get_new_id(id_alloc_t **list, int *n, language_t *lan)
4297{
4298 int i;
4299 assert(lan != NULL);
4300 assert(list != NULL);
4301 assert(n != NULL);
4302
4303 if(!*list)
4304 {
4305 *list = (id_alloc_t *)xmalloc(sizeof(id_alloc_t));
4306 *n = 1;
4307 (*list)[0].lan = *lan;
4308 (*list)[0].id = 1;
4309 return 1;
4310 }
4311
4312 for(i = 0; i < *n; i++)
4313 {
4314 if((*list)[i].lan.id == lan->id && (*list)[i].lan.sub == lan->sub)
4315 return ++((*list)[i].id);
4316 }
4317
4318 *list = (id_alloc_t *)xrealloc(*list, sizeof(id_alloc_t) * (*n+1));
4319 (*list)[*n].lan = *lan;
4320 (*list)[*n].id = 1;
4321 *n += 1;
4322 return 1;
4323}
4324
4325int alloc_icon_id(language_t *lan)
4326{
4327 static id_alloc_t *idlist = NULL;
4328 static int nid = 0;
4329
4330 return get_new_id(&idlist, &nid, lan);
4331}
4332
4333int alloc_cursor_id(language_t *lan)
4334{
4335 static id_alloc_t *idlist = NULL;
4336 static int nid = 0;
4337
4338 return get_new_id(&idlist, &nid, lan);
4339}
4340
4341#define BPTR(base) ((char *)(rd->data + (base)))
4342#define WPTR(base) ((WORD *)(rd->data + (base)))
4343#define DPTR(base) ((DWORD *)(rd->data + (base)))
4344void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico)
4345{
4346 int cnt;
4347 int i;
4348 icon_dir_entry_t *ide;
4349 icon_t *ico;
4350 icon_t *list = NULL;
4351
4352 /* FIXME: Distinguish between normal and animated icons (RIFF format) */
4353 if(WPTR(0)[1] != 1)
4354 yyerror("Icon resource data has invalid type id %d", WPTR(0)[1]);
4355 cnt = WPTR(0)[2];
4356 ide = (icon_dir_entry_t *)&(WPTR(0)[3]);
4357 for(i = 0; i < cnt; i++)
4358 {
4359 ico = new_icon();
4360 ico->id = alloc_icon_id(icog->lvc.language);
4361 ico->lvc.language = dup_language(icog->lvc.language);
4362 if(ide[i].offset > rd->size
4363 || ide[i].offset + ide[i].ressize > rd->size)
4364 yyerror("Icon resource data corrupt");
4365 ico->width = ide[i].width;
4366 ico->height = ide[i].height;
4367 ico->nclr = ide[i].nclr;
4368 ico->planes = ide[i].planes;
4369 ico->bits = ide[i].bits;
4370 if(!ico->planes)
4371 {
4372 /* Argh! They did not fill out the resdir structure */
4373 ico->planes = ((BITMAPINFOHEADER *)BPTR(ide[i].offset))->biPlanes;
4374 }
4375 if(!ico->bits)
4376 {
4377 /* Argh! They did not fill out the resdir structure */
4378 ico->bits = ((BITMAPINFOHEADER *)BPTR(ide[i].offset))->biBitCount;
4379 }
4380 ico->data = new_raw_data();
4381 copy_raw_data(ico->data, rd, ide[i].offset, ide[i].ressize);
4382 if(!list)
4383 {
4384 list = ico;
4385 }
4386 else
4387 {
4388 ico->next = list;
4389 list->prev = ico;
4390 list = ico;
4391 }
4392 }
4393 icog->iconlist = list;
4394 *nico = cnt;
4395}
4396
4397void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
4398{
4399 int cnt;
4400 int i;
4401 cursor_dir_entry_t *cde;
4402 cursor_t *cur;
4403 cursor_t *list = NULL;
4404
4405 /* FIXME: Distinguish between normal and animated cursors (RIFF format)*/
4406 if(WPTR(0)[1] != 2)
4407 yyerror("Cursor resource data has invalid type id %d", WPTR(0)[1]);
4408 cnt = WPTR(0)[2];
4409 cde = (cursor_dir_entry_t *)&(WPTR(0)[3]);
4410 for(i = 0; i < cnt; i++)
4411 {
4412 cur = new_cursor();
4413 cur->id = alloc_cursor_id(curg->lvc.language);
4414 cur->lvc.language = dup_language(curg->lvc.language);
4415 if(cde[i].offset > rd->size
4416 || cde[i].offset + cde[i].ressize > rd->size)
4417 yyerror("Cursor resource data corrupt");
4418 cur->width = cde[i].width;
4419 cur->height = cde[i].height;
4420 cur->nclr = cde[i].nclr;
4421 /* The next two are to support color cursors */
4422 cur->planes = ((BITMAPINFOHEADER *)BPTR(cde[i].offset))->biPlanes;
4423 cur->bits = ((BITMAPINFOHEADER *)BPTR(cde[i].offset))->biBitCount;
4424 if(!win32 && (cur->planes != 1 || cur->bits != 1))
4425 yywarning("Win16 cursor contains colors");
4426 cur->xhot = cde[i].xhot;
4427 cur->yhot = cde[i].yhot;
4428 cur->data = new_raw_data();
4429 copy_raw_data(cur->data, rd, cde[i].offset, cde[i].ressize);
4430 if(!list)
4431 {
4432 list = cur;
4433 }
4434 else
4435 {
4436 cur->next = list;
4437 list->prev = cur;
4438 list = cur;
4439 }
4440 }
4441 curg->cursorlist = list;
4442 *ncur = cnt;
4443}
4444
4445#undef BPTR
4446#undef WPTR
4447#undef DPTR
4448
4449
4450toolbar_item_t *ins_tlbr_button(toolbar_item_t *prev, toolbar_item_t *idrec)
4451{
4452 idrec->prev = prev;
4453 if(prev)
4454 prev->next = idrec;
4455
4456 return idrec;
4457}
4458
4459toolbar_item_t *get_tlbr_buttons_head(toolbar_item_t *p, int *nitems)
4460{
4461 if(!p)
4462 {
4463 *nitems = 0;
4464 return NULL;
4465 }
4466
4467 *nitems = 1;
4468
4469 while(p->prev)
4470 {
4471 (*nitems)++;
4472 p = p->prev;
4473 }
4474
4475 return p;
4476}
4477
Note: See TracBrowser for help on using the repository browser.