1 %{ /* rcparse.y -- parser for Windows rc files
2 Copyright 1997 Free Software Foundation, Inc.
3 Written by Ian Lance Taylor, Cygnus Support.
5 This file is part of GNU Binutils.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 /* This is a parser for Windows rc files. It is based on the parser
23 by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */
27 #include "libiberty.h"
30 /* The current language. The default is U.S. English. */
32 static unsigned short language = 0x409;
34 /* The resource information during a sub statement. */
36 static struct res_res_info sub_res_info;
38 /* Dialog information. This is built by the nonterminals styles and
41 static struct dialog dialog;
43 /* This is used when building a style. It is modified by the
44 nonterminal styleexpr. */
46 static unsigned long style;
48 /* These are used when building a control. They are set before using
51 static unsigned long base_style;
52 static unsigned long default_style;
53 static unsigned long class;
59 struct accelerator acc;
60 struct accelerator *pacc;
61 struct dialog_control *dialog_control;
62 struct menuitem *menuitem;
63 struct rcdata_data *rcdata;
64 struct stringtable_data *stringtable;
65 struct fixed_versioninfo *fixver;
66 struct ver_info *verinfo;
67 struct ver_stringinfo *verstring;
68 struct ver_varinfo *vervar;
70 struct res_res_info res_info;
79 /* Nonzero if this number was explicitly specified as long. */
88 %token ACCELERATORS VIRTKEY ASCII NOINVERT SHIFT CONTROL ALT
91 %token DIALOG DIALOGEX EXSTYLE CAPTION CLASS STYLE
92 %token AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON CHECKBOX COMBOBOX CTEXT
93 %token DEFPUSHBUTTON EDITTEXT GROUPBOX LISTBOX LTEXT PUSHBOX PUSHBUTTON
94 %token RADIOBUTTON RTEXT SCROLLBAR STATE3 USERBUTTON
95 %token BEDIT HEDIT IEDIT
98 %token LANGUAGE CHARACTERISTICS VERSION
99 %token MENU MENUEX MENUITEM SEPARATOR POPUP CHECKED GRAYED HELP INACTIVE
100 %token MENUBARBREAK MENUBREAK
104 %token VERSIONINFO FILEVERSION PRODUCTVERSION FILEFLAGSMASK FILEFLAGS
105 %token FILEOS FILETYPE FILESUBTYPE BLOCKSTRINGFILEINFO BLOCKVARFILEINFO
108 %token MOVEABLE FIXED PURE IMPURE PRELOAD LOADONCALL DISCARDABLE
110 %token <s> QUOTEDSTRING STRING
113 %type <pacc> acc_entries
114 %type <acc> acc_entry acc_event
115 %type <dialog_control> control control_params
116 %type <menuitem> menuitems menuitem menuexitems menuexitem
117 %type <rcdata> optrcdata_data rcdata_data opt_control_data
118 %type <fixver> fixedverinfo
119 %type <verinfo> verblocks
120 %type <verstring> vervals
121 %type <vervar> vertrans
122 %type <res_info> suboptions memflags_move_discard memflags_move
123 %type <memflags> memflag
125 %type <il> exstyle parennumber
126 %type <il> numexpr posnumexpr cnumexpr optcnumexpr cposnumexpr
127 %type <is> acc_options acc_option menuitem_flags menuitem_flag
128 %type <s> optstringc file_name
129 %type <i> sizednumexpr sizedposnumexpr
158 /* Accelerator resources. */
161 id ACCELERATORS suboptions BEG acc_entries END
163 define_accelerator ($1, &$3, $5);
172 | acc_entries acc_entry
174 struct accelerator *a;
176 a = (struct accelerator *) xmalloc (sizeof *a);
182 struct accelerator **pp;
184 for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next)
193 acc_event cposnumexpr
198 | acc_event cposnumexpr ',' acc_options
216 $$.flags = ACC_CONTROL;
221 rcparse_warning ("accelerator should only be one character");
237 | acc_options ',' acc_option
250 /* This is just the absence of VIRTKEY. */
271 /* Bitmap resources. */
274 id BITMAP memflags_move file_name
276 define_bitmap ($1, &$3, $4);
281 /* Cursor resources. */
284 id CURSOR memflags_move_discard file_name
286 define_cursor ($1, &$3, $4);
291 /* Dialog resources. */
294 id DIALOG memflags_move exstyle posnumexpr cnumexpr cnumexpr
297 memset (&dialog, 0, sizeof dialog);
302 dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
306 dialog.controls = NULL;
309 styles BEG controls END
311 define_dialog ($1, &sub_res_info, &dialog);
313 | id DIALOGEX memflags_move exstyle posnumexpr cnumexpr cnumexpr
316 memset (&dialog, 0, sizeof dialog);
321 dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
324 dialog.ex = ((struct dialog_ex *)
325 xmalloc (sizeof (struct dialog_ex)));
326 memset (dialog.ex, 0, sizeof (struct dialog_ex));
327 dialog.controls = NULL;
330 styles BEG controls END
332 define_dialog ($1, &sub_res_info, &dialog);
334 | id DIALOGEX memflags_move exstyle posnumexpr cnumexpr cnumexpr
337 memset (&dialog, 0, sizeof dialog);
342 dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
345 dialog.ex = ((struct dialog_ex *)
346 xmalloc (sizeof (struct dialog_ex)));
347 memset (dialog.ex, 0, sizeof (struct dialog_ex));
348 dialog.ex->help = $9;
349 dialog.controls = NULL;
352 styles BEG controls END
354 define_dialog ($1, &sub_res_info, &dialog);
363 | EXSTYLE '=' numexpr
371 | styles CAPTION QUOTEDSTRING
380 { style = dialog.style }
383 dialog.style = style;
385 | styles EXSTYLE numexpr
389 | styles FONT numexpr ',' QUOTEDSTRING
391 dialog.pointsize = $3;
394 | styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr
396 dialog.pointsize = $3;
398 if (dialog.ex == NULL)
399 rcparse_warning ("extended FONT requires DIALOGEX");
402 dialog.ex->weight = $6;
403 dialog.ex->italic = $7;
410 | styles CHARACTERISTICS numexpr
412 sub_res_info.characteristics = $3;
414 | styles LANGUAGE numexpr cnumexpr
416 sub_res_info.language = $3 | ($4 << 8);
418 | styles VERSION numexpr
420 sub_res_info.version = $3;
428 struct dialog_control **pp;
430 for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next)
439 default_style = BS_AUTO3STATE | WS_TABSTOP;
440 base_style = BS_AUTO3STATE;
449 default_style = BS_AUTOCHECKBOX | WS_TABSTOP;
450 base_style = BS_AUTOCHECKBOX;
459 default_style = BS_AUTORADIOBUTTON | WS_TABSTOP;
460 base_style = BS_AUTORADIOBUTTON;
469 default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
470 base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
476 if (dialog.ex == NULL)
477 rcparse_warning ("IEDIT requires DIALOGEX");
478 res_string_to_id (&$$->class, "BEDIT");
482 default_style = BS_CHECKBOX | WS_TABSTOP;
483 base_style = BS_CHECKBOX | WS_TABSTOP;
492 default_style = CBS_SIMPLE | WS_TABSTOP;
494 class = CTL_COMBOBOX;
500 | CONTROL optstringc numexpr cnumexpr control_styleexpr cnumexpr
501 cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data
503 $$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10);
506 if (dialog.ex == NULL)
507 rcparse_warning ("control data requires DIALOGEX");
511 | CONTROL optstringc numexpr cnumexpr control_styleexpr cnumexpr
512 cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data
514 $$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10);
515 if (dialog.ex == NULL)
516 rcparse_warning ("help ID requires DIALOGEX");
522 default_style = SS_CENTER | WS_GROUP;
523 base_style = SS_CENTER;
532 default_style = BS_DEFPUSHBUTTON | WS_TABSTOP;
533 base_style = BS_DEFPUSHBUTTON | WS_TABSTOP;
542 default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
543 base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
552 default_style = BS_GROUPBOX;
553 base_style = BS_GROUPBOX;
562 default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
563 base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
569 if (dialog.ex == NULL)
570 rcparse_warning ("IEDIT requires DIALOGEX");
571 res_string_to_id (&$$->class, "HEDIT");
573 | ICON optstringc numexpr cnumexpr cnumexpr opt_control_data
575 $$ = define_control ($2, $3, $4, $5, 0, 0, CTL_STATIC,
576 SS_ICON | WS_CHILD | WS_VISIBLE, 0);
579 if (dialog.ex == NULL)
580 rcparse_warning ("control data requires DIALOGEX");
584 | ICON optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
585 icon_styleexpr optcnumexpr opt_control_data
587 $$ = define_control ($2, $3, $4, $5, $6, $7, CTL_STATIC,
591 if (dialog.ex == NULL)
592 rcparse_warning ("control data requires DIALOGEX");
596 | ICON optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
597 icon_styleexpr cnumexpr cnumexpr opt_control_data
599 $$ = define_control ($2, $3, $4, $5, $6, $7, CTL_STATIC,
601 if (dialog.ex == NULL)
602 rcparse_warning ("help ID requires DIALOGEX");
608 default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
609 base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
615 if (dialog.ex == NULL)
616 rcparse_warning ("IEDIT requires DIALOGEX");
617 res_string_to_id (&$$->class, "IEDIT");
621 default_style = LBS_NOTIFY | WS_BORDER;
622 base_style = LBS_NOTIFY | WS_BORDER;
631 default_style = SS_LEFT | WS_GROUP;
632 base_style = SS_LEFT;
641 default_style = BS_PUSHBOX | WS_TABSTOP;
642 base_style = BS_PUSHBOX;
651 default_style = BS_PUSHBUTTON | WS_TABSTOP;
652 base_style = BS_PUSHBUTTON | WS_TABSTOP;
661 default_style = BS_RADIOBUTTON | WS_TABSTOP;
662 base_style = BS_RADIOBUTTON;
671 default_style = SS_RIGHT | WS_GROUP;
672 base_style = SS_RIGHT;
681 default_style = SBS_HORZ;
683 class = CTL_SCROLLBAR;
691 default_style = BS_3STATE | WS_TABSTOP;
692 base_style = BS_3STATE;
699 | USERBUTTON QUOTEDSTRING ',' numexpr ',' numexpr ',' numexpr ','
700 numexpr ',' numexpr ','
701 { style = WS_CHILD | WS_VISIBLE }
702 styleexpr optcnumexpr
704 $$ = define_control ($2, $4, $6, $8, $10, $12, CTL_BUTTON,
709 /* Parameters for a control. The static variables DEFAULT_STYLE,
710 BASE_STYLE, and CLASS must be initialized before this nonterminal
711 is used. DEFAULT_STYLE is the style to use if no style expression
712 is specified. BASE_STYLE is the base style to use if a style
713 expression is specified; the style expression modifies the base
714 style. CLASS is the class of the control. */
717 optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
720 $$ = define_control ($1, $2, $3, $4, $5, $6, class,
721 default_style | WS_CHILD | WS_VISIBLE, 0);
724 if (dialog.ex == NULL)
725 rcparse_warning ("control data requires DIALOGEX");
729 | optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
730 control_params_styleexpr optcnumexpr opt_control_data
732 $$ = define_control ($1, $2, $3, $4, $5, $6, class, style, $8);
735 if (dialog.ex == NULL)
736 rcparse_warning ("control data requires DIALOGEX");
740 | optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
741 control_params_styleexpr cnumexpr cnumexpr opt_control_data
743 $$ = define_control ($1, $2, $3, $4, $5, $6, class, style, $8);
744 if (dialog.ex == NULL)
745 rcparse_warning ("help ID requires DIALOGEX");
767 | BEG optrcdata_data END
773 /* These only exist to parse a reduction out of a common case. */
777 { style = WS_CHILD | WS_VISIBLE; }
783 { style = SS_ICON | WS_CHILD | WS_VISIBLE; }
787 control_params_styleexpr:
789 { style = base_style | WS_CHILD | WS_VISIBLE; }
793 /* Font resources. */
796 id FONT memflags_move_discard file_name
798 define_font ($1, &$3, $4);
803 /* Icon resources. */
806 id ICON memflags_move_discard file_name
808 define_icon ($1, &$3, $4);
813 /* Language command. This changes the static variable language, which
814 affects all subsequent resources. */
817 LANGUAGE numexpr cnumexpr
819 language = $2 | ($3 << 8);
823 /* Menu resources. */
826 id MENU suboptions BEG menuitems END
828 define_menu ($1, &$3, $5);
843 struct menuitem **pp;
845 for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next)
854 MENUITEM QUOTEDSTRING cnumexpr menuitem_flags
856 $$ = define_menuitem ($2, $3, $4, 0, 0, NULL);
860 $$ = define_menuitem (NULL, 0, 0, 0, 0, NULL);
862 | POPUP QUOTEDSTRING menuitem_flags BEG menuitems END
864 $$ = define_menuitem ($2, 0, $3, 0, 0, $5);
873 | menuitem_flags ',' menuitem_flag
877 | menuitem_flags menuitem_flag
886 $$ = MENUITEM_CHECKED;
890 $$ = MENUITEM_GRAYED;
898 $$ = MENUITEM_INACTIVE;
902 $$ = MENUITEM_MENUBARBREAK;
906 $$ = MENUITEM_MENUBREAK;
910 /* Menuex resources. */
913 id MENUEX suboptions BEG menuexitems END
915 define_menu ($1, &$3, $5);
924 | menuexitems menuexitem
930 struct menuitem **pp;
932 for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next)
941 MENUITEM QUOTEDSTRING
943 $$ = define_menuitem ($2, 0, 0, 0, 0, NULL);
945 | MENUITEM QUOTEDSTRING cnumexpr
947 $$ = define_menuitem ($2, $3, 0, 0, 0, NULL);
949 | MENUITEM QUOTEDSTRING cnumexpr cnumexpr optcnumexpr
951 $$ = define_menuitem ($2, $3, $4, $5, 0, NULL);
953 | POPUP QUOTEDSTRING BEG menuexitems END
955 $$ = define_menuitem ($2, 0, 0, 0, 0, $4);
957 | POPUP QUOTEDSTRING cnumexpr BEG menuexitems END
959 $$ = define_menuitem ($2, $3, 0, 0, 0, $5);
961 | POPUP QUOTEDSTRING cnumexpr cnumexpr BEG menuexitems END
963 $$ = define_menuitem ($2, $3, $4, 0, 0, $6);
965 | POPUP QUOTEDSTRING cnumexpr cnumexpr cnumexpr optcnumexpr
968 $$ = define_menuitem ($2, $3, $4, $5, $6, $8);
972 /* Messagetable resources. */
975 id MESSAGETABLE memflags_move file_name
977 define_messagetable ($1, &$3, $4);
982 /* Rcdata resources. */
985 id RCDATA suboptions BEG optrcdata_data END
987 define_rcdata ($1, &$3, $5);
1005 $$ = append_rcdata_string (NULL, $1);
1009 $$ = append_rcdata_number (NULL, $1.val, $1.dword);
1011 | rcdata_data ',' QUOTEDSTRING
1013 $$ = append_rcdata_string ($1, $3);
1015 | rcdata_data ',' sizednumexpr
1017 $$ = append_rcdata_number ($1, $3.val, $3.dword);
1021 /* Stringtable resources. */
1024 STRINGTABLE suboptions BEG
1025 { sub_res_info = $2; }
1031 | string_data numexpr QUOTEDSTRING
1033 define_stringtable (&sub_res_info, $2, $3);
1035 | string_data numexpr ',' QUOTEDSTRING
1037 define_stringtable (&sub_res_info, $2, $4);
1041 /* User defined resources. We accept general suboptions in the
1042 file_name case to keep the parser happy. */
1045 id id suboptions BEG rcdata_data END
1047 define_user_data ($1, $2, &$3, $5);
1049 | id id suboptions file_name
1051 define_user_file ($1, $2, &$3, $4);
1056 /* Versioninfo resources. */
1059 id VERSIONINFO fixedverinfo BEG verblocks END
1061 define_versioninfo ($1, language, $3, $5);
1068 $$ = ((struct fixed_versioninfo *)
1069 xmalloc (sizeof (struct fixed_versioninfo)));
1070 memset ($$, 0, sizeof (struct fixed_versioninfo));
1072 | fixedverinfo FILEVERSION numexpr cnumexpr cnumexpr cnumexpr
1074 $1->file_version_ms = ($3 << 16) | $4;
1075 $1->file_version_ls = ($5 << 16) | $6;
1078 | fixedverinfo PRODUCTVERSION numexpr cnumexpr cnumexpr cnumexpr
1080 $1->product_version_ms = ($3 << 16) | $4;
1081 $1->product_version_ls = ($5 << 16) | $6;
1084 | fixedverinfo FILEFLAGSMASK numexpr
1086 $1->file_flags_mask = $3;
1089 | fixedverinfo FILEFLAGS numexpr
1091 $1->file_flags = $3;
1094 | fixedverinfo FILEOS numexpr
1099 | fixedverinfo FILETYPE numexpr
1104 | fixedverinfo FILESUBTYPE numexpr
1106 $1->file_subtype = $3;
1111 /* To handle verblocks successfully, the lexer handles BLOCK
1112 specially. A BLOCK "StringFileInfo" is returned as
1113 BLOCKSTRINGFILEINFO. A BLOCK "VarFileInfo" is returned as
1114 BLOCKVARFILEINFO. A BLOCK with some other string returns BLOCK
1115 with the string as the value. */
1122 | verblocks BLOCKSTRINGFILEINFO BEG BLOCK BEG vervals END END
1124 $$ = append_ver_stringfileinfo ($1, $4, $6);
1126 | verblocks BLOCKVARFILEINFO BEG VALUE QUOTEDSTRING vertrans END
1128 $$ = append_ver_varfileinfo ($1, $5, $6);
1137 | vervals VALUE QUOTEDSTRING ',' QUOTEDSTRING
1139 $$ = append_verval ($1, $3, $5);
1148 | vertrans cnumexpr cnumexpr
1150 $$ = append_vertrans ($1, $2, $3);
1154 /* A resource ID. */
1164 res_string_to_id (&$$, $1);
1169 /* Generic suboptions. These may appear before the BEGIN in any
1170 multiline statement. */
1175 memset (&$$, 0, sizeof (struct res_res_info));
1176 $$.language = language;
1177 /* FIXME: Is this the right default? */
1178 $$.memflags = MEMFLAG_MOVEABLE;
1180 | suboptions memflag
1183 $$.memflags |= $2.on;
1184 $$.memflags &=~ $2.off;
1186 | suboptions CHARACTERISTICS numexpr
1189 $$.characteristics = $3;
1191 | suboptions LANGUAGE numexpr cnumexpr
1194 $$.language = $3 | ($4 << 8);
1196 | suboptions VERSION numexpr
1203 /* Memory flags which default to MOVEABLE and DISCARDABLE. */
1205 memflags_move_discard:
1208 memset (&$$, 0, sizeof (struct res_res_info));
1209 $$.language = language;
1210 $$.memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE;
1212 | memflags_move_discard memflag
1215 $$.memflags |= $2.on;
1216 $$.memflags &=~ $2.off;
1220 /* Memory flags which default to MOVEABLE. */
1225 memset (&$$, 0, sizeof (struct res_res_info));
1226 $$.language = language;
1227 $$.memflags = MEMFLAG_MOVEABLE;
1229 | memflags_move_discard memflag
1232 $$.memflags |= $2.on;
1233 $$.memflags &=~ $2.off;
1237 /* Memory flags. This returns a struct with two integers, because we
1238 sometimes want to set bits and we sometimes want to clear them. */
1243 $$.on = MEMFLAG_MOVEABLE;
1249 $$.off = MEMFLAG_MOVEABLE;
1253 $$.on = MEMFLAG_PURE;
1259 $$.off = MEMFLAG_PURE;
1263 $$.on = MEMFLAG_PRELOAD;
1269 $$.off = MEMFLAG_PRELOAD;
1273 $$.on = MEMFLAG_DISCARDABLE;
1291 /* A style expression. This changes the static variable STYLE. We do
1292 it this way because rc appears to permit a style to be set to
1294 WS_GROUP | NOT WS_TABSTOP
1295 to mean that a default of WS_TABSTOP should be removed. Anything
1296 which wants to accept a style must first set STYLE to the default
1297 value. The styleexpr nonterminal will change STYLE as specified by
1298 the user. Note that we do not accept arbitrary expressions here,
1299 just numbers separated by '|'. */
1310 | styleexpr '|' parennumber
1314 | styleexpr '|' NOT parennumber
1331 /* An optional expression with a leading comma. */
1344 /* An expression with a leading comma. */
1353 /* A possibly negated numeric expression. */
1362 /* A possibly negated expression with a size. */
1369 | '(' sizednumexpr ')'
1373 | '~' sizednumexpr %prec '~'
1376 $$.dword = $2.dword;
1378 | '-' sizednumexpr %prec NEG
1381 $$.dword = $2.dword;
1383 | sizednumexpr '*' sizednumexpr
1385 $$.val = $1.val * $3.val;
1386 $$.dword = $1.dword || $3.dword;
1388 | sizednumexpr '/' sizednumexpr
1390 $$.val = $1.val / $3.val;
1391 $$.dword = $1.dword || $3.dword;
1393 | sizednumexpr '%' sizednumexpr
1395 $$.val = $1.val % $3.val;
1396 $$.dword = $1.dword || $3.dword;
1398 | sizednumexpr '+' sizednumexpr
1400 $$.val = $1.val + $3.val;
1401 $$.dword = $1.dword || $3.dword;
1403 | sizednumexpr '-' sizednumexpr
1405 $$.val = $1.val - $3.val;
1406 $$.dword = $1.dword || $3.dword;
1408 | sizednumexpr '&' sizednumexpr
1410 $$.val = $1.val & $3.val;
1411 $$.dword = $1.dword || $3.dword;
1413 | sizednumexpr '^' sizednumexpr
1415 $$.val = $1.val ^ $3.val;
1416 $$.dword = $1.dword || $3.dword;
1418 | sizednumexpr '|' sizednumexpr
1420 $$.val = $1.val | $3.val;
1421 $$.dword = $1.dword || $3.dword;
1425 /* An expression with a leading comma which does not use unary
1435 /* An expression which does not use unary negation. */
1444 /* An expression which does not use unary negation. We separate unary
1445 negation to avoid parsing conflicts when two numeric expressions
1446 appear consecutively. */
1453 | '(' sizednumexpr ')'
1457 | '~' sizednumexpr %prec '~'
1460 $$.dword = $2.dword;
1462 | sizedposnumexpr '*' sizednumexpr
1464 $$.val = $1.val * $3.val;
1465 $$.dword = $1.dword || $3.dword;
1467 | sizedposnumexpr '/' sizednumexpr
1469 $$.val = $1.val / $3.val;
1470 $$.dword = $1.dword || $3.dword;
1472 | sizedposnumexpr '%' sizednumexpr
1474 $$.val = $1.val % $3.val;
1475 $$.dword = $1.dword || $3.dword;
1477 | sizedposnumexpr '+' sizednumexpr
1479 $$.val = $1.val + $3.val;
1480 $$.dword = $1.dword || $3.dword;
1482 | sizedposnumexpr '-' sizednumexpr
1484 $$.val = $1.val - $3.val;
1485 $$.dword = $1.dword || $3.dword;
1487 | sizedposnumexpr '&' sizednumexpr
1489 $$.val = $1.val & $3.val;
1490 $$.dword = $1.dword || $3.dword;
1492 | sizedposnumexpr '^' sizednumexpr
1494 $$.val = $1.val ^ $3.val;
1495 $$.dword = $1.dword || $3.dword;
1497 | sizedposnumexpr '|' sizednumexpr
1499 $$.val = $1.val | $3.val;
1500 $$.dword = $1.dword || $3.dword;
1506 /* Set the language from the command line. */
1509 rcparse_set_language (lang)