Add new machien types and section flags
[deliverable/binutils-gdb.git] / binutils / rcparse.y
index 67079a5fd81ef6b4353771b971372961e377236a..b67338f9d0455ce0ce742df6d5e3922ce6152b9e 100644 (file)
@@ -122,6 +122,7 @@ static unsigned long class;
 %token <s> QUOTEDSTRING STRING
 %token <i> NUMBER
 %token <ss> SIZEDSTRING
+%token IGNORED_TOKEN
 
 %type <pacc> acc_entries
 %type <acc> acc_entry acc_event
@@ -135,11 +136,11 @@ static unsigned long class;
 %type <vervar> vertrans
 %type <res_info> suboptions memflags_move_discard memflags_move
 %type <memflags> memflag
-%type <id> id
+%type <id> id resref
 %type <il> exstyle parennumber
 %type <il> numexpr posnumexpr cnumexpr optcnumexpr cposnumexpr
 %type <is> acc_options acc_option menuitem_flags menuitem_flag
-%type <s> optstringc file_name
+%type <s> optstringc file_name resname
 %type <i> sizednumexpr sizedposnumexpr
 
 %left '|'
@@ -167,6 +168,7 @@ input:
        | input newcmd stringtable
        | input newcmd user
        | input newcmd versioninfo
+       | input newcmd IGNORED_TOKEN
        ;
 
 newcmd:
@@ -634,39 +636,29 @@ control:
              rcparse_warning (_("IEDIT requires DIALOGEX"));
            res_string_to_id (&$$->class, "HEDIT");
          }
-       | ICON optstringc numexpr cnumexpr cnumexpr opt_control_data
-         {
-           $$ = define_control ($2, $3, $4, $5, 0, 0, CTL_STATIC,
-                                SS_ICON | WS_CHILD | WS_VISIBLE, 0);
-           if ($6 != NULL)
-             {
-               if (dialog.ex == NULL)
-                 rcparse_warning (_("control data requires DIALOGEX"));
-               $$->data = $6;
-             }
-         }
-       | ICON optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+       | ICON resref numexpr cnumexpr cnumexpr opt_control_data
+          {
+           $$ = define_icon_control ($2, $3, $4, $5, 0, 0, 0, $6,
+                                     dialog.ex);
+          }
+       | ICON resref numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+           opt_control_data
+          {
+           $$ = define_icon_control ($2, $3, $4, $5, 0, 0, 0, $8,
+                                     dialog.ex);
+          }
+       | ICON resref numexpr cnumexpr cnumexpr cnumexpr cnumexpr
            icon_styleexpr optcnumexpr opt_control_data
-         {
-           $$ = define_control ($2, $3, $4, $5, $6, $7, CTL_STATIC,
-                                style, $9);
-           if ($10 != NULL)
-             {
-               if (dialog.ex == NULL)
-                 rcparse_warning (_("control data requires DIALOGEX"));
-               $$->data = $10;
-             }
-         }
-       | ICON optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+          {
+           $$ = define_icon_control ($2, $3, $4, $5, style, $9, 0, $10,
+                                     dialog.ex);
+          }
+       | ICON resref numexpr cnumexpr cnumexpr cnumexpr cnumexpr
            icon_styleexpr cnumexpr cnumexpr opt_control_data
-         {
-           $$ = define_control ($2, $3, $4, $5, $6, $7, CTL_STATIC,
-                                style, $9);
-           if (dialog.ex == NULL)
-             rcparse_warning (_("help ID requires DIALOGEX"));
-           $$->help = $10;
-           $$->data = $11;
-         }
+          {
+           $$ = define_icon_control ($2, $3, $4, $5, style, $9, $10, $11,
+                                     dialog.ex);
+          }
        | IEDIT
            {
              default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
@@ -817,6 +809,10 @@ optstringc:
          {
            $$ = NULL;
          }
+       | QUOTEDSTRING
+         {
+           $$ = $1;
+         }
        | QUOTEDSTRING ','
          {
            $$ = $1;
@@ -1270,6 +1266,44 @@ id:
          }
        ;
 
+/* A resource reference.  */
+
+resname:
+         QUOTEDSTRING
+         {
+           $$ = $1;
+         }
+       | QUOTEDSTRING ','
+         {
+           $$ = $1;
+         }
+       | STRING ','
+         {
+           $$ = $1;
+         }
+       ;
+
+
+resref:
+         posnumexpr ','
+         {
+           $$.named = 0;
+           $$.u.id = $1;
+         }
+       | resname
+         {
+           char *copy, *s;
+
+           /* It seems that resource ID's are forced to upper case.  */
+           copy = xstrdup ($1);
+           for (s = copy; *s != '\0'; s++)
+             if (islower ((unsigned char) *s))
+               *s = toupper ((unsigned char) *s);
+           res_string_to_id (&$$, copy);
+           free (copy);
+         }
+       ;
+
 /* Generic suboptions.  These may appear before the BEGIN in any
    multiline statement.  */
 
This page took 0.026572 seconds and 4 git commands to generate.