From c42936177ec2d8a1755d822cdc628f1a2992d676 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Wed, 16 Jan 2008 17:16:34 +0000 Subject: [PATCH] - Update WRC to Wine-0.9.53. - Update and include to the build process utf8.c of unicode library. svn path=/trunk/; revision=31829 --- reactos/media/doc/README.WINE | 2 +- reactos/tools/unicode/unicode.mak | 5 + reactos/tools/unicode/utf8.c | 79 +- reactos/tools/unicode/wine/unicode.h | 3 +- reactos/tools/wrc/CHANGES | 2 +- reactos/tools/wrc/dumpres.c | 10 +- reactos/tools/wrc/dumpres.h | 2 +- reactos/tools/wrc/genres.c | 33 +- reactos/tools/wrc/genres.h | 2 +- reactos/tools/wrc/lex.yy.c | 1210 ++++------ reactos/tools/wrc/newstruc.c | 59 +- reactos/tools/wrc/newstruc.h | 6 +- reactos/tools/wrc/parser.h | 12 +- reactos/tools/wrc/parser.l | 246 +- reactos/tools/wrc/parser.tab.c | 3353 ++++++++++++++------------ reactos/tools/wrc/parser.tab.h | 17 +- reactos/tools/wrc/parser.y | 248 +- reactos/tools/wrc/readres.c | 24 +- reactos/tools/wrc/readres.h | 2 +- reactos/tools/wrc/translation.c | 504 ++-- reactos/tools/wrc/utils.c | 58 +- reactos/tools/wrc/utils.h | 6 +- reactos/tools/wrc/wrc.c | 53 +- reactos/tools/wrc/wrc.h | 2 +- reactos/tools/wrc/wrctypes.h | 2 +- reactos/tools/wrc/writeres.c | 8 +- 26 files changed, 2977 insertions(+), 2971 deletions(-) diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 9cfb2bcb7c3..6dbc23f5ddc 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -26,7 +26,7 @@ reactos/tools/wpp # Synced to Wine-0_9_5 reactos/tools/bin2res # Resource to binary converter reactos/tools/winebuild # Synced to Wine-20071217 reactos/tools/wmc # Synced to Wine-20071201 -reactos/tools/wrc # Synced to Wine-0_9_5 +reactos/tools/wrc # Synced to Wine-0_9_53 reactos/tools/widl # Synced to Wine-20080105 The following libraries are shared with Wine. diff --git a/reactos/tools/unicode/unicode.mak b/reactos/tools/unicode/unicode.mak index 50cf8b9abba..1fcc45cdf12 100644 --- a/reactos/tools/unicode/unicode.mak +++ b/reactos/tools/unicode/unicode.mak @@ -89,6 +89,7 @@ UNICODE_SOURCES = $(addprefix $(UNICODE_BASE_), \ wctomb.c \ wctype.c \ $(UNICODE_CODEPAGES:%=c_%.o) \ + utf8.c \ ) UNICODE_OBJECTS = \ @@ -374,6 +375,10 @@ $(UNICODE_INT_)c_28606.o: $(UNICODE_BASE_)c_28606.c | $(UNICODE_INT) $(ECHO_CC) ${host_gcc} $(UNICODE_HOST_CFLAGS) -c $< -o $@ +$(UNICODE_INT_)utf8.o: $(UNICODE_BASE_)utf8.c | $(UNICODE_INT) + $(ECHO_CC) + ${host_gcc} $(UNICODE_HOST_CFLAGS) -c $< -o $@ + .PHONY: unicode_clean unicode_clean: -@$(rm) $(UNICODE_TARGET) $(UNICODE_OBJECTS) 2>$(NUL) diff --git a/reactos/tools/unicode/utf8.c b/reactos/tools/unicode/utf8.c index 334d7fc3b3e..c1b594fc243 100644 --- a/reactos/tools/unicode/utf8.c +++ b/reactos/tools/unicode/utf8.c @@ -41,33 +41,63 @@ static const unsigned char utf8_mask[6] = { 0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01 } /* minimum Unicode value depending on UTF-8 sequence length */ static const unsigned int utf8_minval[6] = { 0x0, 0x80, 0x800, 0x10000, 0x200000, 0x4000000 }; +/* get the next char value taking surrogates into account */ +static inline unsigned int get_surrogate_value( const WCHAR *src, unsigned int srclen ) +{ + if (src[0] >= 0xd800 && src[0] <= 0xdfff) /* surrogate pair */ + { + if (src[0] > 0xdbff || /* invalid high surrogate */ + srclen <= 1 || /* missing low surrogate */ + src[1] < 0xdc00 || src[1] > 0xdfff) /* invalid low surrogate */ + return 0; + return 0x10000 + ((src[0] & 0x3ff) << 10) + (src[1] & 0x3ff); + } + return src[0]; +} /* query necessary dst length for src string */ -inline static int get_length_wcs_utf8( const WCHAR *src, unsigned int srclen ) +static inline int get_length_wcs_utf8( int flags, const WCHAR *src, unsigned int srclen ) { int len; - for (len = 0; srclen; srclen--, src++, len++) + unsigned int val; + + for (len = 0; srclen; srclen--, src++) { - if (*src >= 0x80) + if (*src < 0x80) /* 0x00-0x7f: 1 byte */ { len++; - if (*src >= 0x800) len++; + continue; } + if (*src < 0x800) /* 0x80-0x7ff: 2 bytes */ + { + len += 2; + continue; + } + if (!(val = get_surrogate_value( src, srclen ))) + { + if (flags & WC_ERR_INVALID_CHARS) return -2; + continue; + } + if (val < 0x10000) /* 0x800-0xffff: 3 bytes */ + len += 3; + else /* 0x10000-0x10ffff: 4 bytes */ + len += 4; } return len; } /* wide char to UTF-8 string conversion */ -/* return -1 on dst buffer overflow */ -int wine_utf8_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen ) +/* return -1 on dst buffer overflow, -2 on invalid input char */ +int wine_utf8_wcstombs( int flags, const WCHAR *src, int srclen, char *dst, int dstlen ) { int len; - if (!dstlen) return get_length_wcs_utf8( src, srclen ); + if (!dstlen) return get_length_wcs_utf8( flags, src, srclen ); for (len = dstlen; srclen; srclen--, src++) { WCHAR ch = *src; + unsigned int val; if (ch < 0x80) /* 0x00-0x7f: 1 byte */ { @@ -86,15 +116,34 @@ int wine_utf8_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen ) continue; } - /* 0x800-0xffff: 3 bytes */ + if (!(val = get_surrogate_value( src, srclen ))) + { + if (flags & WC_ERR_INVALID_CHARS) return -2; + continue; + } - if ((len -= 3) < 0) return -1; /* overflow */ - dst[2] = 0x80 | (ch & 0x3f); - ch >>= 6; - dst[1] = 0x80 | (ch & 0x3f); - ch >>= 6; - dst[0] = 0xe0 | ch; - dst += 3; + if (val < 0x10000) /* 0x800-0xffff: 3 bytes */ + { + if ((len -= 3) < 0) return -1; /* overflow */ + dst[2] = 0x80 | (val & 0x3f); + val >>= 6; + dst[1] = 0x80 | (val & 0x3f); + val >>= 6; + dst[0] = 0xe0 | val; + dst += 3; + } + else /* 0x10000-0x10ffff: 4 bytes */ + { + if ((len -= 4) < 0) return -1; /* overflow */ + dst[3] = 0x80 | (val & 0x3f); + val >>= 6; + dst[2] = 0x80 | (val & 0x3f); + val >>= 6; + dst[1] = 0x80 | (val & 0x3f); + val >>= 6; + dst[0] = 0xf0 | val; + dst += 4; + } } return dstlen - len; } diff --git a/reactos/tools/unicode/wine/unicode.h b/reactos/tools/unicode/wine/unicode.h index f5d6f4dc9ca..1a6582bdc42 100644 --- a/reactos/tools/unicode/wine/unicode.h +++ b/reactos/tools/unicode/wine/unicode.h @@ -41,6 +41,7 @@ #define WC_DISCARDNS 16 #define WC_DEFAULTCHAR 64 #define WC_NO_BEST_FIT_CHARS 1024 +#define WC_ERR_INVALID_CHARS 0x0080 #ifndef WINE_UNICODE_API #define WINE_UNICODE_API DECLSPEC_IMPORT @@ -93,7 +94,7 @@ extern int wine_cp_wcstombs( const union cptable *table, int flags, extern int wine_cpsymbol_mbstowcs( const char *src, int srclen, WCHAR *dst, int dstlen ); extern int wine_cpsymbol_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen ); extern int wine_utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int dstlen ); -extern int wine_utf8_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen ); +extern int wine_utf8_wcstombs( int flags, const WCHAR *src, int srclen, char *dst, int dstlen ); extern int wine_compare_string( int flags, const WCHAR *str1, int len1, const WCHAR *str2, int len2 ); extern int wine_get_sortkey( int flags, const WCHAR *src, int srclen, char *dst, int dstlen ); diff --git a/reactos/tools/wrc/CHANGES b/reactos/tools/wrc/CHANGES index 9281233213d..766ecdab691 100644 --- a/reactos/tools/wrc/CHANGES +++ b/reactos/tools/wrc/CHANGES @@ -273,7 +273,7 @@ Bertho Stultiens - Allocate cursor and icon ordinals according to the language of the item to decrease the amount of ordinals in use. This reduces the resource directory size by reducing the tree size. -- Versions 1.0.5 through 1.0.7 were never commited to cvs but were available +- Versions 1.0.5 through 1.0.7 were never committed to cvs but were available for download from an alternate site for elf-dll test generation. --------------------------------------------------------------------------- diff --git a/reactos/tools/wrc/dumpres.c b/reactos/tools/wrc/dumpres.c index a121189a8e3..fdaecb077da 100644 --- a/reactos/tools/wrc/dumpres.c +++ b/reactos/tools/wrc/dumpres.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -546,7 +546,7 @@ static void dump_control(const control_t *ctrl) printf("\tExStyle: %08x\n", ctrl->exstyle->or_mask); } if(ctrl->gothelpid) - printf("\tHelpid: %u\n", ctrl->helpid); + printf("\tHelpid: %d\n", ctrl->helpid); if(ctrl->extra) { printf("\t"); @@ -636,7 +636,7 @@ static void dump_dialogex(const dialogex_t *dlgex) printf("ExStyle: %08x\n", dlgex->exstyle->or_mask); } if(dlgex->gothelpid) - printf("Helpid: %u\n", dlgex->helpid); + printf("Helpid: %d\n", dlgex->helpid); printf("Menu: %s\n", get_nameid_str(dlgex->menu)); printf("Class: %s\n", get_nameid_str(dlgex->dlgclass)); printf("Title: "); print_string(dlgex->title); printf("\n"); @@ -732,7 +732,7 @@ static void dump_menuex_item(const menuex_item_t *item) if(item->gotid) printf(", Id=%d", item->id); if(item->gottype) - printf(", Type=%u", item->type); + printf(", Type=%d", item->type); if(item->gotstate) printf(", State=%08x", item->state); if(item->gothelpid) @@ -749,7 +749,7 @@ static void dump_menuex_item(const menuex_item_t *item) if(item->gotid) printf(", Id=%d", item->id); if(item->gottype) - printf(", Type=%u", item->type); + printf(", Type=%d", item->type); if(item->gotstate) printf(", State=%08x", item->state); if(item->gothelpid) diff --git a/reactos/tools/wrc/dumpres.h b/reactos/tools/wrc/dumpres.h index ba862f339d5..a6c3dac3800 100644 --- a/reactos/tools/wrc/dumpres.h +++ b/reactos/tools/wrc/dumpres.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WRC_DUMPRES_H diff --git a/reactos/tools/wrc/genres.c b/reactos/tools/wrc/genres.c index 4de1ab7bbc2..05b1dd533b7 100644 --- a/reactos/tools/wrc/genres.c +++ b/reactos/tools/wrc/genres.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * History: * 05-May-2000 BS - Added code to support endian conversions. The @@ -54,7 +54,8 @@ res_t *new_res(void) r = (res_t *)xmalloc(sizeof(res_t)); r->allocsize = RES_BLOCKSIZE; r->size = 0; - r->data = (char *)xmalloc(RES_BLOCKSIZE); + r->dataidx = 0; + r->data = xmalloc(RES_BLOCKSIZE); return r; } @@ -276,7 +277,7 @@ static void string_to_upper(string_t *str) } else { - internal_error(__FILE__, __LINE__, "Invalid string type %d", str->type); + internal_error(__FILE__, __LINE__, "Invalid string type %d\n", str->type); } } @@ -317,7 +318,7 @@ static void put_string(res_t *res, const string_t *str, enum str_e type, int ist { if (!check_unicode_conversion( str, newstr, codepage )) error( "String %s does not convert identically to Unicode and back in codepage %d. " - "Try using a Unicode string instead.", str->str.cstr, codepage ); + "Try using a Unicode string instead\n", str->str.cstr, codepage ); } if (!isterm) put_word(res, newstr->size); for(cnt = 0; cnt < newstr->size; cnt++) @@ -370,7 +371,7 @@ static void put_name_id(res_t *res, name_id_t *nid, int upcase, const language_t } else { - internal_error(__FILE__, __LINE__, "Invalid name_id type %d", nid->type); + internal_error(__FILE__, __LINE__, "Invalid name_id type %d\n", nid->type); } } @@ -601,7 +602,7 @@ static res_t *dialog2res(name_id_t *name, dialog_t *dlg) if(ctrl->ctlclass) put_name_id(res, ctrl->ctlclass, TRUE, dlg->lvc.language); else - internal_error(__FILE__, __LINE__, "Control has no control-class"); + internal_error(__FILE__, __LINE__, "Control has no control-class\n"); if(ctrl->title) put_name_id(res, ctrl->title, FALSE, dlg->lvc.language); else @@ -669,10 +670,10 @@ static res_t *dialog2res(name_id_t *name, dialog_t *dlg) else if(ctrl->ctlclass->type == name_str) put_name_id(res, ctrl->ctlclass, FALSE, NULL); else - error("Unknown control-class %04x", ctrl->ctlclass->name.i_name); + error("Unknown control-class %04x\n", ctrl->ctlclass->name.i_name); } else - internal_error(__FILE__, __LINE__, "Control has no control-class"); + internal_error(__FILE__, __LINE__, "Control has no control-class\n"); if(ctrl->title) put_name_id(res, ctrl->title, FALSE, NULL); else @@ -776,7 +777,7 @@ static res_t *dialogex2res(name_id_t *name, dialogex_t *dlgex) if(ctrl->ctlclass) put_name_id(res, ctrl->ctlclass, TRUE, dlgex->lvc.language); else - internal_error(__FILE__, __LINE__, "Control has no control-class"); + internal_error(__FILE__, __LINE__, "Control has no control-class\n"); if(ctrl->title) put_name_id(res, ctrl->title, FALSE, dlgex->lvc.language); else @@ -1412,7 +1413,7 @@ static res_t *rcdata2res(name_id_t *name, rcdata_t *rdt) * Output : New .res format structure * Description : * Remarks : The data has been converted to the appropriate endian - * after is was parsed. + * after it was parsed. ***************************************************************************** */ static res_t *messagetable2res(name_id_t *name, messagetable_t *msg) @@ -1458,7 +1459,7 @@ static res_t *stringtable2res(stringtable_t *stt) { if(!stt->nentries) { - warning("Empty internal stringtable"); + warning("Empty internal stringtable\n"); continue; } name.type = name_ord; @@ -1595,7 +1596,7 @@ static void versionblock2res(res_t *res, ver_block_t *blk, int level, const lang } else { - internal_error(__FILE__, __LINE__, "Invalid value indicator %d in VERSIONINFO", val->type); + internal_error(__FILE__, __LINE__, "Invalid value indicator %d in VERSIONINFO\n", val->type); } } @@ -1798,7 +1799,7 @@ char *prep_nid_for_label(const name_id_t *nid) if((unsigned)*sptr < 0x80 && isprint(*sptr & 0xff)) buf[i] = *sptr++; else - warning("Resourcename (str_unicode) contain unprintable characters or invalid translation, ignored"); + warning("Resourcename (str_unicode) contain unprintable characters or invalid translation, ignored\n"); } buf[i] = '\0'; } @@ -1813,7 +1814,7 @@ char *prep_nid_for_label(const name_id_t *nid) if((unsigned)*cptr < 0x80 && isprint(*cptr & 0xff)) buf[i] = *cptr++; else - warning("Resourcename (str_char) contain unprintable characters, ignored"); + warning("Resourcename (str_char) contain unprintable characters, ignored\n"); } buf[i] = '\0'; } @@ -1823,7 +1824,7 @@ char *prep_nid_for_label(const name_id_t *nid) } else { - internal_error(__FILE__, __LINE__, "Resource name_id with invalid type %d", nid->type); + internal_error(__FILE__, __LINE__, "Resource name_id with invalid type %d\n", nid->type); } return buf; } @@ -2004,7 +2005,7 @@ void resources2res(resource_t *top) top->binres = anicurico2res(top->name, top->res.ani, top->type); break; default: - internal_error(__FILE__, __LINE__, "Unknown resource type encountered %d in binary res generation", top->type); + internal_error(__FILE__, __LINE__, "Unknown resource type encountered %d in binary res generation\n", top->type); } top->c_name = make_c_name(get_c_typename(top->type), top->name, top->lan); top = top->next; diff --git a/reactos/tools/wrc/genres.h b/reactos/tools/wrc/genres.h index afdf1e82832..f8007d14cd9 100644 --- a/reactos/tools/wrc/genres.h +++ b/reactos/tools/wrc/genres.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WRC_GENRES_H diff --git a/reactos/tools/wrc/lex.yy.c b/reactos/tools/wrc/lex.yy.c index 38febdea97f..5e979fed17e 100644 --- a/reactos/tools/wrc/lex.yy.c +++ b/reactos/tools/wrc/lex.yy.c @@ -1,8 +1,25 @@ -#line 2 "tools/wrc/lex.yy.c" +#define yy_create_buffer parser__create_buffer +#define yy_delete_buffer parser__delete_buffer +#define yy_scan_buffer parser__scan_buffer +#define yy_scan_string parser__scan_string +#define yy_scan_bytes parser__scan_bytes +#define yy_flex_debug parser__flex_debug +#define yy_init_buffer parser__init_buffer +#define yy_flush_buffer parser__flush_buffer +#define yy_load_buffer_state parser__load_buffer_state +#define yy_switch_to_buffer parser__switch_to_buffer +#define yyin parser_in +#define yyleng parser_leng +#define yylex parser_lex +#define yyout parser_out +#define yyrestart parser_restart +#define yytext parser_text + +#line 19 "lex.yy.c" /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ */ #define FLEX_SCANNER @@ -10,7 +27,6 @@ #define YY_FLEX_MINOR_VERSION 5 #include -#include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ @@ -24,6 +40,7 @@ #ifdef __cplusplus #include +#include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -127,7 +144,6 @@ extern FILE *yyin, *yyout; { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ @@ -237,7 +253,7 @@ void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); @@ -262,6 +278,9 @@ static void yy_flex_free YY_PROTO(( void * )); #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +#define yywrap() 1 +#define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; @@ -283,33 +302,30 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 92 -#define YY_END_OF_BUFFER 93 -static yyconst short int yy_accept[207] = +#define YY_NUM_RULES 80 +#define YY_END_OF_BUFFER 81 +static yyconst short int yy_accept[189] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 82, 82, - 0, 0, 13, 13, 18, 18, 20, 20, 3, 3, - 5, 5, 8, 8, 93, 90, 89, 88, 53, 75, - 29, 30, 26, 26, 86, 29, 30, 24, 25, 89, - 2, 70, 74, 55, 91, 51, 52, 33, 91, 80, - 78, 79, 76, 80, 82, 84, 83, 91, 13, 14, - 91, 11, 9, 10, 13, 2, 18, 19, 15, 16, - 91, 18, 23, 20, 22, 21, 3, 5, 5, 8, - 8, 89, 29, 30, 81, 30, 26, 26, 29, 29, - 86, 31, 89, 2, 2, 0, 70, 54, 71, 68, + 0, 0, 0, 0, 0, 0, 0, 0, 70, 70, + 0, 0, 3, 3, 5, 5, 9, 9, 81, 78, + 77, 76, 41, 63, 17, 18, 14, 14, 74, 17, + 18, 12, 13, 77, 2, 58, 62, 43, 79, 39, + 40, 21, 79, 68, 66, 67, 64, 68, 70, 72, + 71, 11, 10, 11, 11, 2, 3, 79, 5, 5, + 9, 9, 77, 17, 18, 69, 18, 14, 14, 17, + 17, 74, 19, 77, 2, 2, 0, 58, 42, 59, + 56, 48, 56, 56, 44, 47, 49, 50, 51, 52, + 53, 54, 55, 56, 39, 20, 36, 34, 26, 34, - 60, 68, 68, 56, 59, 61, 62, 63, 64, 65, - 66, 67, 68, 51, 32, 48, 46, 38, 46, 46, - 34, 37, 39, 40, 41, 42, 43, 44, 45, 46, - 78, 77, 82, 83, 83, 85, 13, 12, 13, 18, - 17, 18, 20, 3, 5, 5, 8, 8, 8, 8, - 87, 30, 28, 27, 0, 73, 60, 69, 72, 56, - 59, 58, 50, 38, 47, 49, 34, 37, 36, 5, - 8, 7, 8, 28, 27, 0, 56, 57, 34, 36, - 5, 7, 8, 0, 34, 36, 5, 8, 0, 34, - 35, 5, 8, 0, 34, 5, 8, 1, 5, 8, - - 4, 8, 6, 4, 6, 0 + 34, 22, 25, 27, 28, 29, 30, 31, 32, 33, + 34, 66, 65, 70, 71, 71, 73, 0, 3, 5, + 5, 9, 9, 9, 9, 9, 75, 18, 16, 15, + 0, 61, 48, 57, 60, 44, 47, 46, 38, 26, + 35, 37, 22, 25, 24, 5, 9, 8, 9, 9, + 16, 15, 0, 44, 45, 22, 24, 5, 8, 9, + 9, 0, 22, 24, 5, 9, 9, 0, 22, 23, + 5, 9, 9, 7, 0, 22, 5, 9, 7, 1, + 5, 9, 4, 9, 6, 4, 6, 0 } ; static yyconst int yy_ec[256] = @@ -319,15 +335,15 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, 6, 1, 1, 1, 7, 8, 9, 10, 1, 1, 1, 11, 12, 13, 14, 14, - 14, 14, 14, 14, 14, 15, 15, 1, 16, 1, - 1, 1, 1, 1, 17, 17, 17, 17, 17, 17, - 11, 11, 11, 11, 11, 18, 11, 11, 19, 11, - 11, 11, 11, 11, 11, 11, 11, 20, 11, 11, - 1, 21, 1, 1, 22, 1, 23, 24, 25, 26, + 14, 14, 14, 14, 14, 15, 16, 1, 17, 1, + 1, 1, 1, 1, 18, 18, 18, 18, 18, 18, + 11, 11, 11, 11, 11, 19, 11, 11, 20, 11, + 11, 11, 11, 11, 11, 11, 11, 21, 11, 11, + 1, 22, 1, 1, 23, 1, 24, 25, 26, 27, - 27, 28, 29, 11, 11, 11, 11, 30, 31, 32, - 33, 34, 11, 35, 11, 36, 37, 38, 11, 39, - 11, 11, 40, 1, 41, 1, 1, 1, 1, 1, + 28, 29, 30, 11, 11, 11, 11, 31, 32, 33, + 34, 35, 11, 36, 11, 37, 38, 39, 11, 40, + 11, 11, 41, 1, 42, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -344,261 +360,221 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[42] = +static yyconst int yy_meta[43] = { 0, - 1, 1, 2, 1, 3, 4, 1, 5, 5, 6, - 7, 8, 9, 9, 9, 4, 9, 7, 7, 7, - 10, 7, 9, 9, 9, 9, 9, 9, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 11, - 11 + 1, 1, 2, 1, 3, 1, 1, 1, 1, 4, + 5, 5, 6, 6, 6, 6, 1, 6, 5, 5, + 5, 7, 5, 6, 6, 6, 6, 6, 6, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 1, 1 } ; -static yyconst short int yy_base[246] = +static yyconst short int yy_base[222] = { 0, - 0, 40, 40, 44, 45, 48, 68, 95, 49, 52, - 0, 0, 74, 122, 124, 162, 85, 101, 367, 366, - 51, 53, 55, 65, 358, 764, 109, 764, 764, 764, - 95, 119, 167, 122, 0, 132, 341, 764, 764, 141, - 150, 0, 764, 144, 204, 0, 764, 154, 241, 764, - 165, 764, 764, 0, 0, 764, 163, 764, 0, 764, - 340, 764, 764, 764, 187, 188, 0, 764, 764, 764, - 322, 192, 764, 197, 764, 764, 0, 0, 296, 0, - 200, 201, 139, 316, 764, 280, 191, 200, 236, 310, - 0, 764, 227, 233, 249, 284, 0, 256, 764, 764, + 0, 41, 41, 45, 46, 49, 70, 98, 50, 52, + 53, 126, 392, 385, 54, 55, 56, 58, 387, 608, + 74, 608, 608, 608, 57, 77, 127, 70, 0, 70, + 376, 608, 608, 113, 116, 0, 608, 104, 165, 0, + 608, 129, 203, 608, 133, 608, 608, 0, 0, 608, + 140, 608, 608, 366, 151, 152, 0, 608, 0, 341, + 0, 242, 158, 81, 363, 608, 280, 143, 153, 160, + 311, 0, 608, 182, 189, 195, 329, 0, 207, 608, + 608, 211, 361, 358, 207, 234, 608, 608, 608, 608, + 608, 608, 608, 0, 0, 229, 608, 608, 233, 358, - 221, 291, 273, 257, 278, 764, 764, 764, 764, 764, - 764, 764, 0, 0, 293, 764, 764, 264, 272, 269, - 286, 289, 764, 764, 764, 764, 764, 764, 764, 0, - 303, 764, 0, 296, 299, 764, 0, 764, 308, 0, - 764, 311, 314, 0, 0, 237, 0, 326, 340, 235, - 0, 355, 354, 49, 236, 764, 341, 764, 764, 333, - 363, 0, 764, 377, 764, 764, 372, 375, 0, 225, - 389, 0, 213, 226, 361, 205, 386, 764, 389, 0, - 198, 0, 193, 164, 392, 0, 149, 140, 153, 395, - 764, 149, 127, 390, 398, 121, 103, 412, 108, 413, + 346, 238, 246, 608, 608, 608, 608, 608, 608, 608, + 0, 261, 608, 0, 254, 258, 608, 269, 0, 0, + 323, 0, 339, 376, 303, 283, 0, 392, 279, 140, + 295, 608, 270, 608, 608, 263, 289, 0, 608, 292, + 608, 608, 293, 298, 0, 272, 340, 0, 270, 266, + 154, 173, 253, 302, 608, 332, 0, 244, 0, 221, + 226, 206, 343, 0, 194, 188, 358, 201, 355, 608, + 190, 179, 370, 0, 326, 368, 173, 163, 0, 330, + 168, 401, 0, 402, 0, 0, 0, 608, 434, 441, + 448, 455, 462, 469, 476, 483, 486, 490, 497, 504, - 0, 416, 0, 0, 0, 764, 425, 436, 447, 458, - 469, 480, 491, 502, 513, 524, 535, 540, 545, 555, - 566, 577, 588, 599, 97, 610, 621, 632, 642, 653, - 664, 675, 686, 697, 708, 91, 75, 719, 65, 55, - 730, 51, 48, 741, 752 + 510, 517, 523, 186, 530, 537, 544, 551, 558, 565, + 139, 138, 572, 130, 115, 579, 101, 64, 586, 593, + 600 } ; -static yyconst short int yy_def[246] = +static yyconst short int yy_def[222] = { 0, - 206, 1, 207, 207, 208, 208, 209, 209, 210, 210, - 211, 211, 212, 212, 213, 213, 214, 214, 215, 215, - 216, 216, 217, 217, 206, 206, 206, 206, 206, 206, - 218, 219, 218, 33, 220, 218, 219, 206, 206, 206, - 206, 221, 206, 206, 222, 223, 206, 206, 224, 206, - 206, 206, 206, 225, 226, 206, 227, 206, 228, 206, - 229, 206, 206, 206, 228, 206, 230, 206, 206, 206, - 231, 230, 206, 206, 206, 206, 232, 233, 233, 234, - 234, 206, 218, 219, 206, 235, 33, 218, 218, 218, - 220, 206, 206, 206, 206, 206, 221, 206, 206, 206, + 188, 1, 189, 189, 190, 190, 191, 191, 192, 192, + 193, 193, 194, 194, 195, 195, 196, 196, 188, 188, + 188, 188, 188, 188, 197, 198, 197, 27, 199, 197, + 198, 188, 188, 188, 188, 200, 188, 188, 201, 202, + 188, 188, 203, 188, 188, 188, 188, 204, 205, 188, + 206, 188, 188, 188, 188, 188, 207, 188, 208, 208, + 209, 209, 188, 197, 198, 188, 210, 27, 197, 197, + 197, 199, 188, 188, 188, 188, 188, 200, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 211, 202, 188, 188, 188, 188, 188, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 236, 223, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 237, - 206, 206, 226, 227, 227, 206, 228, 206, 228, 230, - 206, 230, 206, 232, 233, 233, 234, 234, 234, 234, - 238, 235, 218, 90, 206, 206, 206, 206, 206, 206, - 206, 239, 206, 206, 206, 206, 206, 206, 240, 233, - 234, 241, 234, 218, 218, 206, 206, 206, 206, 242, - 233, 241, 234, 206, 206, 243, 233, 234, 206, 206, - 206, 233, 234, 206, 206, 233, 234, 206, 233, 234, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 212, 188, 188, 205, 206, 206, 188, 188, 207, 208, + 208, 209, 209, 209, 209, 209, 213, 210, 197, 71, + 188, 188, 188, 188, 188, 188, 188, 214, 188, 188, + 188, 188, 188, 188, 215, 208, 209, 216, 209, 209, + 197, 197, 188, 188, 188, 188, 217, 208, 216, 209, + 209, 188, 188, 218, 208, 209, 209, 188, 188, 188, + 208, 209, 209, 219, 188, 188, 208, 209, 219, 188, + 208, 209, 220, 209, 221, 220, 221, 0, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, - 244, 234, 245, 244, 245, 0, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206 + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188 } ; -static yyconst short int yy_nxt[806] = +static yyconst short int yy_nxt[651] = { 0, - 26, 27, 28, 27, 29, 26, 30, 26, 26, 26, - 31, 32, 33, 34, 34, 35, 31, 36, 31, 31, - 37, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 38, - 39, 40, 43, 40, 44, 41, 43, 47, 44, 48, - 47, 56, 48, 58, 56, 58, 191, 58, 57, 186, - 45, 57, 81, 180, 45, 49, 175, 58, 49, 51, - 52, 51, 81, 178, 53, 79, 60, 79, 175, 58, - 54, 54, 54, 169, 54, 61, 74, 75, 74, 62, - 54, 54, 54, 54, 54, 54, 51, 52, 51, 162, + 20, 21, 22, 21, 23, 20, 24, 20, 20, 20, + 25, 26, 27, 28, 28, 28, 29, 25, 30, 25, + 25, 31, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 32, 33, 34, 37, 34, 38, 35, 37, 41, 38, + 42, 41, 50, 42, 50, 53, 58, 58, 58, 51, + 58, 51, 39, 62, 54, 62, 39, 43, 65, 170, + 43, 45, 46, 45, 73, 63, 47, 63, 65, 60, + 60, 65, 48, 48, 48, 48, 66, 48, 67, 64, + 64, 65, 65, 48, 48, 48, 48, 48, 48, 45, - 76, 53, 74, 75, 74, 132, 84, 54, 54, 54, - 82, 54, 82, 63, 64, 84, 76, 54, 54, 54, - 54, 54, 54, 65, 60, 65, 68, 66, 85, 58, - 86, 69, 70, 61, 201, 71, 92, 62, 200, 58, - 83, 83, 93, 84, 93, 98, 94, 98, 99, 199, - 84, 95, 84, 95, 83, 115, 197, 115, 116, 84, - 83, 63, 64, 72, 68, 72, 131, 66, 131, 69, - 70, 196, 135, 71, 136, 194, 193, 58, 84, 87, - 87, 87, 192, 96, 88, 89, 90, 84, 139, 95, - 139, 95, 94, 142, 189, 142, 88, 94, 143, 89, + 46, 45, 65, 64, 47, 79, 164, 79, 80, 64, + 48, 48, 48, 48, 74, 48, 74, 76, 75, 76, + 157, 48, 48, 48, 48, 48, 48, 55, 53, 55, + 96, 56, 96, 97, 112, 155, 112, 54, 65, 68, + 68, 68, 68, 145, 138, 69, 70, 71, 65, 116, + 77, 117, 118, 76, 118, 76, 75, 69, 152, 63, + 70, 63, 64, 64, 65, 65, 71, 82, 83, 84, + 152, 65, 129, 129, 65, 65, 64, 85, 85, 86, + 86, 65, 64, 74, 65, 74, 77, 75, 87, 88, + 76, 113, 76, 89, 65, 183, 76, 90, 76, 182, - 143, 148, 82, 148, 82, 90, 101, 102, 103, 83, - 83, 84, 149, 149, 149, 188, 104, 104, 105, 187, - 84, 96, 157, 83, 157, 150, 106, 107, 93, 83, - 93, 108, 94, 184, 95, 109, 95, 84, 110, 111, - 183, 112, 113, 118, 119, 120, 84, 84, 153, 153, - 95, 181, 95, 121, 121, 122, 84, 98, 176, 98, - 156, 173, 170, 123, 124, 164, 96, 164, 125, 160, - 160, 161, 126, 166, 165, 127, 128, 159, 129, 130, - 151, 151, 96, 151, 151, 151, 151, 151, 151, 151, - 161, 161, 161, 158, 115, 151, 115, 163, 167, 167, + 91, 92, 181, 93, 94, 99, 100, 101, 79, 178, + 79, 132, 133, 177, 133, 102, 102, 103, 103, 136, + 136, 137, 137, 77, 175, 172, 104, 105, 171, 77, + 96, 106, 96, 139, 140, 107, 140, 168, 108, 109, + 167, 110, 111, 123, 166, 123, 137, 137, 137, 137, + 143, 143, 144, 144, 124, 124, 124, 124, 144, 144, + 144, 144, 112, 188, 112, 188, 165, 116, 125, 117, + 118, 133, 118, 133, 75, 154, 154, 137, 137, 126, + 127, 127, 162, 127, 127, 127, 127, 127, 127, 127, + 65, 129, 129, 140, 161, 140, 127, 151, 160, 158, - 168, 168, 168, 168, 131, 206, 131, 206, 135, 139, - 136, 139, 142, 94, 142, 143, 94, 143, 155, 151, - 151, 84, 154, 154, 154, 206, 154, 148, 146, 148, - 84, 85, 154, 154, 154, 154, 154, 154, 149, 149, - 149, 171, 157, 171, 157, 177, 177, 161, 172, 85, - 206, 150, 149, 149, 149, 151, 151, 206, 151, 151, - 151, 151, 151, 151, 151, 84, 153, 153, 58, 58, - 151, 174, 84, 206, 84, 161, 161, 161, 164, 206, - 164, 84, 206, 174, 179, 179, 168, 168, 168, 168, - 171, 198, 171, 198, 151, 151, 206, 172, 161, 161, + 65, 137, 137, 137, 137, 156, 156, 144, 144, 151, + 144, 144, 144, 144, 137, 137, 137, 137, 153, 150, + 127, 127, 65, 130, 130, 130, 130, 180, 130, 180, + 149, 180, 65, 180, 130, 130, 130, 130, 130, 130, + 123, 147, 123, 147, 163, 163, 144, 144, 148, 146, + 142, 124, 124, 124, 124, 169, 169, 144, 144, 173, + 141, 173, 135, 134, 131, 125, 174, 176, 176, 144, + 144, 173, 188, 173, 121, 66, 126, 147, 174, 147, + 144, 144, 144, 144, 148, 188, 188, 58, 124, 124, + 124, 124, 127, 127, 58, 127, 127, 127, 127, 127, - 161, 185, 185, 168, 190, 190, 168, 195, 195, 168, - 168, 168, 168, 198, 202, 198, 202, 202, 206, 202, - 206, 203, 206, 206, 203, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 67, 67, 67, 67, 67, 67, 67, 67, 67, + 127, 127, 184, 184, 184, 184, 188, 188, 127, 185, + 185, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 127, 127, 36, 36, 36, 36, 36, 36, + 36, 40, 40, 40, 40, 40, 40, 40, 44, 44, + 44, 44, 44, 44, 44, 49, 49, 49, 49, 49, + 49, 49, 52, 52, 52, 52, 52, 52, 52, 57, + 57, 57, 57, 57, 57, 57, 59, 59, 59, 59, + 59, 59, 59, 61, 61, 61, 61, 61, 61, 61, + 64, 64, 64, 65, 65, 65, 65, 72, 188, 72, - 67, 67, 73, 73, 73, 73, 73, 73, 73, 73, - 73, 73, 73, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 83, 83, 83, 83, - 84, 84, 84, 84, 84, 91, 206, 91, 91, 91, - 91, 91, 91, 91, 91, 91, 97, 206, 206, 97, - 97, 97, 97, 97, 97, 206, 97, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 114, 206, - 206, 114, 114, 114, 114, 114, 114, 206, 114, 117, + 72, 72, 72, 72, 78, 188, 188, 78, 78, 78, + 81, 81, 81, 81, 81, 81, 81, 95, 188, 188, + 95, 95, 95, 98, 98, 98, 98, 98, 98, 98, + 114, 188, 114, 188, 114, 114, 114, 115, 188, 115, + 115, 115, 115, 115, 119, 188, 119, 119, 119, 119, + 119, 120, 188, 120, 120, 120, 120, 120, 122, 188, + 122, 122, 122, 122, 122, 128, 188, 128, 128, 128, + 128, 128, 127, 188, 127, 127, 127, 127, 127, 159, + 188, 159, 159, 159, 159, 159, 179, 188, 179, 179, + 179, 179, 179, 186, 188, 186, 186, 186, 186, 186, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 133, 206, 133, 133, 133, 206, 133, 133, 133, 133, - 133, 134, 206, 134, 134, 134, 134, 134, 134, 134, - 134, 134, 137, 206, 137, 206, 137, 137, 137, 206, - 137, 137, 138, 206, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 140, 206, 140, 206, 206, 140, 140, - 206, 140, 140, 140, 141, 206, 141, 141, 141, 141, - 141, 141, 141, 141, 141, 144, 206, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 145, 206, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 147, 206, 147, - - 147, 147, 147, 147, 147, 147, 147, 147, 152, 206, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 151, - 206, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 182, 206, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 204, 206, 204, 204, 204, 204, 204, 204, 204, - 204, 204, 205, 206, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 25, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - - 206, 206, 206, 206, 206 + 187, 188, 187, 187, 187, 187, 187, 19, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188 } ; -static yyconst short int yy_chk[806] = +static yyconst short int yy_chk[651] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 3, 2, 3, 2, 4, 5, 4, 5, - 6, 9, 6, 21, 10, 22, 243, 23, 9, 242, - 3, 10, 23, 240, 4, 5, 154, 24, 6, 7, - 7, 7, 24, 239, 7, 21, 13, 22, 154, 13, - 7, 7, 7, 237, 7, 13, 17, 17, 17, 13, - 7, 7, 7, 7, 7, 7, 8, 8, 8, 236, + 1, 1, 2, 3, 2, 3, 2, 4, 5, 4, + 5, 6, 9, 6, 10, 11, 15, 16, 17, 9, + 18, 10, 3, 17, 11, 18, 4, 5, 25, 218, + 6, 7, 7, 7, 30, 21, 7, 21, 25, 15, + 16, 30, 7, 7, 7, 7, 26, 7, 26, 28, + 28, 30, 64, 7, 7, 7, 7, 7, 7, 8, - 17, 8, 18, 18, 18, 225, 31, 8, 8, 8, - 27, 8, 27, 13, 13, 31, 18, 8, 8, 8, - 8, 8, 8, 14, 14, 14, 15, 14, 32, 15, - 32, 15, 15, 14, 199, 15, 36, 14, 197, 15, - 34, 34, 40, 36, 40, 44, 40, 44, 44, 196, - 83, 41, 36, 41, 34, 48, 193, 48, 48, 83, - 34, 14, 14, 16, 16, 16, 51, 16, 51, 16, - 16, 192, 57, 16, 57, 189, 188, 16, 33, 33, - 33, 33, 187, 41, 33, 33, 33, 33, 65, 66, - 65, 66, 65, 72, 184, 72, 33, 72, 74, 33, + 8, 8, 64, 28, 8, 38, 217, 38, 38, 28, + 8, 8, 8, 8, 34, 8, 34, 35, 34, 35, + 215, 8, 8, 8, 8, 8, 8, 12, 12, 12, + 42, 12, 42, 42, 45, 214, 45, 12, 27, 27, + 27, 27, 27, 212, 211, 27, 27, 27, 27, 51, + 35, 51, 55, 56, 55, 56, 55, 27, 130, 63, + 27, 63, 68, 68, 69, 151, 27, 39, 39, 39, + 130, 70, 70, 70, 69, 151, 68, 39, 39, 39, + 39, 70, 68, 74, 152, 74, 56, 74, 39, 39, + 75, 204, 75, 39, 152, 181, 76, 39, 76, 178, - 74, 81, 82, 81, 82, 33, 45, 45, 45, 87, - 87, 88, 81, 81, 81, 183, 45, 45, 45, 181, - 88, 66, 101, 87, 101, 81, 45, 45, 93, 87, - 93, 45, 93, 176, 94, 45, 94, 174, 45, 45, - 173, 45, 45, 49, 49, 49, 174, 89, 89, 89, - 95, 170, 95, 49, 49, 49, 89, 98, 155, 98, - 98, 150, 146, 49, 49, 118, 94, 118, 49, 104, - 104, 104, 49, 120, 119, 49, 49, 103, 49, 49, - 86, 86, 95, 86, 86, 86, 86, 86, 86, 86, - 105, 105, 105, 102, 115, 86, 115, 115, 121, 121, + 39, 39, 177, 39, 39, 43, 43, 43, 79, 172, + 79, 79, 82, 171, 82, 43, 43, 43, 43, 85, + 85, 85, 85, 75, 168, 166, 43, 43, 165, 76, + 96, 43, 96, 96, 99, 43, 99, 162, 43, 43, + 161, 43, 43, 62, 160, 62, 86, 86, 86, 86, + 102, 102, 102, 102, 62, 62, 62, 62, 103, 103, + 103, 103, 112, 115, 112, 115, 158, 116, 62, 116, + 118, 133, 118, 133, 118, 136, 136, 136, 136, 62, + 67, 67, 153, 67, 67, 67, 67, 67, 67, 67, + 129, 129, 129, 140, 150, 140, 67, 129, 149, 146, - 121, 122, 122, 122, 131, 134, 131, 134, 135, 139, - 135, 139, 142, 139, 142, 143, 142, 143, 96, 86, - 86, 90, 90, 90, 90, 84, 90, 148, 79, 148, - 90, 71, 90, 90, 90, 90, 90, 90, 148, 148, - 148, 149, 157, 149, 157, 160, 160, 160, 149, 61, - 37, 148, 149, 149, 149, 152, 152, 25, 152, 152, - 152, 152, 152, 152, 152, 153, 153, 153, 20, 19, - 152, 153, 175, 0, 153, 161, 161, 161, 164, 0, - 164, 175, 0, 153, 167, 167, 167, 168, 168, 168, - 171, 194, 171, 194, 152, 152, 0, 171, 177, 177, + 129, 137, 137, 137, 137, 143, 143, 143, 143, 129, + 144, 144, 144, 144, 154, 154, 154, 154, 131, 126, + 67, 67, 71, 71, 71, 71, 71, 175, 71, 175, + 125, 180, 71, 180, 71, 71, 71, 71, 71, 71, + 123, 147, 123, 147, 156, 156, 156, 156, 147, 121, + 101, 123, 123, 123, 123, 163, 163, 163, 163, 167, + 100, 167, 84, 83, 77, 123, 167, 169, 169, 169, + 169, 173, 65, 173, 60, 54, 123, 124, 173, 124, + 176, 176, 176, 176, 124, 31, 19, 14, 124, 124, + 124, 124, 128, 128, 13, 128, 128, 128, 128, 128, - 177, 179, 179, 179, 185, 185, 185, 190, 190, 190, - 195, 195, 195, 198, 200, 198, 200, 202, 0, 202, - 0, 200, 0, 0, 202, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, - 208, 208, 208, 208, 208, 208, 208, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 128, 128, 182, 184, 182, 184, 0, 0, 128, 182, + 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 128, 128, 189, 189, 189, 189, 189, 189, + 189, 190, 190, 190, 190, 190, 190, 190, 191, 191, + 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, + 192, 192, 193, 193, 193, 193, 193, 193, 193, 194, + 194, 194, 194, 194, 194, 194, 195, 195, 195, 195, + 195, 195, 195, 196, 196, 196, 196, 196, 196, 196, + 197, 197, 197, 198, 198, 198, 198, 199, 0, 199, - 213, 213, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 217, 217, 217, 217, 217, - 217, 217, 217, 217, 217, 217, 218, 218, 218, 218, - 219, 219, 219, 219, 219, 220, 0, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 221, 0, 0, 221, - 221, 221, 221, 221, 221, 0, 221, 222, 222, 222, - 222, 222, 222, 222, 222, 222, 222, 222, 223, 0, - 0, 223, 223, 223, 223, 223, 223, 0, 223, 224, + 199, 199, 199, 199, 200, 0, 0, 200, 200, 200, + 201, 201, 201, 201, 201, 201, 201, 202, 0, 0, + 202, 202, 202, 203, 203, 203, 203, 203, 203, 203, + 205, 0, 205, 0, 205, 205, 205, 206, 0, 206, + 206, 206, 206, 206, 207, 0, 207, 207, 207, 207, + 207, 208, 0, 208, 208, 208, 208, 208, 209, 0, + 209, 209, 209, 209, 209, 210, 0, 210, 210, 210, + 210, 210, 213, 0, 213, 213, 213, 213, 213, 216, + 0, 216, 216, 216, 216, 216, 219, 0, 219, 219, + 219, 219, 219, 220, 0, 220, 220, 220, 220, 220, - 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - 226, 0, 226, 226, 226, 0, 226, 226, 226, 226, - 226, 227, 0, 227, 227, 227, 227, 227, 227, 227, - 227, 227, 228, 0, 228, 0, 228, 228, 228, 0, - 228, 228, 229, 0, 229, 229, 229, 229, 229, 229, - 229, 229, 229, 230, 0, 230, 0, 0, 230, 230, - 0, 230, 230, 230, 231, 0, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 232, 0, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 233, 0, 233, 233, - 233, 233, 233, 233, 233, 233, 233, 234, 0, 234, - - 234, 234, 234, 234, 234, 234, 234, 234, 235, 0, - 235, 235, 235, 235, 235, 235, 235, 235, 235, 238, - 0, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 241, 0, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 244, 0, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 245, 0, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - - 206, 206, 206, 206, 206 + 221, 0, 221, 221, 221, 221, 221, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188 } ; static yy_state_type yy_last_accepting_state; @@ -610,9 +586,8 @@ static char *yy_last_accepting_cpos; #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "tools/wrc/parser.l" +#line 1 "parser.l" #define INITIAL 0 /* -*-C-*- * @@ -630,7 +605,7 @@ char *yytext; * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * History: * 21-May-2000 BS - Fixed the ident requirement of resource names @@ -683,40 +658,34 @@ char *yytext; * escaped '\0'. */ /* Exclusive string handling */ -#define yystr 1 +#define tkstr 1 /* Exclusive unicode string handling */ -#define yylstr 2 +#define tklstr 2 /* Exclusive rcdata single quoted data handling */ -#define yyrcd 3 +#define tkrcd 3 /* Exclusive comment eating... */ #define comment 4 /* Set when stripping c-junk */ -#define pp_stripe 5 - -#define pp_strips 6 - -#define pp_stripp 7 - -#define pp_stripp_final 8 +#define pp_cstrip 5 /* Set when scanning #line style directives */ -#define pp_line 9 +#define pp_line 6 /* Set when scanning #pragma */ -#define pp_pragma 10 +#define pp_pragma 7 -#define pp_code_page 11 +#define pp_code_page 8 #define YY_STACK_USED 1 #define YY_NO_UNPUT 1 #define YY_NO_TOP_STATE 1 #define YY_NEVER_INTERACTIVE 1 /* Some shortcut definitions */ -#line 98 "tools/wrc/parser.l" +#line 96 "parser.l" /*#define LEX_DEBUG*/ @@ -749,9 +718,6 @@ static int cbufalloc = 0; static WCHAR *wbuffer; static int wbufidx; static int wbufalloc = 0; -static int stripslevel = 0; /* Count {} during pp_strips/pp_stripe mode */ -static int stripplevel = 0; /* Count () during pp_strips mode */ -static int cjunk_tagline; /* Where did we start stripping (helps error tracking) */ static int current_codepage = -1; /* use language default */ @@ -921,7 +887,7 @@ static struct keyword *iskeyword(char *kw) * The flexer starts here ************************************************************************** */ -#line 925 "tools/wrc/lex.yy.c" +#line 891 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -943,10 +909,6 @@ static void yyunput YY_PROTO(( int c, char *buf_ptr )); static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); @@ -1072,10 +1034,10 @@ YY_MALLOC_DECL YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp, *yy_bp; register int yy_act; -#line 304 "tools/wrc/parser.l" +#line 299 "parser.l" /* * Catch the GCC-style line statements here and parse them. @@ -1095,7 +1057,7 @@ YY_DECL * because we only want to know the linenumber and * filename. */ -#line 1099 "tools/wrc/lex.yy.c" +#line 1061 "lex.yy.c" if ( yy_init ) { @@ -1147,13 +1109,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 207 ) + if ( yy_current_state >= 189 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 764 ); + while ( yy_base[yy_current_state] != 608 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1181,183 +1143,122 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 323 "tools/wrc/parser.l" +#line 318 "parser.l" yy_push_state(pp_pragma); YY_BREAK case 2: YY_RULE_SETUP -#line 324 "tools/wrc/parser.l" +#line 319 "parser.l" yy_push_state(pp_line); YY_BREAK case 3: YY_RULE_SETUP -#line 325 "tools/wrc/parser.l" +#line 320 "parser.l" { - int lineno; + int lineno, len; char *cptr; char *fname; yy_pop_state(); lineno = (int)strtol(yytext, &cptr, 10); if(!lineno) - yyerror("Malformed '#...' line-directive; invalid linenumber"); + parser_error("Malformed '#...' line-directive; invalid linenumber\n"); fname = strchr(cptr, '"'); if(!fname) - yyerror("Malformed '#...' line-directive; missing filename"); + parser_error("Malformed '#...' line-directive; missing filename\n"); fname++; cptr = strchr(fname, '"'); if(!cptr) - yyerror("Malformed '#...' line-directive; missing terminating \""); + parser_error("Malformed '#...' line-directive; missing terminating \""); *cptr = '\0'; line_number = lineno - 1; /* We didn't read the newline */ input_name = xstrdup(fname); + /* ignore contents of C include files */ + len = strlen(input_name); + if (len > 1 && !strcasecmp( input_name + len - 2, ".h" )) + BEGIN(pp_cstrip); + else + BEGIN(INITIAL); } YY_BREAK case 4: YY_RULE_SETUP -#line 345 "tools/wrc/parser.l" +#line 346 "parser.l" yyless(9); yy_pop_state(); yy_push_state(pp_code_page); YY_BREAK case 5: YY_RULE_SETUP -#line 346 "tools/wrc/parser.l" -yy_pop_state(); if (pedantic) yywarning("Unrecognized #pragma directive '%s'",yytext); +#line 347 "parser.l" +yy_pop_state(); if (pedantic) parser_warning("Unrecognized #pragma directive '%s'\n",yytext); YY_BREAK case 6: YY_RULE_SETUP -#line 348 "tools/wrc/parser.l" +#line 349 "parser.l" current_codepage = -1; yy_pop_state(); YY_BREAK case 7: YY_RULE_SETUP -#line 349 "tools/wrc/parser.l" +#line 350 "parser.l" +current_codepage = CP_UTF8; yy_pop_state(); + YY_BREAK +case 8: +YY_RULE_SETUP +#line 351 "parser.l" { char *p = yytext; yy_pop_state(); while (*p < '0' || *p > '9') p++; current_codepage = strtol( p, NULL, 10 ); - if (current_codepage && !wine_cp_get_table( current_codepage )) + if (current_codepage && current_codepage != CP_UTF8 && !wine_cp_get_table( current_codepage )) { - yyerror("Codepage %d not supported", current_codepage); + parser_error("Codepage %d not supported\n", current_codepage); current_codepage = 0; } } YY_BREAK -case 8: +case 9: YY_RULE_SETUP -#line 360 "tools/wrc/parser.l" -yy_pop_state(); yyerror("Malformed #pragma code_page directive"); +#line 362 "parser.l" +yy_pop_state(); parser_error("Malformed #pragma code_page directive\n"); YY_BREAK /* * Strip everything until a ';' taking * into account braces {} for structures, * classes and enums. */ -case 9: -YY_RULE_SETUP -#line 367 "tools/wrc/parser.l" -stripslevel++; - YY_BREAK case 10: YY_RULE_SETUP -#line 368 "tools/wrc/parser.l" -stripslevel--; +#line 369 "parser.l" +line_number++; char_number = 1; YY_BREAK case 11: YY_RULE_SETUP -#line 369 "tools/wrc/parser.l" -if(!stripslevel) yy_pop_state(); +#line 370 "parser.l" +; /* ignore */ YY_BREAK case 12: YY_RULE_SETUP -#line 370 "tools/wrc/parser.l" -; /* To catch comments */ +#line 372 "parser.l" +return tBEGIN; YY_BREAK case 13: YY_RULE_SETUP -#line 371 "tools/wrc/parser.l" -; /* Ignore rest */ +#line 373 "parser.l" +return tEND; YY_BREAK case 14: YY_RULE_SETUP -#line 372 "tools/wrc/parser.l" -line_number++; char_number = 1; +#line 375 "parser.l" +{ parser_lval.num = strtoul(yytext, 0, 10); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } YY_BREAK case 15: YY_RULE_SETUP -#line 374 "tools/wrc/parser.l" -stripplevel++; +#line 376 "parser.l" +{ parser_lval.num = strtoul(yytext, 0, 16); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } YY_BREAK case 16: YY_RULE_SETUP -#line 375 "tools/wrc/parser.l" -{ - stripplevel--; - if(!stripplevel) - { - yy_pop_state(); - yy_push_state(pp_stripp_final); - } - } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 383 "tools/wrc/parser.l" -; /* To catch comments */ - YY_BREAK -case 18: -YY_RULE_SETUP -#line 384 "tools/wrc/parser.l" -; /* Ignore rest */ - YY_BREAK -case 19: -YY_RULE_SETUP -#line 385 "tools/wrc/parser.l" -line_number++; char_number = 1; - YY_BREAK -case 20: -YY_RULE_SETUP -#line 387 "tools/wrc/parser.l" -; /* Ignore */ - YY_BREAK -case 21: -YY_RULE_SETUP -#line 388 "tools/wrc/parser.l" -yy_pop_state(); /* Kill the semicolon */ - YY_BREAK -case 22: -YY_RULE_SETUP -#line 389 "tools/wrc/parser.l" -line_number++; char_number = 1; yy_pop_state(); - YY_BREAK -case 23: -YY_RULE_SETUP -#line 390 "tools/wrc/parser.l" -yyless(0); yy_pop_state(); - YY_BREAK -case 24: -YY_RULE_SETUP -#line 392 "tools/wrc/parser.l" -return tBEGIN; - YY_BREAK -case 25: -YY_RULE_SETUP -#line 393 "tools/wrc/parser.l" -return tEND; - YY_BREAK -case 26: -YY_RULE_SETUP -#line 395 "tools/wrc/parser.l" -{ yylval.num = strtoul(yytext, 0, 10); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 396 "tools/wrc/parser.l" -{ yylval.num = strtoul(yytext, 0, 16); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 397 "tools/wrc/parser.l" -{ yylval.num = strtoul(yytext+2, 0, 8); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } +#line 377 "parser.l" +{ parser_lval.num = strtoul(yytext+2, 0, 8); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } YY_BREAK /* * The next two rules scan identifiers and filenames. @@ -1366,9 +1267,9 @@ YY_RULE_SETUP * and *only* in a filename. In this case, the second * rule will be reduced because it is longer. */ -case 29: +case 17: YY_RULE_SETUP -#line 406 "tools/wrc/parser.l" +#line 386 "parser.l" { struct keyword *tok = iskeyword(yytext); @@ -1376,7 +1277,7 @@ YY_RULE_SETUP { if(wanted_id && !tok->alwayskw) { - yylval.str = make_string(yytext); + parser_lval.str = make_string(yytext); return tIDENT; } else @@ -1384,368 +1285,368 @@ YY_RULE_SETUP } else { - yylval.str = make_string(yytext); + parser_lval.str = make_string(yytext); return tIDENT; } } YY_BREAK -case 30: +case 18: YY_RULE_SETUP -#line 425 "tools/wrc/parser.l" -yylval.str = make_string(yytext); return tFILENAME; +#line 405 "parser.l" +parser_lval.str = make_string(yytext); return tFILENAME; YY_BREAK /* * Wide string scanning */ -case 31: +case 19: YY_RULE_SETUP -#line 430 "tools/wrc/parser.l" +#line 410 "parser.l" { - yy_push_state(yylstr); + yy_push_state(tklstr); wbufidx = 0; if(!win32) - yywarning("16bit resource contains unicode strings\n"); + parser_warning("16bit resource contains unicode strings\n"); } YY_BREAK -case 32: -#line 437 "tools/wrc/parser.l" -case 33: +case 20: +#line 417 "parser.l" +case 21: YY_RULE_SETUP -#line 437 "tools/wrc/parser.l" +#line 417 "parser.l" { yy_pop_state(); - yylval.str = get_buffered_wstring(); + parser_lval.str = get_buffered_wstring(); return tSTRING; } YY_BREAK -case 34: +case 22: YY_RULE_SETUP -#line 442 "tools/wrc/parser.l" +#line 422 "parser.l" { /* octal escape sequence */ unsigned int result; result = strtoul(yytext+1, 0, 8); if ( result > 0xffff ) - yyerror("Character constant out of range"); + parser_error("Character constant out of range\n"); addwchar((WCHAR)result); } YY_BREAK -case 35: +case 23: YY_RULE_SETUP -#line 449 "tools/wrc/parser.l" +#line 429 "parser.l" { /* hex escape sequence */ unsigned int result; result = strtoul(yytext+2, 0, 16); addwchar((WCHAR)result); } YY_BREAK +case 24: +YY_RULE_SETUP +#line 434 "parser.l" +{ parser_error("Invalid hex escape sequence '%s'\n", yytext); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 436 "parser.l" +parser_error("Bad escape sequence\n"); + YY_BREAK +case 26: +YY_RULE_SETUP +#line 437 "parser.l" +line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ + YY_BREAK +case 27: +YY_RULE_SETUP +#line 438 "parser.l" +addwchar('\a'); + YY_BREAK +case 28: +YY_RULE_SETUP +#line 439 "parser.l" +addwchar('\b'); + YY_BREAK +case 29: +YY_RULE_SETUP +#line 440 "parser.l" +addwchar('\f'); + YY_BREAK +case 30: +YY_RULE_SETUP +#line 441 "parser.l" +addwchar('\n'); + YY_BREAK +case 31: +YY_RULE_SETUP +#line 442 "parser.l" +addwchar('\r'); + YY_BREAK +case 32: +YY_RULE_SETUP +#line 443 "parser.l" +addwchar('\t'); + YY_BREAK +case 33: +YY_RULE_SETUP +#line 444 "parser.l" +addwchar('\v'); + YY_BREAK +case 34: +YY_RULE_SETUP +#line 445 "parser.l" +addwchar(yytext[1]); + YY_BREAK +case 35: +YY_RULE_SETUP +#line 446 "parser.l" +addwchar(yytext[2]); line_number++; char_number = 1; + YY_BREAK case 36: YY_RULE_SETUP -#line 454 "tools/wrc/parser.l" -{ yyerror("Invalid hex escape sequence '%s'", yytext); } +#line 447 "parser.l" +addwchar('\"'); /* "bla""bla" -> "bla\"bla" */ YY_BREAK case 37: YY_RULE_SETUP -#line 456 "tools/wrc/parser.l" -yyerror("Bad escape sequence"); +#line 448 "parser.l" +addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */ YY_BREAK case 38: YY_RULE_SETUP -#line 457 "tools/wrc/parser.l" -line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ +#line 449 "parser.l" +; /* "bla" "bla" -> "blabla" */ YY_BREAK case 39: YY_RULE_SETUP -#line 458 "tools/wrc/parser.l" -addwchar('\a'); - YY_BREAK -case 40: -YY_RULE_SETUP -#line 459 "tools/wrc/parser.l" -addwchar('\b'); - YY_BREAK -case 41: -YY_RULE_SETUP -#line 460 "tools/wrc/parser.l" -addwchar('\f'); - YY_BREAK -case 42: -YY_RULE_SETUP -#line 461 "tools/wrc/parser.l" -addwchar('\n'); - YY_BREAK -case 43: -YY_RULE_SETUP -#line 462 "tools/wrc/parser.l" -addwchar('\r'); - YY_BREAK -case 44: -YY_RULE_SETUP -#line 463 "tools/wrc/parser.l" -addwchar('\t'); - YY_BREAK -case 45: -YY_RULE_SETUP -#line 464 "tools/wrc/parser.l" -addwchar('\v'); - YY_BREAK -case 46: -YY_RULE_SETUP -#line 465 "tools/wrc/parser.l" -addwchar(yytext[1]); - YY_BREAK -case 47: -YY_RULE_SETUP -#line 466 "tools/wrc/parser.l" -addwchar(yytext[2]); line_number++; char_number = 1; - YY_BREAK -case 48: -YY_RULE_SETUP -#line 467 "tools/wrc/parser.l" -addwchar('\"'); /* "bla""bla" -> "bla\"bla" */ - YY_BREAK -case 49: -YY_RULE_SETUP -#line 468 "tools/wrc/parser.l" -addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */ - YY_BREAK -case 50: -YY_RULE_SETUP -#line 469 "tools/wrc/parser.l" -; /* "bla" "bla" -> "blabla" */ - YY_BREAK -case 51: -YY_RULE_SETUP -#line 470 "tools/wrc/parser.l" +#line 450 "parser.l" { char *yptr = yytext; while(*yptr) /* FIXME: codepage translation */ addwchar(*yptr++ & 0xff); } YY_BREAK -case 52: +case 40: YY_RULE_SETUP -#line 475 "tools/wrc/parser.l" -yyerror("Unterminated string"); +#line 455 "parser.l" +parser_error("Unterminated string\n"); YY_BREAK /* * Normal string scanning */ -case 53: +case 41: YY_RULE_SETUP -#line 480 "tools/wrc/parser.l" -yy_push_state(yystr); cbufidx = 0; +#line 460 "parser.l" +yy_push_state(tkstr); cbufidx = 0; YY_BREAK -case 54: -#line 482 "tools/wrc/parser.l" -case 55: +case 42: +#line 462 "parser.l" +case 43: YY_RULE_SETUP -#line 482 "tools/wrc/parser.l" +#line 462 "parser.l" { yy_pop_state(); - yylval.str = get_buffered_cstring(); + parser_lval.str = get_buffered_cstring(); return tSTRING; } YY_BREAK -case 56: +case 44: YY_RULE_SETUP -#line 487 "tools/wrc/parser.l" +#line 467 "parser.l" { /* octal escape sequence */ int result; result = strtol(yytext+1, 0, 8); if ( result > 0xff ) - yyerror("Character constant out of range"); + parser_error("Character constant out of range\n"); addcchar((char)result); } YY_BREAK -case 57: +case 45: YY_RULE_SETUP -#line 494 "tools/wrc/parser.l" +#line 474 "parser.l" { /* hex escape sequence */ int result; result = strtol(yytext+2, 0, 16); addcchar((char)result); } YY_BREAK -case 58: +case 46: YY_RULE_SETUP -#line 499 "tools/wrc/parser.l" -{ yyerror("Invalid hex escape sequence '%s'", yytext); } +#line 479 "parser.l" +{ parser_error("Invalid hex escape sequence '%s'\n", yytext); } YY_BREAK -case 59: +case 47: YY_RULE_SETUP -#line 501 "tools/wrc/parser.l" -yyerror("Bad escape sequence"); +#line 481 "parser.l" +parser_error("Bad escape sequence\n"); YY_BREAK -case 60: +case 48: YY_RULE_SETUP -#line 502 "tools/wrc/parser.l" +#line 482 "parser.l" line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ YY_BREAK -case 61: +case 49: YY_RULE_SETUP -#line 503 "tools/wrc/parser.l" +#line 483 "parser.l" addcchar('\a'); YY_BREAK -case 62: +case 50: YY_RULE_SETUP -#line 504 "tools/wrc/parser.l" +#line 484 "parser.l" addcchar('\b'); YY_BREAK -case 63: +case 51: YY_RULE_SETUP -#line 505 "tools/wrc/parser.l" +#line 485 "parser.l" addcchar('\f'); YY_BREAK -case 64: +case 52: YY_RULE_SETUP -#line 506 "tools/wrc/parser.l" +#line 486 "parser.l" addcchar('\n'); YY_BREAK -case 65: +case 53: YY_RULE_SETUP -#line 507 "tools/wrc/parser.l" +#line 487 "parser.l" addcchar('\r'); YY_BREAK -case 66: +case 54: YY_RULE_SETUP -#line 508 "tools/wrc/parser.l" +#line 488 "parser.l" addcchar('\t'); YY_BREAK -case 67: +case 55: YY_RULE_SETUP -#line 509 "tools/wrc/parser.l" +#line 489 "parser.l" addcchar('\v'); YY_BREAK -case 68: +case 56: YY_RULE_SETUP -#line 510 "tools/wrc/parser.l" +#line 490 "parser.l" addcchar(yytext[1]); YY_BREAK -case 69: +case 57: YY_RULE_SETUP -#line 511 "tools/wrc/parser.l" +#line 491 "parser.l" addcchar(yytext[2]); line_number++; char_number = 1; YY_BREAK -case 70: +case 58: YY_RULE_SETUP -#line 512 "tools/wrc/parser.l" +#line 492 "parser.l" { char *yptr = yytext; while(*yptr) addcchar(*yptr++); } YY_BREAK -case 71: +case 59: YY_RULE_SETUP -#line 517 "tools/wrc/parser.l" +#line 497 "parser.l" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */ YY_BREAK -case 72: +case 60: YY_RULE_SETUP -#line 518 "tools/wrc/parser.l" +#line 498 "parser.l" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */ YY_BREAK -case 73: +case 61: YY_RULE_SETUP -#line 519 "tools/wrc/parser.l" +#line 499 "parser.l" ; /* "bla" "bla" -> "blabla" */ YY_BREAK -case 74: +case 62: YY_RULE_SETUP -#line 520 "tools/wrc/parser.l" -yyerror("Unterminated string"); +#line 500 "parser.l" +parser_error("Unterminated string\n"); YY_BREAK /* * Raw data scanning */ -case 75: +case 63: YY_RULE_SETUP -#line 525 "tools/wrc/parser.l" -yy_push_state(yyrcd); cbufidx = 0; +#line 505 "parser.l" +yy_push_state(tkrcd); cbufidx = 0; YY_BREAK -case 76: +case 64: YY_RULE_SETUP -#line 526 "tools/wrc/parser.l" +#line 506 "parser.l" { yy_pop_state(); - yylval.raw = new_raw_data(); - yylval.raw->size = cbufidx; - yylval.raw->data = xmalloc(yylval.raw->size); - memcpy(yylval.raw->data, cbuffer, yylval.raw->size); + parser_lval.raw = new_raw_data(); + parser_lval.raw->size = cbufidx; + parser_lval.raw->data = xmalloc(parser_lval.raw->size); + memcpy(parser_lval.raw->data, cbuffer, parser_lval.raw->size); return tRAWDATA; } YY_BREAK -case 77: +case 65: YY_RULE_SETUP -#line 534 "tools/wrc/parser.l" +#line 514 "parser.l" { int result; result = strtol(yytext, 0, 16); addcchar((char)result); } YY_BREAK -case 78: +case 66: YY_RULE_SETUP -#line 539 "tools/wrc/parser.l" +#line 519 "parser.l" ; /* Ignore space */ YY_BREAK -case 79: +case 67: YY_RULE_SETUP -#line 540 "tools/wrc/parser.l" +#line 520 "parser.l" line_number++; char_number = 1; YY_BREAK -case 80: +case 68: YY_RULE_SETUP -#line 541 "tools/wrc/parser.l" -yyerror("Malformed data-line"); +#line 521 "parser.l" +parser_error("Malformed data-line\n"); YY_BREAK /* * Comment stripping * Should never occur after preprocessing */ -case 81: +case 69: YY_RULE_SETUP -#line 547 "tools/wrc/parser.l" +#line 527 "parser.l" { yy_push_state(comment); save_wanted_id = wanted_id; if(!no_preprocess) - yywarning("Found comments after preprocessing, please report"); + parser_warning("Found comments after preprocessing, please report\n"); } YY_BREAK -case 82: +case 70: YY_RULE_SETUP -#line 553 "tools/wrc/parser.l" +#line 533 "parser.l" ; YY_BREAK -case 83: +case 71: YY_RULE_SETUP -#line 554 "tools/wrc/parser.l" +#line 534 "parser.l" ; YY_BREAK -case 84: +case 72: YY_RULE_SETUP -#line 555 "tools/wrc/parser.l" +#line 535 "parser.l" line_number++; char_number = 1; YY_BREAK -case 85: +case 73: YY_RULE_SETUP -#line 556 "tools/wrc/parser.l" +#line 536 "parser.l" yy_pop_state(); want_id = save_wanted_id; YY_BREAK -case 86: +case 74: YY_RULE_SETUP -#line 558 "tools/wrc/parser.l" +#line 538 "parser.l" want_id = wanted_id; /* not really comment, but left-over c-junk */ YY_BREAK -case 87: +case 75: YY_RULE_SETUP -#line 559 "tools/wrc/parser.l" -want_id = wanted_id; if(!no_preprocess) yywarning("Found comments after preprocessing, please report"); +#line 539 "parser.l" +want_id = wanted_id; if(!no_preprocess) parser_warning("Found comments after preprocessing, please report\n"); YY_BREAK -case 88: +case 76: YY_RULE_SETUP -#line 561 "tools/wrc/parser.l" +#line 541 "parser.l" { want_id = wanted_id; line_number++; @@ -1757,39 +1658,19 @@ YY_RULE_SETUP } } YY_BREAK -case 89: +case 77: YY_RULE_SETUP -#line 571 "tools/wrc/parser.l" +#line 551 "parser.l" want_id = wanted_id; /* Eat whitespace */ YY_BREAK -case 90: +case 78: YY_RULE_SETUP -#line 573 "tools/wrc/parser.l" +#line 553 "parser.l" return yytext[0]; YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(yystr): -case YY_STATE_EOF(yylstr): -case YY_STATE_EOF(yyrcd): -case YY_STATE_EOF(comment): -case YY_STATE_EOF(pp_stripe): -case YY_STATE_EOF(pp_strips): -case YY_STATE_EOF(pp_stripp): -case YY_STATE_EOF(pp_stripp_final): -case YY_STATE_EOF(pp_line): -case YY_STATE_EOF(pp_pragma): -case YY_STATE_EOF(pp_code_page): -#line 575 "tools/wrc/parser.l" -{ - if(YY_START == pp_strips || YY_START == pp_stripe || YY_START == pp_stripp || YY_START == pp_stripp_final) - yyerror("Unexpected end of file during c-junk scanning (started at %d)", cjunk_tagline); - else - yyterminate(); - } - YY_BREAK -case 91: +case 79: YY_RULE_SETUP -#line 582 "tools/wrc/parser.l" +#line 555 "parser.l" { /* Catch all rule to find any unmatched text */ if(*yytext == '\n') @@ -1797,16 +1678,26 @@ YY_RULE_SETUP line_number++; char_number = 1; } - yywarning("Unmatched text '%c' (0x%02x) YY_START=%d stripslevel=%d", - isprint(*yytext & 0xff) ? *yytext : '.', *yytext, YY_START,stripslevel); + parser_warning("Unmatched text '%c' (0x%02x) YY_START=%d\n", + isprint(*yytext & 0xff) ? *yytext : '.', *yytext, YY_START); } YY_BREAK -case 92: +case 80: YY_RULE_SETUP -#line 593 "tools/wrc/parser.l" +#line 566 "parser.l" ECHO; YY_BREAK -#line 1810 "tools/wrc/lex.yy.c" +#line 1691 "lex.yy.c" +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(tkstr): +case YY_STATE_EOF(tklstr): +case YY_STATE_EOF(tkrcd): +case YY_STATE_EOF(comment): +case YY_STATE_EOF(pp_cstrip): +case YY_STATE_EOF(pp_line): +case YY_STATE_EOF(pp_pragma): +case YY_STATE_EOF(pp_code_page): + yyterminate(); case YY_END_OF_BUFFER: { @@ -1815,7 +1706,6 @@ ECHO; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { @@ -1961,7 +1851,7 @@ static int yy_get_next_buffer() { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { - /* We matched a single character, the EOB, so + /* We matched a singled characater, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; @@ -1988,7 +1878,7 @@ static int yy_get_next_buffer() /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; + yy_n_chars = 0; else { @@ -2043,8 +1933,6 @@ static int yy_get_next_buffer() /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) @@ -2097,7 +1985,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 207 ) + if ( yy_current_state >= 189 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2132,11 +2020,11 @@ yy_state_type yy_current_state; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 207 ) + if ( yy_current_state >= 189 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 206); + yy_is_jam = (yy_current_state == 188); return yy_is_jam ? 0 : yy_current_state; } @@ -2170,8 +2058,7 @@ register char *yy_bp; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; + yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -2187,7 +2074,6 @@ register char *yy_bp; #endif /* ifndef YY_NO_UNPUT */ -#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else @@ -2210,31 +2096,19 @@ static int input() else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; + yytext_ptr = yy_c_buf_p; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - case EOB_ACT_END_OF_FILE: { if ( yywrap() ) + { + yy_c_buf_p = + yytext_ptr + YY_MORE_ADJ; return EOF; + } if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -2246,8 +2120,17 @@ static int input() } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; break; + + case EOB_ACT_LAST_MATCH: +#ifdef __cplusplus + YY_FATAL_ERROR( + "unexpected last match in yyinput()" ); +#else + YY_FATAL_ERROR( + "unexpected last match in input()" ); +#endif } } } @@ -2260,7 +2143,7 @@ static int input() return c; } -#endif /* YY_NO_INPUT */ + #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) @@ -2371,6 +2254,11 @@ YY_BUFFER_STATE b; } +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) @@ -2407,9 +2295,6 @@ YY_BUFFER_STATE b; #endif { - if ( ! b ) - return; - b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes @@ -2469,17 +2354,17 @@ yy_size_t size; #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +YY_BUFFER_STATE yy_scan_string( yyconst char *str ) #else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; +YY_BUFFER_STATE yy_scan_string( str ) +yyconst char *str; #endif { int len; - for ( len = 0; yy_str[len]; ++len ) + for ( len = 0; str[len]; ++len ) ; - return yy_scan_bytes( yy_str, len ); + return yy_scan_bytes( str, len ); } #endif @@ -2600,7 +2485,7 @@ char msg[]; { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ + yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ @@ -2626,22 +2511,6 @@ int n; } #endif -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) @@ -2688,22 +2557,9 @@ int main() return 0; } #endif -#line 593 "tools/wrc/parser.l" +#line 566 "parser.l" -#ifndef yywrap -int yywrap(void) -{ -#if 0 - if(bufferstackidx > 0) - { - return 0; - } -#endif - return 1; -} -#endif - /* These dup functions copy the enclosed '\0' from * the resource string. */ @@ -2714,7 +2570,7 @@ static void addcchar(char c) cbufalloc += 1024; cbuffer = xrealloc(cbuffer, cbufalloc * sizeof(cbuffer[0])); if(cbufalloc > 65536) - yywarning("Reallocating string buffer larger than 64kB"); + parser_warning("Reallocating string buffer larger than 64kB\n"); } cbuffer[cbufidx++] = c; } @@ -2726,7 +2582,7 @@ static void addwchar(WCHAR s) wbufalloc += 1024; wbuffer = xrealloc(wbuffer, wbufalloc * sizeof(wbuffer[0])); if(wbufalloc > 65536) - yywarning("Reallocating wide string buffer larger than 64kB"); + parser_warning("Reallocating wide string buffer larger than 64kB\n"); } wbuffer[wbufidx++] = s; } @@ -2737,21 +2593,21 @@ static string_t *get_buffered_cstring(void) str->size = cbufidx; str->type = str_char; - str->str.cstr = (char *)xmalloc(cbufidx+1); + str->str.cstr = xmalloc(cbufidx+1); memcpy(str->str.cstr, cbuffer, cbufidx); str->str.cstr[cbufidx] = '\0'; if (!current_codepage || current_codepage == -1 || !win32) /* store as ANSI string */ { - if (!current_codepage) yyerror("Codepage set to Unicode only, cannot use ASCII string here"); + if (!current_codepage) parser_error("Codepage set to Unicode only, cannot use ASCII string here\n"); return str; } else /* convert to Unicode before storing */ { string_t *str_w = convert_string( str, str_unicode, current_codepage ); if (!check_unicode_conversion( str, str_w, current_codepage )) - yyerror("String %s does not convert identically to Unicode and back in codepage %d. " - "Try using a Unicode string instead.", str->str.cstr, current_codepage ); + parser_error("String %s does not convert identically to Unicode and back in codepage %d. " + "Try using a Unicode string instead\n", str->str.cstr, current_codepage ); free_string( str ); return str_w; } @@ -2773,7 +2629,7 @@ static string_t *make_string(char *s) string_t *str = new_string(); str->size = strlen(s); str->type = str_char; - str->str.cstr = (char *)xmalloc(str->size+1); + str->str.cstr = xmalloc(str->size+1); memcpy(str->str.cstr, s, str->size+1); return str; } diff --git a/reactos/tools/wrc/newstruc.c b/reactos/tools/wrc/newstruc.c index 4ffdbebc88c..88d1c7a1127 100644 --- a/reactos/tools/wrc/newstruc.c +++ b/reactos/tools/wrc/newstruc.c @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -73,7 +73,8 @@ __NEW_STRUCT_FUNC(ani_any) */ resource_t *new_resource(enum res_e t, void *res, int memopt, language_t *lan) { - resource_t *r = (resource_t *)xmalloc(sizeof(resource_t)); + resource_t *r = xmalloc(sizeof(resource_t)); + memset( r, 0, sizeof(*r) ); r->type = t; r->res.overlay = res; r->memopt = memopt; @@ -324,10 +325,7 @@ static int convert_bitmap(char *data, int size) type |= FL_SIZEBE | FL_OS2; } else - { - fprintf(stderr, "bisizel %d bosizel %d b4sizel %d\n", bisizel, bosizel, b4sizel); - yyerror("Invalid bitmap format, bih->biSize = %u", bih->biSize); - } + parser_error("Invalid bitmap format, bih->biSize = %d\n", bih->biSize); switch(type) { @@ -336,12 +334,12 @@ static int convert_bitmap(char *data, int size) case FL_SIZEBE: case FL_SIZEBE | FL_V4: case FL_SIZEBE | FL_OS2: - yywarning("Bitmap v%c signature little-endian, but size big-endian", type & FL_V4 ? '4' : '3'); + parser_warning("Bitmap v%c signature little-endian, but size big-endian\n", type & FL_V4 ? '4' : '3'); break; case FL_SIGBE: case FL_SIGBE | FL_V4: case FL_SIGBE | FL_OS2: - yywarning("Bitmap v%c signature big-endian, but size little-endian", type & FL_V4 ? '4' : '3'); + parser_warning("Bitmap v%c signature big-endian, but size little-endian\n", type & FL_V4 ? '4' : '3'); break; } @@ -461,7 +459,7 @@ static void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico) else if(BYTESWAP_WORD(ih->type) == 1) swap = 1; else - yyerror("Icon resource data has invalid type id %d", ih->type); + parser_error("Icon resource data has invalid type id %d\n", ih->type); cnt = swap ? BYTESWAP_WORD(ih->count) : ih->count; for(i = 0; i < cnt; i++) @@ -481,7 +479,7 @@ static void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico) } if(ide.offset > rd->size || ide.offset + ide.ressize > rd->size) - yyerror("Icon resource data corrupt"); + parser_error("Icon resource data corrupt\n"); ico->width = ide.width; ico->height = ide.height; ico->nclr = ide.nclr; @@ -556,7 +554,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur) else if(BYTESWAP_WORD(ch->type) == 2) swap = 1; else - yyerror("Cursor resource data has invalid type id %d", ch->type); + parser_error("Cursor resource data has invalid type id %d\n", ch->type); cnt = swap ? BYTESWAP_WORD(ch->count) : ch->count; for(i = 0; i < cnt; i++) { @@ -575,7 +573,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur) } if(cde.offset > rd->size || cde.offset + cde.ressize > rd->size) - yyerror("Cursor resource data corrupt"); + parser_error("Cursor resource data corrupt\n"); cur->width = cde.width; cur->height = cde.height; cur->nclr = cde.nclr; @@ -598,7 +596,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur) cur->bits = info.biBitCount; } if(!win32 && (cur->planes != 1 || cur->bits != 1)) - yywarning("Win16 cursor contains colors"); + parser_warning("Win16 cursor contains colors\n"); cur->xhot = swap ? BYTESWAP_WORD(cde.xhot) : cde.xhot; cur->yhot = swap ? BYTESWAP_WORD(cde.yhot) : cde.yhot; cur->data = new_raw_data(); @@ -745,21 +743,21 @@ static void handle_ani_icon(riff_tag_t *rtp, enum res_e type, int isswapped) if(type == res_anicur && ctype != 2 && !once) { - yywarning("Animated cursor contains invalid \"icon\" tag cursor-file (%d->%s)", + parser_warning("Animated cursor contains invalid \"icon\" tag cursor-file (%d->%s)", ctype, ctype == 1 ? "icontype" : "?"); once++; } else if(type == res_aniico && ctype != 1 && !once) { - yywarning("Animated icon contains invalid \"icon\" tag icon-file (%d->%s)", + parser_warning("Animated icon contains invalid \"icon\" tag icon-file (%d->%s)", ctype, ctype == 2 ? "cursortype" : "?"); once++; } else if(ctype != 1 && ctype != 2 && !once) { - yywarning("Animated %s contains invalid \"icon\" tag file-type (%d; neither icon nor cursor)", anistr, ctype); + parser_warning("Animated %s contains invalid \"icon\" tag file-type (%d; neither icon nor cursor)", anistr, ctype); once++; } @@ -768,7 +766,7 @@ static void handle_ani_icon(riff_tag_t *rtp, enum res_e type, int isswapped) DWORD ofs = isswapped ? BYTESWAP_DWORD(cdp[i].offset) : cdp[i].offset; DWORD sze = isswapped ? BYTESWAP_DWORD(cdp[i].ressize) : cdp[i].ressize; if(ofs > rtp->size || ofs+sze > rtp->size) - yyerror("Animated %s's data corrupt", anistr); + parser_error("Animated %s's data corrupt", anistr); convert_bitmap((char *)chp + ofs, 0); cdp[i].xhot = BYTESWAP_WORD(cdp->xhot); cdp[i].yhot = BYTESWAP_WORD(cdp->yhot); @@ -817,7 +815,7 @@ static void handle_ani_list(riff_tag_t *lst, enum res_e type, int isswapped) isprint(rtp->tag[2]) ? rtp->tag[2] : '.', isprint(rtp->tag[3]) ? rtp->tag[3] : '.'); - if((LONG_PTR)rtp & 1) + if((UINT_PTR)rtp & 1) rtp = SKIP_TAG(rtp,1); } } @@ -840,7 +838,7 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt) else if(rtp->size + 2*sizeof(DWORD) == rd->size) isswapped = 0; else - yyerror("Animated %s has an invalid RIFF length", anistr); + parser_error("Animated %s has an invalid RIFF length\n", anistr); switch(byteorder) { @@ -927,13 +925,13 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt) isprint(rtp->tag[2]) ? rtp->tag[2] : '.', isprint(rtp->tag[3]) ? rtp->tag[3] : '.'); - if((LONG_PTR)rtp & 1) + if((UINT_PTR)rtp & 1) rtp = SKIP_TAG(rtp,1); } /* We must end correctly here */ if((char *)rtp != (char *)rd->data + rd->size) - yyerror("Animated %s contains invalid field size(s)", anistr); + parser_error("Animated %s contains invalid field size(s)", anistr); } ani->data = rd; @@ -1002,7 +1000,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) msg->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE; if(rd->size < sizeof(DWORD)) - yyerror("Invalid messagetable, size too small"); + parser_error("Invalid messagetable, size too small\n"); nblk = *(DWORD *)rd->data; lo = WRC_LOWORD(nblk); @@ -1017,9 +1015,9 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) * the ID, offset and length (and flag) fields to be very sure. */ if(hi && lo) - internal_error(__FILE__, __LINE__, "Messagetable contains more than 65535 blocks; cannot determine endian"); + internal_error(__FILE__, __LINE__, "Messagetable contains more than 65535 blocks; cannot determine endian\n"); if(!hi && !lo) - yyerror("Invalid messagetable block count 0"); + parser_error("Invalid messagetable block count 0\n"); if(!hi && lo) /* Messagetable byteorder == native byteorder */ { @@ -1032,7 +1030,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) mbp = (msgtab_block_t *)&(((DWORD *)rd->data)[1]); if(MSGTAB_BAD_PTR(mbp, rd->data, rd->size, nblk * sizeof(*mbp))) - yyerror("Messagetable's blocks are outside of defined data"); + parser_error("Messagetable's blocks are outside of defined data\n"); for(i = 0; i < nblk; i++) { msgtab_entry_t *mep, *next_mep; @@ -1043,7 +1041,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) for(id = mbp[i].idlo; id <= mbp[i].idhi; id++) { if(MSGTAB_BAD_PTR(mep, rd->data, rd->size, mep->length)) - yyerror("Messagetable's data for block %d, ID 0x%08x is outside of defined data", (int)i, id); + parser_error("Messagetable's data for block %d, ID 0x%08x is outside of defined data\n", i, id); if(mep->flags == 1) /* Docu says 'flags == 0x0001' for unicode */ { WORD *wp = (WORD *)&mep[1]; @@ -1051,7 +1049,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) int n; if(mep->length & 1) - yyerror("Message 0x%08x is unicode (block %d), but has odd length (%d)", id, (int)i, mep->length); + parser_error("Message 0x%08x is unicode (block %d), but has odd length (%d)\n", id, i, mep->length); for(n = 0; n < l; n++) wp[n] = BYTESWAP_WORD(wp[n]); @@ -1079,7 +1077,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) mbp = (msgtab_block_t *)&(((DWORD *)rd->data)[1]); nblk = BYTESWAP_DWORD(nblk); if(MSGTAB_BAD_PTR(mbp, rd->data, rd->size, nblk * sizeof(*mbp))) - yyerror("Messagetable's blocks are outside of defined data"); + parser_error("Messagetable's blocks are outside of defined data\n"); for(i = 0; i < nblk; i++) { msgtab_entry_t *mep; @@ -1096,7 +1094,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) mep->flags = BYTESWAP_WORD(mep->flags); if(MSGTAB_BAD_PTR(mep, rd->data, rd->size, mep->length)) - yyerror("Messagetable's data for block %d, ID 0x%08x is outside of defined data", (int)i, id); + parser_error("Messagetable's data for block %d, ID 0x%08x is outside of defined data\n", i, id); if(mep->flags == 1) /* Docu says 'flags == 0x0001' for unicode */ { WORD *wp = (WORD *)&mep[1]; @@ -1104,7 +1102,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) int n; if(mep->length & 1) - yyerror("Message 0x%08x is unicode (block %d), but has odd length (%d)", id, (int)i, mep->length); + parser_error("Message 0x%08x is unicode (block %d), but has odd length (%d)\n", id, i, mep->length); for(n = 0; n < l; n++) wp[n] = BYTESWAP_WORD(wp[n]); @@ -1146,6 +1144,7 @@ stringtable_t *new_stringtable(lvc_t *lvc) { stringtable_t *stt = (stringtable_t *)xmalloc(sizeof(stringtable_t)); + memset( stt, 0, sizeof(*stt) ); if(lvc) stt->lvc = *lvc; diff --git a/reactos/tools/wrc/newstruc.h b/reactos/tools/wrc/newstruc.h index 8f061ef2dbf..2e46b144035 100644 --- a/reactos/tools/wrc/newstruc.h +++ b/reactos/tools/wrc/newstruc.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WRC_NEWSTRUC_H @@ -26,7 +26,9 @@ #define __NEW_STRUCT_FUNC(p) \ p##_t *new_##p(void)\ {\ - return (p##_t *)xmalloc(sizeof(p##_t));\ + p##_t * ret = xmalloc(sizeof(*ret)); \ + memset( ret, 0, sizeof(*ret) ); \ + return ret; \ } #define __NEW_STRUCT_PROTO(p) p##_t *new_##p(void) diff --git a/reactos/tools/wrc/parser.h b/reactos/tools/wrc/parser.h index 63116383bcd..8be2269dc12 100644 --- a/reactos/tools/wrc/parser.h +++ b/reactos/tools/wrc/parser.h @@ -15,25 +15,25 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WRC_PARSER_H #define __WRC_PARSER_H /* From parser.y */ -extern int yydebug; +extern int parser_debug; extern int want_nl; /* Set when getting line-numers */ extern int want_id; /* Set when getting the resource name */ -int yyparse(void); +int parser_parse(void); /* From parser.l */ -extern FILE *yyin; -extern char *yytext; +extern FILE *parser_in; +extern char *parser_text; extern int yy_flex_debug; -int yylex(void); +int parser_lex(void); #endif diff --git a/reactos/tools/wrc/parser.l b/reactos/tools/wrc/parser.l index aea3fb85a6e..98f9c85d778 100644 --- a/reactos/tools/wrc/parser.l +++ b/reactos/tools/wrc/parser.l @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * History: * 21-May-2000 BS - Fixed the ident requirement of resource names @@ -68,18 +68,15 @@ */ /* Exclusive string handling */ -%x yystr +%x tkstr /* Exclusive unicode string handling */ -%x yylstr +%x tklstr /* Exclusive rcdata single quoted data handling */ -%x yyrcd +%x tkrcd /* Exclusive comment eating... */ %x comment /* Set when stripping c-junk */ -%x pp_stripe -%x pp_strips -%x pp_stripp -%x pp_stripp_final +%x pp_cstrip /* Set when scanning #line style directives */ %x pp_line /* Set when scanning #pragma */ @@ -87,8 +84,9 @@ %x pp_code_page %option stack -%option nounput noyy_top_state +%option nounput noyy_top_state noyywrap %option 8bit never-interactive +%option prefix="parser_" /* Some shortcut definitions */ ws [ \f\t\r] @@ -127,9 +125,6 @@ static int cbufalloc = 0; static WCHAR *wbuffer; static int wbufidx; static int wbufalloc = 0; -static int stripslevel = 0; /* Count {} during pp_strips/pp_stripe mode */ -static int stripplevel = 0; /* Count () during pp_strips mode */ -static int cjunk_tagline; /* Where did we start stripping (helps error tracking) */ static int current_codepage = -1; /* use language default */ @@ -320,81 +315,66 @@ static struct keyword *iskeyword(char *kw) * because we only want to know the linenumber and * filename. */ -^{ws}*\#{ws}*pragma{ws}+ yy_push_state(pp_pragma); -^{ws}*\#{ws}* yy_push_state(pp_line); +^{ws}*\#{ws}*pragma{ws}+ yy_push_state(pp_pragma); +^{ws}*\#{ws}* yy_push_state(pp_line); [^\n]* { - int lineno; + int lineno, len; char *cptr; char *fname; yy_pop_state(); lineno = (int)strtol(yytext, &cptr, 10); if(!lineno) - yyerror("Malformed '#...' line-directive; invalid linenumber"); + parser_error("Malformed '#...' line-directive; invalid linenumber\n"); fname = strchr(cptr, '"'); if(!fname) - yyerror("Malformed '#...' line-directive; missing filename"); + parser_error("Malformed '#...' line-directive; missing filename\n"); fname++; cptr = strchr(fname, '"'); if(!cptr) - yyerror("Malformed '#...' line-directive; missing terminating \""); + parser_error("Malformed '#...' line-directive; missing terminating \""); *cptr = '\0'; line_number = lineno - 1; /* We didn't read the newline */ input_name = xstrdup(fname); + /* ignore contents of C include files */ + len = strlen(input_name); + if (len > 1 && !strcasecmp( input_name + len - 2, ".h" )) + BEGIN(pp_cstrip); + else + BEGIN(INITIAL); } code_page[^\n]* yyless(9); yy_pop_state(); yy_push_state(pp_code_page); -[^\n]* yy_pop_state(); if (pedantic) yywarning("Unrecognized #pragma directive '%s'",yytext); +[^\n]* yy_pop_state(); if (pedantic) parser_warning("Unrecognized #pragma directive '%s'\n",yytext); \({ws}*default{ws}*\)[^\n]* current_codepage = -1; yy_pop_state(); +\({ws}*utf8{ws}*\)[^\n]* current_codepage = CP_UTF8; yy_pop_state(); \({ws}*[0-9]+{ws}*\)[^\n]* { char *p = yytext; yy_pop_state(); while (*p < '0' || *p > '9') p++; current_codepage = strtol( p, NULL, 10 ); - if (current_codepage && !wine_cp_get_table( current_codepage )) + if (current_codepage && current_codepage != CP_UTF8 && !wine_cp_get_table( current_codepage )) { - yyerror("Codepage %d not supported", current_codepage); + parser_error("Codepage %d not supported\n", current_codepage); current_codepage = 0; } } -[^\n]* yy_pop_state(); yyerror("Malformed #pragma code_page directive"); +[^\n]* yy_pop_state(); parser_error("Malformed #pragma code_page directive\n"); /* * Strip everything until a ';' taking * into account braces {} for structures, * classes and enums. */ -\{ stripslevel++; -\} stripslevel--; -; if(!stripslevel) yy_pop_state(); -\/[^*\n] ; /* To catch comments */ -[^\{\};\n#/]* ; /* Ignore rest */ -\n line_number++; char_number = 1; - -\( stripplevel++; -\) { - stripplevel--; - if(!stripplevel) - { - yy_pop_state(); - yy_push_state(pp_stripp_final); - } - } -\/[^*\n] ; /* To catch comments */ -[^\(\);\n#/]* ; /* Ignore rest */ -\n line_number++; char_number = 1; - -{ws}* ; /* Ignore */ -; yy_pop_state(); /* Kill the semicolon */ -\n line_number++; char_number = 1; yy_pop_state(); -. yyless(0); yy_pop_state(); +\n line_number++; char_number = 1; +. ; /* ignore */ \{ return tBEGIN; \} return tEND; -[0-9]+[lL]? { yylval.num = strtoul(yytext, 0, 10); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } -0[xX][0-9A-Fa-f]+[lL]? { yylval.num = strtoul(yytext, 0, 16); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } -0[oO][0-7]+[lL]? { yylval.num = strtoul(yytext+2, 0, 8); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } +[0-9]+[lL]? { parser_lval.num = strtoul(yytext, 0, 10); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } +0[xX][0-9A-Fa-f]+[lL]? { parser_lval.num = strtoul(yytext, 0, 16); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } +0[oO][0-7]+[lL]? { parser_lval.num = strtoul(yytext+2, 0, 8); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } /* * The next two rules scan identifiers and filenames. @@ -410,7 +390,7 @@ static struct keyword *iskeyword(char *kw) { if(wanted_id && !tok->alwayskw) { - yylval.str = make_string(yytext); + parser_lval.str = make_string(yytext); return tIDENT; } else @@ -418,137 +398,137 @@ static struct keyword *iskeyword(char *kw) } else { - yylval.str = make_string(yytext); + parser_lval.str = make_string(yytext); return tIDENT; } } -[A-Za-z_0-9./\\]+ yylval.str = make_string(yytext); return tFILENAME; +[A-Za-z_0-9./\\]+ parser_lval.str = make_string(yytext); return tFILENAME; /* * Wide string scanning */ L\" { - yy_push_state(yylstr); + yy_push_state(tklstr); wbufidx = 0; if(!win32) - yywarning("16bit resource contains unicode strings\n"); + parser_warning("16bit resource contains unicode strings\n"); } -\"{ws}+ | -\" { +\"{ws}+ | +\" { yy_pop_state(); - yylval.str = get_buffered_wstring(); + parser_lval.str = get_buffered_wstring(); return tSTRING; } -\\[0-7]{1,6} { /* octal escape sequence */ +\\[0-7]{1,6} { /* octal escape sequence */ unsigned int result; result = strtoul(yytext+1, 0, 8); if ( result > 0xffff ) - yyerror("Character constant out of range"); + parser_error("Character constant out of range\n"); addwchar((WCHAR)result); } -\\x[0-9a-fA-F]{4} { /* hex escape sequence */ +\\x[0-9a-fA-F]{4} { /* hex escape sequence */ unsigned int result; result = strtoul(yytext+2, 0, 16); addwchar((WCHAR)result); } -\\x[0-9a-fA-F]{1,3} { yyerror("Invalid hex escape sequence '%s'", yytext); } +\\x[0-9a-fA-F]{1,3} { parser_error("Invalid hex escape sequence '%s'\n", yytext); } -\\[0-9]+ yyerror("Bad escape sequence"); -\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ -\\a addwchar('\a'); -\\b addwchar('\b'); -\\f addwchar('\f'); -\\n addwchar('\n'); -\\r addwchar('\r'); -\\t addwchar('\t'); -\\v addwchar('\v'); -\\. addwchar(yytext[1]); -\\\r\n addwchar(yytext[2]); line_number++; char_number = 1; -\"\" addwchar('\"'); /* "bla""bla" -> "bla\"bla" */ -\\\"\" addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */ -\"{ws}+\" ; /* "bla" "bla" -> "blabla" */ -[^\\\n\"]+ { +\\[0-9]+ parser_error("Bad escape sequence\n"); +\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ +\\a addwchar('\a'); +\\b addwchar('\b'); +\\f addwchar('\f'); +\\n addwchar('\n'); +\\r addwchar('\r'); +\\t addwchar('\t'); +\\v addwchar('\v'); +\\. addwchar(yytext[1]); +\\\r\n addwchar(yytext[2]); line_number++; char_number = 1; +\"\" addwchar('\"'); /* "bla""bla" -> "bla\"bla" */ +\\\"\" addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */ +\"{ws}+\" ; /* "bla" "bla" -> "blabla" */ +[^\\\n\"]+ { char *yptr = yytext; while(*yptr) /* FIXME: codepage translation */ addwchar(*yptr++ & 0xff); } -\n yyerror("Unterminated string"); +\n parser_error("Unterminated string\n"); /* * Normal string scanning */ -\" yy_push_state(yystr); cbufidx = 0; -\"{ws}+ | -\" { +\" yy_push_state(tkstr); cbufidx = 0; +\"{ws}+ | +\" { yy_pop_state(); - yylval.str = get_buffered_cstring(); + parser_lval.str = get_buffered_cstring(); return tSTRING; } -\\[0-7]{1,3} { /* octal escape sequence */ +\\[0-7]{1,3} { /* octal escape sequence */ int result; result = strtol(yytext+1, 0, 8); if ( result > 0xff ) - yyerror("Character constant out of range"); + parser_error("Character constant out of range\n"); addcchar((char)result); } -\\x[0-9a-fA-F]{2} { /* hex escape sequence */ +\\x[0-9a-fA-F]{2} { /* hex escape sequence */ int result; result = strtol(yytext+2, 0, 16); addcchar((char)result); } -\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); } +\\x[0-9a-fA-F] { parser_error("Invalid hex escape sequence '%s'\n", yytext); } -\\[0-9]+ yyerror("Bad escape sequence"); -\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ -\\a addcchar('\a'); -\\b addcchar('\b'); -\\f addcchar('\f'); -\\n addcchar('\n'); -\\r addcchar('\r'); -\\t addcchar('\t'); -\\v addcchar('\v'); -\\. addcchar(yytext[1]); -\\\r\n addcchar(yytext[2]); line_number++; char_number = 1; -[^\\\n\"]+ { +\\[0-9]+ parser_error("Bad escape sequence\n"); +\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ +\\a addcchar('\a'); +\\b addcchar('\b'); +\\f addcchar('\f'); +\\n addcchar('\n'); +\\r addcchar('\r'); +\\t addcchar('\t'); +\\v addcchar('\v'); +\\. addcchar(yytext[1]); +\\\r\n addcchar(yytext[2]); line_number++; char_number = 1; +[^\\\n\"]+ { char *yptr = yytext; while(*yptr) addcchar(*yptr++); } -\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */ -\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */ -\"{ws}+\" ; /* "bla" "bla" -> "blabla" */ -\n yyerror("Unterminated string"); +\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */ +\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */ +\"{ws}+\" ; /* "bla" "bla" -> "blabla" */ +\n parser_error("Unterminated string\n"); /* * Raw data scanning */ -\' yy_push_state(yyrcd); cbufidx = 0; -\' { +\' yy_push_state(tkrcd); cbufidx = 0; +\' { yy_pop_state(); - yylval.raw = new_raw_data(); - yylval.raw->size = cbufidx; - yylval.raw->data = xmalloc(yylval.raw->size); - memcpy(yylval.raw->data, cbuffer, yylval.raw->size); + parser_lval.raw = new_raw_data(); + parser_lval.raw->size = cbufidx; + parser_lval.raw->data = xmalloc(parser_lval.raw->size); + memcpy(parser_lval.raw->data, cbuffer, parser_lval.raw->size); return tRAWDATA; } -[0-9a-fA-F]{2} { +[0-9a-fA-F]{2} { int result; result = strtol(yytext, 0, 16); addcchar((char)result); } -{ws}+ ; /* Ignore space */ -\n line_number++; char_number = 1; -. yyerror("Malformed data-line"); +{ws}+ ; /* Ignore space */ +\n line_number++; char_number = 1; +. parser_error("Malformed data-line\n"); /* * Comment stripping * Should never occur after preprocessing */ -"/*" { +"/*" { yy_push_state(comment); save_wanted_id = wanted_id; if(!no_preprocess) - yywarning("Found comments after preprocessing, please report"); + parser_warning("Found comments after preprocessing, please report\n"); } [^*\n]* ; "*"+[^*/\n]* ; @@ -556,7 +536,7 @@ L\" { "*"+"/" yy_pop_state(); want_id = save_wanted_id; ;[^\n]* want_id = wanted_id; /* not really comment, but left-over c-junk */ -"//"[^\n]* want_id = wanted_id; if(!no_preprocess) yywarning("Found comments after preprocessing, please report"); +"//"[^\n]* want_id = wanted_id; if(!no_preprocess) parser_warning("Found comments after preprocessing, please report\n"); \n { want_id = wanted_id; @@ -572,13 +552,6 @@ L\" { . return yytext[0]; -<> { - if(YY_START == pp_strips || YY_START == pp_stripe || YY_START == pp_stripp || YY_START == pp_stripp_final) - yyerror("Unexpected end of file during c-junk scanning (started at %d)", cjunk_tagline); - else - yyterminate(); - } - <*>.|\n { /* Catch all rule to find any unmatched text */ if(*yytext == '\n') @@ -586,25 +559,12 @@ L\" { line_number++; char_number = 1; } - yywarning("Unmatched text '%c' (0x%02x) YY_START=%d stripslevel=%d", - isprint(*yytext & 0xff) ? *yytext : '.', *yytext, YY_START,stripslevel); + parser_warning("Unmatched text '%c' (0x%02x) YY_START=%d\n", + isprint(*yytext & 0xff) ? *yytext : '.', *yytext, YY_START); } %% -#ifndef yywrap -int yywrap(void) -{ -#if 0 - if(bufferstackidx > 0) - { - return 0; - } -#endif - return 1; -} -#endif - /* These dup functions copy the enclosed '\0' from * the resource string. */ @@ -615,7 +575,7 @@ static void addcchar(char c) cbufalloc += 1024; cbuffer = xrealloc(cbuffer, cbufalloc * sizeof(cbuffer[0])); if(cbufalloc > 65536) - yywarning("Reallocating string buffer larger than 64kB"); + parser_warning("Reallocating string buffer larger than 64kB\n"); } cbuffer[cbufidx++] = c; } @@ -627,7 +587,7 @@ static void addwchar(WCHAR s) wbufalloc += 1024; wbuffer = xrealloc(wbuffer, wbufalloc * sizeof(wbuffer[0])); if(wbufalloc > 65536) - yywarning("Reallocating wide string buffer larger than 64kB"); + parser_warning("Reallocating wide string buffer larger than 64kB\n"); } wbuffer[wbufidx++] = s; } @@ -638,21 +598,21 @@ static string_t *get_buffered_cstring(void) str->size = cbufidx; str->type = str_char; - str->str.cstr = (char *)xmalloc(cbufidx+1); + str->str.cstr = xmalloc(cbufidx+1); memcpy(str->str.cstr, cbuffer, cbufidx); str->str.cstr[cbufidx] = '\0'; if (!current_codepage || current_codepage == -1 || !win32) /* store as ANSI string */ { - if (!current_codepage) yyerror("Codepage set to Unicode only, cannot use ASCII string here"); + if (!current_codepage) parser_error("Codepage set to Unicode only, cannot use ASCII string here\n"); return str; } else /* convert to Unicode before storing */ { string_t *str_w = convert_string( str, str_unicode, current_codepage ); if (!check_unicode_conversion( str, str_w, current_codepage )) - yyerror("String %s does not convert identically to Unicode and back in codepage %d. " - "Try using a Unicode string instead.", str->str.cstr, current_codepage ); + parser_error("String %s does not convert identically to Unicode and back in codepage %d. " + "Try using a Unicode string instead\n", str->str.cstr, current_codepage ); free_string( str ); return str_w; } @@ -674,7 +634,7 @@ static string_t *make_string(char *s) string_t *str = new_string(); str->size = strlen(s); str->type = str_char; - str->str.cstr = (char *)xmalloc(str->size+1); + str->str.cstr = xmalloc(str->size+1); memcpy(str->str.cstr, s, str->size+1); return str; } diff --git a/reactos/tools/wrc/parser.tab.c b/reactos/tools/wrc/parser.tab.c index 7b9be19c343..1cd40755598 100644 --- a/reactos/tools/wrc/parser.tab.c +++ b/reactos/tools/wrc/parser.tab.c @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 2.1. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -36,6 +36,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.1" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -45,6 +48,14 @@ /* Using locations. */ #define YYLSP_NEEDED 0 +/* Substitute the variable and function names. */ +#define yyparse parser_parse +#define yylex parser_lex +#define yyerror parser_error +#define yylval parser_lval +#define yychar parser_char +#define yydebug parser_debug +#define yynerrs parser_nerrs /* Tokens. */ @@ -138,6 +149,7 @@ pUPM = 340 }; #endif +/* Tokens. */ #define tNL 258 #define tNUMBER 259 #define tLNUMBER 260 @@ -245,7 +257,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * History: * 24-Jul-2000 BS - Made a fix for broken Berkeley yacc on @@ -466,7 +478,7 @@ static int rsrcid_to_token(int lookahead); /* Enabling traces. */ #ifndef YYDEBUG -# define YYDEBUG 1 +# define YYDEBUG 0 #endif /* Enabling verbose error messages. */ @@ -477,8 +489,13 @@ static int rsrcid_to_token(int lookahead); # define YYERROR_VERBOSE 0 #endif +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 241 "parser.y" +#line 237 "parser.y" typedef union YYSTYPE { string_t *str; int num; @@ -522,8 +539,8 @@ typedef union YYSTYPE { style_t *style; ani_any_t *ani; } YYSTYPE; -/* Line 191 of yacc.c. */ -#line 531 "parser.tab.c" +/* Line 196 of yacc.c. */ +#line 544 "parser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -534,30 +551,49 @@ typedef union YYSTYPE { /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 543 "parser.tab.c" +/* Line 219 of yacc.c. */ +#line 556 "parser.tab.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif #if ! defined (yyoverflow) || YYERROR_VERBOSE -# ifndef YYFREE -# define YYFREE free -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# endif - /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# endif -# else -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif # endif # endif # endif @@ -565,13 +601,39 @@ typedef union YYSTYPE { # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ # endif +# else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ @@ -583,7 +645,7 @@ typedef union YYSTYPE { /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + short int yyss; YYSTYPE yyvs; }; @@ -593,7 +655,7 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do @@ -606,7 +668,7 @@ union yyalloc # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ @@ -635,28 +697,28 @@ union yyalloc #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else - typedef short yysigned_char; + typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 713 +#define YYLAST 677 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 97 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 84 +#define YYNNTS 83 /* YYNRULES -- Number of rules. */ -#define YYNRULES 259 +#define YYNRULES 258 /* YYNRULES -- Number of states. */ -#define YYNSTATES 575 +#define YYNSTATES 572 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 340 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ @@ -702,7 +764,7 @@ static const unsigned char yytranslate[] = #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short yyprhs[] = +static const unsigned short int yyprhs[] = { 0, 0, 3, 5, 6, 9, 12, 16, 20, 22, 23, 29, 30, 32, 34, 36, 38, 40, 42, 44, @@ -729,11 +791,11 @@ static const unsigned short yyprhs[] = 876, 879, 882, 885, 890, 893, 896, 901, 903, 905, 908, 910, 913, 915, 919, 923, 928, 932, 937, 941, 943, 945, 946, 948, 950, 954, 958, 962, 966, 970, - 974, 978, 981, 984, 987, 991, 993, 995, 998, 1000 + 974, 978, 981, 984, 987, 991, 993, 996, 998 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short yyrhs[] = +static const short int yyrhs[] = { 98, 0, -1, 99, -1, -1, 99, 100, -1, 99, 3, -1, 177, 102, 105, -1, 7, 102, 105, -1, @@ -764,7 +826,7 @@ static const short yyrhs[] = 125, 26, 126, -1, 125, 27, 126, -1, 125, 41, 126, -1, 125, 40, 126, -1, 125, 39, 126, -1, 125, 23, 104, 156, 177, 94, 177, 94, 177, 128, - -1, 6, 156, 177, 94, 177, 94, 177, 94, 177, + -1, 104, 156, 177, 94, 177, 94, 177, 94, 177, 94, 177, 131, -1, 177, 94, 177, 94, 177, 94, 177, 94, 177, 131, -1, -1, 94, 177, 94, 177, -1, 94, 177, 94, 177, 94, 132, -1, 94, 177, @@ -774,7 +836,7 @@ static const short yyrhs[] = 94, 132, 94, 177, 94, 177, 94, 177, 94, 177, -1, 21, 177, 94, 6, -1, -1, 94, 132, -1, 94, 132, 94, 132, -1, 132, 84, 132, -1, 95, - 132, 96, -1, 178, -1, 92, 178, -1, 177, -1, + 132, 96, -1, 179, -1, 92, 179, -1, 177, -1, 6, -1, 14, 166, 177, 94, 177, 94, 177, 94, 177, 141, 135, 81, 136, 82, -1, -1, 135, 63, 132, -1, 135, 62, 132, -1, 135, 60, 6, -1, @@ -792,7 +854,7 @@ static const short yyrhs[] = 94, 177, 94, 177, 94, 177, 94, 177, 94, 132, 141, 140, -1, 104, 156, 177, 94, 133, 94, 132, 94, 177, 94, 177, 94, 177, 94, 177, 140, -1, - 6, 156, 177, 94, 177, 94, 177, 94, 177, 94, + 104, 156, 177, 94, 177, 94, 177, 94, 177, 94, 177, 131, 141, 140, -1, 177, 94, 177, 94, 177, 94, 177, 94, 177, 131, 141, 140, -1, -1, 173, -1, -1, 94, 177, -1, 21, 177, 94, 6, 94, @@ -829,49 +891,48 @@ static const short yyrhs[] = 88, 5, -1, 6, -1, 174, 156, 9, -1, 174, 156, 4, -1, 174, 156, 88, 4, -1, 174, 156, 5, -1, 174, 156, 88, 5, -1, 174, 156, 6, - -1, 106, -1, 173, -1, -1, 177, -1, 179, -1, - 179, 87, 179, -1, 179, 88, 179, -1, 179, 84, - 179, -1, 179, 86, 179, -1, 179, 89, 179, -1, - 179, 90, 179, -1, 179, 85, 179, -1, 91, 179, - -1, 88, 179, -1, 87, 179, -1, 95, 179, 96, - -1, 180, -1, 178, -1, 92, 180, -1, 4, -1, - 5, -1 + -1, 106, -1, 173, -1, -1, 177, -1, 178, -1, + 178, 87, 178, -1, 178, 88, 178, -1, 178, 84, + 178, -1, 178, 86, 178, -1, 178, 89, 178, -1, + 178, 90, 178, -1, 178, 85, 178, -1, 91, 178, + -1, 88, 178, -1, 87, 178, -1, 95, 178, 96, + -1, 179, -1, 92, 179, -1, 4, -1, 5, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const unsigned short int yyrline[] = { - 0, 364, 364, 398, 399, 469, 475, 487, 497, 505, - 505, 549, 555, 562, 572, 573, 582, 583, 584, 608, - 609, 615, 616, 617, 618, 642, 643, 649, 650, 651, - 652, 653, 654, 658, 659, 660, 664, 668, 684, 706, - 716, 724, 732, 736, 740, 744, 755, 760, 769, 793, - 794, 795, 804, 805, 808, 809, 812, 813, 814, 815, - 816, 817, 822, 857, 858, 859, 860, 861, 862, 863, - 864, 865, 866, 869, 870, 871, 872, 873, 874, 875, - 876, 877, 878, 880, 881, 882, 883, 884, 885, 886, - 887, 889, 899, 924, 946, 948, 953, 960, 971, 985, - 1000, 1005, 1006, 1007, 1011, 1012, 1013, 1014, 1018, 1023, - 1031, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, - 1084, 1085, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, - 1096, 1097, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, - 1108, 1118, 1143, 1159, 1187, 1210, 1211, 1214, 1215, 1219, - 1226, 1227, 1231, 1254, 1258, 1259, 1268, 1274, 1293, 1294, - 1295, 1296, 1297, 1298, 1299, 1303, 1328, 1332, 1333, 1349, - 1355, 1375, 1376, 1380, 1388, 1399, 1400, 1404, 1410, 1418, - 1438, 1479, 1490, 1491, 1524, 1526, 1531, 1547, 1548, 1558, - 1568, 1575, 1582, 1589, 1596, 1606, 1607, 1616, 1624, 1625, - 1634, 1639, 1645, 1654, 1655, 1659, 1685, 1686, 1691, 1700, - 1701, 1711, 1726, 1727, 1728, 1729, 1732, 1733, 1734, 1738, - 1739, 1747, 1755, 1773, 1780, 1784, 1788, 1803, 1804, 1805, - 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1818, - 1819, 1826, 1827, 1831, 1834, 1835, 1836, 1837, 1838, 1839, - 1840, 1841, 1842, 1843, 1844, 1845, 1849, 1850, 1853, 1854 + 0, 359, 359, 393, 394, 464, 470, 482, 492, 500, + 500, 543, 549, 556, 566, 567, 576, 577, 578, 602, + 603, 609, 610, 611, 612, 636, 637, 643, 644, 645, + 646, 647, 648, 652, 653, 654, 658, 662, 678, 700, + 710, 718, 726, 730, 734, 738, 749, 754, 763, 787, + 788, 789, 798, 799, 802, 803, 806, 807, 808, 809, + 810, 811, 816, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 863, 864, 865, 866, 867, 868, 869, + 870, 871, 872, 874, 875, 876, 877, 878, 879, 880, + 881, 883, 893, 916, 938, 940, 945, 952, 963, 977, + 992, 997, 998, 999, 1003, 1004, 1005, 1006, 1010, 1015, + 1023, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, + 1076, 1077, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, + 1088, 1089, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, + 1100, 1110, 1135, 1151, 1177, 1200, 1201, 1204, 1205, 1209, + 1216, 1217, 1221, 1244, 1248, 1249, 1258, 1264, 1283, 1284, + 1285, 1286, 1287, 1288, 1289, 1293, 1318, 1322, 1323, 1339, + 1345, 1365, 1366, 1370, 1378, 1389, 1390, 1394, 1400, 1408, + 1428, 1466, 1476, 1477, 1510, 1512, 1517, 1533, 1534, 1544, + 1554, 1561, 1568, 1575, 1582, 1592, 1593, 1602, 1610, 1611, + 1620, 1625, 1631, 1640, 1641, 1645, 1671, 1672, 1677, 1686, + 1687, 1697, 1712, 1713, 1714, 1715, 1718, 1719, 1720, 1724, + 1725, 1733, 1741, 1759, 1766, 1770, 1774, 1789, 1790, 1791, + 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1804, + 1805, 1812, 1813, 1817, 1820, 1821, 1822, 1823, 1824, 1825, + 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1835, 1836 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { @@ -906,15 +967,14 @@ static const char *const yytname[] = "fix_version", "ver_blocks", "ver_block", "ver_values", "ver_value", "ver_words", "toolbar", "toolbar_items", "loadmemopts", "lamo", "lama", "opt_lvc", "opt_language", "opt_characts", "opt_version", "raw_data", - "raw_elements", "file_raw", "e_expr", "expr", "xpr_no_not", "xpr", - "any_num", 0 + "raw_elements", "file_raw", "e_expr", "expr", "xpr", "any_num", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -957,7 +1017,7 @@ static const unsigned char yyr1[] = 169, 169, 169, 170, 171, 172, 173, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 176, 176, 177, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 179, 179, 180, 180 + 178, 178, 178, 178, 178, 178, 178, 179, 179 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -988,322 +1048,314 @@ static const unsigned char yyr2[] = 2, 2, 2, 4, 2, 2, 4, 1, 1, 2, 1, 2, 1, 3, 3, 4, 3, 4, 3, 1, 1, 0, 1, 1, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 2, 3, 1, 1, 2, 1, 1 + 3, 2, 2, 2, 3, 1, 2, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned short yydefact[] = +static const unsigned short int yydefact[] = { - 3, 0, 2, 1, 5, 258, 259, 11, 209, 9, - 0, 0, 0, 0, 0, 4, 8, 0, 11, 256, - 243, 255, 0, 219, 0, 253, 252, 251, 257, 0, - 182, 0, 0, 0, 0, 0, 0, 0, 0, 46, - 47, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 7, 17, 18, - 24, 22, 23, 27, 28, 29, 21, 31, 209, 16, - 19, 20, 25, 26, 32, 30, 215, 218, 214, 216, - 212, 217, 213, 210, 211, 181, 0, 254, 0, 6, - 246, 250, 247, 244, 245, 248, 249, 219, 219, 219, - 0, 0, 219, 219, 219, 219, 187, 219, 219, 219, - 219, 0, 219, 219, 0, 0, 0, 220, 221, 222, - 0, 180, 184, 0, 35, 34, 33, 239, 0, 240, - 36, 37, 0, 0, 0, 0, 41, 43, 0, 39, - 40, 38, 42, 0, 44, 45, 224, 225, 0, 10, - 185, 0, 49, 0, 0, 0, 154, 152, 167, 165, - 0, 0, 0, 0, 0, 0, 0, 195, 0, 0, - 183, 0, 228, 230, 232, 227, 0, 184, 0, 0, - 0, 0, 0, 0, 191, 192, 193, 190, 194, 0, - 219, 223, 0, 48, 0, 229, 231, 226, 0, 0, - 0, 0, 0, 153, 0, 0, 166, 0, 0, 0, - 186, 196, 0, 0, 0, 234, 236, 238, 233, 0, - 0, 0, 184, 156, 184, 171, 169, 175, 0, 0, - 0, 206, 52, 52, 235, 237, 0, 0, 0, 0, - 0, 241, 168, 241, 0, 0, 0, 198, 0, 0, - 50, 51, 63, 147, 184, 157, 184, 184, 184, 184, - 184, 184, 0, 172, 0, 176, 170, 0, 0, 0, - 208, 0, 205, 58, 57, 59, 60, 61, 56, 53, - 54, 0, 0, 111, 155, 160, 159, 162, 163, 164, - 161, 241, 241, 0, 0, 0, 197, 200, 199, 207, - 0, 0, 0, 0, 0, 0, 0, 73, 67, 70, - 71, 72, 148, 0, 184, 242, 0, 177, 188, 189, - 0, 55, 13, 69, 12, 0, 15, 14, 68, 66, - 0, 0, 65, 106, 0, 64, 0, 0, 0, 0, - 0, 0, 0, 122, 115, 116, 119, 120, 121, 185, - 173, 241, 0, 0, 107, 255, 0, 0, 0, 0, + 3, 0, 2, 1, 5, 257, 258, 11, 209, 9, + 0, 0, 0, 0, 0, 4, 8, 0, 11, 243, + 255, 0, 219, 0, 253, 252, 251, 256, 0, 182, + 0, 0, 0, 0, 0, 0, 0, 0, 46, 47, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 7, 17, 18, 24, + 22, 23, 27, 28, 29, 21, 31, 209, 16, 19, + 20, 25, 26, 32, 30, 215, 218, 214, 216, 212, + 217, 213, 210, 211, 181, 0, 254, 0, 6, 246, + 250, 247, 244, 245, 248, 249, 219, 219, 219, 0, + 0, 219, 219, 219, 219, 187, 219, 219, 219, 219, + 0, 219, 219, 0, 0, 0, 220, 221, 222, 0, + 180, 184, 0, 35, 34, 33, 239, 0, 240, 36, + 37, 0, 0, 0, 0, 41, 43, 0, 39, 40, + 38, 42, 0, 44, 45, 224, 225, 0, 10, 185, + 0, 49, 0, 0, 0, 154, 152, 167, 165, 0, + 0, 0, 0, 0, 0, 0, 195, 0, 0, 183, + 0, 228, 230, 232, 227, 0, 184, 0, 0, 0, + 0, 0, 0, 191, 192, 193, 190, 194, 0, 219, + 223, 0, 48, 0, 229, 231, 226, 0, 0, 0, + 0, 0, 153, 0, 0, 166, 0, 0, 0, 186, + 196, 0, 0, 0, 234, 236, 238, 233, 0, 0, + 0, 184, 156, 184, 171, 169, 175, 0, 0, 0, + 206, 52, 52, 235, 237, 0, 0, 0, 0, 0, + 241, 168, 241, 0, 0, 0, 198, 0, 0, 50, + 51, 63, 147, 184, 157, 184, 184, 184, 184, 184, + 184, 0, 172, 0, 176, 170, 0, 0, 0, 208, + 0, 205, 58, 57, 59, 60, 61, 56, 53, 54, + 0, 0, 111, 155, 160, 159, 162, 163, 164, 161, + 241, 241, 0, 0, 0, 197, 200, 199, 207, 0, + 0, 0, 0, 0, 0, 0, 73, 67, 70, 71, + 72, 148, 0, 184, 242, 0, 177, 188, 189, 0, + 55, 13, 69, 12, 0, 15, 14, 68, 66, 0, + 0, 65, 106, 64, 0, 0, 0, 0, 0, 0, + 0, 122, 115, 116, 119, 120, 121, 185, 173, 241, + 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 62, 118, 0, 117, - 114, 113, 112, 0, 174, 0, 178, 201, 202, 203, - 100, 105, 104, 184, 184, 84, 86, 87, 79, 80, - 82, 83, 85, 81, 77, 0, 76, 78, 184, 74, - 75, 90, 89, 88, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 62, 118, 0, 117, 114, 113, 112, + 0, 174, 0, 178, 201, 202, 203, 100, 105, 104, + 184, 184, 84, 86, 87, 79, 80, 82, 83, 85, + 81, 77, 0, 76, 78, 184, 74, 75, 90, 89, + 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, - 100, 184, 184, 133, 135, 136, 128, 129, 131, 132, - 134, 130, 126, 0, 125, 127, 184, 123, 124, 139, - 138, 137, 179, 204, 0, 0, 0, 0, 0, 0, + 110, 0, 0, 0, 0, 0, 0, 100, 184, 184, + 133, 135, 136, 128, 129, 131, 132, 134, 130, 126, + 0, 125, 127, 184, 123, 124, 139, 138, 137, 179, + 204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 109, 0, 108, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, - 0, 0, 94, 0, 0, 0, 0, 149, 0, 0, - 0, 0, 0, 91, 0, 0, 0, 151, 94, 0, - 0, 0, 0, 0, 101, 0, 140, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 101, 0, 95, 101, - 102, 0, 0, 147, 0, 0, 92, 0, 0, 101, - 145, 0, 96, 103, 0, 147, 144, 146, 0, 0, - 0, 145, 0, 97, 99, 143, 0, 0, 145, 98, - 0, 142, 147, 145, 141 + 0, 0, 109, 0, 108, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 150, 0, 0, 0, 0, 94, + 0, 0, 0, 0, 149, 0, 0, 0, 0, 0, + 91, 0, 0, 0, 151, 94, 0, 0, 0, 0, + 0, 101, 0, 140, 0, 0, 0, 0, 0, 0, + 93, 0, 0, 101, 0, 95, 101, 102, 0, 0, + 147, 0, 0, 92, 0, 0, 101, 145, 0, 96, + 103, 0, 147, 144, 146, 0, 0, 0, 145, 0, + 97, 99, 143, 0, 0, 145, 98, 0, 142, 147, + 145, 141 }; /* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = +static const short int yydefgoto[] = { - -1, 1, 2, 15, 24, 22, 327, 328, 57, 127, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 171, 250, 279, 280, 70, 281, 336, 395, - 404, 513, 409, 308, 533, 332, 486, 71, 313, 383, - 457, 443, 452, 556, 283, 345, 507, 72, 157, 180, - 239, 73, 159, 181, 242, 244, 16, 17, 88, 240, - 74, 138, 189, 211, 269, 298, 388, 75, 248, 23, - 83, 84, 128, 117, 118, 119, 129, 177, 130, 262, - 324, 19, 20, 21 + -1, 1, 2, 15, 23, 21, 326, 391, 56, 126, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 170, 249, 278, 279, 69, 280, 334, 392, + 401, 510, 406, 307, 530, 331, 483, 70, 312, 380, + 454, 440, 449, 553, 282, 343, 504, 71, 156, 179, + 238, 72, 158, 180, 241, 243, 16, 17, 87, 239, + 73, 137, 188, 210, 268, 297, 385, 74, 247, 22, + 82, 83, 127, 116, 117, 118, 128, 176, 129, 261, + 323, 19, 20 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -472 -static const short yypact[] = +#define YYPACT_NINF -535 +static const short int yypact[] = { - -472, 17, 1, -472, -472, -472, -472, -472, -472, -472, - 86, 86, 86, 140, 86, -472, -472, -55, -472, -472, - 610, -472, 376, 649, 86, -472, -472, -472, -472, 597, - -472, 376, 86, 86, 86, 86, 86, 86, 86, -472, - -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, - -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, - -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, - -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, - -472, -472, -472, -472, -472, 268, 21, -472, 59, -472, - 480, 409, 327, -78, -78, -472, -472, 649, 395, 395, - 48, 48, 649, 649, 395, 395, 649, 395, 395, 395, - 395, 48, 395, 395, 86, 86, 86, -472, -472, -472, - 86, -472, 44, 67, -472, -472, -472, -472, 156, -472, - -472, -472, 55, 62, 240, 247, -472, -472, 413, -472, - -472, -472, -472, 71, -472, -472, -472, -472, 78, -472, - -472, 68, -472, 187, 86, 86, -472, -472, -472, -472, - 86, 86, 86, 86, 86, 86, 86, -472, 86, 86, - -472, 29, -472, -472, -472, -472, 183, -21, 82, 85, - 249, 262, 108, 114, -472, -472, -472, -472, -472, 12, - -472, -472, 128, -472, 137, -472, -472, -472, 195, 86, - 86, 3, 117, -472, 7, 236, -472, 86, 86, 243, - -472, -472, 278, 86, 86, -472, -472, -472, -472, 282, - 159, 160, 44, -472, -71, 168, -472, 174, 188, 203, - 191, -472, 220, 220, -472, -472, 86, 86, 86, 241, - 178, 86, -472, 86, 259, 86, 86, -472, -10, 472, - -472, -472, -472, 223, 182, -472, 364, 364, 364, 364, - 364, 364, 254, 264, 266, 264, -472, 270, 271, 15, - -472, 86, -472, -472, -472, -472, -472, -472, -472, 281, - -472, 292, 86, -472, -472, -472, -472, -472, -472, -472, - -472, 86, 86, 86, 86, 324, -472, -472, -472, -472, - 472, 211, 86, 179, 356, 228, 228, -472, -472, -472, - -472, -472, -472, 348, 381, -472, 285, 264, -472, -472, - 302, -472, -472, -472, -472, 310, -472, -472, -472, -472, - 86, 228, 300, 623, 610, 300, 550, 211, 86, 179, - 370, 228, 228, -472, -472, -472, -472, -472, -472, 86, - -472, 86, 42, 399, 623, -472, -15, 228, 179, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 86, 86, - 86, 179, 86, 400, 400, 400, -472, -472, 325, -472, - -472, 300, 300, 569, -472, 326, 264, -472, 332, -472, - -472, -472, -472, 44, 44, -472, -472, -472, -472, -472, - -472, -472, -472, -472, -472, 334, -472, -472, 44, -472, - -472, -472, -472, -472, 424, 179, 425, 425, 425, 425, - 425, 425, 425, 425, 425, 86, 86, 86, 179, 86, - 425, 425, 425, -472, 86, 86, 86, 86, 86, 86, - 347, 44, 44, -472, -472, -472, -472, -472, -472, -472, - -472, -472, -472, 349, -472, -472, 44, -472, -472, -472, - -472, -472, -472, -472, 350, 360, 366, 371, 86, 86, - 86, 86, 86, 86, 86, 86, 290, 382, 383, 384, - 407, 408, 411, 417, 426, -472, 427, -472, 86, 86, - 86, 86, 290, 86, 86, 86, 228, 428, 430, 436, - 437, 439, 440, 441, 443, 125, 86, -472, 86, 86, - 86, 228, 86, -472, 86, 86, 86, -472, 440, 444, - 445, 129, 447, 449, 450, 451, -472, 86, 86, 86, - 86, 86, 228, -472, 86, 453, 450, 454, 456, 450, - 146, 458, 86, 223, 86, 228, -472, 228, 86, 450, - 357, 459, 154, 300, 460, 223, -472, -472, 86, 228, - 86, 357, 461, 300, 463, -472, 86, 228, 61, 300, - 228, -472, 161, 357, -472 + -535, 31, 12, -535, -535, -535, -535, -535, -535, -535, + 240, 240, 240, 182, 240, -535, -535, -69, -535, 577, + -535, 365, 616, 240, -535, -535, -535, -535, 564, -535, + 365, 240, 240, 240, 240, 240, 240, 240, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, 362, -60, -535, 111, -535, 392, + 329, 363, 131, 131, -535, -535, 616, 403, 403, 84, + 84, 616, 616, 403, 403, 616, 403, 403, 403, 403, + 84, 403, 403, 240, 240, 240, -535, -535, -535, 240, + -535, -7, -6, -535, -535, -535, -535, 83, -535, -535, + -535, 0, 8, 202, 265, -535, -535, 449, -535, -535, + -535, -535, 15, -535, -535, -535, -535, 36, -535, -535, + 90, -535, 18, 240, 240, -535, -535, -535, -535, 240, + 240, 240, 240, 240, 240, 240, -535, 240, 240, -535, + 213, -535, -535, -535, -535, 318, -11, 51, 55, -46, + 211, 88, 94, -535, -535, -535, -535, -535, -28, -535, + -535, 119, -535, 134, -535, -535, -535, 40, 240, 240, + 1, 108, -535, 3, 174, -535, 240, 240, 248, -535, + -535, 290, 240, 240, -535, -535, -535, -535, 339, 162, + 175, -7, -535, -41, 188, -535, 190, 200, 203, 144, + -535, 258, 258, -535, -535, 240, 240, 240, 195, 364, + 240, -535, 240, 199, 240, 240, -535, 159, 501, -535, + -535, -535, 267, 171, -535, 133, 133, 133, 133, 133, + 133, 268, 272, 274, 272, -535, 276, 291, -32, -535, + 240, -535, -535, -535, -535, -535, -535, -535, 297, -535, + 5, 240, -535, -535, -535, -535, -535, -535, -535, -535, + 240, 240, 240, 240, 419, -535, -535, -535, -535, 501, + 219, 240, 86, 422, 37, 37, -535, -535, -535, -535, + -535, -535, 277, 227, -535, 341, 272, -535, -535, 342, + -535, -535, -535, -535, 345, -535, -535, -535, -535, 182, + 37, 212, -535, 212, 367, 219, 240, 86, 439, 37, + 37, -535, -535, -535, -535, -535, -535, 240, -535, 240, + 186, 440, -535, 71, 37, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 240, 240, 240, 86, 240, + 86, 86, 86, -535, -535, 353, -535, -535, 212, 212, + 563, -535, 360, 272, -535, 368, -535, -535, -535, -535, + -7, -7, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, 381, -535, -535, -7, -535, -535, -535, -535, + -535, 485, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 240, 240, 240, 86, 240, 86, 86, 86, + -535, 240, 240, 240, 240, 240, 240, 398, -7, -7, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + 406, -535, -535, -7, -535, -535, -535, -535, -535, -535, + -535, 408, 412, 414, 418, 240, 240, 240, 240, 240, + 240, 240, 240, 225, 420, 433, 437, 438, 441, 442, + 446, 447, -535, 448, -535, 240, 240, 240, 240, 225, + 240, 240, 240, 37, 450, 456, 457, 460, 463, 464, + 465, 466, -21, 240, -535, 240, 240, 240, 37, 240, + -535, 240, 240, 240, -535, 464, 469, 479, 11, 480, + 481, 483, 487, -535, 240, 240, 240, 240, 240, 37, + -535, 240, 488, 483, 489, 491, 483, 100, 536, 240, + 267, 240, 37, -535, 37, 240, 483, 292, 537, 101, + 212, 543, 267, -535, -535, 240, 37, 240, 292, 546, + 212, 561, -535, 240, 37, 89, 212, 37, -535, 138, + 292, -535 }; /* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = +static const short int yypgoto[] = { - -472, -472, -472, -472, -472, 485, -258, -168, 528, -472, - -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, - -472, -472, -472, 209, -472, 260, -472, -472, -472, 279, - 2, 43, -472, 280, -471, -282, 70, -472, -472, -472, - -472, 238, 35, -379, -348, -472, -472, -472, 333, -472, - -229, -472, 385, -472, -472, -472, -472, -472, -472, -115, - -472, -472, -472, 358, -472, -472, -472, -472, -472, 570, - -472, -472, -20, -205, -194, -186, -393, -472, 567, -241, - -2, -286, 4, -12 + -535, -535, -535, -535, -535, 515, -296, -294, 504, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, 324, -535, 330, -535, -535, -535, 208, + -118, 141, -535, 346, -390, -292, 168, -535, -535, -535, + -535, 207, 17, -486, -534, -535, -535, -535, 421, -535, + 2, -535, 432, -535, -535, -535, -535, -535, -535, -120, + -535, -535, -535, 409, -535, -535, -535, -535, -535, 565, + -535, -535, -20, -275, -255, -252, -358, -535, 535, -239, + -2, 462, 20 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -257 -static const short yytable[] = +#define YYTABLE_NINF -243 +static const short int yytable[] = { - 18, 28, 264, 85, 4, 5, 6, 151, 7, 222, - -158, 37, 38, 225, 25, 26, 27, 3, 29, 333, - 333, 8, 86, 150, 335, 284, 30, 285, 286, 287, - 288, 289, 290, 5, 6, 192, 90, 91, 92, 93, - 94, 95, 96, 323, 354, 333, 5, 6, 387, 356, - 314, 316, 5, 6, 209, 333, 333, 209, 295, 381, - 382, 197, 198, 5, 6, 543, 9, 270, 546, 357, - 271, 333, 272, 150, 170, 392, 309, 123, 555, 377, - 223, 391, 134, 135, 226, 350, 122, 310, 10, 11, - 5, 6, 12, 13, 210, 311, 14, 296, 132, 133, - 76, 77, 78, 79, 80, 81, 82, 238, 346, 143, - 385, 193, 146, 147, 148, 120, 10, 11, 149, 347, - 12, 13, -219, 224, 14, -219, -219, 348, 114, 10, - 11, 115, 116, 12, 13, 10, 11, 14, 150, 12, - 13, 121, -219, 14, 5, 6, 10, 11, 152, 154, - 12, 13, 178, 179, 14, 570, 155, 557, 182, 183, - 184, 185, 186, 187, 188, 168, 190, 191, 557, 194, - 212, 379, 169, 10, 11, 557, 199, 12, 13, 200, - 557, 14, 565, 5, 6, 326, 322, 195, 196, 571, - 393, 172, 173, 174, 574, 550, 175, 220, 221, 215, - 216, 217, 207, 408, 218, 228, 229, 561, 208, 357, - 333, 232, 233, 357, 505, 5, 6, 114, 322, 516, - 115, 116, 213, 529, 573, 333, 256, 257, 258, 521, - 357, 214, 5, 6, 252, 253, 254, 153, 357, 263, - 547, 265, 227, 267, 268, 357, 333, 441, 559, 230, - 540, 259, 260, 236, 237, 282, 261, -158, -158, 333, - 456, 333, 241, 552, -158, 553, 10, 11, 243, 299, - 12, 13, 247, 333, 14, 176, 150, 563, 436, 437, - 312, 333, 245, 219, 333, 569, 234, 235, 572, 315, - 317, 318, 319, 439, 5, 6, 485, 246, 10, 11, - 325, 114, 12, 13, 115, 116, 14, 301, 114, 334, - 334, 115, 116, 302, 249, 10, 11, 282, 355, 12, - 330, 156, 156, 331, 201, 202, 469, 470, 158, 114, - 320, 203, 115, 116, 334, 29, 378, 204, 205, 114, - 158, 472, 115, 116, 206, 334, 334, 384, 291, 386, - 389, 303, 304, 114, 305, 306, 115, 116, -242, 231, - 292, 334, 329, 337, 293, 294, 405, 405, 405, 338, - 405, 406, 407, 307, 410, 300, 380, 10, 11, 351, - 39, 12, 13, 40, 357, 14, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 352, 51, 52, 53, - 54, 124, 125, 126, 353, 390, 394, 339, 340, 114, - 341, 342, 115, 116, 35, 36, 37, 38, -219, 414, - 434, -219, -219, 453, 453, 453, 435, 453, 438, 343, - 440, 442, 462, 463, 464, 465, 466, 467, -219, -158, - -158, 468, 251, 471, 473, -158, -158, 76, 77, 78, - 79, 80, 81, 82, 474, 55, -158, -158, 150, 56, - 475, 454, 455, -158, 458, 476, 477, 478, 479, 480, - 481, 482, 483, 484, 487, 349, 488, 489, 490, 160, - 161, 162, 163, 164, 165, 166, 497, 498, 499, 500, - 487, 502, 503, 504, 167, 34, 35, 36, 37, 38, - 334, 491, 492, 31, 517, 493, 518, 519, 520, 273, - 522, 494, 523, 524, 525, 334, 274, 275, 276, 277, - 495, 496, 506, 278, 508, 535, 536, 537, 538, 539, - 509, 510, 541, 511, 512, 514, 334, 515, 527, 528, - 549, 530, 551, 531, 532, 534, 554, 542, 544, 334, - 545, 334, 548, 558, 560, 566, 562, 567, 564, 89, - 321, 526, 501, 334, 568, 33, 34, 35, 36, 37, - 38, 334, 255, 358, 334, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 415, 344, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 297, 0, 266, - 0, 0, 376, 0, 0, 0, 0, 0, 113, 396, - 397, 398, 399, 400, 401, 402, 403, 0, 0, 0, - 0, 433, 411, 412, 413, 444, 445, 446, 447, 448, - 449, 450, 451, 0, 0, 0, 131, 0, 459, 460, - 461, 136, 137, 0, 139, 140, 141, 142, 0, 144, - 145, 32, 33, 34, 35, 36, 37, 38, 0, 0, - 0, 0, 0, 87, 32, 33, 34, 35, 36, 37, - 38, 76, 77, 78, 79, 80, 81, 82, -256, -256, - -256, -256, -256, -256 + 18, 150, 84, 263, 322, 308, 547, 221, 327, 224, + 208, 294, 29, 333, 208, 4, 5, 6, 558, 7, + 300, 85, 171, 172, 173, 309, 301, 174, 310, 200, + 201, 3, 8, 27, 119, 570, 202, 344, 353, 374, + -158, 5, 6, 376, 214, 215, 216, 378, 379, 217, + 295, 313, 315, 149, 209, 113, 197, 345, 114, 115, + 346, 390, 389, 354, 302, 303, 113, 304, 305, 114, + 115, 196, 562, 513, 405, 151, 122, 9, 222, 568, + 225, 133, 134, 149, 571, 121, 306, 149, 5, 6, + 5, 6, 325, 321, 153, 354, 169, 131, 132, 10, + 11, 237, 154, 12, 13, 526, 175, 14, 142, 167, + 382, 145, 146, 147, 223, 5, 6, 148, 438, 439, + 439, 439, 439, 439, 439, 439, 439, 439, 218, 329, + 168, 453, 330, 439, 439, 439, 75, 76, 77, 78, + 79, 80, 81, 540, 113, 198, 543, 114, 115, 199, + -219, 177, 178, -219, -219, 354, 552, 181, 182, 183, + 184, 185, 186, 187, 152, 189, 190, 388, 193, 211, + -219, 10, 11, 10, 11, 12, 13, 12, 13, 14, + 226, 14, 206, 567, 354, 354, 5, 6, 207, 554, + 5, 6, 384, 120, 544, 556, 219, 220, 10, 11, + 554, 502, 12, 13, 227, 228, 14, 554, -158, -158, + 231, 232, 554, 212, -158, -158, 518, 5, 6, 191, + 36, 37, 354, 5, 6, 246, 321, 149, 213, 5, + 6, 482, 281, 251, 252, 253, 269, 537, 262, 270, + 264, 271, 266, 267, 5, 6, -158, -158, 403, 404, + 549, 407, 550, -158, 229, 283, 235, 284, 285, 286, + 287, 288, 289, 113, 560, 149, 114, 115, 298, 236, + 433, 434, 566, 10, 11, 569, 155, 12, 13, 311, + 157, 14, 240, 155, 242, 436, 203, 204, 314, 316, + 317, 318, 335, 205, 244, 192, 354, 245, 336, 324, + 10, 11, -158, -158, 12, 13, 10, 11, 14, -158, + 12, 13, 10, 11, 14, 348, 12, 13, 466, 467, + 14, 347, 194, 195, 332, 332, 113, 10, 11, 114, + 115, 12, 13, 469, 375, 14, 337, 338, 113, 339, + 340, 114, 115, 233, 234, 381, 157, 383, 386, 352, + 332, 113, 248, -219, 114, 115, -219, -219, 341, 332, + 332, 281, 290, 402, 402, 402, -242, 402, 291, 38, + 292, 230, 39, -219, 332, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 293, 50, 51, 52, 53, + 355, 299, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 123, + 124, 125, 255, 256, 257, 33, 34, 35, 36, 37, + 450, 450, 450, 113, 450, 319, 114, 115, 328, 459, + 460, 461, 462, 463, 464, 349, 350, 258, 259, 351, + 451, 452, 260, 455, 54, 377, 387, 411, 55, 373, + 34, 35, 36, 37, 431, 75, 76, 77, 78, 79, + 80, 81, 432, 474, 475, 476, 477, 478, 479, 480, + 481, 484, 24, 25, 26, 435, 28, 32, 33, 34, + 35, 36, 37, 494, 495, 496, 497, 484, 499, 500, + 501, 437, 465, 89, 90, 91, 92, 93, 94, 95, + 468, 514, 470, 515, 516, 517, 471, 519, 472, 520, + 521, 522, 473, 332, 485, 159, 160, 161, 162, 163, + 164, 165, 532, 533, 534, 535, 536, 486, 332, 538, + 166, 487, 488, 30, 88, 489, 490, 546, 272, 548, + 491, 492, 493, 551, 503, 273, 274, 275, 276, 332, + 505, 506, 277, 559, 507, 561, 250, 508, 509, 511, + 512, 565, 332, 524, 332, 393, 394, 395, 396, 397, + 398, 399, 400, 525, 527, 528, 332, 529, 408, 409, + 410, 531, 539, 541, 332, 542, 412, 332, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 441, 442, 443, 444, 445, 446, 447, 448, 320, + 545, 555, 112, 130, 456, 457, 458, 557, 135, 136, + 563, 138, 139, 140, 141, 430, 143, 144, 31, 32, + 33, 34, 35, 36, 37, 564, 523, 498, 342, 254, + 86, 31, 32, 33, 34, 35, 36, 37, 75, 76, + 77, 78, 79, 80, 81, 265, 0, 296 }; -static const short yycheck[] = +static const short int yycheck[] = { - 2, 13, 243, 23, 3, 4, 5, 122, 7, 6, - 81, 89, 90, 6, 10, 11, 12, 0, 14, 305, - 306, 20, 24, 94, 306, 254, 81, 256, 257, 258, - 259, 260, 261, 4, 5, 6, 32, 33, 34, 35, - 36, 37, 38, 301, 330, 331, 4, 5, 6, 331, - 291, 292, 4, 5, 42, 341, 342, 42, 43, 341, - 342, 82, 177, 4, 5, 536, 65, 77, 539, 84, - 80, 357, 82, 94, 6, 357, 281, 97, 549, 337, - 77, 96, 102, 103, 77, 314, 88, 281, 87, 88, - 4, 5, 91, 92, 82, 281, 95, 82, 100, 101, - 52, 53, 54, 55, 56, 57, 58, 222, 313, 111, - 351, 82, 114, 115, 116, 94, 87, 88, 120, 313, - 91, 92, 61, 6, 95, 64, 65, 313, 61, 87, - 88, 64, 65, 91, 92, 87, 88, 95, 94, 91, - 92, 82, 81, 95, 4, 5, 87, 88, 81, 94, - 91, 92, 154, 155, 95, 94, 94, 550, 160, 161, - 162, 163, 164, 165, 166, 94, 168, 169, 561, 171, - 190, 339, 94, 87, 88, 568, 94, 91, 92, 94, - 573, 95, 561, 4, 5, 6, 7, 4, 5, 568, - 358, 4, 5, 6, 573, 543, 9, 199, 200, 4, - 5, 6, 94, 371, 9, 207, 208, 555, 94, 84, - 496, 213, 214, 84, 496, 4, 5, 61, 7, 94, - 64, 65, 94, 94, 572, 511, 48, 49, 50, 511, - 84, 94, 4, 5, 236, 237, 238, 81, 84, 241, - 94, 243, 6, 245, 246, 84, 532, 415, 94, 6, - 532, 73, 74, 94, 94, 94, 78, 75, 76, 545, - 428, 547, 94, 545, 82, 547, 87, 88, 94, 271, - 91, 92, 81, 559, 95, 88, 94, 559, 393, 394, - 282, 567, 94, 88, 570, 567, 4, 5, 570, 291, - 292, 293, 294, 408, 4, 5, 6, 94, 87, 88, - 302, 61, 91, 92, 64, 65, 95, 15, 61, 305, - 306, 64, 65, 21, 94, 87, 88, 94, 330, 91, - 92, 81, 81, 95, 75, 76, 441, 442, 81, 61, - 6, 82, 64, 65, 330, 331, 338, 75, 76, 61, - 81, 456, 64, 65, 82, 341, 342, 349, 94, 351, - 352, 59, 60, 61, 62, 63, 64, 65, 94, 81, - 94, 357, 6, 15, 94, 94, 368, 369, 370, 21, - 372, 369, 370, 81, 372, 94, 6, 87, 88, 94, - 4, 91, 92, 7, 84, 95, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 94, 21, 22, 23, - 24, 6, 7, 8, 94, 6, 6, 59, 60, 61, - 62, 63, 64, 65, 87, 88, 89, 90, 61, 94, - 94, 64, 65, 425, 426, 427, 94, 429, 94, 81, - 6, 6, 434, 435, 436, 437, 438, 439, 81, 75, - 76, 94, 233, 94, 94, 81, 82, 52, 53, 54, - 55, 56, 57, 58, 94, 79, 75, 76, 94, 83, - 94, 426, 427, 82, 429, 94, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 94, 94, 94, 94, 66, - 67, 68, 69, 70, 71, 72, 488, 489, 490, 491, - 492, 493, 494, 495, 81, 86, 87, 88, 89, 90, - 496, 94, 94, 18, 506, 94, 508, 509, 510, 37, - 512, 94, 514, 515, 516, 511, 44, 45, 46, 47, - 94, 94, 94, 51, 94, 527, 528, 529, 530, 531, - 94, 94, 534, 94, 94, 94, 532, 94, 94, 94, - 542, 94, 544, 94, 94, 94, 548, 94, 94, 545, - 94, 547, 94, 94, 94, 94, 558, 94, 560, 31, - 300, 518, 492, 559, 566, 85, 86, 87, 88, 89, - 90, 567, 239, 23, 570, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 23, 313, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 269, -1, 244, - -1, -1, 82, -1, -1, -1, -1, -1, 68, 360, - 361, 362, 363, 364, 365, 366, 367, -1, -1, -1, - -1, 82, 373, 374, 375, 417, 418, 419, 420, 421, - 422, 423, 424, -1, -1, -1, 99, -1, 430, 431, - 432, 104, 105, -1, 107, 108, 109, 110, -1, 112, - 113, 84, 85, 86, 87, 88, 89, 90, -1, -1, - -1, -1, -1, 96, 84, 85, 86, 87, 88, 89, - 90, 52, 53, 54, 55, 56, 57, 58, 85, 86, - 87, 88, 89, 90 + 2, 121, 22, 242, 300, 280, 540, 6, 302, 6, + 42, 43, 81, 305, 42, 3, 4, 5, 552, 7, + 15, 23, 4, 5, 6, 280, 21, 9, 280, 75, + 76, 0, 20, 13, 94, 569, 82, 312, 330, 335, + 81, 4, 5, 337, 4, 5, 6, 339, 340, 9, + 82, 290, 291, 94, 82, 61, 176, 312, 64, 65, + 312, 355, 354, 84, 59, 60, 61, 62, 63, 64, + 65, 82, 558, 94, 368, 81, 96, 65, 77, 565, + 77, 101, 102, 94, 570, 87, 81, 94, 4, 5, + 4, 5, 6, 7, 94, 84, 6, 99, 100, 87, + 88, 221, 94, 91, 92, 94, 88, 95, 110, 94, + 349, 113, 114, 115, 6, 4, 5, 119, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 88, 92, + 94, 425, 95, 427, 428, 429, 52, 53, 54, 55, + 56, 57, 58, 533, 61, 94, 536, 64, 65, 94, + 61, 153, 154, 64, 65, 84, 546, 159, 160, 161, + 162, 163, 164, 165, 81, 167, 168, 96, 170, 189, + 81, 87, 88, 87, 88, 91, 92, 91, 92, 95, + 6, 95, 94, 94, 84, 84, 4, 5, 94, 547, + 4, 5, 6, 82, 94, 94, 198, 199, 87, 88, + 558, 493, 91, 92, 206, 207, 95, 565, 75, 76, + 212, 213, 570, 94, 81, 82, 508, 4, 5, 6, + 89, 90, 84, 4, 5, 81, 7, 94, 94, 4, + 5, 6, 94, 235, 236, 237, 77, 529, 240, 80, + 242, 82, 244, 245, 4, 5, 75, 76, 366, 367, + 542, 369, 544, 82, 6, 253, 94, 255, 256, 257, + 258, 259, 260, 61, 556, 94, 64, 65, 270, 94, + 390, 391, 564, 87, 88, 567, 81, 91, 92, 281, + 81, 95, 94, 81, 94, 405, 75, 76, 290, 291, + 292, 293, 15, 82, 94, 82, 84, 94, 21, 301, + 87, 88, 75, 76, 91, 92, 87, 88, 95, 82, + 91, 92, 87, 88, 95, 313, 91, 92, 438, 439, + 95, 94, 4, 5, 304, 305, 61, 87, 88, 64, + 65, 91, 92, 453, 336, 95, 59, 60, 61, 62, + 63, 64, 65, 4, 5, 347, 81, 349, 350, 329, + 330, 61, 94, 61, 64, 65, 64, 65, 81, 339, + 340, 94, 94, 365, 366, 367, 94, 369, 94, 4, + 94, 81, 7, 81, 354, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 94, 21, 22, 23, 24, + 23, 94, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 6, + 7, 8, 48, 49, 50, 86, 87, 88, 89, 90, + 422, 423, 424, 61, 426, 6, 64, 65, 6, 431, + 432, 433, 434, 435, 436, 94, 94, 73, 74, 94, + 423, 424, 78, 426, 79, 6, 6, 94, 83, 82, + 87, 88, 89, 90, 94, 52, 53, 54, 55, 56, + 57, 58, 94, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 10, 11, 12, 94, 14, 85, 86, 87, + 88, 89, 90, 485, 486, 487, 488, 489, 490, 491, + 492, 6, 94, 31, 32, 33, 34, 35, 36, 37, + 94, 503, 94, 505, 506, 507, 94, 509, 94, 511, + 512, 513, 94, 493, 94, 66, 67, 68, 69, 70, + 71, 72, 524, 525, 526, 527, 528, 94, 508, 531, + 81, 94, 94, 18, 30, 94, 94, 539, 37, 541, + 94, 94, 94, 545, 94, 44, 45, 46, 47, 529, + 94, 94, 51, 555, 94, 557, 232, 94, 94, 94, + 94, 563, 542, 94, 544, 357, 358, 359, 360, 361, + 362, 363, 364, 94, 94, 94, 556, 94, 370, 371, + 372, 94, 94, 94, 564, 94, 23, 567, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 414, 415, 416, 417, 418, 419, 420, 421, 299, + 94, 94, 67, 98, 427, 428, 429, 94, 103, 104, + 94, 106, 107, 108, 109, 82, 111, 112, 84, 85, + 86, 87, 88, 89, 90, 94, 515, 489, 312, 238, + 96, 84, 85, 86, 87, 88, 89, 90, 52, 53, + 54, 55, 56, 57, 58, 243, -1, 268 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1312,80 +1364,64 @@ static const unsigned char yystos[] = { 0, 98, 99, 0, 3, 4, 5, 7, 20, 65, 87, 88, 91, 92, 95, 100, 153, 154, 177, 178, - 179, 180, 102, 166, 101, 179, 179, 179, 180, 179, - 81, 102, 84, 85, 86, 87, 88, 89, 90, 4, - 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 21, 22, 23, 24, 79, 83, 105, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 123, 134, 144, 148, 157, 164, 52, 53, 54, 55, - 56, 57, 58, 167, 168, 169, 177, 96, 155, 105, - 179, 179, 179, 179, 179, 179, 179, 166, 166, 166, + 179, 102, 166, 101, 178, 178, 178, 179, 178, 81, + 102, 84, 85, 86, 87, 88, 89, 90, 4, 7, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 21, 22, 23, 24, 79, 83, 105, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 123, + 134, 144, 148, 157, 164, 52, 53, 54, 55, 56, + 57, 58, 167, 168, 169, 177, 96, 155, 105, 178, + 178, 178, 178, 178, 178, 178, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 61, 64, 65, 170, 171, 172, - 94, 82, 177, 169, 6, 7, 8, 106, 169, 173, - 175, 175, 177, 177, 169, 169, 175, 175, 158, 175, - 175, 175, 175, 177, 175, 175, 177, 177, 177, 177, - 94, 156, 81, 81, 94, 94, 81, 145, 81, 149, - 66, 67, 68, 69, 70, 71, 72, 81, 94, 94, - 6, 119, 4, 5, 6, 9, 88, 174, 177, 177, - 146, 150, 177, 177, 177, 177, 177, 177, 177, 159, - 177, 177, 6, 82, 177, 4, 5, 82, 156, 94, - 94, 75, 76, 82, 75, 76, 82, 94, 94, 42, - 82, 160, 169, 94, 94, 4, 5, 6, 9, 88, - 177, 177, 6, 77, 6, 6, 77, 6, 177, 177, - 6, 81, 177, 177, 4, 5, 94, 94, 156, 147, - 156, 94, 151, 94, 152, 94, 94, 81, 165, 94, - 120, 120, 177, 177, 177, 145, 48, 49, 50, 73, - 74, 78, 176, 177, 176, 177, 149, 177, 177, 161, - 77, 80, 82, 37, 44, 45, 46, 47, 51, 121, - 122, 124, 94, 141, 147, 147, 147, 147, 147, 147, - 147, 94, 94, 94, 94, 43, 82, 160, 162, 177, - 94, 15, 21, 59, 60, 62, 63, 81, 130, 170, - 171, 172, 177, 135, 176, 177, 176, 177, 177, 177, - 6, 122, 7, 103, 177, 177, 6, 103, 104, 6, - 92, 95, 132, 178, 179, 132, 125, 15, 21, 59, - 60, 62, 63, 81, 130, 142, 170, 171, 172, 94, - 147, 94, 94, 94, 178, 180, 132, 84, 23, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 82, 103, 177, 104, - 6, 132, 132, 136, 177, 176, 177, 6, 163, 177, - 6, 96, 132, 104, 6, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 127, 177, 127, 127, 104, 129, - 127, 126, 126, 126, 94, 23, 25, 26, 27, 28, + 166, 166, 166, 61, 64, 65, 170, 171, 172, 94, + 82, 177, 169, 6, 7, 8, 106, 169, 173, 175, + 175, 177, 177, 169, 169, 175, 175, 158, 175, 175, + 175, 175, 177, 175, 175, 177, 177, 177, 177, 94, + 156, 81, 81, 94, 94, 81, 145, 81, 149, 66, + 67, 68, 69, 70, 71, 72, 81, 94, 94, 6, + 119, 4, 5, 6, 9, 88, 174, 177, 177, 146, + 150, 177, 177, 177, 177, 177, 177, 177, 159, 177, + 177, 6, 82, 177, 4, 5, 82, 156, 94, 94, + 75, 76, 82, 75, 76, 82, 94, 94, 42, 82, + 160, 169, 94, 94, 4, 5, 6, 9, 88, 177, + 177, 6, 77, 6, 6, 77, 6, 177, 177, 6, + 81, 177, 177, 4, 5, 94, 94, 156, 147, 156, + 94, 151, 94, 152, 94, 94, 81, 165, 94, 120, + 120, 177, 177, 177, 145, 48, 49, 50, 73, 74, + 78, 176, 177, 176, 177, 149, 177, 177, 161, 77, + 80, 82, 37, 44, 45, 46, 47, 51, 121, 122, + 124, 94, 141, 147, 147, 147, 147, 147, 147, 147, + 94, 94, 94, 94, 43, 82, 160, 162, 177, 94, + 15, 21, 59, 60, 62, 63, 81, 130, 170, 171, + 172, 177, 135, 176, 177, 176, 177, 177, 177, 6, + 122, 7, 103, 177, 177, 6, 103, 104, 6, 92, + 95, 132, 179, 132, 125, 15, 21, 59, 60, 62, + 63, 81, 130, 142, 170, 171, 172, 94, 147, 94, + 94, 94, 179, 132, 84, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 82, 94, 94, 156, 156, 94, 156, - 6, 104, 6, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 139, 177, 139, 139, 104, 137, 139, 138, - 138, 138, 177, 177, 177, 177, 177, 177, 94, 156, - 156, 94, 156, 94, 94, 94, 94, 177, 177, 177, - 177, 177, 177, 177, 177, 6, 133, 177, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 177, 177, 177, - 177, 133, 177, 177, 177, 132, 94, 143, 94, 94, - 94, 94, 94, 128, 94, 94, 94, 177, 177, 177, - 177, 132, 177, 177, 177, 177, 128, 94, 94, 94, - 94, 94, 94, 131, 94, 177, 177, 177, 177, 177, - 132, 177, 94, 131, 94, 94, 131, 94, 94, 177, - 141, 177, 132, 132, 177, 131, 140, 173, 94, 94, - 94, 141, 177, 132, 177, 140, 94, 94, 177, 132, - 94, 140, 132, 141, 140 + 39, 40, 41, 82, 103, 177, 104, 6, 132, 132, + 136, 177, 176, 177, 6, 163, 177, 6, 96, 132, + 104, 104, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 127, 177, 127, 127, 104, 129, 127, 126, 126, + 126, 94, 23, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 82, 94, 94, 156, 156, 94, 156, 6, 104, 104, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 139, + 177, 139, 139, 104, 137, 139, 138, 138, 138, 177, + 177, 177, 177, 177, 177, 94, 156, 156, 94, 156, + 94, 94, 94, 94, 177, 177, 177, 177, 177, 177, + 177, 177, 6, 133, 177, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 177, 177, 177, 177, 133, 177, + 177, 177, 132, 94, 143, 94, 94, 94, 94, 94, + 128, 94, 94, 94, 177, 177, 177, 177, 132, 177, + 177, 177, 177, 128, 94, 94, 94, 94, 94, 94, + 131, 94, 177, 177, 177, 177, 177, 132, 177, 94, + 131, 94, 94, 131, 94, 94, 177, 141, 177, 132, + 132, 177, 131, 140, 173, 94, 94, 94, 141, 177, + 132, 177, 140, 94, 94, 177, 132, 94, 140, 132, + 141, 140 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -1415,26 +1451,59 @@ do \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - ((Current).first_line = (Rhs)[1].first_line, \ - (Current).first_column = (Rhs)[1].first_column, \ - (Current).last_line = (Rhs)[N].last_line, \ - (Current).last_column = (Rhs)[N].last_column) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) #endif + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -1457,19 +1526,13 @@ do { \ YYFPRINTF Args; \ } while (0) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) - -# define YYDSYMPRINTF(Title, Token, Value, Location) \ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ + yysymprint (stderr, \ + Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -1481,12 +1544,12 @@ do { \ #if defined (__STDC__) || defined (__cplusplus) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + short int *bottom; + short int *top; #endif { YYFPRINTF (stderr, "Stack now"); @@ -1516,13 +1579,13 @@ yy_reduce_print (yyrule) #endif { int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", yyrule - 1, yylno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ @@ -1536,8 +1599,7 @@ do { \ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -1552,13 +1614,9 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -1580,7 +1638,7 @@ yystrlen (yystr) const char *yystr; # endif { - register const char *yys = yystr; + const char *yys = yystr; while (*yys++ != '\0') continue; @@ -1605,8 +1663,8 @@ yystpcpy (yydest, yysrc) const char *yysrc; # endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -1616,7 +1674,55 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +#endif /* YYERROR_VERBOSE */ @@ -1640,15 +1746,15 @@ yysymprint (yyoutput, yytype, yyvaluep) (void) yyvaluep; if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif switch (yytype) { default: @@ -1664,10 +1770,11 @@ yysymprint (yyoutput, yytype, yyvaluep) #if defined (__STDC__) || defined (__cplusplus) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif @@ -1675,6 +1782,10 @@ yydestruct (yytype, yyvaluep) /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + switch (yytype) { @@ -1702,10 +1813,10 @@ int yyparse (); -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1731,17 +1842,17 @@ yyparse (void) #else int yyparse () - + ; #endif #endif { - - register int yystate; - register int yyn; + + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: @@ -1753,14 +1864,14 @@ yyparse () to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; @@ -1817,14 +1928,14 @@ yyparse () these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1835,21 +1946,21 @@ yyparse () } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1881,18 +1992,18 @@ yyparse () yybackup: /* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ +/* Read a look-ahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1907,7 +2018,7 @@ yybackup: else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -1927,8 +2038,8 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) @@ -1978,63 +2089,63 @@ yyreduce: switch (yyn) { case 2: -#line 364 "parser.y" +#line 359 "parser.y" { resource_t *rsc; /* First add stringtables to the resource-list */ rsc = build_stt_resources(sttres); /* 'build_stt_resources' returns a head and $1 is a tail */ - if(yyvsp[0].res) + if((yyvsp[0].res)) { - yyvsp[0].res->next = rsc; + (yyvsp[0].res)->next = rsc; if(rsc) - rsc->prev = yyvsp[0].res; + rsc->prev = (yyvsp[0].res); } else - yyvsp[0].res = rsc; + (yyvsp[0].res) = rsc; /* Find the tail again */ - while(yyvsp[0].res && yyvsp[0].res->next) - yyvsp[0].res = yyvsp[0].res->next; + while((yyvsp[0].res) && (yyvsp[0].res)->next) + (yyvsp[0].res) = (yyvsp[0].res)->next; /* Now add any fontdirecory */ - rsc = build_fontdirs(yyvsp[0].res); + rsc = build_fontdirs((yyvsp[0].res)); /* 'build_fontdir' returns a head and $1 is a tail */ - if(yyvsp[0].res) + if((yyvsp[0].res)) { - yyvsp[0].res->next = rsc; + (yyvsp[0].res)->next = rsc; if(rsc) - rsc->prev = yyvsp[0].res; + rsc->prev = (yyvsp[0].res); } else - yyvsp[0].res = rsc; + (yyvsp[0].res) = rsc; /* Final statement before were done */ - resource_top = get_resource_head(yyvsp[0].res); + resource_top = get_resource_head((yyvsp[0].res)); ;} break; case 3: -#line 398 "parser.y" - { yyval.res = NULL; want_id = 1; ;} +#line 393 "parser.y" + { (yyval.res) = NULL; want_id = 1; ;} break; case 4: -#line 399 "parser.y" +#line 394 "parser.y" { - if(yyvsp[0].res) + if((yyvsp[0].res)) { - resource_t *tail = yyvsp[0].res; - resource_t *head = yyvsp[0].res; + resource_t *tail = (yyvsp[0].res); + resource_t *head = (yyvsp[0].res); while(tail->next) tail = tail->next; while(head->prev) head = head->prev; - head->prev = yyvsp[-1].res; - if(yyvsp[-1].res) - yyvsp[-1].res->next = head; - yyval.res = tail; + head->prev = (yyvsp[-1].res); + if((yyvsp[-1].res)) + (yyvsp[-1].res)->next = head; + (yyval.res) = tail; /* Check for duplicate identifiers */ - while(yyvsp[-1].res && head) + while((yyvsp[-1].res) && head) { - resource_t *rsc = yyvsp[-1].res; + resource_t *rsc = (yyvsp[-1].res); while(rsc) { if(rsc->type == head->type @@ -2042,22 +2153,22 @@ yyreduce: && rsc->lan->sub == head->lan->sub && !compare_name_id(rsc->name, head->name)) { - yyerror("Duplicate resource name '%s'", get_nameid_str(rsc->name)); + parser_error("Duplicate resource name '%s'\n", get_nameid_str(rsc->name)); } rsc = rsc->prev; } head = head->next; } } - else if(yyvsp[-1].res) + else if((yyvsp[-1].res)) { - resource_t *tail = yyvsp[-1].res; + resource_t *tail = (yyvsp[-1].res); while(tail->next) tail = tail->next; - yyval.res = tail; + (yyval.res) = tail; } else - yyval.res = NULL; + (yyval.res) = NULL; if(!dont_want_id) /* See comments in language parsing below */ want_id = 1; @@ -2066,54 +2177,54 @@ yyreduce: break; case 6: -#line 475 "parser.y" +#line 470 "parser.y" { - yyval.res = yyvsp[0].res; - if(yyval.res) + (yyval.res) = (yyvsp[0].res); + if((yyval.res)) { - if(yyvsp[-2].num > 65535 || yyvsp[-2].num < -32768) - yyerror("Resource's ID out of range (%d)", yyvsp[-2].num); - yyval.res->name = new_name_id(); - yyval.res->name->type = name_ord; - yyval.res->name->name.i_name = yyvsp[-2].num; - chat("Got %s (%d)", get_typename(yyvsp[0].res), yyval.res->name->name.i_name); + if((yyvsp[-2].num) > 65535 || (yyvsp[-2].num) < -32768) + parser_error("Resource's ID out of range (%d)\n", (yyvsp[-2].num)); + (yyval.res)->name = new_name_id(); + (yyval.res)->name->type = name_ord; + (yyval.res)->name->name.i_name = (yyvsp[-2].num); + chat("Got %s (%d)\n", get_typename((yyvsp[0].res)), (yyval.res)->name->name.i_name); } ;} break; case 7: -#line 487 "parser.y" +#line 482 "parser.y" { - yyval.res = yyvsp[0].res; - if(yyval.res) + (yyval.res) = (yyvsp[0].res); + if((yyval.res)) { - yyval.res->name = new_name_id(); - yyval.res->name->type = name_str; - yyval.res->name->name.s_name = yyvsp[-2].str; - chat("Got %s (%s)", get_typename(yyvsp[0].res), yyval.res->name->name.s_name->str.cstr); + (yyval.res)->name = new_name_id(); + (yyval.res)->name->type = name_str; + (yyval.res)->name->name.s_name = (yyvsp[-2].str); + chat("Got %s (%s)\n", get_typename((yyvsp[0].res)), (yyval.res)->name->name.s_name->str.cstr); } ;} break; case 8: -#line 497 "parser.y" +#line 492 "parser.y" { /* Don't do anything, stringtables are converted to * resource_t structures when we are finished parsing and * the final rule of the parser is reduced (see above) */ - yyval.res = NULL; - chat("Got STRINGTABLE"); + (yyval.res) = NULL; + chat("Got STRINGTABLE\n"); ;} break; case 9: -#line 505 "parser.y" +#line 500 "parser.y" {want_nl = 1; ;} break; case 10: -#line 505 "parser.y" +#line 500 "parser.y" { /* We *NEED* the newline to delimit the expression. * Otherwise, we would not be able to set the next @@ -2138,86 +2249,85 @@ yyreduce: yychar = YYEMPTY; /* Could use 'yyclearin', but we already need the*/ /* direct access to yychar in rule 'usrcvt' below. */ else if(yychar == tIDENT) - yywarning("LANGUAGE statement not delimited with newline; next identifier might be wrong"); + parser_warning("LANGUAGE statement not delimited with newline; next identifier might be wrong\n"); want_nl = 0; /* We don't want it anymore if we didn't get it */ if(!win32) - yywarning("LANGUAGE not supported in 16-bit mode"); - if(currentlanguage) - free(currentlanguage); - if (get_language_codepage(yyvsp[-2].num, yyvsp[0].num) == -1) - yyerror( "Language %04x is not supported", (yyvsp[0].num<<10) + yyvsp[-2].num); - currentlanguage = new_language(yyvsp[-2].num, yyvsp[0].num); - yyval.res = NULL; - chat("Got LANGUAGE %d,%d (0x%04x)", yyvsp[-2].num, yyvsp[0].num, (yyvsp[0].num<<10) + yyvsp[-2].num); + parser_warning("LANGUAGE not supported in 16-bit mode\n"); + free(currentlanguage); + if (get_language_codepage((yyvsp[-2].num), (yyvsp[0].num)) == -1) + parser_error( "Language %04x is not supported\n", ((yyvsp[0].num)<<10) + (yyvsp[-2].num)); + currentlanguage = new_language((yyvsp[-2].num), (yyvsp[0].num)); + (yyval.res) = NULL; + chat("Got LANGUAGE %d,%d (0x%04x)\n", (yyvsp[-2].num), (yyvsp[0].num), ((yyvsp[0].num)<<10) + (yyvsp[-2].num)); ;} break; case 11: -#line 549 "parser.y" +#line 543 "parser.y" { yychar = rsrcid_to_token(yychar); ;} break; case 12: -#line 555 "parser.y" +#line 549 "parser.y" { - if(yyvsp[0].num > 65535 || yyvsp[0].num < -32768) - yyerror("Resource's ID out of range (%d)", yyvsp[0].num); - yyval.nid = new_name_id(); - yyval.nid->type = name_ord; - yyval.nid->name.i_name = yyvsp[0].num; + if((yyvsp[0].num) > 65535 || (yyvsp[0].num) < -32768) + parser_error("Resource's ID out of range (%d)\n", (yyvsp[0].num)); + (yyval.nid) = new_name_id(); + (yyval.nid)->type = name_ord; + (yyval.nid)->name.i_name = (yyvsp[0].num); ;} break; case 13: -#line 562 "parser.y" +#line 556 "parser.y" { - yyval.nid = new_name_id(); - yyval.nid->type = name_str; - yyval.nid->name.s_name = yyvsp[0].str; + (yyval.nid) = new_name_id(); + (yyval.nid)->type = name_str; + (yyval.nid)->name.s_name = (yyvsp[0].str); ;} break; case 14: -#line 572 "parser.y" - { yyval.nid = yyvsp[0].nid; ;} +#line 566 "parser.y" + { (yyval.nid) = (yyvsp[0].nid); ;} break; case 15: -#line 573 "parser.y" +#line 567 "parser.y" { - yyval.nid = new_name_id(); - yyval.nid->type = name_str; - yyval.nid->name.s_name = yyvsp[0].str; + (yyval.nid) = new_name_id(); + (yyval.nid)->type = name_str; + (yyval.nid)->name.s_name = (yyvsp[0].str); ;} break; case 16: -#line 582 "parser.y" - { yyval.res = new_resource(res_acc, yyvsp[0].acc, yyvsp[0].acc->memopt, yyvsp[0].acc->lvc.language); ;} +#line 576 "parser.y" + { (yyval.res) = new_resource(res_acc, (yyvsp[0].acc), (yyvsp[0].acc)->memopt, (yyvsp[0].acc)->lvc.language); ;} break; case 17: -#line 583 "parser.y" - { yyval.res = new_resource(res_bmp, yyvsp[0].bmp, yyvsp[0].bmp->memopt, yyvsp[0].bmp->data->lvc.language); ;} +#line 577 "parser.y" + { (yyval.res) = new_resource(res_bmp, (yyvsp[0].bmp), (yyvsp[0].bmp)->memopt, (yyvsp[0].bmp)->data->lvc.language); ;} break; case 18: -#line 584 "parser.y" +#line 578 "parser.y" { resource_t *rsc; - if(yyvsp[0].ani->type == res_anicur) + if((yyvsp[0].ani)->type == res_anicur) { - yyval.res = rsc = new_resource(res_anicur, yyvsp[0].ani->u.ani, yyvsp[0].ani->u.ani->memopt, yyvsp[0].ani->u.ani->data->lvc.language); + (yyval.res) = rsc = new_resource(res_anicur, (yyvsp[0].ani)->u.ani, (yyvsp[0].ani)->u.ani->memopt, (yyvsp[0].ani)->u.ani->data->lvc.language); } - else if(yyvsp[0].ani->type == res_curg) + else if((yyvsp[0].ani)->type == res_curg) { cursor_t *cur; - yyval.res = rsc = new_resource(res_curg, yyvsp[0].ani->u.curg, yyvsp[0].ani->u.curg->memopt, yyvsp[0].ani->u.curg->lvc.language); - for(cur = yyvsp[0].ani->u.curg->cursorlist; cur; cur = cur->next) + (yyval.res) = rsc = new_resource(res_curg, (yyvsp[0].ani)->u.curg, (yyvsp[0].ani)->u.curg->memopt, (yyvsp[0].ani)->u.curg->lvc.language); + for(cur = (yyvsp[0].ani)->u.curg->cursorlist; cur; cur = cur->next) { - rsc->prev = new_resource(res_cur, cur, yyvsp[0].ani->u.curg->memopt, yyvsp[0].ani->u.curg->lvc.language); + rsc->prev = new_resource(res_cur, cur, (yyvsp[0].ani)->u.curg->memopt, (yyvsp[0].ani)->u.curg->lvc.language); rsc->prev->next = rsc; rsc = rsc->prev; rsc->name = new_name_id(); @@ -2226,56 +2336,56 @@ yyreduce: } } else - internal_error(__FILE__, __LINE__, "Invalid top-level type %d in cursor resource", yyvsp[0].ani->type); - free(yyvsp[0].ani); + internal_error(__FILE__, __LINE__, "Invalid top-level type %d in cursor resource\n", (yyvsp[0].ani)->type); + free((yyvsp[0].ani)); ;} break; case 19: -#line 608 "parser.y" - { yyval.res = new_resource(res_dlg, yyvsp[0].dlg, yyvsp[0].dlg->memopt, yyvsp[0].dlg->lvc.language); ;} +#line 602 "parser.y" + { (yyval.res) = new_resource(res_dlg, (yyvsp[0].dlg), (yyvsp[0].dlg)->memopt, (yyvsp[0].dlg)->lvc.language); ;} break; case 20: -#line 609 "parser.y" +#line 603 "parser.y" { if(win32) - yyval.res = new_resource(res_dlgex, yyvsp[0].dlgex, yyvsp[0].dlgex->memopt, yyvsp[0].dlgex->lvc.language); + (yyval.res) = new_resource(res_dlgex, (yyvsp[0].dlgex), (yyvsp[0].dlgex)->memopt, (yyvsp[0].dlgex)->lvc.language); else - yyval.res = NULL; + (yyval.res) = NULL; ;} break; case 21: -#line 615 "parser.y" - { yyval.res = new_resource(res_dlginit, yyvsp[0].dginit, yyvsp[0].dginit->memopt, yyvsp[0].dginit->data->lvc.language); ;} +#line 609 "parser.y" + { (yyval.res) = new_resource(res_dlginit, (yyvsp[0].dginit), (yyvsp[0].dginit)->memopt, (yyvsp[0].dginit)->data->lvc.language); ;} break; case 22: -#line 616 "parser.y" - { yyval.res = new_resource(res_fnt, yyvsp[0].fnt, yyvsp[0].fnt->memopt, yyvsp[0].fnt->data->lvc.language); ;} +#line 610 "parser.y" + { (yyval.res) = new_resource(res_fnt, (yyvsp[0].fnt), (yyvsp[0].fnt)->memopt, (yyvsp[0].fnt)->data->lvc.language); ;} break; case 23: -#line 617 "parser.y" - { yyval.res = new_resource(res_fntdir, yyvsp[0].fnd, yyvsp[0].fnd->memopt, yyvsp[0].fnd->data->lvc.language); ;} +#line 611 "parser.y" + { (yyval.res) = new_resource(res_fntdir, (yyvsp[0].fnd), (yyvsp[0].fnd)->memopt, (yyvsp[0].fnd)->data->lvc.language); ;} break; case 24: -#line 618 "parser.y" +#line 612 "parser.y" { resource_t *rsc; - if(yyvsp[0].ani->type == res_aniico) + if((yyvsp[0].ani)->type == res_aniico) { - yyval.res = rsc = new_resource(res_aniico, yyvsp[0].ani->u.ani, yyvsp[0].ani->u.ani->memopt, yyvsp[0].ani->u.ani->data->lvc.language); + (yyval.res) = rsc = new_resource(res_aniico, (yyvsp[0].ani)->u.ani, (yyvsp[0].ani)->u.ani->memopt, (yyvsp[0].ani)->u.ani->data->lvc.language); } - else if(yyvsp[0].ani->type == res_icog) + else if((yyvsp[0].ani)->type == res_icog) { icon_t *ico; - yyval.res = rsc = new_resource(res_icog, yyvsp[0].ani->u.icog, yyvsp[0].ani->u.icog->memopt, yyvsp[0].ani->u.icog->lvc.language); - for(ico = yyvsp[0].ani->u.icog->iconlist; ico; ico = ico->next) + (yyval.res) = rsc = new_resource(res_icog, (yyvsp[0].ani)->u.icog, (yyvsp[0].ani)->u.icog->memopt, (yyvsp[0].ani)->u.icog->lvc.language); + for(ico = (yyvsp[0].ani)->u.icog->iconlist; ico; ico = ico->next) { - rsc->prev = new_resource(res_ico, ico, yyvsp[0].ani->u.icog->memopt, yyvsp[0].ani->u.icog->lvc.language); + rsc->prev = new_resource(res_ico, ico, (yyvsp[0].ani)->u.icog->memopt, (yyvsp[0].ani)->u.icog->lvc.language); rsc->prev->next = rsc; rsc = rsc->prev; rsc->name = new_name_id(); @@ -2284,1248 +2394,1244 @@ yyreduce: } } else - internal_error(__FILE__, __LINE__, "Invalid top-level type %d in icon resource", yyvsp[0].ani->type); - free(yyvsp[0].ani); + internal_error(__FILE__, __LINE__, "Invalid top-level type %d in icon resource\n", (yyvsp[0].ani)->type); + free((yyvsp[0].ani)); ;} break; case 25: -#line 642 "parser.y" - { yyval.res = new_resource(res_men, yyvsp[0].men, yyvsp[0].men->memopt, yyvsp[0].men->lvc.language); ;} +#line 636 "parser.y" + { (yyval.res) = new_resource(res_men, (yyvsp[0].men), (yyvsp[0].men)->memopt, (yyvsp[0].men)->lvc.language); ;} break; case 26: -#line 643 "parser.y" +#line 637 "parser.y" { if(win32) - yyval.res = new_resource(res_menex, yyvsp[0].menex, yyvsp[0].menex->memopt, yyvsp[0].menex->lvc.language); + (yyval.res) = new_resource(res_menex, (yyvsp[0].menex), (yyvsp[0].menex)->memopt, (yyvsp[0].menex)->lvc.language); else - yyval.res = NULL; + (yyval.res) = NULL; ;} break; case 27: -#line 649 "parser.y" - { yyval.res = new_resource(res_msg, yyvsp[0].msg, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, yyvsp[0].msg->data->lvc.language); ;} +#line 643 "parser.y" + { (yyval.res) = new_resource(res_msg, (yyvsp[0].msg), WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, (yyvsp[0].msg)->data->lvc.language); ;} break; case 28: -#line 650 "parser.y" - { yyval.res = new_resource(res_html, yyvsp[0].html, yyvsp[0].html->memopt, yyvsp[0].html->data->lvc.language); ;} +#line 644 "parser.y" + { (yyval.res) = new_resource(res_html, (yyvsp[0].html), (yyvsp[0].html)->memopt, (yyvsp[0].html)->data->lvc.language); ;} break; case 29: -#line 651 "parser.y" - { yyval.res = new_resource(res_rdt, yyvsp[0].rdt, yyvsp[0].rdt->memopt, yyvsp[0].rdt->data->lvc.language); ;} +#line 645 "parser.y" + { (yyval.res) = new_resource(res_rdt, (yyvsp[0].rdt), (yyvsp[0].rdt)->memopt, (yyvsp[0].rdt)->data->lvc.language); ;} break; case 30: -#line 652 "parser.y" - { yyval.res = new_resource(res_toolbar, yyvsp[0].tlbar, yyvsp[0].tlbar->memopt, yyvsp[0].tlbar->lvc.language); ;} +#line 646 "parser.y" + { (yyval.res) = new_resource(res_toolbar, (yyvsp[0].tlbar), (yyvsp[0].tlbar)->memopt, (yyvsp[0].tlbar)->lvc.language); ;} break; case 31: -#line 653 "parser.y" - { yyval.res = new_resource(res_usr, yyvsp[0].usr, yyvsp[0].usr->memopt, yyvsp[0].usr->data->lvc.language); ;} +#line 647 "parser.y" + { (yyval.res) = new_resource(res_usr, (yyvsp[0].usr), (yyvsp[0].usr)->memopt, (yyvsp[0].usr)->data->lvc.language); ;} break; case 32: -#line 654 "parser.y" - { yyval.res = new_resource(res_ver, yyvsp[0].veri, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, yyvsp[0].veri->lvc.language); ;} +#line 648 "parser.y" + { (yyval.res) = new_resource(res_ver, (yyvsp[0].veri), WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, (yyvsp[0].veri)->lvc.language); ;} break; case 33: -#line 658 "parser.y" - { yyval.str = make_filename(yyvsp[0].str); ;} +#line 652 "parser.y" + { (yyval.str) = make_filename((yyvsp[0].str)); ;} break; case 34: -#line 659 "parser.y" - { yyval.str = make_filename(yyvsp[0].str); ;} +#line 653 "parser.y" + { (yyval.str) = make_filename((yyvsp[0].str)); ;} break; case 35: -#line 660 "parser.y" - { yyval.str = make_filename(yyvsp[0].str); ;} +#line 654 "parser.y" + { (yyval.str) = make_filename((yyvsp[0].str)); ;} break; case 36: -#line 664 "parser.y" - { yyval.bmp = new_bitmap(yyvsp[0].raw, yyvsp[-1].iptr); ;} +#line 658 "parser.y" + { (yyval.bmp) = new_bitmap((yyvsp[0].raw), (yyvsp[-1].iptr)); ;} break; case 37: -#line 668 "parser.y" +#line 662 "parser.y" { - yyval.ani = new_ani_any(); - if(yyvsp[0].raw->size > 4 && !memcmp(yyvsp[0].raw->data, riff, sizeof(riff))) + (yyval.ani) = new_ani_any(); + if((yyvsp[0].raw)->size > 4 && !memcmp((yyvsp[0].raw)->data, riff, sizeof(riff))) { - yyval.ani->type = res_anicur; - yyval.ani->u.ani = new_ani_curico(res_anicur, yyvsp[0].raw, yyvsp[-1].iptr); + (yyval.ani)->type = res_anicur; + (yyval.ani)->u.ani = new_ani_curico(res_anicur, (yyvsp[0].raw), (yyvsp[-1].iptr)); } else { - yyval.ani->type = res_curg; - yyval.ani->u.curg = new_cursor_group(yyvsp[0].raw, yyvsp[-1].iptr); + (yyval.ani)->type = res_curg; + (yyval.ani)->u.curg = new_cursor_group((yyvsp[0].raw), (yyvsp[-1].iptr)); } ;} break; case 38: -#line 684 "parser.y" +#line 678 "parser.y" { - yyval.ani = new_ani_any(); - if(yyvsp[0].raw->size > 4 && !memcmp(yyvsp[0].raw->data, riff, sizeof(riff))) + (yyval.ani) = new_ani_any(); + if((yyvsp[0].raw)->size > 4 && !memcmp((yyvsp[0].raw)->data, riff, sizeof(riff))) { - yyval.ani->type = res_aniico; - yyval.ani->u.ani = new_ani_curico(res_aniico, yyvsp[0].raw, yyvsp[-1].iptr); + (yyval.ani)->type = res_aniico; + (yyval.ani)->u.ani = new_ani_curico(res_aniico, (yyvsp[0].raw), (yyvsp[-1].iptr)); } else { - yyval.ani->type = res_icog; - yyval.ani->u.icog = new_icon_group(yyvsp[0].raw, yyvsp[-1].iptr); + (yyval.ani)->type = res_icog; + (yyval.ani)->u.icog = new_icon_group((yyvsp[0].raw), (yyvsp[-1].iptr)); } ;} break; case 39: -#line 706 "parser.y" - { yyval.fnt = new_font(yyvsp[0].raw, yyvsp[-1].iptr); ;} +#line 700 "parser.y" + { (yyval.fnt) = new_font((yyvsp[0].raw), (yyvsp[-1].iptr)); ;} break; case 40: -#line 716 "parser.y" - { yyval.fnd = new_fontdir(yyvsp[0].raw, yyvsp[-1].iptr); ;} +#line 710 "parser.y" + { (yyval.fnd) = new_fontdir((yyvsp[0].raw), (yyvsp[-1].iptr)); ;} break; case 41: -#line 724 "parser.y" +#line 718 "parser.y" { if(!win32) - yywarning("MESSAGETABLE not supported in 16-bit mode"); - yyval.msg = new_messagetable(yyvsp[0].raw, yyvsp[-1].iptr); + parser_warning("MESSAGETABLE not supported in 16-bit mode\n"); + (yyval.msg) = new_messagetable((yyvsp[0].raw), (yyvsp[-1].iptr)); ;} break; case 42: -#line 732 "parser.y" - { yyval.html = new_html(yyvsp[0].raw, yyvsp[-1].iptr); ;} +#line 726 "parser.y" + { (yyval.html) = new_html((yyvsp[0].raw), (yyvsp[-1].iptr)); ;} break; case 43: -#line 736 "parser.y" - { yyval.rdt = new_rcdata(yyvsp[0].raw, yyvsp[-1].iptr); ;} +#line 730 "parser.y" + { (yyval.rdt) = new_rcdata((yyvsp[0].raw), (yyvsp[-1].iptr)); ;} break; case 44: -#line 740 "parser.y" - { yyval.dginit = new_dlginit(yyvsp[0].raw, yyvsp[-1].iptr); ;} +#line 734 "parser.y" + { (yyval.dginit) = new_dlginit((yyvsp[0].raw), (yyvsp[-1].iptr)); ;} break; case 45: -#line 744 "parser.y" +#line 738 "parser.y" { #ifdef WORDS_BIGENDIAN if(pedantic && byteorder != WRC_BO_LITTLE) #else if(pedantic && byteorder == WRC_BO_BIG) #endif - yywarning("Byteordering is not little-endian and type cannot be interpreted"); - yyval.usr = new_user(yyvsp[-2].nid, yyvsp[0].raw, yyvsp[-1].iptr); + parser_warning("Byteordering is not little-endian and type cannot be interpreted\n"); + (yyval.usr) = new_user((yyvsp[-2].nid), (yyvsp[0].raw), (yyvsp[-1].iptr)); ;} break; case 46: -#line 755 "parser.y" +#line 749 "parser.y" { - yyval.nid = new_name_id(); - yyval.nid->type = name_ord; - yyval.nid->name.i_name = yyvsp[0].num; + (yyval.nid) = new_name_id(); + (yyval.nid)->type = name_ord; + (yyval.nid)->name.i_name = (yyvsp[0].num); ;} break; case 47: -#line 760 "parser.y" +#line 754 "parser.y" { - yyval.nid = new_name_id(); - yyval.nid->type = name_str; - yyval.nid->name.s_name = yyvsp[0].str; + (yyval.nid) = new_name_id(); + (yyval.nid)->type = name_str; + (yyval.nid)->name.s_name = (yyvsp[0].str); ;} break; case 48: -#line 769 "parser.y" +#line 763 "parser.y" { - yyval.acc = new_accelerator(); - if(yyvsp[-4].iptr) + (yyval.acc) = new_accelerator(); + if((yyvsp[-4].iptr)) { - yyval.acc->memopt = *(yyvsp[-4].iptr); - free(yyvsp[-4].iptr); + (yyval.acc)->memopt = *((yyvsp[-4].iptr)); + free((yyvsp[-4].iptr)); } else { - yyval.acc->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE; + (yyval.acc)->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE; } - if(!yyvsp[-1].event) - yyerror("Accelerator table must have at least one entry"); - yyval.acc->events = get_event_head(yyvsp[-1].event); - if(yyvsp[-3].lvc) + if(!(yyvsp[-1].event)) + parser_error("Accelerator table must have at least one entry\n"); + (yyval.acc)->events = get_event_head((yyvsp[-1].event)); + if((yyvsp[-3].lvc)) { - yyval.acc->lvc = *(yyvsp[-3].lvc); - free(yyvsp[-3].lvc); + (yyval.acc)->lvc = *((yyvsp[-3].lvc)); + free((yyvsp[-3].lvc)); } - if(!yyval.acc->lvc.language) - yyval.acc->lvc.language = dup_language(currentlanguage); + if(!(yyval.acc)->lvc.language) + (yyval.acc)->lvc.language = dup_language(currentlanguage); ;} break; case 49: -#line 793 "parser.y" - { yyval.event=NULL; ;} +#line 787 "parser.y" + { (yyval.event)=NULL; ;} break; case 50: -#line 794 "parser.y" - { yyval.event=add_string_event(yyvsp[-3].str, yyvsp[-1].num, yyvsp[0].num, yyvsp[-4].event); ;} +#line 788 "parser.y" + { (yyval.event)=add_string_event((yyvsp[-3].str), (yyvsp[-1].num), (yyvsp[0].num), (yyvsp[-4].event)); ;} break; case 51: -#line 795 "parser.y" - { yyval.event=add_event(yyvsp[-3].num, yyvsp[-1].num, yyvsp[0].num, yyvsp[-4].event); ;} +#line 789 "parser.y" + { (yyval.event)=add_event((yyvsp[-3].num), (yyvsp[-1].num), (yyvsp[0].num), (yyvsp[-4].event)); ;} break; case 52: -#line 804 "parser.y" - { yyval.num = 0; ;} +#line 798 "parser.y" + { (yyval.num) = 0; ;} break; case 53: -#line 805 "parser.y" - { yyval.num = yyvsp[0].num; ;} +#line 799 "parser.y" + { (yyval.num) = (yyvsp[0].num); ;} break; case 54: -#line 808 "parser.y" - { yyval.num = yyvsp[0].num; ;} +#line 802 "parser.y" + { (yyval.num) = (yyvsp[0].num); ;} break; case 55: -#line 809 "parser.y" - { yyval.num = yyvsp[-2].num | yyvsp[0].num; ;} +#line 803 "parser.y" + { (yyval.num) = (yyvsp[-2].num) | (yyvsp[0].num); ;} break; case 56: -#line 812 "parser.y" - { yyval.num = WRC_AF_NOINVERT; ;} +#line 806 "parser.y" + { (yyval.num) = WRC_AF_NOINVERT; ;} break; case 57: -#line 813 "parser.y" - { yyval.num = WRC_AF_SHIFT; ;} +#line 807 "parser.y" + { (yyval.num) = WRC_AF_SHIFT; ;} break; case 58: -#line 814 "parser.y" - { yyval.num = WRC_AF_CONTROL; ;} +#line 808 "parser.y" + { (yyval.num) = WRC_AF_CONTROL; ;} break; case 59: -#line 815 "parser.y" - { yyval.num = WRC_AF_ALT; ;} +#line 809 "parser.y" + { (yyval.num) = WRC_AF_ALT; ;} break; case 60: -#line 816 "parser.y" - { yyval.num = WRC_AF_ASCII; ;} +#line 810 "parser.y" + { (yyval.num) = WRC_AF_ASCII; ;} break; case 61: -#line 817 "parser.y" - { yyval.num = WRC_AF_VIRTKEY; ;} +#line 811 "parser.y" + { (yyval.num) = WRC_AF_VIRTKEY; ;} break; case 62: -#line 823 "parser.y" +#line 817 "parser.y" { - if(yyvsp[-11].iptr) + if((yyvsp[-11].iptr)) { - yyvsp[-3].dlg->memopt = *(yyvsp[-11].iptr); - free(yyvsp[-11].iptr); + (yyvsp[-3].dlg)->memopt = *((yyvsp[-11].iptr)); + free((yyvsp[-11].iptr)); } else - yyvsp[-3].dlg->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE; - yyvsp[-3].dlg->x = yyvsp[-10].num; - yyvsp[-3].dlg->y = yyvsp[-8].num; - yyvsp[-3].dlg->width = yyvsp[-6].num; - yyvsp[-3].dlg->height = yyvsp[-4].num; - yyvsp[-3].dlg->controls = get_control_head(yyvsp[-1].ctl); - yyval.dlg = yyvsp[-3].dlg; - if(!yyval.dlg->gotstyle) + (yyvsp[-3].dlg)->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE; + (yyvsp[-3].dlg)->x = (yyvsp[-10].num); + (yyvsp[-3].dlg)->y = (yyvsp[-8].num); + (yyvsp[-3].dlg)->width = (yyvsp[-6].num); + (yyvsp[-3].dlg)->height = (yyvsp[-4].num); + (yyvsp[-3].dlg)->controls = get_control_head((yyvsp[-1].ctl)); + (yyval.dlg) = (yyvsp[-3].dlg); + if(!(yyval.dlg)->gotstyle) { - yyval.dlg->style = new_style(0,0); - yyval.dlg->style->or_mask = WS_POPUP; - yyval.dlg->gotstyle = TRUE; + (yyval.dlg)->style = new_style(0,0); + (yyval.dlg)->style->or_mask = WS_POPUP; + (yyval.dlg)->gotstyle = TRUE; } - if(yyval.dlg->title) - yyval.dlg->style->or_mask |= WS_CAPTION; - if(yyval.dlg->font) - yyval.dlg->style->or_mask |= DS_SETFONT; + if((yyval.dlg)->title) + (yyval.dlg)->style->or_mask |= WS_CAPTION; + if((yyval.dlg)->font) + (yyval.dlg)->style->or_mask |= DS_SETFONT; - yyval.dlg->style->or_mask &= ~(yyval.dlg->style->and_mask); - yyval.dlg->style->and_mask = 0; + (yyval.dlg)->style->or_mask &= ~((yyval.dlg)->style->and_mask); + (yyval.dlg)->style->and_mask = 0; - if(!yyval.dlg->lvc.language) - yyval.dlg->lvc.language = dup_language(currentlanguage); + if(!(yyval.dlg)->lvc.language) + (yyval.dlg)->lvc.language = dup_language(currentlanguage); ;} break; case 63: -#line 857 "parser.y" - { yyval.dlg=new_dialog(); ;} +#line 851 "parser.y" + { (yyval.dlg)=new_dialog(); ;} break; case 64: -#line 858 "parser.y" - { yyval.dlg=dialog_style(yyvsp[0].style,yyvsp[-2].dlg); ;} +#line 852 "parser.y" + { (yyval.dlg)=dialog_style((yyvsp[0].style),(yyvsp[-2].dlg)); ;} break; case 65: -#line 859 "parser.y" - { yyval.dlg=dialog_exstyle(yyvsp[0].style,yyvsp[-2].dlg); ;} +#line 853 "parser.y" + { (yyval.dlg)=dialog_exstyle((yyvsp[0].style),(yyvsp[-2].dlg)); ;} break; case 66: -#line 860 "parser.y" - { yyval.dlg=dialog_caption(yyvsp[0].str,yyvsp[-2].dlg); ;} +#line 854 "parser.y" + { (yyval.dlg)=dialog_caption((yyvsp[0].str),(yyvsp[-2].dlg)); ;} break; case 67: -#line 861 "parser.y" - { yyval.dlg=dialog_font(yyvsp[0].fntid,yyvsp[-1].dlg); ;} +#line 855 "parser.y" + { (yyval.dlg)=dialog_font((yyvsp[0].fntid),(yyvsp[-1].dlg)); ;} break; case 68: -#line 862 "parser.y" - { yyval.dlg=dialog_class(yyvsp[0].nid,yyvsp[-2].dlg); ;} +#line 856 "parser.y" + { (yyval.dlg)=dialog_class((yyvsp[0].nid),(yyvsp[-2].dlg)); ;} break; case 69: -#line 863 "parser.y" - { yyval.dlg=dialog_menu(yyvsp[0].nid,yyvsp[-2].dlg); ;} +#line 857 "parser.y" + { (yyval.dlg)=dialog_menu((yyvsp[0].nid),(yyvsp[-2].dlg)); ;} break; case 70: -#line 864 "parser.y" - { yyval.dlg=dialog_language(yyvsp[0].lan,yyvsp[-1].dlg); ;} +#line 858 "parser.y" + { (yyval.dlg)=dialog_language((yyvsp[0].lan),(yyvsp[-1].dlg)); ;} break; case 71: -#line 865 "parser.y" - { yyval.dlg=dialog_characteristics(yyvsp[0].chars,yyvsp[-1].dlg); ;} +#line 859 "parser.y" + { (yyval.dlg)=dialog_characteristics((yyvsp[0].chars),(yyvsp[-1].dlg)); ;} break; case 72: -#line 866 "parser.y" - { yyval.dlg=dialog_version(yyvsp[0].ver,yyvsp[-1].dlg); ;} +#line 860 "parser.y" + { (yyval.dlg)=dialog_version((yyvsp[0].ver),(yyvsp[-1].dlg)); ;} break; case 73: -#line 869 "parser.y" - { yyval.ctl = NULL; ;} +#line 863 "parser.y" + { (yyval.ctl) = NULL; ;} break; case 74: -#line 870 "parser.y" - { yyval.ctl=ins_ctrl(-1, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 864 "parser.y" + { (yyval.ctl)=ins_ctrl(-1, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 75: -#line 871 "parser.y" - { yyval.ctl=ins_ctrl(CT_EDIT, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 865 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_EDIT, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 76: -#line 872 "parser.y" - { yyval.ctl=ins_ctrl(CT_LISTBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 866 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_LISTBOX, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 77: -#line 873 "parser.y" - { yyval.ctl=ins_ctrl(CT_COMBOBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 867 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_COMBOBOX, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 78: -#line 874 "parser.y" - { yyval.ctl=ins_ctrl(CT_SCROLLBAR, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 868 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_SCROLLBAR, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 79: -#line 875 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_CHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 869 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_CHECKBOX, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 80: -#line 876 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 870 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 81: -#line 877 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_GROUPBOX, yyvsp[0].ctl, yyvsp[-2].ctl);;} +#line 871 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_GROUPBOX, (yyvsp[0].ctl), (yyvsp[-2].ctl));;} break; case 82: -#line 878 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 872 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 83: -#line 880 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 874 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 84: -#line 881 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 875 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 85: -#line 882 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 876 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_3STATE, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 86: -#line 883 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 877 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 87: -#line 884 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 878 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 88: -#line 885 "parser.y" - { yyval.ctl=ins_ctrl(CT_STATIC, SS_LEFT, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 879 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_STATIC, SS_LEFT, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 89: -#line 886 "parser.y" - { yyval.ctl=ins_ctrl(CT_STATIC, SS_CENTER, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 880 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_STATIC, SS_CENTER, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 90: -#line 887 "parser.y" - { yyval.ctl=ins_ctrl(CT_STATIC, SS_RIGHT, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 881 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_STATIC, SS_RIGHT, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 91: -#line 889 "parser.y" +#line 883 "parser.y" { - yyvsp[0].ctl->title = yyvsp[-7].nid; - yyvsp[0].ctl->id = yyvsp[-5].num; - yyvsp[0].ctl->x = yyvsp[-3].num; - yyvsp[0].ctl->y = yyvsp[-1].num; - yyval.ctl = ins_ctrl(CT_STATIC, SS_ICON, yyvsp[0].ctl, yyvsp[-9].ctl); + (yyvsp[0].ctl)->title = (yyvsp[-7].nid); + (yyvsp[0].ctl)->id = (yyvsp[-5].num); + (yyvsp[0].ctl)->x = (yyvsp[-3].num); + (yyvsp[0].ctl)->y = (yyvsp[-1].num); + (yyval.ctl) = ins_ctrl(CT_STATIC, SS_ICON, (yyvsp[0].ctl), (yyvsp[-9].ctl)); ;} break; case 92: -#line 899 "parser.y" +#line 893 "parser.y" { - yyval.ctl=new_control(); - yyval.ctl->title = new_name_id(); - yyval.ctl->title->type = name_str; - yyval.ctl->title->name.s_name = yyvsp[-11].str; - yyval.ctl->id = yyvsp[-9].num; - yyval.ctl->x = yyvsp[-7].num; - yyval.ctl->y = yyvsp[-5].num; - yyval.ctl->width = yyvsp[-3].num; - yyval.ctl->height = yyvsp[-1].num; - if(yyvsp[0].styles) + (yyval.ctl)=new_control(); + (yyval.ctl)->title = (yyvsp[-11].nid); + (yyval.ctl)->id = (yyvsp[-9].num); + (yyval.ctl)->x = (yyvsp[-7].num); + (yyval.ctl)->y = (yyvsp[-5].num); + (yyval.ctl)->width = (yyvsp[-3].num); + (yyval.ctl)->height = (yyvsp[-1].num); + if((yyvsp[0].styles)) { - yyval.ctl->style = yyvsp[0].styles->style; - yyval.ctl->gotstyle = TRUE; - if (yyvsp[0].styles->exstyle) + (yyval.ctl)->style = (yyvsp[0].styles)->style; + (yyval.ctl)->gotstyle = TRUE; + if ((yyvsp[0].styles)->exstyle) { - yyval.ctl->exstyle = yyvsp[0].styles->exstyle; - yyval.ctl->gotexstyle = TRUE; + (yyval.ctl)->exstyle = (yyvsp[0].styles)->exstyle; + (yyval.ctl)->gotexstyle = TRUE; } - free(yyvsp[0].styles); + free((yyvsp[0].styles)); } ;} break; case 93: -#line 924 "parser.y" +#line 916 "parser.y" { - yyval.ctl = new_control(); - yyval.ctl->id = yyvsp[-9].num; - yyval.ctl->x = yyvsp[-7].num; - yyval.ctl->y = yyvsp[-5].num; - yyval.ctl->width = yyvsp[-3].num; - yyval.ctl->height = yyvsp[-1].num; - if(yyvsp[0].styles) + (yyval.ctl) = new_control(); + (yyval.ctl)->id = (yyvsp[-9].num); + (yyval.ctl)->x = (yyvsp[-7].num); + (yyval.ctl)->y = (yyvsp[-5].num); + (yyval.ctl)->width = (yyvsp[-3].num); + (yyval.ctl)->height = (yyvsp[-1].num); + if((yyvsp[0].styles)) { - yyval.ctl->style = yyvsp[0].styles->style; - yyval.ctl->gotstyle = TRUE; - if (yyvsp[0].styles->exstyle) + (yyval.ctl)->style = (yyvsp[0].styles)->style; + (yyval.ctl)->gotstyle = TRUE; + if ((yyvsp[0].styles)->exstyle) { - yyval.ctl->exstyle = yyvsp[0].styles->exstyle; - yyval.ctl->gotexstyle = TRUE; + (yyval.ctl)->exstyle = (yyvsp[0].styles)->exstyle; + (yyval.ctl)->gotexstyle = TRUE; } - free(yyvsp[0].styles); + free((yyvsp[0].styles)); } ;} break; case 94: -#line 946 "parser.y" - { yyval.ctl = new_control(); ;} +#line 938 "parser.y" + { (yyval.ctl) = new_control(); ;} break; case 95: -#line 948 "parser.y" +#line 940 "parser.y" { - yyval.ctl = new_control(); - yyval.ctl->width = yyvsp[-2].num; - yyval.ctl->height = yyvsp[0].num; + (yyval.ctl) = new_control(); + (yyval.ctl)->width = (yyvsp[-2].num); + (yyval.ctl)->height = (yyvsp[0].num); ;} break; case 96: -#line 953 "parser.y" +#line 945 "parser.y" { - yyval.ctl = new_control(); - yyval.ctl->width = yyvsp[-4].num; - yyval.ctl->height = yyvsp[-2].num; - yyval.ctl->style = yyvsp[0].style; - yyval.ctl->gotstyle = TRUE; + (yyval.ctl) = new_control(); + (yyval.ctl)->width = (yyvsp[-4].num); + (yyval.ctl)->height = (yyvsp[-2].num); + (yyval.ctl)->style = (yyvsp[0].style); + (yyval.ctl)->gotstyle = TRUE; ;} break; case 97: -#line 960 "parser.y" +#line 952 "parser.y" { - yyval.ctl = new_control(); - yyval.ctl->width = yyvsp[-6].num; - yyval.ctl->height = yyvsp[-4].num; - yyval.ctl->style = yyvsp[-2].style; - yyval.ctl->gotstyle = TRUE; - yyval.ctl->exstyle = yyvsp[0].style; - yyval.ctl->gotexstyle = TRUE; + (yyval.ctl) = new_control(); + (yyval.ctl)->width = (yyvsp[-6].num); + (yyval.ctl)->height = (yyvsp[-4].num); + (yyval.ctl)->style = (yyvsp[-2].style); + (yyval.ctl)->gotstyle = TRUE; + (yyval.ctl)->exstyle = (yyvsp[0].style); + (yyval.ctl)->gotexstyle = TRUE; ;} break; case 98: -#line 971 "parser.y" +#line 963 "parser.y" { - yyval.ctl=new_control(); - yyval.ctl->title = yyvsp[-16].nid; - yyval.ctl->id = yyvsp[-14].num; - yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-12].nid); - yyval.ctl->style = yyvsp[-10].style; - yyval.ctl->gotstyle = TRUE; - yyval.ctl->x = yyvsp[-8].num; - yyval.ctl->y = yyvsp[-6].num; - yyval.ctl->width = yyvsp[-4].num; - yyval.ctl->height = yyvsp[-2].num; - yyval.ctl->exstyle = yyvsp[0].style; - yyval.ctl->gotexstyle = TRUE; + (yyval.ctl)=new_control(); + (yyval.ctl)->title = (yyvsp[-16].nid); + (yyval.ctl)->id = (yyvsp[-14].num); + (yyval.ctl)->ctlclass = convert_ctlclass((yyvsp[-12].nid)); + (yyval.ctl)->style = (yyvsp[-10].style); + (yyval.ctl)->gotstyle = TRUE; + (yyval.ctl)->x = (yyvsp[-8].num); + (yyval.ctl)->y = (yyvsp[-6].num); + (yyval.ctl)->width = (yyvsp[-4].num); + (yyval.ctl)->height = (yyvsp[-2].num); + (yyval.ctl)->exstyle = (yyvsp[0].style); + (yyval.ctl)->gotexstyle = TRUE; ;} break; case 99: -#line 985 "parser.y" +#line 977 "parser.y" { - yyval.ctl=new_control(); - yyval.ctl->title = yyvsp[-14].nid; - yyval.ctl->id = yyvsp[-12].num; - yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-10].nid); - yyval.ctl->style = yyvsp[-8].style; - yyval.ctl->gotstyle = TRUE; - yyval.ctl->x = yyvsp[-6].num; - yyval.ctl->y = yyvsp[-4].num; - yyval.ctl->width = yyvsp[-2].num; - yyval.ctl->height = yyvsp[0].num; + (yyval.ctl)=new_control(); + (yyval.ctl)->title = (yyvsp[-14].nid); + (yyval.ctl)->id = (yyvsp[-12].num); + (yyval.ctl)->ctlclass = convert_ctlclass((yyvsp[-10].nid)); + (yyval.ctl)->style = (yyvsp[-8].style); + (yyval.ctl)->gotstyle = TRUE; + (yyval.ctl)->x = (yyvsp[-6].num); + (yyval.ctl)->y = (yyvsp[-4].num); + (yyval.ctl)->width = (yyvsp[-2].num); + (yyval.ctl)->height = (yyvsp[0].num); ;} break; case 100: -#line 1000 "parser.y" - { yyval.fntid = new_font_id(yyvsp[-2].num, yyvsp[0].str, 0, 0); ;} +#line 992 "parser.y" + { (yyval.fntid) = new_font_id((yyvsp[-2].num), (yyvsp[0].str), 0, 0); ;} break; case 101: -#line 1005 "parser.y" - { yyval.styles = NULL; ;} +#line 997 "parser.y" + { (yyval.styles) = NULL; ;} break; case 102: -#line 1006 "parser.y" - { yyval.styles = new_style_pair(yyvsp[0].style, 0); ;} +#line 998 "parser.y" + { (yyval.styles) = new_style_pair((yyvsp[0].style), 0); ;} break; case 103: -#line 1007 "parser.y" - { yyval.styles = new_style_pair(yyvsp[-2].style, yyvsp[0].style); ;} +#line 999 "parser.y" + { (yyval.styles) = new_style_pair((yyvsp[-2].style), (yyvsp[0].style)); ;} break; case 104: -#line 1011 "parser.y" - { yyval.style = new_style(yyvsp[-2].style->or_mask | yyvsp[0].style->or_mask, yyvsp[-2].style->and_mask | yyvsp[0].style->and_mask); free(yyvsp[-2].style); free(yyvsp[0].style);;} +#line 1003 "parser.y" + { (yyval.style) = new_style((yyvsp[-2].style)->or_mask | (yyvsp[0].style)->or_mask, (yyvsp[-2].style)->and_mask | (yyvsp[0].style)->and_mask); free((yyvsp[-2].style)); free((yyvsp[0].style));;} break; case 105: -#line 1012 "parser.y" - { yyval.style = yyvsp[-1].style; ;} +#line 1004 "parser.y" + { (yyval.style) = (yyvsp[-1].style); ;} break; case 106: -#line 1013 "parser.y" - { yyval.style = new_style(yyvsp[0].num, 0); ;} +#line 1005 "parser.y" + { (yyval.style) = new_style((yyvsp[0].num), 0); ;} break; case 107: -#line 1014 "parser.y" - { yyval.style = new_style(0, yyvsp[0].num); ;} +#line 1006 "parser.y" + { (yyval.style) = new_style(0, (yyvsp[0].num)); ;} break; case 108: -#line 1018 "parser.y" +#line 1010 "parser.y" { - yyval.nid = new_name_id(); - yyval.nid->type = name_ord; - yyval.nid->name.i_name = yyvsp[0].num; + (yyval.nid) = new_name_id(); + (yyval.nid)->type = name_ord; + (yyval.nid)->name.i_name = (yyvsp[0].num); ;} break; case 109: -#line 1023 "parser.y" +#line 1015 "parser.y" { - yyval.nid = new_name_id(); - yyval.nid->type = name_str; - yyval.nid->name.s_name = yyvsp[0].str; + (yyval.nid) = new_name_id(); + (yyval.nid)->type = name_str; + (yyval.nid)->name.s_name = (yyvsp[0].str); ;} break; case 110: -#line 1032 "parser.y" +#line 1024 "parser.y" { if(!win32) - yywarning("DIALOGEX not supported in 16-bit mode"); - if(yyvsp[-12].iptr) + parser_warning("DIALOGEX not supported in 16-bit mode\n"); + if((yyvsp[-12].iptr)) { - yyvsp[-3].dlgex->memopt = *(yyvsp[-12].iptr); - free(yyvsp[-12].iptr); + (yyvsp[-3].dlgex)->memopt = *((yyvsp[-12].iptr)); + free((yyvsp[-12].iptr)); } else - yyvsp[-3].dlgex->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE; - yyvsp[-3].dlgex->x = yyvsp[-11].num; - yyvsp[-3].dlgex->y = yyvsp[-9].num; - yyvsp[-3].dlgex->width = yyvsp[-7].num; - yyvsp[-3].dlgex->height = yyvsp[-5].num; - if(yyvsp[-4].iptr) + (yyvsp[-3].dlgex)->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE; + (yyvsp[-3].dlgex)->x = (yyvsp[-11].num); + (yyvsp[-3].dlgex)->y = (yyvsp[-9].num); + (yyvsp[-3].dlgex)->width = (yyvsp[-7].num); + (yyvsp[-3].dlgex)->height = (yyvsp[-5].num); + if((yyvsp[-4].iptr)) { - yyvsp[-3].dlgex->helpid = *(yyvsp[-4].iptr); - yyvsp[-3].dlgex->gothelpid = TRUE; - free(yyvsp[-4].iptr); + (yyvsp[-3].dlgex)->helpid = *((yyvsp[-4].iptr)); + (yyvsp[-3].dlgex)->gothelpid = TRUE; + free((yyvsp[-4].iptr)); } - yyvsp[-3].dlgex->controls = get_control_head(yyvsp[-1].ctl); - yyval.dlgex = yyvsp[-3].dlgex; + (yyvsp[-3].dlgex)->controls = get_control_head((yyvsp[-1].ctl)); + (yyval.dlgex) = (yyvsp[-3].dlgex); - assert(yyval.dlgex->style != NULL); - if(!yyval.dlgex->gotstyle) + assert((yyval.dlgex)->style != NULL); + if(!(yyval.dlgex)->gotstyle) { - yyval.dlgex->style->or_mask = WS_POPUP; - yyval.dlgex->gotstyle = TRUE; + (yyval.dlgex)->style->or_mask = WS_POPUP; + (yyval.dlgex)->gotstyle = TRUE; } - if(yyval.dlgex->title) - yyval.dlgex->style->or_mask |= WS_CAPTION; - if(yyval.dlgex->font) - yyval.dlgex->style->or_mask |= DS_SETFONT; + if((yyval.dlgex)->title) + (yyval.dlgex)->style->or_mask |= WS_CAPTION; + if((yyval.dlgex)->font) + (yyval.dlgex)->style->or_mask |= DS_SETFONT; - yyval.dlgex->style->or_mask &= ~(yyval.dlgex->style->and_mask); - yyval.dlgex->style->and_mask = 0; + (yyval.dlgex)->style->or_mask &= ~((yyval.dlgex)->style->and_mask); + (yyval.dlgex)->style->and_mask = 0; - if(!yyval.dlgex->lvc.language) - yyval.dlgex->lvc.language = dup_language(currentlanguage); + if(!(yyval.dlgex)->lvc.language) + (yyval.dlgex)->lvc.language = dup_language(currentlanguage); ;} break; case 111: -#line 1075 "parser.y" - { yyval.dlgex=new_dialogex(); ;} +#line 1067 "parser.y" + { (yyval.dlgex)=new_dialogex(); ;} break; case 112: -#line 1076 "parser.y" - { yyval.dlgex=dialogex_style(yyvsp[0].style,yyvsp[-2].dlgex); ;} +#line 1068 "parser.y" + { (yyval.dlgex)=dialogex_style((yyvsp[0].style),(yyvsp[-2].dlgex)); ;} break; case 113: -#line 1077 "parser.y" - { yyval.dlgex=dialogex_exstyle(yyvsp[0].style,yyvsp[-2].dlgex); ;} +#line 1069 "parser.y" + { (yyval.dlgex)=dialogex_exstyle((yyvsp[0].style),(yyvsp[-2].dlgex)); ;} break; case 114: -#line 1078 "parser.y" - { yyval.dlgex=dialogex_caption(yyvsp[0].str,yyvsp[-2].dlgex); ;} +#line 1070 "parser.y" + { (yyval.dlgex)=dialogex_caption((yyvsp[0].str),(yyvsp[-2].dlgex)); ;} break; case 115: -#line 1079 "parser.y" - { yyval.dlgex=dialogex_font(yyvsp[0].fntid,yyvsp[-1].dlgex); ;} +#line 1071 "parser.y" + { (yyval.dlgex)=dialogex_font((yyvsp[0].fntid),(yyvsp[-1].dlgex)); ;} break; case 116: -#line 1080 "parser.y" - { yyval.dlgex=dialogex_font(yyvsp[0].fntid,yyvsp[-1].dlgex); ;} +#line 1072 "parser.y" + { (yyval.dlgex)=dialogex_font((yyvsp[0].fntid),(yyvsp[-1].dlgex)); ;} break; case 117: -#line 1081 "parser.y" - { yyval.dlgex=dialogex_class(yyvsp[0].nid,yyvsp[-2].dlgex); ;} +#line 1073 "parser.y" + { (yyval.dlgex)=dialogex_class((yyvsp[0].nid),(yyvsp[-2].dlgex)); ;} break; case 118: -#line 1082 "parser.y" - { yyval.dlgex=dialogex_menu(yyvsp[0].nid,yyvsp[-2].dlgex); ;} +#line 1074 "parser.y" + { (yyval.dlgex)=dialogex_menu((yyvsp[0].nid),(yyvsp[-2].dlgex)); ;} break; case 119: -#line 1083 "parser.y" - { yyval.dlgex=dialogex_language(yyvsp[0].lan,yyvsp[-1].dlgex); ;} +#line 1075 "parser.y" + { (yyval.dlgex)=dialogex_language((yyvsp[0].lan),(yyvsp[-1].dlgex)); ;} break; case 120: -#line 1084 "parser.y" - { yyval.dlgex=dialogex_characteristics(yyvsp[0].chars,yyvsp[-1].dlgex); ;} +#line 1076 "parser.y" + { (yyval.dlgex)=dialogex_characteristics((yyvsp[0].chars),(yyvsp[-1].dlgex)); ;} break; case 121: -#line 1085 "parser.y" - { yyval.dlgex=dialogex_version(yyvsp[0].ver,yyvsp[-1].dlgex); ;} +#line 1077 "parser.y" + { (yyval.dlgex)=dialogex_version((yyvsp[0].ver),(yyvsp[-1].dlgex)); ;} break; case 122: -#line 1088 "parser.y" - { yyval.ctl = NULL; ;} +#line 1080 "parser.y" + { (yyval.ctl) = NULL; ;} break; case 123: -#line 1089 "parser.y" - { yyval.ctl=ins_ctrl(-1, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1081 "parser.y" + { (yyval.ctl)=ins_ctrl(-1, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 124: -#line 1090 "parser.y" - { yyval.ctl=ins_ctrl(CT_EDIT, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1082 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_EDIT, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 125: -#line 1091 "parser.y" - { yyval.ctl=ins_ctrl(CT_LISTBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1083 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_LISTBOX, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 126: -#line 1092 "parser.y" - { yyval.ctl=ins_ctrl(CT_COMBOBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1084 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_COMBOBOX, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 127: -#line 1093 "parser.y" - { yyval.ctl=ins_ctrl(CT_SCROLLBAR, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1085 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_SCROLLBAR, 0, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 128: -#line 1094 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_CHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1086 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_CHECKBOX, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 129: -#line 1095 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1087 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 130: -#line 1096 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_GROUPBOX, yyvsp[0].ctl, yyvsp[-2].ctl);;} +#line 1088 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_GROUPBOX, (yyvsp[0].ctl), (yyvsp[-2].ctl));;} break; case 131: -#line 1097 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1089 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 132: -#line 1099 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1091 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 133: -#line 1100 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1092 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 134: -#line 1101 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1093 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_3STATE, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 135: -#line 1102 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1094 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 136: -#line 1103 "parser.y" - { yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1095 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 137: -#line 1104 "parser.y" - { yyval.ctl=ins_ctrl(CT_STATIC, SS_LEFT, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1096 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_STATIC, SS_LEFT, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 138: -#line 1105 "parser.y" - { yyval.ctl=ins_ctrl(CT_STATIC, SS_CENTER, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1097 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_STATIC, SS_CENTER, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 139: -#line 1106 "parser.y" - { yyval.ctl=ins_ctrl(CT_STATIC, SS_RIGHT, yyvsp[0].ctl, yyvsp[-2].ctl); ;} +#line 1098 "parser.y" + { (yyval.ctl)=ins_ctrl(CT_STATIC, SS_RIGHT, (yyvsp[0].ctl), (yyvsp[-2].ctl)); ;} break; case 140: -#line 1108 "parser.y" +#line 1100 "parser.y" { - yyvsp[0].ctl->title = yyvsp[-7].nid; - yyvsp[0].ctl->id = yyvsp[-5].num; - yyvsp[0].ctl->x = yyvsp[-3].num; - yyvsp[0].ctl->y = yyvsp[-1].num; - yyval.ctl = ins_ctrl(CT_STATIC, SS_ICON, yyvsp[0].ctl, yyvsp[-9].ctl); + (yyvsp[0].ctl)->title = (yyvsp[-7].nid); + (yyvsp[0].ctl)->id = (yyvsp[-5].num); + (yyvsp[0].ctl)->x = (yyvsp[-3].num); + (yyvsp[0].ctl)->y = (yyvsp[-1].num); + (yyval.ctl) = ins_ctrl(CT_STATIC, SS_ICON, (yyvsp[0].ctl), (yyvsp[-9].ctl)); ;} break; case 141: -#line 1119 "parser.y" +#line 1111 "parser.y" { - yyval.ctl=new_control(); - yyval.ctl->title = yyvsp[-18].nid; - yyval.ctl->id = yyvsp[-16].num; - yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-14].nid); - yyval.ctl->style = yyvsp[-12].style; - yyval.ctl->gotstyle = TRUE; - yyval.ctl->x = yyvsp[-10].num; - yyval.ctl->y = yyvsp[-8].num; - yyval.ctl->width = yyvsp[-6].num; - yyval.ctl->height = yyvsp[-4].num; - if(yyvsp[-2].style) + (yyval.ctl)=new_control(); + (yyval.ctl)->title = (yyvsp[-18].nid); + (yyval.ctl)->id = (yyvsp[-16].num); + (yyval.ctl)->ctlclass = convert_ctlclass((yyvsp[-14].nid)); + (yyval.ctl)->style = (yyvsp[-12].style); + (yyval.ctl)->gotstyle = TRUE; + (yyval.ctl)->x = (yyvsp[-10].num); + (yyval.ctl)->y = (yyvsp[-8].num); + (yyval.ctl)->width = (yyvsp[-6].num); + (yyval.ctl)->height = (yyvsp[-4].num); + if((yyvsp[-2].style)) { - yyval.ctl->exstyle = yyvsp[-2].style; - yyval.ctl->gotexstyle = TRUE; + (yyval.ctl)->exstyle = (yyvsp[-2].style); + (yyval.ctl)->gotexstyle = TRUE; } - if(yyvsp[-1].iptr) + if((yyvsp[-1].iptr)) { - yyval.ctl->helpid = *(yyvsp[-1].iptr); - yyval.ctl->gothelpid = TRUE; - free(yyvsp[-1].iptr); + (yyval.ctl)->helpid = *((yyvsp[-1].iptr)); + (yyval.ctl)->gothelpid = TRUE; + free((yyvsp[-1].iptr)); } - yyval.ctl->extra = yyvsp[0].raw; + (yyval.ctl)->extra = (yyvsp[0].raw); ;} break; case 142: -#line 1143 "parser.y" +#line 1135 "parser.y" { - yyval.ctl=new_control(); - yyval.ctl->title = yyvsp[-15].nid; - yyval.ctl->id = yyvsp[-13].num; - yyval.ctl->style = yyvsp[-9].style; - yyval.ctl->gotstyle = TRUE; - yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-11].nid); - yyval.ctl->x = yyvsp[-7].num; - yyval.ctl->y = yyvsp[-5].num; - yyval.ctl->width = yyvsp[-3].num; - yyval.ctl->height = yyvsp[-1].num; - yyval.ctl->extra = yyvsp[0].raw; + (yyval.ctl)=new_control(); + (yyval.ctl)->title = (yyvsp[-15].nid); + (yyval.ctl)->id = (yyvsp[-13].num); + (yyval.ctl)->style = (yyvsp[-9].style); + (yyval.ctl)->gotstyle = TRUE; + (yyval.ctl)->ctlclass = convert_ctlclass((yyvsp[-11].nid)); + (yyval.ctl)->x = (yyvsp[-7].num); + (yyval.ctl)->y = (yyvsp[-5].num); + (yyval.ctl)->width = (yyvsp[-3].num); + (yyval.ctl)->height = (yyvsp[-1].num); + (yyval.ctl)->extra = (yyvsp[0].raw); ;} break; case 143: -#line 1159 "parser.y" +#line 1151 "parser.y" { - yyval.ctl=new_control(); - yyval.ctl->title = new_name_id(); - yyval.ctl->title->type = name_str; - yyval.ctl->title->name.s_name = yyvsp[-13].str; - yyval.ctl->id = yyvsp[-11].num; - yyval.ctl->x = yyvsp[-9].num; - yyval.ctl->y = yyvsp[-7].num; - yyval.ctl->width = yyvsp[-5].num; - yyval.ctl->height = yyvsp[-3].num; - if(yyvsp[-2].styles) + (yyval.ctl)=new_control(); + (yyval.ctl)->title = (yyvsp[-13].nid); + (yyval.ctl)->id = (yyvsp[-11].num); + (yyval.ctl)->x = (yyvsp[-9].num); + (yyval.ctl)->y = (yyvsp[-7].num); + (yyval.ctl)->width = (yyvsp[-5].num); + (yyval.ctl)->height = (yyvsp[-3].num); + if((yyvsp[-2].styles)) { - yyval.ctl->style = yyvsp[-2].styles->style; - yyval.ctl->gotstyle = TRUE; + (yyval.ctl)->style = (yyvsp[-2].styles)->style; + (yyval.ctl)->gotstyle = TRUE; - if (yyvsp[-2].styles->exstyle) + if ((yyvsp[-2].styles)->exstyle) { - yyval.ctl->exstyle = yyvsp[-2].styles->exstyle; - yyval.ctl->gotexstyle = TRUE; + (yyval.ctl)->exstyle = (yyvsp[-2].styles)->exstyle; + (yyval.ctl)->gotexstyle = TRUE; } - free(yyvsp[-2].styles); + free((yyvsp[-2].styles)); } - yyval.ctl->extra = yyvsp[0].raw; + (yyval.ctl)->extra = (yyvsp[0].raw); ;} break; case 144: -#line 1187 "parser.y" +#line 1177 "parser.y" { - yyval.ctl = new_control(); - yyval.ctl->id = yyvsp[-11].num; - yyval.ctl->x = yyvsp[-9].num; - yyval.ctl->y = yyvsp[-7].num; - yyval.ctl->width = yyvsp[-5].num; - yyval.ctl->height = yyvsp[-3].num; - if(yyvsp[-2].styles) + (yyval.ctl) = new_control(); + (yyval.ctl)->id = (yyvsp[-11].num); + (yyval.ctl)->x = (yyvsp[-9].num); + (yyval.ctl)->y = (yyvsp[-7].num); + (yyval.ctl)->width = (yyvsp[-5].num); + (yyval.ctl)->height = (yyvsp[-3].num); + if((yyvsp[-2].styles)) { - yyval.ctl->style = yyvsp[-2].styles->style; - yyval.ctl->gotstyle = TRUE; + (yyval.ctl)->style = (yyvsp[-2].styles)->style; + (yyval.ctl)->gotstyle = TRUE; - if (yyvsp[-2].styles->exstyle) + if ((yyvsp[-2].styles)->exstyle) { - yyval.ctl->exstyle = yyvsp[-2].styles->exstyle; - yyval.ctl->gotexstyle = TRUE; + (yyval.ctl)->exstyle = (yyvsp[-2].styles)->exstyle; + (yyval.ctl)->gotexstyle = TRUE; } - free(yyvsp[-2].styles); + free((yyvsp[-2].styles)); } - yyval.ctl->extra = yyvsp[0].raw; + (yyval.ctl)->extra = (yyvsp[0].raw); ;} break; case 145: -#line 1210 "parser.y" - { yyval.raw = NULL; ;} +#line 1200 "parser.y" + { (yyval.raw) = NULL; ;} break; case 146: -#line 1211 "parser.y" - { yyval.raw = yyvsp[0].raw; ;} +#line 1201 "parser.y" + { (yyval.raw) = (yyvsp[0].raw); ;} break; case 147: -#line 1214 "parser.y" - { yyval.iptr = NULL; ;} +#line 1204 "parser.y" + { (yyval.iptr) = NULL; ;} break; case 148: -#line 1215 "parser.y" - { yyval.iptr = new_int(yyvsp[0].num); ;} +#line 1205 "parser.y" + { (yyval.iptr) = new_int((yyvsp[0].num)); ;} break; case 149: -#line 1219 "parser.y" - { yyval.fntid = new_font_id(yyvsp[-7].num, yyvsp[-5].str, yyvsp[-3].num, yyvsp[-1].num); ;} +#line 1209 "parser.y" + { (yyval.fntid) = new_font_id((yyvsp[-7].num), (yyvsp[-5].str), (yyvsp[-3].num), (yyvsp[-1].num)); ;} break; case 150: -#line 1226 "parser.y" - { yyval.fntid = NULL; ;} +#line 1216 "parser.y" + { (yyval.fntid) = NULL; ;} break; case 151: -#line 1227 "parser.y" - { yyval.fntid = NULL; ;} +#line 1217 "parser.y" + { (yyval.fntid) = NULL; ;} break; case 152: -#line 1231 "parser.y" +#line 1221 "parser.y" { - if(!yyvsp[0].menitm) - yyerror("Menu must contain items"); - yyval.men = new_menu(); - if(yyvsp[-2].iptr) + if(!(yyvsp[0].menitm)) + parser_error("Menu must contain items\n"); + (yyval.men) = new_menu(); + if((yyvsp[-2].iptr)) { - yyval.men->memopt = *(yyvsp[-2].iptr); - free(yyvsp[-2].iptr); + (yyval.men)->memopt = *((yyvsp[-2].iptr)); + free((yyvsp[-2].iptr)); } else - yyval.men->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE; - yyval.men->items = get_item_head(yyvsp[0].menitm); - if(yyvsp[-1].lvc) + (yyval.men)->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE; + (yyval.men)->items = get_item_head((yyvsp[0].menitm)); + if((yyvsp[-1].lvc)) { - yyval.men->lvc = *(yyvsp[-1].lvc); - free(yyvsp[-1].lvc); + (yyval.men)->lvc = *((yyvsp[-1].lvc)); + free((yyvsp[-1].lvc)); } - if(!yyval.men->lvc.language) - yyval.men->lvc.language = dup_language(currentlanguage); + if(!(yyval.men)->lvc.language) + (yyval.men)->lvc.language = dup_language(currentlanguage); ;} break; case 153: -#line 1254 "parser.y" - { yyval.menitm = yyvsp[-1].menitm; ;} +#line 1244 "parser.y" + { (yyval.menitm) = (yyvsp[-1].menitm); ;} break; case 154: -#line 1258 "parser.y" - {yyval.menitm = NULL;;} +#line 1248 "parser.y" + {(yyval.menitm) = NULL;;} break; case 155: -#line 1259 "parser.y" +#line 1249 "parser.y" { - yyval.menitm=new_menu_item(); - yyval.menitm->prev = yyvsp[-5].menitm; - if(yyvsp[-5].menitm) - yyvsp[-5].menitm->next = yyval.menitm; - yyval.menitm->id = yyvsp[-1].num; - yyval.menitm->state = yyvsp[0].num; - yyval.menitm->name = yyvsp[-3].str; + (yyval.menitm)=new_menu_item(); + (yyval.menitm)->prev = (yyvsp[-5].menitm); + if((yyvsp[-5].menitm)) + (yyvsp[-5].menitm)->next = (yyval.menitm); + (yyval.menitm)->id = (yyvsp[-1].num); + (yyval.menitm)->state = (yyvsp[0].num); + (yyval.menitm)->name = (yyvsp[-3].str); ;} break; case 156: -#line 1268 "parser.y" +#line 1258 "parser.y" { - yyval.menitm=new_menu_item(); - yyval.menitm->prev = yyvsp[-2].menitm; - if(yyvsp[-2].menitm) - yyvsp[-2].menitm->next = yyval.menitm; + (yyval.menitm)=new_menu_item(); + (yyval.menitm)->prev = (yyvsp[-2].menitm); + if((yyvsp[-2].menitm)) + (yyvsp[-2].menitm)->next = (yyval.menitm); ;} break; case 157: -#line 1274 "parser.y" +#line 1264 "parser.y" { - yyval.menitm = new_menu_item(); - yyval.menitm->prev = yyvsp[-4].menitm; - if(yyvsp[-4].menitm) - yyvsp[-4].menitm->next = yyval.menitm; - yyval.menitm->popup = get_item_head(yyvsp[0].menitm); - yyval.menitm->name = yyvsp[-2].str; + (yyval.menitm) = new_menu_item(); + (yyval.menitm)->prev = (yyvsp[-4].menitm); + if((yyvsp[-4].menitm)) + (yyvsp[-4].menitm)->next = (yyval.menitm); + (yyval.menitm)->popup = get_item_head((yyvsp[0].menitm)); + (yyval.menitm)->name = (yyvsp[-2].str); ;} break; case 158: -#line 1293 "parser.y" - { yyval.num = 0; ;} +#line 1283 "parser.y" + { (yyval.num) = 0; ;} break; case 159: -#line 1294 "parser.y" - { yyval.num = yyvsp[0].num | MF_CHECKED; ;} +#line 1284 "parser.y" + { (yyval.num) = (yyvsp[0].num) | MF_CHECKED; ;} break; case 160: -#line 1295 "parser.y" - { yyval.num = yyvsp[0].num | MF_GRAYED; ;} +#line 1285 "parser.y" + { (yyval.num) = (yyvsp[0].num) | MF_GRAYED; ;} break; case 161: -#line 1296 "parser.y" - { yyval.num = yyvsp[0].num | MF_HELP; ;} +#line 1286 "parser.y" + { (yyval.num) = (yyvsp[0].num) | MF_HELP; ;} break; case 162: -#line 1297 "parser.y" - { yyval.num = yyvsp[0].num | MF_DISABLED; ;} +#line 1287 "parser.y" + { (yyval.num) = (yyvsp[0].num) | MF_DISABLED; ;} break; case 163: -#line 1298 "parser.y" - { yyval.num = yyvsp[0].num | MF_MENUBARBREAK; ;} +#line 1288 "parser.y" + { (yyval.num) = (yyvsp[0].num) | MF_MENUBARBREAK; ;} break; case 164: -#line 1299 "parser.y" - { yyval.num = yyvsp[0].num | MF_MENUBREAK; ;} +#line 1289 "parser.y" + { (yyval.num) = (yyvsp[0].num) | MF_MENUBREAK; ;} break; case 165: -#line 1303 "parser.y" +#line 1293 "parser.y" { if(!win32) - yywarning("MENUEX not supported in 16-bit mode"); - if(!yyvsp[0].menexitm) - yyerror("MenuEx must contain items"); - yyval.menex = new_menuex(); - if(yyvsp[-2].iptr) + parser_warning("MENUEX not supported in 16-bit mode\n"); + if(!(yyvsp[0].menexitm)) + parser_error("MenuEx must contain items\n"); + (yyval.menex) = new_menuex(); + if((yyvsp[-2].iptr)) { - yyval.menex->memopt = *(yyvsp[-2].iptr); - free(yyvsp[-2].iptr); + (yyval.menex)->memopt = *((yyvsp[-2].iptr)); + free((yyvsp[-2].iptr)); } else - yyval.menex->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE; - yyval.menex->items = get_itemex_head(yyvsp[0].menexitm); - if(yyvsp[-1].lvc) + (yyval.menex)->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE; + (yyval.menex)->items = get_itemex_head((yyvsp[0].menexitm)); + if((yyvsp[-1].lvc)) { - yyval.menex->lvc = *(yyvsp[-1].lvc); - free(yyvsp[-1].lvc); + (yyval.menex)->lvc = *((yyvsp[-1].lvc)); + free((yyvsp[-1].lvc)); } - if(!yyval.menex->lvc.language) - yyval.menex->lvc.language = dup_language(currentlanguage); + if(!(yyval.menex)->lvc.language) + (yyval.menex)->lvc.language = dup_language(currentlanguage); ;} break; case 166: -#line 1328 "parser.y" - { yyval.menexitm = yyvsp[-1].menexitm; ;} +#line 1318 "parser.y" + { (yyval.menexitm) = (yyvsp[-1].menexitm); ;} break; case 167: -#line 1332 "parser.y" - {yyval.menexitm = NULL; ;} +#line 1322 "parser.y" + {(yyval.menexitm) = NULL; ;} break; case 168: -#line 1333 "parser.y" +#line 1323 "parser.y" { - yyval.menexitm = new_menuex_item(); - yyval.menexitm->prev = yyvsp[-3].menexitm; - if(yyvsp[-3].menexitm) - yyvsp[-3].menexitm->next = yyval.menexitm; - yyval.menexitm->name = yyvsp[-1].str; - yyval.menexitm->id = yyvsp[0].exopt->id; - yyval.menexitm->type = yyvsp[0].exopt->type; - yyval.menexitm->state = yyvsp[0].exopt->state; - yyval.menexitm->helpid = yyvsp[0].exopt->helpid; - yyval.menexitm->gotid = yyvsp[0].exopt->gotid; - yyval.menexitm->gottype = yyvsp[0].exopt->gottype; - yyval.menexitm->gotstate = yyvsp[0].exopt->gotstate; - yyval.menexitm->gothelpid = yyvsp[0].exopt->gothelpid; - free(yyvsp[0].exopt); + (yyval.menexitm) = new_menuex_item(); + (yyval.menexitm)->prev = (yyvsp[-3].menexitm); + if((yyvsp[-3].menexitm)) + (yyvsp[-3].menexitm)->next = (yyval.menexitm); + (yyval.menexitm)->name = (yyvsp[-1].str); + (yyval.menexitm)->id = (yyvsp[0].exopt)->id; + (yyval.menexitm)->type = (yyvsp[0].exopt)->type; + (yyval.menexitm)->state = (yyvsp[0].exopt)->state; + (yyval.menexitm)->helpid = (yyvsp[0].exopt)->helpid; + (yyval.menexitm)->gotid = (yyvsp[0].exopt)->gotid; + (yyval.menexitm)->gottype = (yyvsp[0].exopt)->gottype; + (yyval.menexitm)->gotstate = (yyvsp[0].exopt)->gotstate; + (yyval.menexitm)->gothelpid = (yyvsp[0].exopt)->gothelpid; + free((yyvsp[0].exopt)); ;} break; case 169: -#line 1349 "parser.y" +#line 1339 "parser.y" { - yyval.menexitm = new_menuex_item(); - yyval.menexitm->prev = yyvsp[-2].menexitm; - if(yyvsp[-2].menexitm) - yyvsp[-2].menexitm->next = yyval.menexitm; + (yyval.menexitm) = new_menuex_item(); + (yyval.menexitm)->prev = (yyvsp[-2].menexitm); + if((yyvsp[-2].menexitm)) + (yyvsp[-2].menexitm)->next = (yyval.menexitm); ;} break; case 170: -#line 1355 "parser.y" +#line 1345 "parser.y" { - yyval.menexitm = new_menuex_item(); - yyval.menexitm->prev = yyvsp[-4].menexitm; - if(yyvsp[-4].menexitm) - yyvsp[-4].menexitm->next = yyval.menexitm; - yyval.menexitm->popup = get_itemex_head(yyvsp[0].menexitm); - yyval.menexitm->name = yyvsp[-2].str; - yyval.menexitm->id = yyvsp[-1].exopt->id; - yyval.menexitm->type = yyvsp[-1].exopt->type; - yyval.menexitm->state = yyvsp[-1].exopt->state; - yyval.menexitm->helpid = yyvsp[-1].exopt->helpid; - yyval.menexitm->gotid = yyvsp[-1].exopt->gotid; - yyval.menexitm->gottype = yyvsp[-1].exopt->gottype; - yyval.menexitm->gotstate = yyvsp[-1].exopt->gotstate; - yyval.menexitm->gothelpid = yyvsp[-1].exopt->gothelpid; - free(yyvsp[-1].exopt); + (yyval.menexitm) = new_menuex_item(); + (yyval.menexitm)->prev = (yyvsp[-4].menexitm); + if((yyvsp[-4].menexitm)) + (yyvsp[-4].menexitm)->next = (yyval.menexitm); + (yyval.menexitm)->popup = get_itemex_head((yyvsp[0].menexitm)); + (yyval.menexitm)->name = (yyvsp[-2].str); + (yyval.menexitm)->id = (yyvsp[-1].exopt)->id; + (yyval.menexitm)->type = (yyvsp[-1].exopt)->type; + (yyval.menexitm)->state = (yyvsp[-1].exopt)->state; + (yyval.menexitm)->helpid = (yyvsp[-1].exopt)->helpid; + (yyval.menexitm)->gotid = (yyvsp[-1].exopt)->gotid; + (yyval.menexitm)->gottype = (yyvsp[-1].exopt)->gottype; + (yyval.menexitm)->gotstate = (yyvsp[-1].exopt)->gotstate; + (yyval.menexitm)->gothelpid = (yyvsp[-1].exopt)->gothelpid; + free((yyvsp[-1].exopt)); ;} break; case 171: -#line 1375 "parser.y" - { yyval.exopt = new_itemex_opt(0, 0, 0, 0); ;} +#line 1365 "parser.y" + { (yyval.exopt) = new_itemex_opt(0, 0, 0, 0); ;} break; case 172: -#line 1376 "parser.y" +#line 1366 "parser.y" { - yyval.exopt = new_itemex_opt(yyvsp[0].num, 0, 0, 0); - yyval.exopt->gotid = TRUE; + (yyval.exopt) = new_itemex_opt((yyvsp[0].num), 0, 0, 0); + (yyval.exopt)->gotid = TRUE; ;} break; case 173: -#line 1380 "parser.y" +#line 1370 "parser.y" { - yyval.exopt = new_itemex_opt(yyvsp[-3].iptr ? *(yyvsp[-3].iptr) : 0, yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, yyvsp[0].num, 0); - yyval.exopt->gotid = TRUE; - yyval.exopt->gottype = TRUE; - yyval.exopt->gotstate = TRUE; - if(yyvsp[-3].iptr) free(yyvsp[-3].iptr); - if(yyvsp[-1].iptr) free(yyvsp[-1].iptr); + (yyval.exopt) = new_itemex_opt((yyvsp[-3].iptr) ? *((yyvsp[-3].iptr)) : 0, (yyvsp[-1].iptr) ? *((yyvsp[-1].iptr)) : 0, (yyvsp[0].num), 0); + (yyval.exopt)->gotid = TRUE; + (yyval.exopt)->gottype = TRUE; + (yyval.exopt)->gotstate = TRUE; + free((yyvsp[-3].iptr)); + free((yyvsp[-1].iptr)); ;} break; case 174: -#line 1388 "parser.y" +#line 1378 "parser.y" { - yyval.exopt = new_itemex_opt(yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0); - yyval.exopt->gotid = TRUE; - yyval.exopt->gottype = TRUE; - yyval.exopt->gotstate = TRUE; - if(yyvsp[-4].iptr) free(yyvsp[-4].iptr); - if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); + (yyval.exopt) = new_itemex_opt((yyvsp[-4].iptr) ? *((yyvsp[-4].iptr)) : 0, (yyvsp[-2].iptr) ? *((yyvsp[-2].iptr)) : 0, (yyvsp[0].num), 0); + (yyval.exopt)->gotid = TRUE; + (yyval.exopt)->gottype = TRUE; + (yyval.exopt)->gotstate = TRUE; + free((yyvsp[-4].iptr)); + free((yyvsp[-2].iptr)); ;} break; case 175: -#line 1399 "parser.y" - { yyval.exopt = new_itemex_opt(0, 0, 0, 0); ;} +#line 1389 "parser.y" + { (yyval.exopt) = new_itemex_opt(0, 0, 0, 0); ;} break; case 176: -#line 1400 "parser.y" +#line 1390 "parser.y" { - yyval.exopt = new_itemex_opt(yyvsp[0].num, 0, 0, 0); - yyval.exopt->gotid = TRUE; + (yyval.exopt) = new_itemex_opt((yyvsp[0].num), 0, 0, 0); + (yyval.exopt)->gotid = TRUE; ;} break; case 177: -#line 1404 "parser.y" +#line 1394 "parser.y" { - yyval.exopt = new_itemex_opt(yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0, 0); - if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); - yyval.exopt->gotid = TRUE; - yyval.exopt->gottype = TRUE; + (yyval.exopt) = new_itemex_opt((yyvsp[-2].iptr) ? *((yyvsp[-2].iptr)) : 0, (yyvsp[0].num), 0, 0); + free((yyvsp[-2].iptr)); + (yyval.exopt)->gotid = TRUE; + (yyval.exopt)->gottype = TRUE; ;} break; case 178: -#line 1410 "parser.y" +#line 1400 "parser.y" { - yyval.exopt = new_itemex_opt(yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0); - if(yyvsp[-4].iptr) free(yyvsp[-4].iptr); - if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); - yyval.exopt->gotid = TRUE; - yyval.exopt->gottype = TRUE; - yyval.exopt->gotstate = TRUE; + (yyval.exopt) = new_itemex_opt((yyvsp[-4].iptr) ? *((yyvsp[-4].iptr)) : 0, (yyvsp[-2].iptr) ? *((yyvsp[-2].iptr)) : 0, (yyvsp[0].num), 0); + free((yyvsp[-4].iptr)); + free((yyvsp[-2].iptr)); + (yyval.exopt)->gotid = TRUE; + (yyval.exopt)->gottype = TRUE; + (yyval.exopt)->gotstate = TRUE; ;} break; case 179: -#line 1418 "parser.y" +#line 1408 "parser.y" { - 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); - if(yyvsp[-6].iptr) free(yyvsp[-6].iptr); - if(yyvsp[-4].iptr) free(yyvsp[-4].iptr); - if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); - yyval.exopt->gotid = TRUE; - yyval.exopt->gottype = TRUE; - yyval.exopt->gotstate = TRUE; - yyval.exopt->gothelpid = TRUE; + (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)); + free((yyvsp[-6].iptr)); + free((yyvsp[-4].iptr)); + free((yyvsp[-2].iptr)); + (yyval.exopt)->gotid = TRUE; + (yyval.exopt)->gottype = TRUE; + (yyval.exopt)->gotstate = TRUE; + (yyval.exopt)->gothelpid = TRUE; ;} break; case 180: -#line 1438 "parser.y" +#line 1428 "parser.y" { - if(!yyvsp[-1].stt) + if(!(yyvsp[-1].stt)) { - yyerror("Stringtable must have at least one entry"); + parser_error("Stringtable must have at least one entry\n"); } else { @@ -3552,52 +3658,48 @@ yyreduce: } /* Else were done */ } - if(tagstt_memopt) - { - free(tagstt_memopt); - tagstt_memopt = NULL; - } + free(tagstt_memopt); + tagstt_memopt = NULL; - yyval.stt = tagstt; + (yyval.stt) = tagstt; ;} break; case 181: -#line 1479 "parser.y" +#line 1466 "parser.y" { - if((tagstt = find_stringtable(yyvsp[0].lvc)) == NULL) - tagstt = new_stringtable(yyvsp[0].lvc); - tagstt_memopt = yyvsp[-1].iptr; - tagstt_version = yyvsp[0].lvc->version; - tagstt_characts = yyvsp[0].lvc->characts; - if(yyvsp[0].lvc) - free(yyvsp[0].lvc); + if((tagstt = find_stringtable((yyvsp[0].lvc))) == NULL) + tagstt = new_stringtable((yyvsp[0].lvc)); + tagstt_memopt = (yyvsp[-1].iptr); + tagstt_version = (yyvsp[0].lvc)->version; + tagstt_characts = (yyvsp[0].lvc)->characts; + free((yyvsp[0].lvc)); ;} break; case 182: -#line 1490 "parser.y" - { yyval.stt = NULL; ;} +#line 1476 "parser.y" + { (yyval.stt) = NULL; ;} break; case 183: -#line 1491 "parser.y" +#line 1477 "parser.y" { int i; assert(tagstt != NULL); - if(yyvsp[-2].num > 65535 || yyvsp[-2].num < -32768) - yyerror("Stringtable entry's ID out of range (%d)", yyvsp[-2].num); + if((yyvsp[-2].num) > 65535 || (yyvsp[-2].num) < -32768) + parser_error("Stringtable entry's ID out of range (%d)\n", (yyvsp[-2].num)); /* Search for the ID */ for(i = 0; i < tagstt->nentries; i++) { - if(tagstt->entries[i].id == yyvsp[-2].num) - yyerror("Stringtable ID %d already in use", yyvsp[-2].num); + if(tagstt->entries[i].id == (yyvsp[-2].num)) + parser_error("Stringtable ID %d already in use\n", (yyvsp[-2].num)); } /* If we get here, then we have a new unique entry */ tagstt->nentries++; tagstt->entries = xrealloc(tagstt->entries, sizeof(tagstt->entries[0]) * tagstt->nentries); - tagstt->entries[tagstt->nentries-1].id = yyvsp[-2].num; - tagstt->entries[tagstt->nentries-1].str = yyvsp[0].str; + tagstt->entries[tagstt->nentries-1].id = (yyvsp[-2].num); + tagstt->entries[tagstt->nentries-1].str = (yyvsp[0].str); if(tagstt_memopt) tagstt->entries[tagstt->nentries-1].memopt = *tagstt_memopt; else @@ -3605,565 +3707,561 @@ yyreduce: tagstt->entries[tagstt->nentries-1].version = tagstt_version; tagstt->entries[tagstt->nentries-1].characts = tagstt_characts; - if(pedantic && !yyvsp[0].str->size) - yywarning("Zero length strings make no sense"); - if(!win32 && yyvsp[0].str->size > 254) - yyerror("Stringtable entry more than 254 characters"); - if(win32 && yyvsp[0].str->size > 65534) /* Hmm..., does this happen? */ - yyerror("Stringtable entry more than 65534 characters (probably something else that went wrong)"); - yyval.stt = tagstt; + if(pedantic && !(yyvsp[0].str)->size) + parser_warning("Zero length strings make no sense\n"); + if(!win32 && (yyvsp[0].str)->size > 254) + parser_error("Stringtable entry more than 254 characters\n"); + if(win32 && (yyvsp[0].str)->size > 65534) /* Hmm..., does this happen? */ + parser_error("Stringtable entry more than 65534 characters (probably something else that went wrong)\n"); + (yyval.stt) = tagstt; ;} break; case 186: -#line 1531 "parser.y" +#line 1517 "parser.y" { - yyval.veri = yyvsp[-3].veri; - if(yyvsp[-4].iptr) + (yyval.veri) = (yyvsp[-3].veri); + if((yyvsp[-4].iptr)) { - yyval.veri->memopt = *(yyvsp[-4].iptr); - free(yyvsp[-4].iptr); + (yyval.veri)->memopt = *((yyvsp[-4].iptr)); + free((yyvsp[-4].iptr)); } else - yyval.veri->memopt = WRC_MO_MOVEABLE | (win32 ? WRC_MO_PURE : 0); - yyval.veri->blocks = get_ver_block_head(yyvsp[-1].blk); + (yyval.veri)->memopt = WRC_MO_MOVEABLE | (win32 ? WRC_MO_PURE : 0); + (yyval.veri)->blocks = get_ver_block_head((yyvsp[-1].blk)); /* Set language; there is no version or characteristics */ - yyval.veri->lvc.language = dup_language(currentlanguage); + (yyval.veri)->lvc.language = dup_language(currentlanguage); ;} break; case 187: -#line 1547 "parser.y" - { yyval.veri = new_versioninfo(); ;} +#line 1533 "parser.y" + { (yyval.veri) = new_versioninfo(); ;} break; case 188: -#line 1548 "parser.y" +#line 1534 "parser.y" { - if(yyvsp[-8].veri->gotit.fv) - yyerror("FILEVERSION already defined"); - yyval.veri = yyvsp[-8].veri; - yyval.veri->filever_maj1 = yyvsp[-6].num; - yyval.veri->filever_maj2 = yyvsp[-4].num; - yyval.veri->filever_min1 = yyvsp[-2].num; - yyval.veri->filever_min2 = yyvsp[0].num; - yyval.veri->gotit.fv = 1; + if((yyvsp[-8].veri)->gotit.fv) + parser_error("FILEVERSION already defined\n"); + (yyval.veri) = (yyvsp[-8].veri); + (yyval.veri)->filever_maj1 = (yyvsp[-6].num); + (yyval.veri)->filever_maj2 = (yyvsp[-4].num); + (yyval.veri)->filever_min1 = (yyvsp[-2].num); + (yyval.veri)->filever_min2 = (yyvsp[0].num); + (yyval.veri)->gotit.fv = 1; ;} break; case 189: -#line 1558 "parser.y" +#line 1544 "parser.y" { - if(yyvsp[-8].veri->gotit.pv) - yyerror("PRODUCTVERSION already defined"); - yyval.veri = yyvsp[-8].veri; - yyval.veri->prodver_maj1 = yyvsp[-6].num; - yyval.veri->prodver_maj2 = yyvsp[-4].num; - yyval.veri->prodver_min1 = yyvsp[-2].num; - yyval.veri->prodver_min2 = yyvsp[0].num; - yyval.veri->gotit.pv = 1; + if((yyvsp[-8].veri)->gotit.pv) + parser_error("PRODUCTVERSION already defined\n"); + (yyval.veri) = (yyvsp[-8].veri); + (yyval.veri)->prodver_maj1 = (yyvsp[-6].num); + (yyval.veri)->prodver_maj2 = (yyvsp[-4].num); + (yyval.veri)->prodver_min1 = (yyvsp[-2].num); + (yyval.veri)->prodver_min2 = (yyvsp[0].num); + (yyval.veri)->gotit.pv = 1; ;} break; case 190: -#line 1568 "parser.y" +#line 1554 "parser.y" { - if(yyvsp[-2].veri->gotit.ff) - yyerror("FILEFLAGS already defined"); - yyval.veri = yyvsp[-2].veri; - yyval.veri->fileflags = yyvsp[0].num; - yyval.veri->gotit.ff = 1; + if((yyvsp[-2].veri)->gotit.ff) + parser_error("FILEFLAGS already defined\n"); + (yyval.veri) = (yyvsp[-2].veri); + (yyval.veri)->fileflags = (yyvsp[0].num); + (yyval.veri)->gotit.ff = 1; ;} break; case 191: -#line 1575 "parser.y" +#line 1561 "parser.y" { - if(yyvsp[-2].veri->gotit.ffm) - yyerror("FILEFLAGSMASK already defined"); - yyval.veri = yyvsp[-2].veri; - yyval.veri->fileflagsmask = yyvsp[0].num; - yyval.veri->gotit.ffm = 1; + if((yyvsp[-2].veri)->gotit.ffm) + parser_error("FILEFLAGSMASK already defined\n"); + (yyval.veri) = (yyvsp[-2].veri); + (yyval.veri)->fileflagsmask = (yyvsp[0].num); + (yyval.veri)->gotit.ffm = 1; ;} break; case 192: -#line 1582 "parser.y" +#line 1568 "parser.y" { - if(yyvsp[-2].veri->gotit.fo) - yyerror("FILEOS already defined"); - yyval.veri = yyvsp[-2].veri; - yyval.veri->fileos = yyvsp[0].num; - yyval.veri->gotit.fo = 1; + if((yyvsp[-2].veri)->gotit.fo) + parser_error("FILEOS already defined\n"); + (yyval.veri) = (yyvsp[-2].veri); + (yyval.veri)->fileos = (yyvsp[0].num); + (yyval.veri)->gotit.fo = 1; ;} break; case 193: -#line 1589 "parser.y" +#line 1575 "parser.y" { - if(yyvsp[-2].veri->gotit.ft) - yyerror("FILETYPE already defined"); - yyval.veri = yyvsp[-2].veri; - yyval.veri->filetype = yyvsp[0].num; - yyval.veri->gotit.ft = 1; + if((yyvsp[-2].veri)->gotit.ft) + parser_error("FILETYPE already defined\n"); + (yyval.veri) = (yyvsp[-2].veri); + (yyval.veri)->filetype = (yyvsp[0].num); + (yyval.veri)->gotit.ft = 1; ;} break; case 194: -#line 1596 "parser.y" +#line 1582 "parser.y" { - if(yyvsp[-2].veri->gotit.fst) - yyerror("FILESUBTYPE already defined"); - yyval.veri = yyvsp[-2].veri; - yyval.veri->filesubtype = yyvsp[0].num; - yyval.veri->gotit.fst = 1; + if((yyvsp[-2].veri)->gotit.fst) + parser_error("FILESUBTYPE already defined\n"); + (yyval.veri) = (yyvsp[-2].veri); + (yyval.veri)->filesubtype = (yyvsp[0].num); + (yyval.veri)->gotit.fst = 1; ;} break; case 195: -#line 1606 "parser.y" - { yyval.blk = NULL; ;} +#line 1592 "parser.y" + { (yyval.blk) = NULL; ;} break; case 196: -#line 1607 "parser.y" +#line 1593 "parser.y" { - yyval.blk = yyvsp[0].blk; - yyval.blk->prev = yyvsp[-1].blk; - if(yyvsp[-1].blk) - yyvsp[-1].blk->next = yyval.blk; + (yyval.blk) = (yyvsp[0].blk); + (yyval.blk)->prev = (yyvsp[-1].blk); + if((yyvsp[-1].blk)) + (yyvsp[-1].blk)->next = (yyval.blk); ;} break; case 197: -#line 1616 "parser.y" +#line 1602 "parser.y" { - yyval.blk = new_ver_block(); - yyval.blk->name = yyvsp[-3].str; - yyval.blk->values = get_ver_value_head(yyvsp[-1].val); + (yyval.blk) = new_ver_block(); + (yyval.blk)->name = (yyvsp[-3].str); + (yyval.blk)->values = get_ver_value_head((yyvsp[-1].val)); ;} break; case 198: -#line 1624 "parser.y" - { yyval.val = NULL; ;} +#line 1610 "parser.y" + { (yyval.val) = NULL; ;} break; case 199: -#line 1625 "parser.y" +#line 1611 "parser.y" { - yyval.val = yyvsp[0].val; - yyval.val->prev = yyvsp[-1].val; - if(yyvsp[-1].val) - yyvsp[-1].val->next = yyval.val; + (yyval.val) = (yyvsp[0].val); + (yyval.val)->prev = (yyvsp[-1].val); + if((yyvsp[-1].val)) + (yyvsp[-1].val)->next = (yyval.val); ;} break; case 200: -#line 1634 "parser.y" +#line 1620 "parser.y" { - yyval.val = new_ver_value(); - yyval.val->type = val_block; - yyval.val->value.block = yyvsp[0].blk; + (yyval.val) = new_ver_value(); + (yyval.val)->type = val_block; + (yyval.val)->value.block = (yyvsp[0].blk); ;} break; case 201: -#line 1639 "parser.y" +#line 1625 "parser.y" { - yyval.val = new_ver_value(); - yyval.val->type = val_str; - yyval.val->key = yyvsp[-2].str; - yyval.val->value.str = yyvsp[0].str; + (yyval.val) = new_ver_value(); + (yyval.val)->type = val_str; + (yyval.val)->key = (yyvsp[-2].str); + (yyval.val)->value.str = (yyvsp[0].str); ;} break; case 202: -#line 1645 "parser.y" +#line 1631 "parser.y" { - yyval.val = new_ver_value(); - yyval.val->type = val_words; - yyval.val->key = yyvsp[-2].str; - yyval.val->value.words = yyvsp[0].verw; + (yyval.val) = new_ver_value(); + (yyval.val)->type = val_words; + (yyval.val)->key = (yyvsp[-2].str); + (yyval.val)->value.words = (yyvsp[0].verw); ;} break; case 203: -#line 1654 "parser.y" - { yyval.verw = new_ver_words(yyvsp[0].num); ;} +#line 1640 "parser.y" + { (yyval.verw) = new_ver_words((yyvsp[0].num)); ;} break; case 204: -#line 1655 "parser.y" - { yyval.verw = add_ver_words(yyvsp[-2].verw, yyvsp[0].num); ;} +#line 1641 "parser.y" + { (yyval.verw) = add_ver_words((yyvsp[-2].verw), (yyvsp[0].num)); ;} break; case 205: -#line 1659 "parser.y" +#line 1645 "parser.y" { int nitems; - toolbar_item_t *items = get_tlbr_buttons_head(yyvsp[-1].tlbarItems, &nitems); - yyval.tlbar = new_toolbar(yyvsp[-6].num, yyvsp[-4].num, items, nitems); - if(yyvsp[-7].iptr) + toolbar_item_t *items = get_tlbr_buttons_head((yyvsp[-1].tlbarItems), &nitems); + (yyval.tlbar) = new_toolbar((yyvsp[-6].num), (yyvsp[-4].num), items, nitems); + if((yyvsp[-7].iptr)) { - yyval.tlbar->memopt = *(yyvsp[-7].iptr); - free(yyvsp[-7].iptr); + (yyval.tlbar)->memopt = *((yyvsp[-7].iptr)); + free((yyvsp[-7].iptr)); } else { - yyval.tlbar->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE; + (yyval.tlbar)->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE; } - if(yyvsp[-3].lvc) + if((yyvsp[-3].lvc)) { - yyval.tlbar->lvc = *(yyvsp[-3].lvc); - free(yyvsp[-3].lvc); + (yyval.tlbar)->lvc = *((yyvsp[-3].lvc)); + free((yyvsp[-3].lvc)); } - if(!yyval.tlbar->lvc.language) + if(!(yyval.tlbar)->lvc.language) { - yyval.tlbar->lvc.language = dup_language(currentlanguage); + (yyval.tlbar)->lvc.language = dup_language(currentlanguage); } ;} break; case 206: -#line 1685 "parser.y" - { yyval.tlbarItems = NULL; ;} +#line 1671 "parser.y" + { (yyval.tlbarItems) = NULL; ;} break; case 207: -#line 1686 "parser.y" +#line 1672 "parser.y" { toolbar_item_t *idrec = new_toolbar_item(); - idrec->id = yyvsp[0].num; - yyval.tlbarItems = ins_tlbr_button(yyvsp[-2].tlbarItems, idrec); + idrec->id = (yyvsp[0].num); + (yyval.tlbarItems) = ins_tlbr_button((yyvsp[-2].tlbarItems), idrec); ;} break; case 208: -#line 1691 "parser.y" +#line 1677 "parser.y" { toolbar_item_t *idrec = new_toolbar_item(); idrec->id = 0; - yyval.tlbarItems = ins_tlbr_button(yyvsp[-1].tlbarItems, idrec); + (yyval.tlbarItems) = ins_tlbr_button((yyvsp[-1].tlbarItems), idrec); ;} break; case 209: -#line 1700 "parser.y" - { yyval.iptr = NULL; ;} +#line 1686 "parser.y" + { (yyval.iptr) = NULL; ;} break; case 210: -#line 1701 "parser.y" +#line 1687 "parser.y" { - if(yyvsp[-1].iptr) + if((yyvsp[-1].iptr)) { - *(yyvsp[-1].iptr) |= *(yyvsp[0].iptr); - yyval.iptr = yyvsp[-1].iptr; - free(yyvsp[0].iptr); + *((yyvsp[-1].iptr)) |= *((yyvsp[0].iptr)); + (yyval.iptr) = (yyvsp[-1].iptr); + free((yyvsp[0].iptr)); } else - yyval.iptr = yyvsp[0].iptr; + (yyval.iptr) = (yyvsp[0].iptr); ;} break; case 211: -#line 1711 "parser.y" +#line 1697 "parser.y" { - if(yyvsp[-1].iptr) + if((yyvsp[-1].iptr)) { - *(yyvsp[-1].iptr) &= *(yyvsp[0].iptr); - yyval.iptr = yyvsp[-1].iptr; - free(yyvsp[0].iptr); + *((yyvsp[-1].iptr)) &= *((yyvsp[0].iptr)); + (yyval.iptr) = (yyvsp[-1].iptr); + free((yyvsp[0].iptr)); } else { - *yyvsp[0].iptr &= WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE | WRC_MO_PURE; - yyval.iptr = yyvsp[0].iptr; + *(yyvsp[0].iptr) &= WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE | WRC_MO_PURE; + (yyval.iptr) = (yyvsp[0].iptr); } ;} break; case 212: -#line 1726 "parser.y" - { yyval.iptr = new_int(WRC_MO_PRELOAD); ;} +#line 1712 "parser.y" + { (yyval.iptr) = new_int(WRC_MO_PRELOAD); ;} break; case 213: -#line 1727 "parser.y" - { yyval.iptr = new_int(WRC_MO_MOVEABLE); ;} +#line 1713 "parser.y" + { (yyval.iptr) = new_int(WRC_MO_MOVEABLE); ;} break; case 214: -#line 1728 "parser.y" - { yyval.iptr = new_int(WRC_MO_DISCARDABLE); ;} +#line 1714 "parser.y" + { (yyval.iptr) = new_int(WRC_MO_DISCARDABLE); ;} break; case 215: -#line 1729 "parser.y" - { yyval.iptr = new_int(WRC_MO_PURE); ;} +#line 1715 "parser.y" + { (yyval.iptr) = new_int(WRC_MO_PURE); ;} break; case 216: -#line 1732 "parser.y" - { yyval.iptr = new_int(~WRC_MO_PRELOAD); ;} +#line 1718 "parser.y" + { (yyval.iptr) = new_int(~WRC_MO_PRELOAD); ;} break; case 217: -#line 1733 "parser.y" - { yyval.iptr = new_int(~WRC_MO_MOVEABLE); ;} +#line 1719 "parser.y" + { (yyval.iptr) = new_int(~WRC_MO_MOVEABLE); ;} break; case 218: -#line 1734 "parser.y" - { yyval.iptr = new_int(~WRC_MO_PURE); ;} +#line 1720 "parser.y" + { (yyval.iptr) = new_int(~WRC_MO_PURE); ;} break; case 219: -#line 1738 "parser.y" - { yyval.lvc = new_lvc(); ;} +#line 1724 "parser.y" + { (yyval.lvc) = new_lvc(); ;} break; case 220: -#line 1739 "parser.y" +#line 1725 "parser.y" { if(!win32) - yywarning("LANGUAGE not supported in 16-bit mode"); - if(yyvsp[-1].lvc->language) - yyerror("Language already defined"); - yyval.lvc = yyvsp[-1].lvc; - yyvsp[-1].lvc->language = yyvsp[0].lan; + parser_warning("LANGUAGE not supported in 16-bit mode\n"); + if((yyvsp[-1].lvc)->language) + parser_error("Language already defined\n"); + (yyval.lvc) = (yyvsp[-1].lvc); + (yyvsp[-1].lvc)->language = (yyvsp[0].lan); ;} break; case 221: -#line 1747 "parser.y" +#line 1733 "parser.y" { if(!win32) - yywarning("CHARACTERISTICS not supported in 16-bit mode"); - if(yyvsp[-1].lvc->characts) - yyerror("Characteristics already defined"); - yyval.lvc = yyvsp[-1].lvc; - yyvsp[-1].lvc->characts = yyvsp[0].chars; + parser_warning("CHARACTERISTICS not supported in 16-bit mode\n"); + if((yyvsp[-1].lvc)->characts) + parser_error("Characteristics already defined\n"); + (yyval.lvc) = (yyvsp[-1].lvc); + (yyvsp[-1].lvc)->characts = (yyvsp[0].chars); ;} break; case 222: -#line 1755 "parser.y" +#line 1741 "parser.y" { if(!win32) - yywarning("VERSION not supported in 16-bit mode"); - if(yyvsp[-1].lvc->version) - yyerror("Version already defined"); - yyval.lvc = yyvsp[-1].lvc; - yyvsp[-1].lvc->version = yyvsp[0].ver; + parser_warning("VERSION not supported in 16-bit mode\n"); + if((yyvsp[-1].lvc)->version) + parser_error("Version already defined\n"); + (yyval.lvc) = (yyvsp[-1].lvc); + (yyvsp[-1].lvc)->version = (yyvsp[0].ver); ;} break; case 223: -#line 1773 "parser.y" - { yyval.lan = new_language(yyvsp[-2].num, yyvsp[0].num); - if (get_language_codepage(yyvsp[-2].num, yyvsp[0].num) == -1) - yyerror( "Language %04x is not supported", (yyvsp[0].num<<10) + yyvsp[-2].num); +#line 1759 "parser.y" + { (yyval.lan) = new_language((yyvsp[-2].num), (yyvsp[0].num)); + if (get_language_codepage((yyvsp[-2].num), (yyvsp[0].num)) == -1) + parser_error( "Language %04x is not supported\n", ((yyvsp[0].num)<<10) + (yyvsp[-2].num)); ;} break; case 224: -#line 1780 "parser.y" - { yyval.chars = new_characts(yyvsp[0].num); ;} +#line 1766 "parser.y" + { (yyval.chars) = new_characts((yyvsp[0].num)); ;} break; case 225: -#line 1784 "parser.y" - { yyval.ver = new_version(yyvsp[0].num); ;} +#line 1770 "parser.y" + { (yyval.ver) = new_version((yyvsp[0].num)); ;} break; case 226: -#line 1788 "parser.y" +#line 1774 "parser.y" { - if(yyvsp[-3].lvc) + if((yyvsp[-3].lvc)) { - yyvsp[-1].raw->lvc = *(yyvsp[-3].lvc); - free(yyvsp[-3].lvc); + (yyvsp[-1].raw)->lvc = *((yyvsp[-3].lvc)); + free((yyvsp[-3].lvc)); } - if(!yyvsp[-1].raw->lvc.language) - yyvsp[-1].raw->lvc.language = dup_language(currentlanguage); + if(!(yyvsp[-1].raw)->lvc.language) + (yyvsp[-1].raw)->lvc.language = dup_language(currentlanguage); - yyval.raw = yyvsp[-1].raw; + (yyval.raw) = (yyvsp[-1].raw); ;} break; case 227: -#line 1803 "parser.y" - { yyval.raw = yyvsp[0].raw; ;} +#line 1789 "parser.y" + { (yyval.raw) = (yyvsp[0].raw); ;} break; case 228: -#line 1804 "parser.y" - { yyval.raw = int2raw_data(yyvsp[0].num); ;} +#line 1790 "parser.y" + { (yyval.raw) = int2raw_data((yyvsp[0].num)); ;} break; case 229: -#line 1805 "parser.y" - { yyval.raw = int2raw_data(-(yyvsp[0].num)); ;} +#line 1791 "parser.y" + { (yyval.raw) = int2raw_data(-((yyvsp[0].num))); ;} break; case 230: -#line 1806 "parser.y" - { yyval.raw = long2raw_data(yyvsp[0].num); ;} +#line 1792 "parser.y" + { (yyval.raw) = long2raw_data((yyvsp[0].num)); ;} break; case 231: -#line 1807 "parser.y" - { yyval.raw = long2raw_data(-(yyvsp[0].num)); ;} +#line 1793 "parser.y" + { (yyval.raw) = long2raw_data(-((yyvsp[0].num))); ;} break; case 232: -#line 1808 "parser.y" - { yyval.raw = str2raw_data(yyvsp[0].str); ;} +#line 1794 "parser.y" + { (yyval.raw) = str2raw_data((yyvsp[0].str)); ;} break; case 233: -#line 1809 "parser.y" - { yyval.raw = merge_raw_data(yyvsp[-2].raw, yyvsp[0].raw); free(yyvsp[0].raw->data); free(yyvsp[0].raw); ;} +#line 1795 "parser.y" + { (yyval.raw) = merge_raw_data((yyvsp[-2].raw), (yyvsp[0].raw)); free((yyvsp[0].raw)->data); free((yyvsp[0].raw)); ;} break; case 234: -#line 1810 "parser.y" - { yyval.raw = merge_raw_data_int(yyvsp[-2].raw, yyvsp[0].num); ;} +#line 1796 "parser.y" + { (yyval.raw) = merge_raw_data_int((yyvsp[-2].raw), (yyvsp[0].num)); ;} break; case 235: -#line 1811 "parser.y" - { yyval.raw = merge_raw_data_int(yyvsp[-3].raw, -(yyvsp[0].num)); ;} +#line 1797 "parser.y" + { (yyval.raw) = merge_raw_data_int((yyvsp[-3].raw), -((yyvsp[0].num))); ;} break; case 236: -#line 1812 "parser.y" - { yyval.raw = merge_raw_data_long(yyvsp[-2].raw, yyvsp[0].num); ;} +#line 1798 "parser.y" + { (yyval.raw) = merge_raw_data_long((yyvsp[-2].raw), (yyvsp[0].num)); ;} break; case 237: -#line 1813 "parser.y" - { yyval.raw = merge_raw_data_long(yyvsp[-3].raw, -(yyvsp[0].num)); ;} +#line 1799 "parser.y" + { (yyval.raw) = merge_raw_data_long((yyvsp[-3].raw), -((yyvsp[0].num))); ;} break; case 238: -#line 1814 "parser.y" - { yyval.raw = merge_raw_data_str(yyvsp[-2].raw, yyvsp[0].str); ;} +#line 1800 "parser.y" + { (yyval.raw) = merge_raw_data_str((yyvsp[-2].raw), (yyvsp[0].str)); ;} break; case 239: -#line 1818 "parser.y" - { yyval.raw = load_file(yyvsp[0].str,dup_language(currentlanguage)); ;} +#line 1804 "parser.y" + { (yyval.raw) = load_file((yyvsp[0].str),dup_language(currentlanguage)); ;} break; case 240: -#line 1819 "parser.y" - { yyval.raw = yyvsp[0].raw; ;} +#line 1805 "parser.y" + { (yyval.raw) = (yyvsp[0].raw); ;} break; case 241: -#line 1826 "parser.y" - { yyval.iptr = 0; ;} +#line 1812 "parser.y" + { (yyval.iptr) = 0; ;} break; case 242: -#line 1827 "parser.y" - { yyval.iptr = new_int(yyvsp[0].num); ;} +#line 1813 "parser.y" + { (yyval.iptr) = new_int((yyvsp[0].num)); ;} break; case 243: -#line 1831 "parser.y" - { yyval.num = (yyvsp[0].num); ;} +#line 1817 "parser.y" + { (yyval.num) = ((yyvsp[0].num)); ;} break; case 244: -#line 1834 "parser.y" - { yyval.num = (yyvsp[-2].num) + (yyvsp[0].num); ;} +#line 1820 "parser.y" + { (yyval.num) = ((yyvsp[-2].num)) + ((yyvsp[0].num)); ;} break; case 245: -#line 1835 "parser.y" - { yyval.num = (yyvsp[-2].num) - (yyvsp[0].num); ;} +#line 1821 "parser.y" + { (yyval.num) = ((yyvsp[-2].num)) - ((yyvsp[0].num)); ;} break; case 246: -#line 1836 "parser.y" - { yyval.num = (yyvsp[-2].num) | (yyvsp[0].num); ;} +#line 1822 "parser.y" + { (yyval.num) = ((yyvsp[-2].num)) | ((yyvsp[0].num)); ;} break; case 247: -#line 1837 "parser.y" - { yyval.num = (yyvsp[-2].num) & (yyvsp[0].num); ;} +#line 1823 "parser.y" + { (yyval.num) = ((yyvsp[-2].num)) & ((yyvsp[0].num)); ;} break; case 248: -#line 1838 "parser.y" - { yyval.num = (yyvsp[-2].num) * (yyvsp[0].num); ;} +#line 1824 "parser.y" + { (yyval.num) = ((yyvsp[-2].num)) * ((yyvsp[0].num)); ;} break; case 249: -#line 1839 "parser.y" - { yyval.num = (yyvsp[-2].num) / (yyvsp[0].num); ;} +#line 1825 "parser.y" + { (yyval.num) = ((yyvsp[-2].num)) / ((yyvsp[0].num)); ;} break; case 250: -#line 1840 "parser.y" - { yyval.num = (yyvsp[-2].num) ^ (yyvsp[0].num); ;} +#line 1826 "parser.y" + { (yyval.num) = ((yyvsp[-2].num)) ^ ((yyvsp[0].num)); ;} break; case 251: -#line 1841 "parser.y" - { yyval.num = ~(yyvsp[0].num); ;} +#line 1827 "parser.y" + { (yyval.num) = ~((yyvsp[0].num)); ;} break; case 252: -#line 1842 "parser.y" - { yyval.num = -(yyvsp[0].num); ;} +#line 1828 "parser.y" + { (yyval.num) = -((yyvsp[0].num)); ;} break; case 253: -#line 1843 "parser.y" - { yyval.num = yyvsp[0].num; ;} +#line 1829 "parser.y" + { (yyval.num) = (yyvsp[0].num); ;} break; case 254: -#line 1844 "parser.y" - { yyval.num = yyvsp[-1].num; ;} +#line 1830 "parser.y" + { (yyval.num) = (yyvsp[-1].num); ;} break; case 255: -#line 1845 "parser.y" - { yyval.num = yyvsp[0].num; ;} +#line 1831 "parser.y" + { (yyval.num) = (yyvsp[0].num); ;} break; case 256: -#line 1849 "parser.y" - { yyval.num = (yyvsp[0].num); ;} +#line 1832 "parser.y" + { (yyval.num) = ~((yyvsp[0].num)); ;} break; case 257: -#line 1850 "parser.y" - { yyval.num = ~(yyvsp[0].num); ;} +#line 1835 "parser.y" + { (yyval.num) = (yyvsp[0].num); ;} break; case 258: -#line 1853 "parser.y" - { yyval.num = yyvsp[0].num; ;} - break; - - case 259: -#line 1854 "parser.y" - { yyval.num = yyvsp[0].num; ;} +#line 1836 "parser.y" + { (yyval.num) = (yyvsp[0].num); ;} break; + default: break; } -/* Line 1000 of yacc.c. */ -#line 4171 "parser.tab.c" +/* Line 1126 of yacc.c. */ +#line 4265 "parser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -4202,12 +4300,36 @@ yyerrlab: if (YYPACT_NINF < yyn && yyn < YYLAST) { - YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + char *yymsg = 0; +# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; +#if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +#endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; @@ -4215,81 +4337,91 @@ yyerrlab: /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); - yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { - yysize = 0; + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; break; } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - if (yycount < 5) + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + + if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yymsg; + int yyi = 0; + while ((*yyp = *yyf)) { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else - yyerror ("syntax error; also virtual memory exhausted"); + { + yyerror (YY_("syntax error")); + goto yyexhaustedlab; + } } else #endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + yyerror (YY_("syntax error")); } if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ + /* Return failure if at end of input. */ if (yychar == YYEOF) - for (;;) - { - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - } + YYABORT; } else { - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); + yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; - } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -4299,14 +4431,13 @@ yyerrlab: `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ if (0) goto yyerrorlab; -#endif - yyvsp -= yylen; +yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; @@ -4336,8 +4467,8 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); + + yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -4346,11 +4477,12 @@ yyerrlab1: if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -4370,16 +4502,25 @@ yyabortlab: goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK; + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); @@ -4388,7 +4529,7 @@ yyreturn: } -#line 1857 "parser.y" +#line 1839 "parser.y" /* Dialog specific functions */ static dialog_t *dialog_style(style_t * st, dialog_t *dlg) @@ -4401,7 +4542,7 @@ static dialog_t *dialog_style(style_t * st, dialog_t *dlg) if(dlg->gotstyle) { - yywarning("Style already defined, or-ing together"); + parser_warning("Style already defined, or-ing together\n"); } else { @@ -4425,7 +4566,7 @@ static dialog_t *dialog_exstyle(style_t *st, dialog_t *dlg) if(dlg->gotexstyle) { - yywarning("ExStyle already defined, or-ing together"); + parser_warning("ExStyle already defined, or-ing together\n"); } else { @@ -4443,7 +4584,7 @@ static dialog_t *dialog_caption(string_t *s, dialog_t *dlg) { assert(dlg != NULL); if(dlg->title) - yyerror("Caption already defined"); + parser_error("Caption already defined\n"); dlg->title = s; return dlg; } @@ -4452,7 +4593,7 @@ static dialog_t *dialog_font(font_id_t *f, dialog_t *dlg) { assert(dlg != NULL); if(dlg->font) - yyerror("Font already defined"); + parser_error("Font already defined\n"); dlg->font = f; return dlg; } @@ -4461,7 +4602,7 @@ static dialog_t *dialog_class(name_id_t *n, dialog_t *dlg) { assert(dlg != NULL); if(dlg->dlgclass) - yyerror("Class already defined"); + parser_error("Class already defined\n"); dlg->dlgclass = n; return dlg; } @@ -4573,7 +4714,7 @@ static control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control defaultstyle |= WS_TABSTOP; break; default: - yywarning("Unknown default button control-style 0x%08x", special_style); + parser_warning("Unknown default button control-style 0x%08x\n", special_style); case BS_GROUPBOX: case BS_RADIOBUTTON: break; @@ -4591,7 +4732,7 @@ static control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control case SS_ICON: /* Special case */ break; default: - yywarning("Unknown default static control-style 0x%08x", special_style); + parser_warning("Unknown default static control-style 0x%08x\n", special_style); break; } break; @@ -4676,7 +4817,7 @@ static dialogex_t *dialogex_style(style_t * st, dialogex_t *dlg) if(dlg->gotstyle) { - yywarning("Style already defined, or-ing together"); + parser_warning("Style already defined, or-ing together\n"); } else { @@ -4700,7 +4841,7 @@ static dialogex_t *dialogex_exstyle(style_t * st, dialogex_t *dlg) if(dlg->gotexstyle) { - yywarning("ExStyle already defined, or-ing together"); + parser_warning("ExStyle already defined, or-ing together\n"); } else { @@ -4796,32 +4937,27 @@ static event_t *add_event(int key, int id, int flags, event_t *prev) static event_t *add_string_event(string_t *key, int id, int flags, event_t *prev) { - int keycode = 0, keysym = 0; + int keycode = 0; event_t *ev = new_event(); - if(key->type == str_char) - keysym = key->str.cstr[0]; - else - keysym = key->str.wstr[0]; + if(key->type != str_char) + yyerror("Key code must be an ascii string"); - if((flags & WRC_AF_VIRTKEY) && (!isupper(keysym & 0xff) && !isdigit(keysym & 0xff))) + if((flags & WRC_AF_VIRTKEY) && (!isupper(key->str.cstr[0] & 0xff) && !isdigit(key->str.cstr[0] & 0xff))) yyerror("VIRTKEY code is not equal to ascii value"); - if(keysym == '^' && (flags & WRC_AF_CONTROL) != 0) + if(key->str.cstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0) { yyerror("Cannot use both '^' and CONTROL modifier"); } - else if(keysym == '^') + else if(key->str.cstr[0] == '^') { - if(key->type == str_char) - keycode = toupper(key->str.cstr[1]) - '@'; - else - keycode = toupper(key->str.wstr[1]) - '@'; + keycode = toupper(key->str.cstr[1]) - '@'; if(keycode >= ' ') yyerror("Control-code out of range"); } else - keycode = keysym; + keycode = key->str.cstr[0]; ev->key = keycode; ev->id = id; ev->flags = flags & ~WRC_AF_ASCII; @@ -4834,7 +4970,8 @@ static event_t *add_string_event(string_t *key, int id, int flags, event_t *prev /* MenuEx specific functions */ static itemex_opt_t *new_itemex_opt(int id, int type, int state, int helpid) { - itemex_opt_t *opt = (itemex_opt_t *)xmalloc(sizeof(itemex_opt_t)); + itemex_opt_t *opt = xmalloc(sizeof(itemex_opt_t)); + memset( opt, 0, sizeof(*opt) ); opt->id = id; opt->type = type; opt->state = state; @@ -4866,7 +5003,7 @@ static raw_data_t *load_file(string_t *filename, language_t *lang) fseek(fp, 0, SEEK_SET); if (rd->size) { - rd->data = (char *)xmalloc(rd->size); + rd->data = xmalloc(rd->size); fread(rd->data, rd->size, 1, fp); } else rd->data = NULL; @@ -4882,11 +5019,11 @@ static raw_data_t *int2raw_data(int i) if( ( i >= 0 && (int)((unsigned short)i) != i) || ( i < 0 && (int)((short)i) != i) ) - yywarning("Integer constant out of 16bit range (%d), truncated to %d\n", i, (short)i); + parser_warning("Integer constant out of 16bit range (%d), truncated to %d\n", i, (short)i); rd = new_raw_data(); rd->size = sizeof(short); - rd->data = (char *)xmalloc(rd->size); + rd->data = xmalloc(rd->size); switch(byteorder) { #ifdef WORDS_BIGENDIAN @@ -4913,7 +5050,7 @@ static raw_data_t *long2raw_data(int i) raw_data_t *rd; rd = new_raw_data(); rd->size = sizeof(int); - rd->data = (char *)xmalloc(rd->size); + rd->data = xmalloc(rd->size); switch(byteorder) { #ifdef WORDS_BIGENDIAN @@ -4944,7 +5081,7 @@ static raw_data_t *str2raw_data(string_t *str) raw_data_t *rd; rd = new_raw_data(); rd->size = str->size * (str->type == str_char ? 1 : 2); - rd->data = (char *)xmalloc(rd->size); + rd->data = xmalloc(rd->size); if(str->type == str_char) memcpy(rd->data, str->str.cstr, rd->size); else if(str->type == str_unicode) @@ -4975,7 +5112,7 @@ static raw_data_t *str2raw_data(string_t *str) } } else - internal_error(__FILE__, __LINE__, "Invalid stringtype"); + internal_error(__FILE__, __LINE__, "Invalid stringtype\n"); return rd; } @@ -5100,12 +5237,12 @@ static stringtable_t *find_stringtable(lvc_t *lvc) if((stt->lvc.version && lvc->version && *(stt->lvc.version) != *(lvc->version)) || (!stt->lvc.version && lvc->version) || (stt->lvc.version && !lvc->version)) - yywarning("Stringtable's versions are not the same, using first definition"); + parser_warning("Stringtable's versions are not the same, using first definition\n"); if((stt->lvc.characts && lvc->characts && *(stt->lvc.characts) != *(lvc->characts)) || (!stt->lvc.characts && lvc->characts) || (stt->lvc.characts && !lvc->characts)) - yywarning("Stringtable's characteristics are not the same, using first definition"); + parser_warning("Stringtable's characteristics are not the same, using first definition\n"); */ return stt; } @@ -5150,7 +5287,8 @@ static resource_t *build_stt_resources(stringtable_t *stthead) for(i = 0; i < stt->nentries; ) { newstt = new_stringtable(&stt->lvc); - newstt->entries = (stt_entry_t *)xmalloc(16 * sizeof(stt_entry_t)); + newstt->entries = xmalloc(16 * sizeof(stt_entry_t)); + memset( newstt->entries, 0, 16 * sizeof(stt_entry_t) ); newstt->nentries = 16; newstt->idbase = stt->entries[i].id & ~0xf; for(j = 0; j < 16 && i < stt->nentries; j++) @@ -5181,7 +5319,7 @@ static resource_t *build_stt_resources(stringtable_t *stthead) } if(andsum != orsum) { - warning("Stringtable's memory options are not equal (idbase: %d)", newstt->idbase); + warning("Stringtable's memory options are not equal (idbase: %d)\n", newstt->idbase); } /* Check version and characteristics */ for(j = 0; j < 16; j++) @@ -5189,11 +5327,11 @@ static resource_t *build_stt_resources(stringtable_t *stthead) if(characts && newstt->entries[j].characts && *newstt->entries[j].characts != *characts) - warning("Stringtable's characteristics are not the same (idbase: %d)", newstt->idbase); + warning("Stringtable's characteristics are not the same (idbase: %d)\n", newstt->idbase); if(version && newstt->entries[j].version && *newstt->entries[j].version != *version) - warning("Stringtable's versions are not the same (idbase: %d)", newstt->idbase); + warning("Stringtable's versions are not the same (idbase: %d)\n", newstt->idbase); } rsc = new_resource(res_stt, newstt, newstt->memopt, newstt->lvc.language); rsc->name = new_name_id(); @@ -5307,7 +5445,7 @@ static resource_t *build_fontdir(resource_t **fnt, int nfnt) static int once = 0; if(!once) { - warning("Need to parse fonts, not yet implemented (fnt: %p, nfnt: %d)", fnt, nfnt); + warning("Need to parse fonts, not yet implemented (fnt: %p, nfnt: %d)\n", fnt, nfnt); once++; } return NULL; @@ -5356,7 +5494,7 @@ static resource_t *build_fontdirs(resource_t *tail) { if(compare_name_id(&nid, fnd[i]->name)) { - warning("User supplied FONTDIR entry has an invalid name '%s', ignored", + warning("User supplied FONTDIR entry has an invalid name '%s', ignored\n", get_nameid_str(fnd[i]->name)); fnd[i] = NULL; } @@ -5366,12 +5504,13 @@ static resource_t *build_fontdirs(resource_t *tail) if(nfnt == 0) { if(nfnd != 0) - warning("Found %d FONTDIR entries without any fonts present", nfnd); + warning("Found %d FONTDIR entries without any fonts present\n", nfnd); goto clean; } /* Copy space */ lanfnt = xmalloc(nfnt * sizeof(*lanfnt)); + memset( lanfnt, 0, nfnt * sizeof(*lanfnt)); /* Get all fonts covered by fontdirs */ for(i = 0; i < nfnd; i++) @@ -5400,7 +5539,7 @@ static resource_t *build_fontdirs(resource_t *tail) else if(nlanfnt == BYTESWAP_WORD(cnt)) isswapped = 1; else - error("FONTDIR for language %d,%d has wrong count (%d, expected %d)", + error("FONTDIR for language %d,%d has wrong count (%d, expected %d)\n", fnd[i]->lan->id, fnd[i]->lan->sub, cnt, nlanfnt); #ifdef WORDS_BIGENDIAN if((byteorder == WRC_BO_LITTLE && !isswapped) || (byteorder != WRC_BO_LITTLE && isswapped)) @@ -5408,7 +5547,7 @@ static resource_t *build_fontdirs(resource_t *tail) if((byteorder == WRC_BO_BIG && !isswapped) || (byteorder != WRC_BO_BIG && isswapped)) #endif { - internal_error(__FILE__, __LINE__, "User supplied FONTDIR needs byteswapping"); + internal_error(__FILE__, __LINE__, "User supplied FONTDIR needs byteswapping\n"); } } @@ -5452,10 +5591,8 @@ static resource_t *build_fontdirs(resource_t *tail) free(lanfnt); clean: - if(fnt) - free(fnt); - if(fnd) - free(fnd); + free(fnt); + free(fnd); free(str.str.cstr); return lst; } @@ -5573,13 +5710,13 @@ static int rsrcid_to_token(int lookahead) case WRC_RT_ANIICON: case WRC_RT_GROUP_CURSOR: case WRC_RT_GROUP_ICON: - yywarning("Usertype uses reserved type ID %d, which is auto-generated", yylval.num); + parser_warning("Usertype uses reserved type ID %d, which is auto-generated\n", yylval.num); return lookahead; case WRC_RT_DLGINCLUDE: case WRC_RT_PLUGPLAY: case WRC_RT_VXD: - yywarning("Usertype uses reserved type ID %d, which is not supported by wrc yet", yylval.num); + parser_warning("Usertype uses reserved type ID %d, which is not supported by wrc yet\n", yylval.num); default: return lookahead; } diff --git a/reactos/tools/wrc/parser.tab.h b/reactos/tools/wrc/parser.tab.h index 7508cb0c9a0..6eeddcc86bb 100644 --- a/reactos/tools/wrc/parser.tab.h +++ b/reactos/tools/wrc/parser.tab.h @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 2.1. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -114,6 +114,7 @@ pUPM = 340 }; #endif +/* Tokens. */ #define tNL 258 #define tNUMBER 259 #define tLNUMBER 260 @@ -202,7 +203,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 241 "parser.y" +#line 237 "parser.y" typedef union YYSTYPE { string_t *str; int num; @@ -246,14 +247,14 @@ typedef union YYSTYPE { style_t *style; ani_any_t *ani; } YYSTYPE; -/* Line 1275 of yacc.c. */ -#line 251 "parser.tab.h" +/* Line 1447 of yacc.c. */ +#line 252 "parser.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif -extern YYSTYPE yylval; +extern YYSTYPE parser_lval; diff --git a/reactos/tools/wrc/parser.y b/reactos/tools/wrc/parser.y index 337e9fd6691..63c63a12a19 100644 --- a/reactos/tools/wrc/parser.y +++ b/reactos/tools/wrc/parser.y @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * History: * 24-Jul-2000 BS - Made a fix for broken Berkeley yacc on @@ -296,7 +296,6 @@ static int rsrcid_to_token(int lookahead); %token tFILEVERSION tPRODUCTVERSION tFILEFLAGSMASK tFILEOS tFILETYPE tFILEFLAGS tFILESUBTYPE %token tMENUBARBREAK tMENUBREAK tMENUITEM tPOPUP tSEPARATOR %token tHELP -%token tSTRING tIDENT tRAWDATA %token tTOOLBAR tBUTTON %token tBEGIN tEND %token tDLGINIT @@ -344,7 +343,7 @@ static int rsrcid_to_token(int lookahead); %type opt_language %type opt_characts %type opt_version -%type expr xpr xpr_no_not +%type expr xpr %type e_expr %type toolbar %type toolbar_items @@ -416,7 +415,7 @@ resources && rsc->lan->sub == head->lan->sub && !compare_name_id(rsc->name, head->name)) { - yyerror("Duplicate resource name '%s'", get_nameid_str(rsc->name)); + parser_error("Duplicate resource name '%s'\n", get_nameid_str(rsc->name)); } rsc = rsc->prev; } @@ -473,11 +472,11 @@ resource if($$) { if($1 > 65535 || $1 < -32768) - yyerror("Resource's ID out of range (%d)", $1); + parser_error("Resource's ID out of range (%d)\n", $1); $$->name = new_name_id(); $$->name->type = name_ord; $$->name->name.i_name = $1; - chat("Got %s (%d)", get_typename($3), $$->name->name.i_name); + chat("Got %s (%d)\n", get_typename($3), $$->name->name.i_name); } } | tIDENT usrcvt resource_definition { @@ -487,7 +486,7 @@ resource $$->name = new_name_id(); $$->name->type = name_str; $$->name->name.s_name = $1; - chat("Got %s (%s)", get_typename($3), $$->name->name.s_name->str.cstr); + chat("Got %s (%s)\n", get_typename($3), $$->name->name.s_name->str.cstr); } } | stringtable { @@ -496,7 +495,7 @@ resource * the final rule of the parser is reduced (see above) */ $$ = NULL; - chat("Got STRINGTABLE"); + chat("Got STRINGTABLE\n"); } | tLANGUAGE {want_nl = 1; } expr ',' expr { /* We *NEED* the newline to delimit the expression. @@ -522,19 +521,18 @@ resource yychar = YYEMPTY; /* Could use 'yyclearin', but we already need the*/ /* direct access to yychar in rule 'usrcvt' below. */ else if(yychar == tIDENT) - yywarning("LANGUAGE statement not delimited with newline; next identifier might be wrong"); + parser_warning("LANGUAGE statement not delimited with newline; next identifier might be wrong\n"); want_nl = 0; /* We don't want it anymore if we didn't get it */ if(!win32) - yywarning("LANGUAGE not supported in 16-bit mode"); - if(currentlanguage) - free(currentlanguage); + parser_warning("LANGUAGE not supported in 16-bit mode\n"); + free(currentlanguage); if (get_language_codepage($3, $5) == -1) - yyerror( "Language %04x is not supported", ($5<<10) + $3); + parser_error( "Language %04x is not supported\n", ($5<<10) + $3); currentlanguage = new_language($3, $5); $$ = NULL; - chat("Got LANGUAGE %d,%d (0x%04x)", $3, $5, ($5<<10) + $3); + chat("Got LANGUAGE %d,%d (0x%04x)\n", $3, $5, ($5<<10) + $3); } ; @@ -550,7 +548,7 @@ usrcvt : /* Empty */ { yychar = rsrcid_to_token(yychar); } */ nameid : expr { if($1 > 65535 || $1 < -32768) - yyerror("Resource's ID out of range (%d)", $1); + parser_error("Resource's ID out of range (%d)\n", $1); $$ = new_name_id(); $$->type = name_ord; $$->name.i_name = $1; @@ -598,7 +596,7 @@ resource_definition } } else - internal_error(__FILE__, __LINE__, "Invalid top-level type %d in cursor resource", $1->type); + internal_error(__FILE__, __LINE__, "Invalid top-level type %d in cursor resource\n", $1->type); free($1); } | dialog { $$ = new_resource(res_dlg, $1, $1->memopt, $1->lvc.language); } @@ -632,7 +630,7 @@ resource_definition } } else - internal_error(__FILE__, __LINE__, "Invalid top-level type %d in icon resource", $1->type); + internal_error(__FILE__, __LINE__, "Invalid top-level type %d in icon resource\n", $1->type); free($1); } | menu { $$ = new_resource(res_men, $1, $1->memopt, $1->lvc.language); } @@ -719,7 +717,7 @@ fontdir : tFONTDIR loadmemopts file_raw { $$ = new_fontdir($3, $2); } messagetable : tMESSAGETABLE loadmemopts file_raw { if(!win32) - yywarning("MESSAGETABLE not supported in 16-bit mode"); + parser_warning("MESSAGETABLE not supported in 16-bit mode\n"); $$ = new_messagetable($3, $2); } ; @@ -743,7 +741,7 @@ userres : usertype loadmemopts file_raw { #else if(pedantic && byteorder == WRC_BO_BIG) #endif - yywarning("Byteordering is not little-endian and type cannot be interpreted"); + parser_warning("Byteordering is not little-endian and type cannot be interpreted\n"); $$ = new_user($1, $3, $2); } ; @@ -774,7 +772,7 @@ accelerators $$->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE; } if(!$5) - yyerror("Accelerator table must have at least one entry"); + parser_error("Accelerator table must have at least one entry\n"); $$->events = get_event_head($5); if($3) { @@ -892,11 +890,9 @@ ctrls : /* Empty */ { $$ = NULL; } ; lab_ctrl - : tSTRING opt_comma expr ',' expr ',' expr ',' expr ',' expr optional_style_pair { + : nameid_s opt_comma expr ',' expr ',' expr ',' expr ',' expr optional_style_pair { $$=new_control(); - $$->title = new_name_id(); - $$->title->type = name_str; - $$->title->name.s_name = $1; + $$->title = $1; $$->id = $3; $$->x = $5; $$->y = $7; @@ -1006,8 +1002,8 @@ optional_style_pair style : style '|' style { $$ = new_style($1->or_mask | $3->or_mask, $1->and_mask | $3->and_mask); free($1); free($3);} | '(' style ')' { $$ = $2; } - | xpr_no_not { $$ = new_style($1, 0); } - | tNOT xpr_no_not { $$ = new_style(0, $2); } + | any_num { $$ = new_style($1, 0); } + | tNOT any_num { $$ = new_style(0, $2); } ; ctlclass @@ -1027,7 +1023,7 @@ ctlclass dialogex: tDIALOGEX loadmemopts expr ',' expr ',' expr ',' expr helpid dlgex_attribs tBEGIN exctrls tEND { if(!win32) - yywarning("DIALOGEX not supported in 16-bit mode"); + parser_warning("DIALOGEX not supported in 16-bit mode\n"); if($2) { $11->memopt = *($2); @@ -1152,11 +1148,9 @@ gen_exctrl ; lab_exctrl - : tSTRING opt_comma expr ',' expr ',' expr ',' expr ',' expr optional_style_pair helpid opt_data { + : nameid_s opt_comma expr ',' expr ',' expr ',' expr ',' expr optional_style_pair helpid opt_data { $$=new_control(); - $$->title = new_name_id(); - $$->title->type = name_str; - $$->title->name.s_name = $1; + $$->title = $1; $$->id = $3; $$->x = $5; $$->y = $7; @@ -1226,7 +1220,7 @@ opt_expr: /* Empty */ { $$ = NULL; } /* ------------------------------ Menu ------------------------------ */ menu : tMENU loadmemopts opt_lvc menu_body { if(!$4) - yyerror("Menu must contain items"); + parser_error("Menu must contain items\n"); $$ = new_menu(); if($2) { @@ -1298,9 +1292,9 @@ item_options /* ------------------------------ MenuEx ------------------------------ */ menuex : tMENUEX loadmemopts opt_lvc menuex_body { if(!win32) - yywarning("MENUEX not supported in 16-bit mode"); + parser_warning("MENUEX not supported in 16-bit mode\n"); if(!$4) - yyerror("MenuEx must contain items"); + parser_error("MenuEx must contain items\n"); $$ = new_menuex(); if($2) { @@ -1378,16 +1372,16 @@ itemex_options $$->gotid = TRUE; $$->gottype = TRUE; $$->gotstate = TRUE; - if($2) free($2); - if($4) free($4); + free($2); + free($4); } | ',' e_expr ',' e_expr ',' expr { $$ = new_itemex_opt($2 ? *($2) : 0, $4 ? *($4) : 0, $6, 0); $$->gotid = TRUE; $$->gottype = TRUE; $$->gotstate = TRUE; - if($2) free($2); - if($4) free($4); + free($2); + free($4); } ; @@ -1399,23 +1393,23 @@ itemex_p_options } | ',' e_expr ',' expr { $$ = new_itemex_opt($2 ? *($2) : 0, $4, 0, 0); - if($2) free($2); + free($2); $$->gotid = TRUE; $$->gottype = TRUE; } | ',' e_expr ',' e_expr ',' expr { $$ = new_itemex_opt($2 ? *($2) : 0, $4 ? *($4) : 0, $6, 0); - if($2) free($2); - if($4) free($4); + free($2); + free($4); $$->gotid = TRUE; $$->gottype = TRUE; $$->gotstate = TRUE; } | ',' e_expr ',' e_expr ',' e_expr ',' expr { $$ = new_itemex_opt($2 ? *($2) : 0, $4 ? *($4) : 0, $6 ? *($6) : 0, $8); - if($2) free($2); - if($4) free($4); - if($6) free($6); + free($2); + free($4); + free($6); $$->gotid = TRUE; $$->gottype = TRUE; $$->gotstate = TRUE; @@ -1434,7 +1428,7 @@ stringtable : stt_head tBEGIN strings tEND { if(!$3) { - yyerror("Stringtable must have at least one entry"); + parser_error("Stringtable must have at least one entry\n"); } else { @@ -1461,11 +1455,8 @@ stringtable } /* Else were done */ } - if(tagstt_memopt) - { - free(tagstt_memopt); - tagstt_memopt = NULL; - } + free(tagstt_memopt); + tagstt_memopt = NULL; $$ = tagstt; } @@ -1478,8 +1469,7 @@ stt_head: tSTRINGTABLE loadmemopts opt_lvc { tagstt_memopt = $2; tagstt_version = $3->version; tagstt_characts = $3->characts; - if($3) - free($3); + free($3); } ; @@ -1488,12 +1478,12 @@ strings : /* Empty */ { $$ = NULL; } int i; assert(tagstt != NULL); if($2 > 65535 || $2 < -32768) - yyerror("Stringtable entry's ID out of range (%d)", $2); + parser_error("Stringtable entry's ID out of range (%d)\n", $2); /* Search for the ID */ for(i = 0; i < tagstt->nentries; i++) { if(tagstt->entries[i].id == $2) - yyerror("Stringtable ID %d already in use", $2); + parser_error("Stringtable ID %d already in use\n", $2); } /* If we get here, then we have a new unique entry */ tagstt->nentries++; @@ -1508,11 +1498,11 @@ strings : /* Empty */ { $$ = NULL; } tagstt->entries[tagstt->nentries-1].characts = tagstt_characts; if(pedantic && !$4->size) - yywarning("Zero length strings make no sense"); + parser_warning("Zero length strings make no sense\n"); if(!win32 && $4->size > 254) - yyerror("Stringtable entry more than 254 characters"); + parser_error("Stringtable entry more than 254 characters\n"); if(win32 && $4->size > 65534) /* Hmm..., does this happen? */ - yyerror("Stringtable entry more than 65534 characters (probably something else that went wrong)"); + parser_error("Stringtable entry more than 65534 characters (probably something else that went wrong)\n"); $$ = tagstt; } ; @@ -1543,7 +1533,7 @@ fix_version : /* Empty */ { $$ = new_versioninfo(); } | fix_version tFILEVERSION expr ',' expr ',' expr ',' expr { if($1->gotit.fv) - yyerror("FILEVERSION already defined"); + parser_error("FILEVERSION already defined\n"); $$ = $1; $$->filever_maj1 = $3; $$->filever_maj2 = $5; @@ -1553,7 +1543,7 @@ fix_version } | fix_version tPRODUCTVERSION expr ',' expr ',' expr ',' expr { if($1->gotit.pv) - yyerror("PRODUCTVERSION already defined"); + parser_error("PRODUCTVERSION already defined\n"); $$ = $1; $$->prodver_maj1 = $3; $$->prodver_maj2 = $5; @@ -1563,35 +1553,35 @@ fix_version } | fix_version tFILEFLAGS expr { if($1->gotit.ff) - yyerror("FILEFLAGS already defined"); + parser_error("FILEFLAGS already defined\n"); $$ = $1; $$->fileflags = $3; $$->gotit.ff = 1; } | fix_version tFILEFLAGSMASK expr { if($1->gotit.ffm) - yyerror("FILEFLAGSMASK already defined"); + parser_error("FILEFLAGSMASK already defined\n"); $$ = $1; $$->fileflagsmask = $3; $$->gotit.ffm = 1; } | fix_version tFILEOS expr { if($1->gotit.fo) - yyerror("FILEOS already defined"); + parser_error("FILEOS already defined\n"); $$ = $1; $$->fileos = $3; $$->gotit.fo = 1; } | fix_version tFILETYPE expr { if($1->gotit.ft) - yyerror("FILETYPE already defined"); + parser_error("FILETYPE already defined\n"); $$ = $1; $$->filetype = $3; $$->gotit.ft = 1; } | fix_version tFILESUBTYPE expr { if($1->gotit.fst) - yyerror("FILESUBTYPE already defined"); + parser_error("FILESUBTYPE already defined\n"); $$ = $1; $$->filesubtype = $3; $$->gotit.fst = 1; @@ -1734,25 +1724,25 @@ lama : tLOADONCALL { $$ = new_int(~WRC_MO_PRELOAD); } opt_lvc : /* Empty */ { $$ = new_lvc(); } | opt_lvc opt_language { if(!win32) - yywarning("LANGUAGE not supported in 16-bit mode"); + parser_warning("LANGUAGE not supported in 16-bit mode\n"); if($1->language) - yyerror("Language already defined"); + parser_error("Language already defined\n"); $$ = $1; $1->language = $2; } | opt_lvc opt_characts { if(!win32) - yywarning("CHARACTERISTICS not supported in 16-bit mode"); + parser_warning("CHARACTERISTICS not supported in 16-bit mode\n"); if($1->characts) - yyerror("Characteristics already defined"); + parser_error("Characteristics already defined\n"); $$ = $1; $1->characts = $2; } | opt_lvc opt_version { if(!win32) - yywarning("VERSION not supported in 16-bit mode"); + parser_warning("VERSION not supported in 16-bit mode\n"); if($1->version) - yyerror("Version already defined"); + parser_error("Version already defined\n"); $$ = $1; $1->version = $2; } @@ -1768,7 +1758,7 @@ opt_lvc : /* Empty */ { $$ = new_lvc(); } opt_language : tLANGUAGE expr ',' expr { $$ = new_language($2, $4); if (get_language_codepage($2, $4) == -1) - yyerror( "Language %04x is not supported", ($4<<10) + $2); + parser_error( "Language %04x is not supported\n", ($4<<10) + $2); } ; @@ -1827,22 +1817,18 @@ e_expr : /* Empty */ { $$ = 0; } expr : xpr { $$ = ($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); } +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; } | tNOT any_num { $$ = ~($2); } ; @@ -1862,7 +1848,7 @@ static dialog_t *dialog_style(style_t * st, dialog_t *dlg) if(dlg->gotstyle) { - yywarning("Style already defined, or-ing together"); + parser_warning("Style already defined, or-ing together\n"); } else { @@ -1886,7 +1872,7 @@ static dialog_t *dialog_exstyle(style_t *st, dialog_t *dlg) if(dlg->gotexstyle) { - yywarning("ExStyle already defined, or-ing together"); + parser_warning("ExStyle already defined, or-ing together\n"); } else { @@ -1904,7 +1890,7 @@ static dialog_t *dialog_caption(string_t *s, dialog_t *dlg) { assert(dlg != NULL); if(dlg->title) - yyerror("Caption already defined"); + parser_error("Caption already defined\n"); dlg->title = s; return dlg; } @@ -1913,7 +1899,7 @@ static dialog_t *dialog_font(font_id_t *f, dialog_t *dlg) { assert(dlg != NULL); if(dlg->font) - yyerror("Font already defined"); + parser_error("Font already defined\n"); dlg->font = f; return dlg; } @@ -1922,7 +1908,7 @@ static dialog_t *dialog_class(name_id_t *n, dialog_t *dlg) { assert(dlg != NULL); if(dlg->dlgclass) - yyerror("Class already defined"); + parser_error("Class already defined\n"); dlg->dlgclass = n; return dlg; } @@ -2034,7 +2020,7 @@ static control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control defaultstyle |= WS_TABSTOP; break; default: - yywarning("Unknown default button control-style 0x%08x", special_style); + parser_warning("Unknown default button control-style 0x%08x\n", special_style); case BS_GROUPBOX: case BS_RADIOBUTTON: break; @@ -2052,7 +2038,7 @@ static control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control case SS_ICON: /* Special case */ break; default: - yywarning("Unknown default static control-style 0x%08x", special_style); + parser_warning("Unknown default static control-style 0x%08x\n", special_style); break; } break; @@ -2137,7 +2123,7 @@ static dialogex_t *dialogex_style(style_t * st, dialogex_t *dlg) if(dlg->gotstyle) { - yywarning("Style already defined, or-ing together"); + parser_warning("Style already defined, or-ing together\n"); } else { @@ -2161,7 +2147,7 @@ static dialogex_t *dialogex_exstyle(style_t * st, dialogex_t *dlg) if(dlg->gotexstyle) { - yywarning("ExStyle already defined, or-ing together"); + parser_warning("ExStyle already defined, or-ing together\n"); } else { @@ -2257,32 +2243,27 @@ static event_t *add_event(int key, int id, int flags, event_t *prev) static event_t *add_string_event(string_t *key, int id, int flags, event_t *prev) { - int keycode = 0, keysym = 0; + int keycode = 0; event_t *ev = new_event(); - if(key->type == str_char) - keysym = key->str.cstr[0]; - else - keysym = key->str.wstr[0]; + if(key->type != str_char) + yyerror("Key code must be an ascii string"); - if((flags & WRC_AF_VIRTKEY) && (!isupper(keysym & 0xff) && !isdigit(keysym & 0xff))) + if((flags & WRC_AF_VIRTKEY) && (!isupper(key->str.cstr[0] & 0xff) && !isdigit(key->str.cstr[0] & 0xff))) yyerror("VIRTKEY code is not equal to ascii value"); - if(keysym == '^' && (flags & WRC_AF_CONTROL) != 0) + if(key->str.cstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0) { yyerror("Cannot use both '^' and CONTROL modifier"); } - else if(keysym == '^') + else if(key->str.cstr[0] == '^') { - if(key->type == str_char) - keycode = toupper(key->str.cstr[1]) - '@'; - else - keycode = toupper(key->str.wstr[1]) - '@'; + keycode = toupper(key->str.cstr[1]) - '@'; if(keycode >= ' ') yyerror("Control-code out of range"); } else - keycode = keysym; + keycode = key->str.cstr[0]; ev->key = keycode; ev->id = id; ev->flags = flags & ~WRC_AF_ASCII; @@ -2295,7 +2276,8 @@ static event_t *add_string_event(string_t *key, int id, int flags, event_t *prev /* MenuEx specific functions */ static itemex_opt_t *new_itemex_opt(int id, int type, int state, int helpid) { - itemex_opt_t *opt = (itemex_opt_t *)xmalloc(sizeof(itemex_opt_t)); + itemex_opt_t *opt = xmalloc(sizeof(itemex_opt_t)); + memset( opt, 0, sizeof(*opt) ); opt->id = id; opt->type = type; opt->state = state; @@ -2327,7 +2309,7 @@ static raw_data_t *load_file(string_t *filename, language_t *lang) fseek(fp, 0, SEEK_SET); if (rd->size) { - rd->data = (char *)xmalloc(rd->size); + rd->data = xmalloc(rd->size); fread(rd->data, rd->size, 1, fp); } else rd->data = NULL; @@ -2343,11 +2325,11 @@ static raw_data_t *int2raw_data(int i) if( ( i >= 0 && (int)((unsigned short)i) != i) || ( i < 0 && (int)((short)i) != i) ) - yywarning("Integer constant out of 16bit range (%d), truncated to %d\n", i, (short)i); + parser_warning("Integer constant out of 16bit range (%d), truncated to %d\n", i, (short)i); rd = new_raw_data(); rd->size = sizeof(short); - rd->data = (char *)xmalloc(rd->size); + rd->data = xmalloc(rd->size); switch(byteorder) { #ifdef WORDS_BIGENDIAN @@ -2374,7 +2356,7 @@ static raw_data_t *long2raw_data(int i) raw_data_t *rd; rd = new_raw_data(); rd->size = sizeof(int); - rd->data = (char *)xmalloc(rd->size); + rd->data = xmalloc(rd->size); switch(byteorder) { #ifdef WORDS_BIGENDIAN @@ -2405,7 +2387,7 @@ static raw_data_t *str2raw_data(string_t *str) raw_data_t *rd; rd = new_raw_data(); rd->size = str->size * (str->type == str_char ? 1 : 2); - rd->data = (char *)xmalloc(rd->size); + rd->data = xmalloc(rd->size); if(str->type == str_char) memcpy(rd->data, str->str.cstr, rd->size); else if(str->type == str_unicode) @@ -2436,7 +2418,7 @@ static raw_data_t *str2raw_data(string_t *str) } } else - internal_error(__FILE__, __LINE__, "Invalid stringtype"); + internal_error(__FILE__, __LINE__, "Invalid stringtype\n"); return rd; } @@ -2561,12 +2543,12 @@ static stringtable_t *find_stringtable(lvc_t *lvc) if((stt->lvc.version && lvc->version && *(stt->lvc.version) != *(lvc->version)) || (!stt->lvc.version && lvc->version) || (stt->lvc.version && !lvc->version)) - yywarning("Stringtable's versions are not the same, using first definition"); + parser_warning("Stringtable's versions are not the same, using first definition\n"); if((stt->lvc.characts && lvc->characts && *(stt->lvc.characts) != *(lvc->characts)) || (!stt->lvc.characts && lvc->characts) || (stt->lvc.characts && !lvc->characts)) - yywarning("Stringtable's characteristics are not the same, using first definition"); + parser_warning("Stringtable's characteristics are not the same, using first definition\n"); */ return stt; } @@ -2611,7 +2593,8 @@ static resource_t *build_stt_resources(stringtable_t *stthead) for(i = 0; i < stt->nentries; ) { newstt = new_stringtable(&stt->lvc); - newstt->entries = (stt_entry_t *)xmalloc(16 * sizeof(stt_entry_t)); + newstt->entries = xmalloc(16 * sizeof(stt_entry_t)); + memset( newstt->entries, 0, 16 * sizeof(stt_entry_t) ); newstt->nentries = 16; newstt->idbase = stt->entries[i].id & ~0xf; for(j = 0; j < 16 && i < stt->nentries; j++) @@ -2642,7 +2625,7 @@ static resource_t *build_stt_resources(stringtable_t *stthead) } if(andsum != orsum) { - warning("Stringtable's memory options are not equal (idbase: %d)", newstt->idbase); + warning("Stringtable's memory options are not equal (idbase: %d)\n", newstt->idbase); } /* Check version and characteristics */ for(j = 0; j < 16; j++) @@ -2650,11 +2633,11 @@ static resource_t *build_stt_resources(stringtable_t *stthead) if(characts && newstt->entries[j].characts && *newstt->entries[j].characts != *characts) - warning("Stringtable's characteristics are not the same (idbase: %d)", newstt->idbase); + warning("Stringtable's characteristics are not the same (idbase: %d)\n", newstt->idbase); if(version && newstt->entries[j].version && *newstt->entries[j].version != *version) - warning("Stringtable's versions are not the same (idbase: %d)", newstt->idbase); + warning("Stringtable's versions are not the same (idbase: %d)\n", newstt->idbase); } rsc = new_resource(res_stt, newstt, newstt->memopt, newstt->lvc.language); rsc->name = new_name_id(); @@ -2768,7 +2751,7 @@ static resource_t *build_fontdir(resource_t **fnt, int nfnt) static int once = 0; if(!once) { - warning("Need to parse fonts, not yet implemented (fnt: %p, nfnt: %d)", fnt, nfnt); + warning("Need to parse fonts, not yet implemented (fnt: %p, nfnt: %d)\n", fnt, nfnt); once++; } return NULL; @@ -2817,7 +2800,7 @@ static resource_t *build_fontdirs(resource_t *tail) { if(compare_name_id(&nid, fnd[i]->name)) { - warning("User supplied FONTDIR entry has an invalid name '%s', ignored", + warning("User supplied FONTDIR entry has an invalid name '%s', ignored\n", get_nameid_str(fnd[i]->name)); fnd[i] = NULL; } @@ -2827,12 +2810,13 @@ static resource_t *build_fontdirs(resource_t *tail) if(nfnt == 0) { if(nfnd != 0) - warning("Found %d FONTDIR entries without any fonts present", nfnd); + warning("Found %d FONTDIR entries without any fonts present\n", nfnd); goto clean; } /* Copy space */ lanfnt = xmalloc(nfnt * sizeof(*lanfnt)); + memset( lanfnt, 0, nfnt * sizeof(*lanfnt)); /* Get all fonts covered by fontdirs */ for(i = 0; i < nfnd; i++) @@ -2861,7 +2845,7 @@ static resource_t *build_fontdirs(resource_t *tail) else if(nlanfnt == BYTESWAP_WORD(cnt)) isswapped = 1; else - error("FONTDIR for language %d,%d has wrong count (%d, expected %d)", + error("FONTDIR for language %d,%d has wrong count (%d, expected %d)\n", fnd[i]->lan->id, fnd[i]->lan->sub, cnt, nlanfnt); #ifdef WORDS_BIGENDIAN if((byteorder == WRC_BO_LITTLE && !isswapped) || (byteorder != WRC_BO_LITTLE && isswapped)) @@ -2869,7 +2853,7 @@ static resource_t *build_fontdirs(resource_t *tail) if((byteorder == WRC_BO_BIG && !isswapped) || (byteorder != WRC_BO_BIG && isswapped)) #endif { - internal_error(__FILE__, __LINE__, "User supplied FONTDIR needs byteswapping"); + internal_error(__FILE__, __LINE__, "User supplied FONTDIR needs byteswapping\n"); } } @@ -2913,10 +2897,8 @@ static resource_t *build_fontdirs(resource_t *tail) free(lanfnt); clean: - if(fnt) - free(fnt); - if(fnd) - free(fnd); + free(fnt); + free(fnd); free(str.str.cstr); return lst; } @@ -3034,13 +3016,13 @@ static int rsrcid_to_token(int lookahead) case WRC_RT_ANIICON: case WRC_RT_GROUP_CURSOR: case WRC_RT_GROUP_ICON: - yywarning("Usertype uses reserved type ID %d, which is auto-generated", yylval.num); + parser_warning("Usertype uses reserved type ID %d, which is auto-generated\n", yylval.num); return lookahead; case WRC_RT_DLGINCLUDE: case WRC_RT_PLUGPLAY: case WRC_RT_VXD: - yywarning("Usertype uses reserved type ID %d, which is not supported by wrc yet", yylval.num); + parser_warning("Usertype uses reserved type ID %d, which is not supported by wrc yet\n", yylval.num); default: return lookahead; } diff --git a/reactos/tools/wrc/readres.c b/reactos/tools/wrc/readres.c index 4b6405c9a49..35a01768fc1 100644 --- a/reactos/tools/wrc/readres.c +++ b/reactos/tools/wrc/readres.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -31,7 +31,7 @@ #include "utils.h" #include "genres.h" -struct resheader32 { +static const struct resheader32 { DWORD ressize; /* 0 */ DWORD hdrsize; /* 0x20 */ WORD restype1; /* 0xffff */ @@ -105,7 +105,7 @@ static enum res_e res_type_from_id(const name_id_t *nid) return res_usr; if(nid->type != name_ord) - internal_error(__FILE__, __LINE__, "Invalid name_id descriptor %d", nid->type); + internal_error(__FILE__, __LINE__, "Invalid name_id descriptor %d\n", nid->type); switch(nid->name.i_name) { @@ -131,7 +131,7 @@ static enum res_e res_type_from_id(const name_id_t *nid) case WRC_RT_VXD: case WRC_RT_ANICURSOR: case WRC_RT_ANIICON: - warning("Cannot be sure of resource type, using usertype settings"); + warning("Cannot be sure of resource type, using usertype settings\n"); return res_usr; } } @@ -184,7 +184,7 @@ static resource_t *read_res32(FILE *fp) totsize = hdrsize; if(hdrsize & 3) { - warning("Hu? .res header needed alignment (anything can happen now)"); + warning("Hu? .res header needed alignment (anything can happen now)\n"); totsize += 4 - (hdrsize & 3); } totsize += ressize; @@ -216,7 +216,7 @@ static resource_t *read_res32(FILE *fp) } else if(get_word(idx) == 0) { - error("ResType name has zero length (32 bit)"); + error("ResType name has zero length (32 bit)\n"); } else { @@ -250,7 +250,7 @@ static resource_t *read_res32(FILE *fp) } else if(get_word(idx) == 0) { - error("ResName name has zero length (32 bit)"); + error("ResName name has zero length (32 bit)\n"); } else { @@ -327,7 +327,7 @@ static resource_t *read_res32(FILE *fp) */ static resource_t *read_res16(FILE *fp) { - internal_error(__FILE__, __LINE__, "Can't yet read 16 bit .res files"); + internal_error(__FILE__, __LINE__, "Can't yet read 16 bit .res files\n"); return NULL; } @@ -350,7 +350,7 @@ resource_t *read_resfile(char *inname) fp = fopen(inname, "rb"); if(!fp) - error("Could not open inputfile %s", inname); + error("Could not open inputfile %s\n", inname); /* Determine 16 or 32 bit .res file */ if(fread(&rh, 1, sizeof(rh), fp) != sizeof(rh)) @@ -360,16 +360,16 @@ resource_t *read_resfile(char *inname) if(!memcmp(&emptyheader, &rh, sizeof(rh))) is32bit = 1; else if(!memcmp(&emptyheaderSWAPPED, &rh, sizeof(rh))) - error("Binary .res-file has its byteorder swapped"); + error("Binary .res-file has its byteorder swapped\n"); else is32bit = 0; } if(is32bit && !win32) - error("Cannot convert 32-bit .res-file into 16-bit resources (and will, hopefully never, implement it)"); + error("Cannot convert 32-bit .res-file into 16-bit resources (and will, hopefully never, implement it)\n"); if(!is32bit && win32) - error("Cannot (yet) convert 16-bit .res-file into 32-bit resources"); + error("Cannot (yet) convert 16-bit .res-file into 32-bit resources\n"); if(!is32bit) { diff --git a/reactos/tools/wrc/readres.h b/reactos/tools/wrc/readres.h index d4e7a91d5c8..53562f4cf2d 100644 --- a/reactos/tools/wrc/readres.h +++ b/reactos/tools/wrc/readres.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WRC_READRES_H diff --git a/reactos/tools/wrc/translation.c b/reactos/tools/wrc/translation.c index 03db0c29f3c..2721fa71b9d 100644 --- a/reactos/tools/wrc/translation.c +++ b/reactos/tools/wrc/translation.c @@ -13,16 +13,18 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include "dumpres.h" +#include "utils.h" #include "wrc.h" #define MASTER_LANGUAGE LANG_ENGLISH +#define MASTER_SUBLANGUAGE SUBLANG_ENGLISH_US #define NB_LANG 0x94 enum lang_type_e { @@ -31,77 +33,65 @@ enum lang_type_e { lang_type_normal }; -static int present_resources[res_usr+1]; -static char *res_names[res_usr+1]; -static int nb_resources[res_usr+1][lang_type_normal+1]; -static resource_t **list_resources[res_usr+1][lang_type_normal+1]; - -static int get_language_id(resource_t *resource) { +static language_t get_language(resource_t *resource) { switch(resource->type) { case res_acc: - return resource->res.acc->lvc.language->id; + return *resource->res.acc->lvc.language; case res_bmp: - return resource->res.bmp->data->lvc.language->id; + return *resource->res.bmp->data->lvc.language; case res_cur: - return resource->res.cur->lvc.language->id; + return *resource->res.cur->lvc.language; case res_curg: - return resource->res.curg->lvc.language->id; + return *resource->res.curg->lvc.language; case res_dlg: - return resource->res.dlg->lvc.language->id; + return *resource->res.dlg->lvc.language; case res_dlgex: - return resource->res.dlgex->lvc.language->id; + return *resource->res.dlgex->lvc.language; case res_fnt: - return resource->res.fnt->data->lvc.language->id; + return *resource->res.fnt->data->lvc.language; case res_fntdir: - return resource->res.fnd->data->lvc.language->id; + return *resource->res.fnd->data->lvc.language; case res_ico: - return resource->res.ico->lvc.language->id; + return *resource->res.ico->lvc.language; case res_icog: - return resource->res.icog->lvc.language->id; + return *resource->res.icog->lvc.language; case res_men: - return resource->res.men->lvc.language->id; + return *resource->res.men->lvc.language; case res_menex: - return resource->res.menex->lvc.language->id; + return *resource->res.menex->lvc.language; case res_rdt: - return resource->res.rdt->data->lvc.language->id; + return *resource->res.rdt->data->lvc.language; case res_stt: - return resource->res.stt->lvc.language->id; + return *resource->res.stt->lvc.language; case res_usr: - return resource->res.usr->data->lvc.language->id; + return *resource->res.usr->data->lvc.language; case res_msg: - return resource->res.msg->data->lvc.language->id; + return *resource->res.msg->data->lvc.language; case res_ver: - return resource->res.ver->lvc.language->id; + return *resource->res.ver->lvc.language; case res_dlginit: - return resource->res.dlgi->data->lvc.language->id; + return *resource->res.dlgi->data->lvc.language; case res_toolbar: - return resource->res.tbt->lvc.language->id; + return *resource->res.tbt->lvc.language; case res_anicur: case res_aniico: - return resource->res.ani->data->lvc.language->id; + return *resource->res.ani->data->lvc.language; + case res_html: + return *resource->res.html->data->lvc.language; default: /* Not supposed to reach here */ fprintf(stderr, "Not supposed to reach here (get_language_id())\n"); abort(); - return -1; } } -static void add_resource(resource_t *resource) { - enum lang_type_e lang_type; - enum res_e res_type = resource->type; - int lid = get_language_id(resource); +static int get_language_id(resource_t *resource) { + return get_language(resource).id; +} - if(lid == MASTER_LANGUAGE) { - lang_type = lang_type_master; - } else if(lid == LANG_NEUTRAL) { - lang_type = lang_type_neutral; - } else { - lang_type = lang_type_normal; - } - nb_resources[res_type][lang_type]++; - list_resources[res_type][lang_type] = realloc(list_resources[res_type][lang_type], nb_resources[res_type][lang_type]*sizeof(resource_t *)); - list_resources[res_type][lang_type][nb_resources[res_type][lang_type]-1] = resource; +static int compare_lang(language_t lang1, language_t lang2) +{ + return memcmp(&lang1, &lang2, sizeof(language_t)); } #if 0 @@ -299,7 +289,7 @@ static int compare_control(control_t *control1, control_t *control2) { if(!different && strcmp(nameid, get_nameid_str(control2->ctlclass))) different = 1; free(nameid); - if(!different && + if(!different && (control1->id != control2->id)) different = 1; if(!different && control1->gotstyle && control2->gotstyle) { @@ -614,6 +604,16 @@ static int compare_rcdata(rcdata_t *rcdata1, rcdata_t *rcdata2) { return different; } +static int compare_html(html_t *rcdata1, html_t *rcdata2) { + int different = 0; + if(!different && + ((rcdata1->memopt != rcdata2->memopt) || + (rcdata1->data->lvc.version != rcdata2->data->lvc.version) || + (rcdata1->data->lvc.characts != rcdata2->data->lvc.characts))) + different = 1; + return different; +} + static int compare_stringtable(stringtable_t *stringtable1, stringtable_t *stringtable2) { int different = 0; int i; @@ -831,7 +831,7 @@ static int compare_versioninfo(versioninfo_t *versioninfo1, versioninfo_t *versi } if(!different && ((ver_block1 && !ver_block2) || - (ver_block1 && !ver_block2))) + (!ver_block1 && ver_block2))) different = 1; } return different; @@ -917,6 +917,8 @@ static int compare(resource_t *resource1, resource_t *resource2) { return compare_stringtable(resource1->res.stt, resource2->res.stt); case res_usr: return compare_user(resource1->res.usr, resource2->res.usr); + case res_html: + return compare_html(resource1->res.html, resource2->res.html); case res_msg: return compare_messagetable(resource1->res.msg, resource2->res.msg); case res_ver: @@ -936,221 +938,215 @@ static int compare(resource_t *resource1, resource_t *resource2) { } } -void verify_translations(resource_t *top) { - enum lang_type_e lang_type; - enum res_e res_type; - int **presence; - int i, j; - char *nameid; - char **problems; - int nb_problems, last_problem; - int complete, needs_work, partial; - resource_t *next = top; +static void dump_stringtable(resource_t *res) +{ + stringtable_t *stt = res->res.stt; + int j; - for(res_type = res_0; res_type <= res_usr; res_type++) { - present_resources[res_type] = 0; - for(lang_type = lang_type_master; lang_type <= lang_type_normal; lang_type++) { - nb_resources[res_type][lang_type] = 0; - list_resources[res_type][lang_type] = NULL; - } - } + printf("DUMP "); + assert((stt->idbase%16) == 0); + assert(stt->nentries == 16); + for (j = 0; j < stt->nentries; j++) + { + stt_entry_t *entry = &stt->entries[j]; + language_t *lang = stt->lvc.language; + string_t *newstr; + WCHAR *wstr; + int k; - while(next) { - switch(next->type) { - case res_acc: - case res_bmp: - case res_cur: - case res_curg: - case res_dlg: - case res_dlgex: - case res_fnt: - case res_fntdir: - case res_ico: - case res_icog: - case res_men: - case res_menex: - case res_rdt: - case res_stt: - case res_usr: - case res_msg: - case res_ver: - case res_dlginit: - case res_toolbar: - case res_anicur: - case res_aniico: - add_resource(next); - break; - default: - fprintf(stderr, "Report this: unknown resource type parsed %08x\n", next->type); - } - next = next->next; - } - present_resources[res_acc] = 1; - res_names[res_acc] = strdup("accelerator"); - present_resources[res_bmp] = 1; - res_names[res_bmp] = strdup("bitmap"); - present_resources[res_cur] = 1; - res_names[res_cur] = strdup("cursor"); - present_resources[res_curg] = 1; - res_names[res_curg] = strdup("cursor_group"); - present_resources[res_dlg] = 1; - res_names[res_dlg] = strdup("dialog"); - present_resources[res_dlgex] = 1; - res_names[res_dlgex] = strdup("dialogex"); - present_resources[res_fnt] = 1; - res_names[res_fnt] = strdup("font"); - present_resources[res_fntdir] = 1; - res_names[res_fntdir] = strdup("fontdir"); - present_resources[res_ico] = 1; - res_names[res_ico] = strdup("icon"); - present_resources[res_icog] = 1; - res_names[res_icog] = strdup("icon_group"); - present_resources[res_men] = 1; - res_names[res_men] = strdup("menu"); - present_resources[res_menex] = 1; - res_names[res_menex] = strdup("menuex"); - present_resources[res_rdt] = 1; - res_names[res_rdt] = strdup("rcdata"); - present_resources[res_stt] = 1; - res_names[res_stt] = strdup("stringtable"); - present_resources[res_usr] = 1; - res_names[res_usr] = strdup("user"); - present_resources[res_msg] = 1; - res_names[res_msg] = strdup("messagetable"); - present_resources[res_ver] = 1; - res_names[res_ver] = strdup("versioninfo"); - present_resources[res_dlginit] = 1; - res_names[res_dlginit] = strdup("dlginit"); - present_resources[res_toolbar] = 1; - res_names[res_toolbar] = strdup("toolbar"); - present_resources[res_anicur] = 1; - res_names[res_anicur] = strdup("ani_cursor"); - present_resources[res_aniico] = 1; - res_names[res_aniico] = strdup("ani_icon"); + if (entry->str) + { + newstr = convert_string(entry->str, str_unicode, get_language_codepage(lang->id, lang->sub)); + printf("%02x%02x", newstr->size & 0xff, (newstr->size >> 8) & 0xff); + wstr = newstr->str.wstr; + for (k = 0; k < newstr->size; k++) + printf("%02x%02x", wstr[k] & 0xff, wstr[k] >> 8); + free_string(newstr); + } + else + printf("0000"); + } + putchar('\n'); +} - for(res_type = res_0; res_type <= res_usr; res_type++) { - if(!present_resources[res_type]) { - continue; - } - if(nb_resources[res_type][lang_type_normal] > 0) { - if(nb_resources[res_type][lang_type_master] && nb_resources[res_type][lang_type_neutral]) { - fprintf(stderr, "Type %s:\n", res_names[res_type]); - fprintf(stderr, "There are both a NEUTRAL and a MASTER version for %s, along with additional localized versions. The NEUTRAL versions will not be checked against other versions.\n", res_names[res_type]); - } else if(nb_resources[res_type][lang_type_neutral]) { - fprintf(stderr, "Type %s:\n", res_names[res_type]); - fprintf(stderr, "There are no MASTER version, but there are some NEUTRAL versions for %s, so will use those instead of MASTER for comparison.\n", res_names[res_type]); - list_resources[res_type][lang_type_master] = list_resources[res_type][lang_type_neutral]; - nb_resources[res_type][lang_type_master] = nb_resources[res_type][lang_type_neutral]; - } else if(!nb_resources[res_type][lang_type_master]) { - fprintf(stderr, "Type %s:\n", res_names[res_type]); - fprintf(stderr, "There are no NEUTRAL nor MASTER versions for %s, but there are some other localized versions. No comparison will be done at all.\n", res_names[res_type]); - } - } else { - if(nb_resources[res_type][lang_type_master] && nb_resources[res_type][lang_type_neutral]) { - fprintf(stderr, "Type %s:\n", res_names[res_type]); - fprintf(stderr, "There are both a NEUTRAL and a MASTER versions for %s, but no other localized version. No comparison will be done at all.\n", res_names[res_type]); - } else if(nb_resources[res_type][lang_type_master]) { - fprintf(stderr, "Type %s:\n", res_names[res_type]); - fprintf(stderr, "There are only MASTER versions for %s. No comparison will be done at all.\n", res_names[res_type]); - } else if(nb_resources[res_type][lang_type_neutral]) { - /* fprintf(stderr, "There are only NEUTRAL versions for %s. No comparison will be done at all.\n", res_names[res_type]); */ - } else { - /* fprintf(stderr, "There are no versions at all for %s. No comparison will be done at all.\n", res_names[res_type]); */ - } - } +static void dump(resource_t *res) +{ + switch (res->type) + { + case res_stt: + dump_stringtable(res); + return; + default: + break; + } +} - presence = malloc(nb_resources[res_type][lang_type_master]*sizeof(int *)); - for(i = 0; i < nb_resources[res_type][lang_type_master]; i++) { - presence[i] = calloc(NB_LANG, sizeof(int)); - presence[i][MASTER_LANGUAGE] = -1; - } +typedef struct resource_lang_node +{ + language_t lang; + resource_t *res; + struct resource_lang_node *next; +} resource_lang_node_t; - for(i = 0; i < nb_resources[res_type][lang_type_normal]; i++) { - for(j = 0; j < nb_resources[res_type][lang_type_master]; j++) { - nameid = strdup(get_nameid_str(list_resources[res_type][lang_type_normal][i]->name)); - if(!strcmp(nameid, get_nameid_str(list_resources[res_type][lang_type_master][j]->name))) { - if(compare(list_resources[res_type][lang_type_normal][i], list_resources[res_type][lang_type_master][j])) { - presence[j][get_language_id(list_resources[res_type][lang_type_normal][i])] = 2; - /* fprintf(stderr, "Differences in type %s, ID %s, for language %s\n", res_names[res_type], nameid, get_language_name(get_language_id(list_resources[res_type][lang_type_normal][i]))); */ - } else { - presence[j][get_language_id(list_resources[res_type][lang_type_normal][i])] = 1; - } - } - free(nameid); - } - } +typedef struct resource_id_node +{ + name_id_t *id; + resource_lang_node_t *langs; + struct resource_id_node *next; +} resource_id_node_t; - problems = malloc(sizeof(char *)); - problems[0] = strdup(""); - nb_problems = 0; - last_problem = -1; - for(i = 0; i < NB_LANG; i++) { - complete = 1; - needs_work = 0; - partial = 0; - for(j = 0; j < nb_resources[res_type][lang_type_master]; j++) { - if(presence[j][i]) { - partial = 1; - if(presence[j][i] == 2) { - needs_work = 1; - problems = realloc(problems, (++nb_problems+1)*sizeof(char *)); - problems[nb_problems] = malloc(strlen(get_nameid_str(list_resources[res_type][lang_type_master][j]->name)) + 9); - sprintf(problems[nb_problems], "DIFF %s %02x", get_nameid_str(list_resources[res_type][lang_type_master][j]->name), i); - if(last_problem == i) { - problems[nb_problems-1] = realloc(problems[nb_problems-1], strlen(problems[nb_problems-1]) + 3); - strcat(problems[nb_problems-1], " \\"); - } else { - last_problem = i; - } - } - } else { - complete = 0; - problems = realloc(problems, (++nb_problems+1)*sizeof(char *)); - problems[nb_problems] = malloc(strlen(get_nameid_str(list_resources[res_type][lang_type_master][j]->name)) + 8); - sprintf(problems[nb_problems], "ABS %s %02x", get_nameid_str(list_resources[res_type][lang_type_master][j]->name), i); - if(last_problem == i) { - problems[nb_problems-1] = realloc(problems[nb_problems-1], strlen(problems[nb_problems-1]) + 3); - strcat(problems[nb_problems-1], " \\"); - } else { - last_problem = i; - } - } - } - if(complete && partial && !needs_work) { - /* Support is complete, no need to do anything */ - /* fprintf(stderr, "Support for language %s is complete for %s.\n", get_language_name(i), res_names[res_type]); */ - printf("."); - } else if(complete && partial && needs_work) { - /* Support is incomplete (differing resources), needs work */ - /* fprintf(stderr, "Support for language %s is incomplete (differing resources) for %s.\n", get_language_name(i), res_names[res_type]); */ - printf("x"); - } else if(!complete && partial && !needs_work) { - /* Support is incomplete (missing resources), needs work */ - /* fprintf(stderr, "Support for language %s is incomplete (missing resources) for %s.\n", get_language_name(i), res_names[res_type]); */ - printf("-"); - } else if(!complete && partial && needs_work) { - /* Support is incomplete (missing and differing resources), needs work */ - /* fprintf(stderr, "Support for language %s is incomplete (missing and differing resources) for %s.\n", get_language_name(i), res_names[res_type]); */ - printf("+"); - } else if(!complete && !partial) { - /* Support is totally absent, might be interesting to do */ - /* fprintf(stderr, "Support for language %s is absent for %s.\n", get_language_name(i), res_names[res_type]); */ - printf(" "); - } else { - /* Support is not relevant, no need to do anything */ - /* fprintf(stderr, "Support for language %s is not relevant for %s.\n", get_language_name(i), res_names[res_type]); */ - printf("n"); - } - } - printf("\n"); - for(i = 1; i <= nb_problems; i++) { - printf("%s\n", problems[i]); - free(problems[i]); - } - free(problems[0]); - free(problems); - for(i = 0; i < nb_resources[res_type][lang_type_master]; i++) - free(presence[i]); - free(presence); +struct +{ + int enabled; + struct resource_id_node *ids; +} verify_tab[res_usr+1]; + +static void add_resource(resource_t *res) +{ + resource_id_node_t *idnode; + resource_lang_node_t *langnode; + if (!verify_tab[res->type].enabled) + { + fprintf(stderr, "ERR: Report this: unknown resource type parsed %08x\n", res->type); + return; + } + + for (idnode = verify_tab[res->type].ids; idnode; idnode = idnode->next) + if (compare_name_id(idnode->id, res->name) == 0) + break; + + if (idnode == NULL) + { + idnode = xmalloc(sizeof(resource_id_node_t)); + idnode->id = res->name; + idnode->langs = NULL; + idnode->next = verify_tab[res->type].ids; + verify_tab[res->type].ids = idnode; + } + + for (langnode = idnode->langs; langnode; langnode = langnode->next) + if (compare_lang(langnode->lang, get_language(res)) == 0) + { + fprintf(stderr, "ERR: resource %s [type %x] language %03x:%02x duplicated!\n", + get_nameid_str(res->name), res->type, langnode->lang.id, langnode->lang.sub); + return; + } + + langnode = xmalloc(sizeof(resource_lang_node_t)); + langnode->res = res; + langnode->lang = get_language(res); + langnode->next = idnode->langs; + idnode->langs = langnode; +} + +static void setup_tabs(void) +{ + int i; + + for (i = 0; i <= res_usr; i++) + switch(i) { + case res_acc: + case res_bmp: + case res_cur: + case res_curg: + case res_dlg: + case res_dlgex: + case res_fnt: + case res_fntdir: + case res_ico: + case res_icog: + case res_men: + case res_menex: + case res_rdt: + case res_stt: + case res_usr: + case res_msg: + case res_ver: + case res_dlginit: + case res_toolbar: + case res_anicur: + case res_aniico: + case res_html: + verify_tab[i].enabled = 1; + break; } } + +static const char *get_typename_for_int(int type) { + resource_t res; + res.type = type; + return get_typename(&res); +} + +static resource_t *find_main(int type, name_id_t *id, resource_lang_node_t *langnode) +{ + resource_t *neutral = NULL, *en = NULL, *en_US = NULL; + for (; langnode; langnode = langnode->next) + { + if (langnode->lang.id == LANG_NEUTRAL && langnode->lang.sub == SUBLANG_NEUTRAL) + neutral = langnode->res; + if (langnode->lang.id == MASTER_LANGUAGE && langnode->lang.sub == SUBLANG_NEUTRAL) + en = langnode->res; + if (langnode->lang.id == MASTER_LANGUAGE && langnode->lang.sub == MASTER_SUBLANGUAGE) + en_US = langnode->res; + } + + if (neutral != NULL && (en != NULL || en_US != NULL)) + { + fprintf(stderr, "INFO: Resource %04x/%s has both NEUTRAL and MASTER language translarion\n", + type, get_nameid_str(id)); + } + + if (en_US != NULL) return en_US; + if (en != NULL) return en; + return neutral; +} + +void verify_translations(resource_t *top) { + resource_t *curr = top; + resource_id_node_t *idnode; + resource_lang_node_t *langnode; + int type; + + setup_tabs(); + while (curr) + { + add_resource(curr); + curr = curr->next; + } + + for (type = 0; type <= res_usr; type++) + { + printf("TYPE NEXT [%s]\n", get_typename_for_int(type)); + for (idnode = verify_tab[type].ids; idnode; idnode = idnode->next) + { + resource_t *mainres; + printf("RESOURCE [%s]\n", get_nameid_str(idnode->id)); + + mainres = find_main(type, idnode->id, idnode->langs); + if (!mainres) + { + fprintf(stderr, "ERR: resource %04x/%s has translation(s) but not available in NEUTRAL or MASTER language\n", + type, get_nameid_str(idnode->id)); + for (langnode = idnode->langs; langnode; langnode = langnode->next) + printf("EXTRA %03x:%02x\n", langnode->lang.id, langnode->lang.sub); + continue; + } + + if (get_language_id(mainres) == LANG_NEUTRAL && idnode->langs->next == NULL) { + printf("NOTRANSL\n"); + continue; + } + + for (langnode = idnode->langs; langnode; langnode = langnode->next) + { + printf("EXIST %03x:%02x\n", langnode->lang.id, langnode->lang.sub); + dump(langnode->res); + if (compare(langnode->res, mainres)) + { + printf("DIFF %03x:%02x\n", langnode->lang.id, langnode->lang.sub); + } + } + } + } +} diff --git a/reactos/tools/wrc/utils.c b/reactos/tools/wrc/utils.c index 7c34e55f217..14373645314 100644 --- a/reactos/tools/wrc/utils.c +++ b/reactos/tools/wrc/utils.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -63,25 +63,24 @@ static void generic_msg(const char *s, const char *t, const char *n, va_list ap) } } #endif - fprintf(stderr, "\n"); } -int yyerror(const char *s, ...) +int parser_error(const char *s, ...) { va_list ap; va_start(ap, s); - generic_msg(s, "Error", yytext, ap); + generic_msg(s, "Error", parser_text, ap); va_end(ap); exit(1); return 1; } -int yywarning(const char *s, ...) +int parser_warning(const char *s, ...) { va_list ap; va_start(ap, s); - generic_msg(s, "Warning", yytext, ap); + generic_msg(s, "Warning", parser_text, ap); va_end(ap); return 0; } @@ -92,7 +91,6 @@ void internal_error(const char *file, int line, const char *s, ...) va_start(ap, s); fprintf(stderr, "Internal error (please report) %s %d: ", file, line); vfprintf(stderr, s, ap); - fprintf(stderr, "\n"); va_end(ap); exit(3); } @@ -103,7 +101,6 @@ void error(const char *s, ...) va_start(ap, s); fprintf(stderr, "Error: "); vfprintf(stderr, s, ap); - fprintf(stderr, "\n"); va_end(ap); exit(2); } @@ -114,7 +111,6 @@ void warning(const char *s, ...) va_start(ap, s); fprintf(stderr, "Warning: "); vfprintf(stderr, s, ap); - fprintf(stderr, "\n"); va_end(ap); } @@ -126,7 +122,6 @@ void chat(const char *s, ...) va_start(ap, s); fprintf(stderr, "FYI: "); vfprintf(stderr, s, ap); - fprintf(stderr, "\n"); va_end(ap); } } @@ -167,12 +162,7 @@ void *xmalloc(size_t size) { error("Virtual memory exhausted.\n"); } - /* - * We set it to 0. - * This is *paramount* because we depend on it - * just about everywhere in the rest of the code. - */ - memset(res, 0, size); + memset(res, 0x55, size); return res; } @@ -230,7 +220,7 @@ int compare_name_id(const name_id_t *n1, const name_id_t *n2) } else { - internal_error(__FILE__, __LINE__, "Can't yet compare strings of mixed type"); + internal_error(__FILE__, __LINE__, "Can't yet compare strings of mixed type\n"); } } else if(n1->type == name_ord && n2->type == name_str) @@ -238,7 +228,7 @@ int compare_name_id(const name_id_t *n1, const name_id_t *n2) else if(n1->type == name_str && n2->type == name_ord) return -1; else - internal_error(__FILE__, __LINE__, "Comparing name-ids with unknown types (%d, %d)", + internal_error(__FILE__, __LINE__, "Comparing name-ids with unknown types (%d, %d)\n", n1->type, n2->type); return 0; /* Keep the compiler happy */ @@ -248,26 +238,38 @@ string_t *convert_string(const string_t *str, enum str_e type, int codepage) { const union cptable *cptable = codepage ? wine_cp_get_table( codepage ) : NULL; string_t *ret = xmalloc(sizeof(*ret)); + int res; - if (!cptable && str->type != type) - error( "Current language is Unicode only, cannot convert strings" ); + if (!codepage && str->type != type) + parser_error( "Current language is Unicode only, cannot convert string\n" ); if((str->type == str_char) && (type == str_unicode)) { - ret->type = str_unicode; - ret->size = wine_cp_mbstowcs( cptable, 0, str->str.cstr, str->size, NULL, 0 ); + ret->type = str_unicode; + ret->size = cptable ? wine_cp_mbstowcs( cptable, 0, str->str.cstr, str->size, NULL, 0 ) + : wine_utf8_mbstowcs( 0, str->str.cstr, str->size, NULL, 0 ); ret->str.wstr = xmalloc( (ret->size+1) * sizeof(WCHAR) ); - wine_cp_mbstowcs( cptable, 0, str->str.cstr, str->size, ret->str.wstr, ret->size ); + if (cptable) + res = wine_cp_mbstowcs( cptable, MB_ERR_INVALID_CHARS, str->str.cstr, str->size, + ret->str.wstr, ret->size ); + else + res = wine_utf8_mbstowcs( MB_ERR_INVALID_CHARS, str->str.cstr, str->size, + ret->str.wstr, ret->size ); + if (res == -2) + parser_error( "Invalid character in string '%.*s' for codepage %u\n", + str->size, str->str.cstr, codepage ); ret->str.wstr[ret->size] = 0; } else if((str->type == str_unicode) && (type == str_char)) { - ret->type = str_char; - ret->size = wine_cp_wcstombs( cptable, 0, str->str.wstr, str->size, - NULL, 0, NULL, NULL ); + ret->type = str_char; + ret->size = cptable ? wine_cp_wcstombs( cptable, 0, str->str.wstr, str->size, NULL, 0, NULL, NULL ) + : wine_utf8_wcstombs( 0, str->str.wstr, str->size, NULL, 0 ); ret->str.cstr = xmalloc( ret->size + 1 ); - wine_cp_wcstombs( cptable, 0, str->str.wstr, str->size, ret->str.cstr, ret->size, - NULL, NULL ); + if (cptable) + wine_cp_wcstombs( cptable, 0, str->str.wstr, str->size, ret->str.cstr, ret->size, NULL, NULL ); + else + wine_utf8_wcstombs( 0, str->str.wstr, str->size, ret->str.cstr, ret->size ); ret->str.cstr[ret->size] = 0; } else if(str->type == str_unicode) diff --git a/reactos/tools/wrc/utils.h b/reactos/tools/wrc/utils.h index fe16098705f..30c6ab2755f 100644 --- a/reactos/tools/wrc/utils.h +++ b/reactos/tools/wrc/utils.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WRC_UTILS_H @@ -33,8 +33,8 @@ char *xstrdup(const char *str); #define __attribute__(X) #endif -int yyerror(const char *s, ...) __attribute__((format (printf, 1, 2))); -int yywarning(const char *s, ...) __attribute__((format (printf, 1, 2))); +int parser_error(const char *s, ...) __attribute__((format (printf, 1, 2))); +int parser_warning(const char *s, ...) __attribute__((format (printf, 1, 2))); void internal_error(const char *file, int line, const char *s, ...) __attribute__((format (printf, 3, 4), noreturn)); void error(const char *s, ...) __attribute__((format (printf, 1, 2))); void warning(const char *s, ...) __attribute__((format (printf, 1, 2))); diff --git a/reactos/tools/wrc/wrc.c b/reactos/tools/wrc/wrc.c index b45353bbcaf..6d6a1158fb1 100644 --- a/reactos/tools/wrc/wrc.c +++ b/reactos/tools/wrc/wrc.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ @@ -53,7 +53,7 @@ #define ENDIAN "little" #endif -static char usage[] = +static const char usage[] = "Usage: wrc [options...] [infile[.rc|.res]] [outfile]\n" " -D id[=val] Define preprocessor identifier id=val\n" " -E Preprocess only\n" @@ -165,17 +165,17 @@ int char_number = 1; /* The current char pos within the line */ char *cmdline; /* The entire commandline */ time_t now; /* The time of start of wrc */ -int yy_flex_debug; +int parser_debug, yy_flex_debug; resource_t *resource_top; /* The top of the parsed resources */ int getopt (int argc, char *const *argv, const char *optstring); -static void rm_tempfile(void); +static void cleanup_files(void); static void segvhandler(int sig); -static const char* short_options = +static const char short_options[] = "D:Ef:F:hi:I:J:l:o:O:rU:v"; -static struct option long_options[] = { +static const struct option long_options[] = { { "debug", 1, 0, 6 }, { "define", 1, 0, 'D' }, { "endianess", 1, 0, 7 }, @@ -188,7 +188,7 @@ static struct option long_options[] = { { "nostdinc", 0, 0, 1 }, { "output", 1, 0, 'o' }, { "output-format", 1, 0, 'O' }, - { "pendantic", 0, 0, 8 }, + { "pedantic", 0, 0, 8 }, { "preprocessor", 1, 0, 4 }, { "target", 1, 0, 'F' }, { "undefine", 1, 0, 'U' }, @@ -225,6 +225,12 @@ static void set_version_defines(void) free( version ); } +/* clean things up when aborting on a signal */ +static void exit_on_signal( int sig ) +{ + exit(1); /* this will call the atexit functions */ +} + int main(int argc,char *argv[]) { extern char* optarg; @@ -238,6 +244,11 @@ int main(int argc,char *argv[]) int cmdlen; signal(SIGSEGV, segvhandler); + signal( SIGTERM, exit_on_signal ); + signal( SIGINT, exit_on_signal ); +#ifdef SIGHUP + signal( SIGHUP, exit_on_signal ); +#endif now = time(NULL); @@ -390,7 +401,7 @@ int main(int argc,char *argv[]) wpp_add_include_path(INCLUDEDIR"/msvcrt"); wpp_add_include_path(INCLUDEDIR"/windows"); } - + /* Check for input file on command-line */ if(optind < argc) { @@ -412,7 +423,7 @@ int main(int argc,char *argv[]) setbuf(stderr,0); } - yydebug = debuglevel & DEBUGLEVEL_TRACE ? 1 : 0; + parser_debug = debuglevel & DEBUGLEVEL_TRACE ? 1 : 0; yy_flex_debug = debuglevel & DEBUGLEVEL_TRACE ? 1 : 0; wpp_set_debug( (debuglevel & DEBUGLEVEL_PPLEX) != 0, @@ -429,6 +440,7 @@ int main(int argc,char *argv[]) output_name = dup_basename(input_name, ".rc"); strcat(output_name, ".res"); } + atexit(cleanup_files); /* Run the preprocessor on the input */ if(!no_preprocess) @@ -438,11 +450,10 @@ int main(int argc,char *argv[]) * no output was given. */ - chat("Starting preprocess"); + chat("Starting preprocess\n"); if (!preprocess_only) { - atexit(rm_tempfile); ret = wpp_parse_temp( input_name, output_name, &temp_name ); } else if (output_name) @@ -463,20 +474,23 @@ int main(int argc,char *argv[]) exit(1); /* Error during preprocess */ if(preprocess_only) + { + output_name = NULL; exit(0); + } input_name = temp_name; } /* Go from .rc to .res */ - chat("Starting parse"); + chat("Starting parse\n"); - if(!(yyin = fopen(input_name, "rb"))) + if(!(parser_in = fopen(input_name, "rb"))) error("Could not open %s for input\n", input_name); - ret = yyparse(); + ret = parser_parse(); - if(input_name) fclose(yyin); + if(input_name) fclose(parser_in); if(ret) exit(1); /* Error during parse */ @@ -492,17 +506,18 @@ int main(int argc,char *argv[]) /* Convert the internal lists to binary data */ resources2res(resource_top); - chat("Writing .res-file"); + chat("Writing .res-file\n"); write_resfile(output_name, resource_top); + output_name = NULL; return 0; } -static void rm_tempfile(void) +static void cleanup_files(void) { - if(temp_name) - unlink(temp_name); + if (output_name) unlink(output_name); + if (temp_name) unlink(temp_name); } static void segvhandler(int sig) diff --git a/reactos/tools/wrc/wrc.h b/reactos/tools/wrc/wrc.h index 1f2c19aed7e..de8929a56e7 100644 --- a/reactos/tools/wrc/wrc.h +++ b/reactos/tools/wrc/wrc.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WRC_WRC_H diff --git a/reactos/tools/wrc/wrctypes.h b/reactos/tools/wrc/wrctypes.h index 8326f42f13b..28792ebe4ee 100644 --- a/reactos/tools/wrc/wrctypes.h +++ b/reactos/tools/wrc/wrctypes.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WRC_WRCTYPES_H diff --git a/reactos/tools/wrc/writeres.c b/reactos/tools/wrc/writeres.c index 6fed70b728f..5771b8ea17e 100644 --- a/reactos/tools/wrc/writeres.c +++ b/reactos/tools/wrc/writeres.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -74,7 +74,7 @@ void write_resfile(char *outname, resource_t *top) if(ret != res->size) { fclose(fo); - error("Error writing %s", outname); + error("Error writing %s\n", outname); } free(res); } @@ -88,7 +88,7 @@ void write_resfile(char *outname, resource_t *top) if(ret != top->binres->size) { fclose(fo); - error("Error writing %s", outname); + error("Error writing %s\n", outname); } if(win32 && (top->binres->size & 0x03)) { @@ -97,7 +97,7 @@ void write_resfile(char *outname, resource_t *top) if(ret != 4 - (top->binres->size & 0x03)) { fclose(fo); - error("Error writing %s", outname); + error("Error writing %s\n", outname); } } }