* - Added extra comment about grammar
*/
#include "config.h"
+#include "wine/port.h"
#include <stdio.h>
#include <stdlib.h>
fontdir_t *fnd;
menu_t *men;
menuex_t *menex;
+ html_t *html;
rcdata_t *rdt;
stringtable_t *stt;
stt_entry_t *stte;
%token <str> tSTRING tIDENT tFILENAME
%token <raw> tRAWDATA
%token tACCELERATORS tBITMAP tCURSOR tDIALOG tDIALOGEX tMENU tMENUEX tMESSAGETABLE
-%token tRCDATA tVERSIONINFO tSTRINGTABLE tFONT tFONTDIR tICON
+%token tRCDATA tVERSIONINFO tSTRINGTABLE tFONT tFONTDIR tICON tHTML
%token tAUTO3STATE tAUTOCHECKBOX tAUTORADIOBUTTON tCHECKBOX tDEFPUSHBUTTON
%token tPUSHBUTTON tRADIOBUTTON tSTATE3 /* PUSHBOX */
%token tGROUPBOX tCOMBOBOX tLISTBOX tSCROLLBAR
%type <iptr> helpid
%type <dlgex> dialogex dlgex_attribs
%type <ctl> exctrls gen_exctrl lab_exctrl exctrl_desc
+%type <html> html
%type <rdt> rcdata
%type <raw> raw_data raw_elements opt_data file_raw
%type <veri> versioninfo fix_version
%type <lan> opt_language
%type <chars> opt_characts
%type <ver> opt_version
-%type <num> expr xpr
+%type <num> expr xpr xpr_no_not
%type <iptr> e_expr
%type <tlbar> toolbar
%type <tlbarItems> toolbar_items
%type <dginit> dlginit
%type <styles> optional_style_pair
%type <num> any_num
-%type <style> optional_style
%type <style> style
%type <str> filename
* for tNL. However, byacc already generates an error upon reading
* the token instead of keeping it as a lookahead. The reason
* lies in the lack of a $default transition in the "expr : xpr . "
- * state (currently state 25). It is probably ommitted because tNL
+ * state (currently state 25). It is probably omitted because tNL
* is a non-terminal and the state contains 2 s/r conflicts. The
* state enumerates all possible transitions instead of using a
* $default transition.
$$ = NULL;
}
| messagetable { $$ = new_resource(res_msg, $1, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, $1->data->lvc.language); }
+ | html { $$ = new_resource(res_html, $1, $1->memopt, $1->data->lvc.language); }
| rcdata { $$ = new_resource(res_rdt, $1, $1->memopt, $1->data->lvc.language); }
| toolbar { $$ = new_resource(res_toolbar, $1, $1->memopt, $1->lvc.language); }
| userres { $$ = new_resource(res_usr, $1, $1->memopt, $1->data->lvc.language); }
}
;
+/* ------------------------------ HTML ------------------------------ */
+html : tHTML loadmemopts file_raw { $$ = new_html($3, $2); }
+ ;
+
/* ------------------------------ RCData ------------------------------ */
rcdata : tRCDATA loadmemopts file_raw { $$ = new_rcdata($3, $2); }
;
/* ------------------------------ UserType ------------------------------ */
userres : usertype loadmemopts file_raw {
- #ifdef WORDS_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
if(pedantic && byteorder != WRC_BO_LITTLE)
- #else
+#else
if(pedantic && byteorder == WRC_BO_BIG)
- #endif
+#endif
yywarning("Byteordering is not little-endian and type cannot be interpreted");
$$ = new_user($1, $3, $2);
}
;
lab_ctrl
- : tSTRING opt_comma expr ',' expr ',' expr ',' expr ',' expr optional_style {
+ : tSTRING opt_comma expr ',' expr ',' expr ',' expr ',' expr optional_style_pair {
$$=new_control();
$$->title = new_name_id();
$$->title->type = name_str;
$$->height = $11;
if($12)
{
- $$->style = $12;
+ $$->style = $12->style;
$$->gotstyle = TRUE;
+ if ($12->exstyle)
+ {
+ $$->exstyle = $12->exstyle;
+ $$->gotexstyle = TRUE;
+ }
+ free($12);
}
}
;
ctrl_desc
- : expr ',' expr ',' expr ',' expr ',' expr optional_style {
+ : expr ',' expr ',' expr ',' expr ',' expr optional_style_pair {
$$ = new_control();
$$->id = $1;
$$->x = $3;
$$->height = $9;
if($10)
{
- $$->style = $10;
+ $$->style = $10->style;
$$->gotstyle = TRUE;
+ if ($10->exstyle)
+ {
+ $$->exstyle = $10->exstyle;
+ $$->gotexstyle = TRUE;
+ }
+ free($10);
}
}
;
;
/* ------------------------------ style flags ------------------------------ */
-optional_style /* Abbused once to get optional ExStyle */
- : /* Empty */ { $$ = NULL; }
- | ',' style { $$ = $2; }
- ;
-
optional_style_pair
: /* Empty */ { $$ = NULL; }
| ',' style { $$ = new_style_pair($2, 0); }
style
: style '|' style { $$ = new_style($1->or_mask | $3->or_mask, $1->and_mask | $3->and_mask); free($1); free($3);}
| '(' style ')' { $$ = $2; }
- | xpr { $$ = new_style($1, 0); }
- | tNOT xpr { $$ = new_style(0, $2); }
+ | xpr_no_not { $$ = new_style($1, 0); }
+ | tNOT xpr_no_not { $$ = new_style(0, $2); }
;
ctlclass
*/
item_options
: /* Empty */ { $$ = 0; }
- | ',' tCHECKED item_options { $$ = $3 | MF_CHECKED; }
- | ',' tGRAYED item_options { $$ = $3 | MF_GRAYED; }
- | ',' tHELP item_options { $$ = $3 | MF_HELP; }
- | ',' tINACTIVE item_options { $$ = $3 | MF_DISABLED; }
- | ',' tMENUBARBREAK item_options { $$ = $3 | MF_MENUBARBREAK; }
- | ',' tMENUBREAK item_options { $$ = $3 | MF_MENUBREAK; }
+ | opt_comma tCHECKED item_options { $$ = $3 | MF_CHECKED; }
+ | opt_comma tGRAYED item_options { $$ = $3 | MF_GRAYED; }
+ | opt_comma tHELP item_options { $$ = $3 | MF_HELP; }
+ | opt_comma tINACTIVE item_options { $$ = $3 | MF_DISABLED; }
+ | opt_comma tMENUBARBREAK item_options { $$ = $3 | MF_MENUBARBREAK; }
+ | opt_comma tMENUBREAK item_options { $$ = $3 | MF_MENUBREAK; }
;
/* ------------------------------ MenuEx ------------------------------ */
expr : xpr { $$ = ($1); }
;
-xpr : xpr '+' xpr { $$ = ($1) + ($3); }
- | xpr '-' xpr { $$ = ($1) - ($3); }
- | xpr '|' xpr { $$ = ($1) | ($3); }
- | xpr '&' xpr { $$ = ($1) & ($3); }
- | xpr '*' xpr { $$ = ($1) * ($3); }
- | xpr '/' xpr { $$ = ($1) / ($3); }
- | xpr '^' xpr { $$ = ($1) ^ ($3); }
- | '~' xpr { $$ = ~($2); }
- | '-' xpr %prec pUPM { $$ = -($2); }
- | '+' xpr %prec pUPM { $$ = $2; }
- | '(' xpr ')' { $$ = $2; }
- | any_num { $$ = $1; }
+xpr_no_not : xpr '+' xpr { $$ = ($1) + ($3); }
+ | xpr '-' xpr { $$ = ($1) - ($3); }
+ | xpr '|' xpr { $$ = ($1) | ($3); }
+ | xpr '&' xpr { $$ = ($1) & ($3); }
+ | xpr '*' xpr { $$ = ($1) * ($3); }
+ | xpr '/' xpr { $$ = ($1) / ($3); }
+ | xpr '^' xpr { $$ = ($1) ^ ($3); }
+ | '~' xpr { $$ = ~($2); }
+ | '-' xpr %prec pUPM { $$ = -($2); }
+ | '+' xpr %prec pUPM { $$ = $2; }
+ | '(' xpr ')' { $$ = $2; }
+ | any_num { $$ = $1; }
+ ;
+
+
+xpr : xpr_no_not { $$ = ($1); }
| tNOT any_num { $$ = ~($2); }
;
if (codepage <= 0 && filename->type != str_char)
yyerror("Cannot convert filename to ASCII string");
name = convert_string( filename, str_char, codepage );
- if (!(path = wpp_find_include(name->str.cstr, 1)))
+ if (!(path = wpp_find_include(name->str.cstr, input_name, 1)))
yyerror("Cannot open file %s", name->str.cstr);
if (!(fp = fopen( path, "rb" )))
yyerror("Cannot open file %s", name->str.cstr);
}
/* qsort sorting function for string table entries */
-#define STE(p) ((stt_entry_t *)(p))
+#define STE(p) ((const stt_entry_t *)(p))
static int sort_stt_entry(const void *e1, const void *e2)
{
return STE(e1)->id - STE(e2)->id;
type = "TOOLBAR";
token = tTOOLBAR;
break;
+ case WRC_RT_HTML:
+ type = "HTML";
+ token = tHTML;
+ break;
case WRC_RT_STRING:
type = "STRINGTABLE";
case WRC_RT_DLGINCLUDE:
case WRC_RT_PLUGPLAY:
case WRC_RT_VXD:
- case WRC_RT_HTML:
yywarning("Usertype uses reserved type ID %d, which is not supported by wrc yet", yylval.num);
default:
return lookahead;