Correct pasto in ChangeLog
[deliverable/binutils-gdb.git] / binutils / rcparse.y
index f287eb44f2833aa4b9fbcd2a70315b0eb9f5c073..7aacaaa067326d2bd720527b8141922c8def2b54 100644 (file)
@@ -52,6 +52,11 @@ static unsigned long style;
 static unsigned long base_style;
 static unsigned long default_style;
 static unsigned long class;
+static struct res_id res_text_field;
+
+/* This is used for COMBOBOX, LISTBOX and EDITTEXT which
+   do not allow resource 'text' field in control definition. */
+static const struct res_id res_null_text = { 1, {{0, L""}}};
 
 %}
 
@@ -533,64 +538,72 @@ controls:
        ;
 
 control:
-         AUTO3STATE
+         AUTO3STATE optresidc
            {
              default_style = BS_AUTO3STATE | WS_TABSTOP;
              base_style = BS_AUTO3STATE;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | AUTOCHECKBOX
+       | AUTOCHECKBOX optresidc
            {
              default_style = BS_AUTOCHECKBOX | WS_TABSTOP;
              base_style = BS_AUTOCHECKBOX;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | AUTORADIOBUTTON
+       | AUTORADIOBUTTON optresidc
            {
              default_style = BS_AUTORADIOBUTTON | WS_TABSTOP;
              base_style = BS_AUTORADIOBUTTON;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | BEDIT
+       | BEDIT optresidc
            {
              default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
              base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
              class = CTL_EDIT;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
            if (dialog.ex == NULL)
              rcparse_warning (_("BEDIT requires DIALOGEX"));
            res_string_to_id (&$$->class, "BEDIT");
          }
-       | CHECKBOX
+       | CHECKBOX optresidc
            {
              default_style = BS_CHECKBOX | WS_TABSTOP;
              base_style = BS_CHECKBOX | WS_TABSTOP;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
        | COMBOBOX
            {
+             /* This is as per MSDN documentation.  With some (???)
+                versions of MS rc.exe their is no default style.  */
              default_style = CBS_SIMPLE | WS_TABSTOP;
              base_style = 0;
              class = CTL_COMBOBOX;
+             res_text_field = res_null_text;   
            }
            control_params
          {
@@ -640,55 +653,60 @@ control:
            $$->class.named = 1;
            unicode_from_ascii (&$$->class.u.n.length, &$$->class.u.n.name, $5);
          }
-       | CTEXT
+       | CTEXT optresidc
            {
              default_style = SS_CENTER | WS_GROUP;
              base_style = SS_CENTER;
              class = CTL_STATIC;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | DEFPUSHBUTTON
+       | DEFPUSHBUTTON optresidc
            {
              default_style = BS_DEFPUSHBUTTON | WS_TABSTOP;
              base_style = BS_DEFPUSHBUTTON | WS_TABSTOP;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
        | EDITTEXT
            {
              default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
              base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
              class = CTL_EDIT;
+             res_text_field = res_null_text;   
            }
            control_params
          {
            $$ = $3;
          }
-       | GROUPBOX
+       | GROUPBOX optresidc
            {
              default_style = BS_GROUPBOX;
              base_style = BS_GROUPBOX;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | HEDIT
+       | HEDIT optresidc
            {
              default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
              base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
              class = CTL_EDIT;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
            if (dialog.ex == NULL)
              rcparse_warning (_("IEDIT requires DIALOGEX"));
            res_string_to_id (&$$->class, "HEDIT");
@@ -716,15 +734,16 @@ control:
            $$ = define_icon_control ($2, $3, $4, $5, style, $9, $10, $11,
                                      dialog.ex);
           }
-       | IEDIT
+       | IEDIT optresidc
            {
              default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
              base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
              class = CTL_EDIT;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
            if (dialog.ex == NULL)
              rcparse_warning (_("IEDIT requires DIALOGEX"));
            res_string_to_id (&$$->class, "IEDIT");
@@ -734,22 +753,24 @@ control:
              default_style = LBS_NOTIFY | WS_BORDER;
              base_style = LBS_NOTIFY | WS_BORDER;
              class = CTL_LISTBOX;
+             res_text_field = res_null_text;   
            }
            control_params
          {
            $$ = $3;
          }
-       | LTEXT
+       | LTEXT optresidc
            {
              default_style = SS_LEFT | WS_GROUP;
              base_style = SS_LEFT;
              class = CTL_STATIC;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | PUSHBOX
+       | PUSHBOX optresidc
            {
              default_style = BS_PUSHBOX | WS_TABSTOP;
              base_style = BS_PUSHBOX;
@@ -757,57 +778,62 @@ control:
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | PUSHBUTTON
+       | PUSHBUTTON optresidc
            {
              default_style = BS_PUSHBUTTON | WS_TABSTOP;
              base_style = BS_PUSHBUTTON | WS_TABSTOP;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | RADIOBUTTON
+       | RADIOBUTTON optresidc
            {
              default_style = BS_RADIOBUTTON | WS_TABSTOP;
              base_style = BS_RADIOBUTTON;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
-       | RTEXT
+       | RTEXT optresidc
            {
              default_style = SS_RIGHT | WS_GROUP;
              base_style = SS_RIGHT;
              class = CTL_STATIC;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
        | SCROLLBAR
            {
              default_style = SBS_HORZ;
              base_style = 0;
              class = CTL_SCROLLBAR;
+             res_text_field = res_null_text;   
            }
            control_params
          {
            $$ = $3;
          }
-       | STATE3
+       | STATE3 optresidc
            {
              default_style = BS_3STATE | WS_TABSTOP;
              base_style = BS_3STATE;
              class = CTL_BUTTON;
+             res_text_field = $2;      
            }
            control_params
          {
-           $$ = $3;
+           $$ = $4;
          }
        | USERBUTTON resref numexpr ',' numexpr ',' numexpr ','
            numexpr ',' numexpr ',' 
@@ -827,37 +853,36 @@ control:
    style.  CLASS is the class of the control.  */
 
 control_params:
-         optresidc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
-           opt_control_data
+         numexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data
          {
-           $$ = define_control ($1, $2, $3, $4, $5, $6, class,
+           $$ = define_control (res_text_field, $1, $2, $3, $4, $5, class,
                                 default_style | WS_CHILD | WS_VISIBLE, 0);
-           if ($7 != NULL)
+           if ($6 != NULL)
              {
                if (dialog.ex == NULL)
                  rcparse_warning (_("control data requires DIALOGEX"));
-               $$->data = $7;
+               $$->data = $6;
              }
          }
-       | optresidc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+       | numexpr cnumexpr cnumexpr cnumexpr cnumexpr
            control_params_styleexpr optcnumexpr opt_control_data
          {
-           $$ = define_control ($1, $2, $3, $4, $5, $6, class, style, $8);
-           if ($9 != NULL)
+           $$ = define_control (res_text_field, $1, $2, $3, $4, $5, class, style, $7);
+           if ($8 != NULL)
              {
                if (dialog.ex == NULL)
                  rcparse_warning (_("control data requires DIALOGEX"));
-               $$->data = $9;
+               $$->data = $8;
              }
          }
-       | optresidc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+       | numexpr cnumexpr cnumexpr cnumexpr cnumexpr
            control_params_styleexpr cnumexpr cnumexpr opt_control_data
          {
-           $$ = define_control ($1, $2, $3, $4, $5, $6, class, style, $8);
+           $$ = define_control (res_text_field, $1, $2, $3, $4, $5, class, style, $7);
            if (dialog.ex == NULL)
              rcparse_warning (_("help ID requires DIALOGEX"));
-           $$->help = $9;
-           $$->data = $10;
+           $$->help = $8;
+           $$->data = $9;
          }
        ;
 
@@ -1737,8 +1762,7 @@ sizedposnumexpr:
 /* Set the language from the command line.  */
 
 void
-rcparse_set_language (lang)
-     int lang;
+rcparse_set_language (int lang)
 {
   language = lang;
 }
This page took 0.027993 seconds and 4 git commands to generate.