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

Last change on this file since 1355 was 1355, checked in by sandervl, 26 years ago

* empty log message *

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