- Implemented a bug-work-around for Berkeley yacc (byacc) which
does not generate proper default transition rules for non-terminals. See comments in parser.y how the fix works. - Changed the error-line/char position to make emacs happy parsing the position of the error. - Added comments in the documentation in which order the line-numer and character-position of the error is written.
This commit is contained in:
parent
b30b0e74cd
commit
b37a889f2f
|
@ -1,3 +1,15 @@
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
Version 1.1.7 (24-Jul-2000)
|
||||||
|
|
||||||
|
Bertho Stultiens <bertho@akhphd.au.dk>
|
||||||
|
- Implemented a bug-work-arround for Berkeley yacc (byacc) which
|
||||||
|
does not generate proper default transition rules for non-terminals.
|
||||||
|
See comments in parser.y how the fix works.
|
||||||
|
- Changed the error-line/char position to make emacs happy parsing
|
||||||
|
the position of the error.
|
||||||
|
- Added comments in the documentation in which order the line-numer
|
||||||
|
and character-position of the error is written.
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
Version 1.1.6 (05-Jun-2000)
|
Version 1.1.6 (05-Jun-2000)
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ lex.ppl.c: ppl.l
|
||||||
$(LEX) $(LEXOPT) -d -Ppp -8 -olex.ppl.c $(SRCDIR)/ppl.l
|
$(LEX) $(LEXOPT) -d -Ppp -8 -olex.ppl.c $(SRCDIR)/ppl.l
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
$(RM) ppy.tab.h ppy.output lex.backup y.output
|
$(RM) ppy.tab.h ppy.output parser.output parser.tab.h lex.backup y.output
|
||||||
|
|
||||||
install:: $(PROGRAMS)
|
install:: $(PROGRAMS)
|
||||||
[ -d $(bindir) ] || $(MKDIR) $(bindir)
|
[ -d $(bindir) ] || $(MKDIR) $(bindir)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Release 1.1.6 of wrc (05-Jul-2000), the wine resource compiler.
|
Release 1.1.7 of wrc (24-Jul-2000), the wine resource compiler.
|
||||||
|
|
||||||
See the file CHANGES for differences between the version and what has been
|
See the file CHANGES for differences between the version and what has been
|
||||||
corrected in the current version.
|
corrected in the current version.
|
||||||
|
@ -112,8 +112,8 @@ __TIME__ | "23:59:59" | Timestring of compilation
|
||||||
__DATE__ | "May 1 2000" | Datestring of compilation
|
__DATE__ | "May 1 2000" | Datestring of compilation
|
||||||
__WRC__ 1 | Wrc's major version
|
__WRC__ 1 | Wrc's major version
|
||||||
__WRC_MINOR__ | 1 | Wrc's minor version
|
__WRC_MINOR__ | 1 | Wrc's minor version
|
||||||
__WRC_MICRO__ | 6 | Wrc's minor version
|
__WRC_MICRO__ | 7 | Wrc's minor version
|
||||||
__WRC_PATCH__ | 6 | Alias of __WRC_MICRO__
|
__WRC_PATCH__ | 7 | Alias of __WRC_MICRO__
|
||||||
|
|
||||||
Include-files are not read twice if they are protected with this scheme:
|
Include-files are not read twice if they are protected with this scheme:
|
||||||
#ifndef SOME_DEFINE
|
#ifndef SOME_DEFINE
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
* Copyright 1998-2000 Bertho A. Stultiens (BS)
|
* Copyright 1998-2000 Bertho A. Stultiens (BS)
|
||||||
* 1999 Juergen Schmied (JS)
|
* 1999 Juergen Schmied (JS)
|
||||||
*
|
*
|
||||||
|
* 24-Jul-2000 BS - Made a fix for broken Berkeley yacc on
|
||||||
|
* non-terminals (see cjunk rule).
|
||||||
* 21-May-2000 BS - Partial implementation of font resources.
|
* 21-May-2000 BS - Partial implementation of font resources.
|
||||||
* - Corrected language propagation for binary
|
* - Corrected language propagation for binary
|
||||||
* resources such as bitmaps, isons, cursors,
|
* resources such as bitmaps, isons, cursors,
|
||||||
|
@ -125,6 +127,31 @@
|
||||||
#include "wingdi.h"
|
#include "wingdi.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
|
|
||||||
|
#if defined(YYBYACC)
|
||||||
|
/* Berkeley yacc (byacc) doesn't seem to know about these */
|
||||||
|
/* Some *BSD supplied versions do define these though */
|
||||||
|
# ifndef YYEMPTY
|
||||||
|
# define YYEMPTY (-1) /* Empty lookahead value of yychar */
|
||||||
|
# endif
|
||||||
|
# ifndef YYLEX
|
||||||
|
# define YYLEX yylex()
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(YYBISON)
|
||||||
|
/* Bison was used for original development */
|
||||||
|
/* #define YYEMPTY -2 */
|
||||||
|
/* #define YYLEX yylex() */
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* No yacc we know yet */
|
||||||
|
# if !defined(YYEMPTY) || !defined(YYLEX)
|
||||||
|
# error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
|
||||||
|
# elif defined(__GNUC__) /* gcc defines the #warning directive */
|
||||||
|
# warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
|
||||||
|
/* #else we just take a chance that it works... */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
int want_nl = 0; /* Signal flex that we need the next newline */
|
int want_nl = 0; /* Signal flex that we need the next newline */
|
||||||
int want_id = 0; /* Signal flex that we need the next identifier */
|
int want_id = 0; /* Signal flex that we need the next identifier */
|
||||||
stringtable_t *tagstt; /* Stringtable tag.
|
stringtable_t *tagstt; /* Stringtable tag.
|
||||||
|
@ -411,6 +438,31 @@ cjunk : tTYPEDEF { strip_til_semicolon(); }
|
||||||
| tIDENT tIDENT '(' { strip_til_parenthesis(); }
|
| tIDENT tIDENT '(' { strip_til_parenthesis(); }
|
||||||
/* | tIDENT '(' { strip_til_parenthesis(); } */
|
/* | tIDENT '(' { strip_til_parenthesis(); } */
|
||||||
| tIDENT '*' { strip_til_semicolon(); }
|
| tIDENT '*' { strip_til_semicolon(); }
|
||||||
|
| tNL /*
|
||||||
|
* This newline rule will never get reduced because we never
|
||||||
|
* get the tNL token, unless we explicitely set the 'want_nl'
|
||||||
|
* flag, which we don't.
|
||||||
|
* The *ONLY* reason for this to be here is because Berkeley
|
||||||
|
* yacc (byacc), at least version 1.9, has a bug.
|
||||||
|
* (identified in the generated parser on the second
|
||||||
|
* line with:
|
||||||
|
* static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
|
||||||
|
* )
|
||||||
|
* This extra rule fixes it.
|
||||||
|
* The problem is that the expression handling rule "expr: xpr"
|
||||||
|
* is not reduced on non-terminal tokens, defined above in the
|
||||||
|
* %token declarations. Token tNL is the only non-terminal that
|
||||||
|
* can occur. The error becomes visible in the language parsing
|
||||||
|
* rule below, which looks at the look-ahead token and tests it
|
||||||
|
* for tNL. However, byacc already generates an error upon reading
|
||||||
|
* the token instead of keeping it as a lookahead. The reason
|
||||||
|
* lies in the lack of a $default transition in the "expr : xpr . "
|
||||||
|
* state (currently state 25). It is probably ommitted because tNL
|
||||||
|
* is a non-terminal and the state contains 2 s/r conflicts. The
|
||||||
|
* state enumerates all possible transitions instead of using a
|
||||||
|
* $default transition.
|
||||||
|
* All in all, it is a bug in byacc. (period)
|
||||||
|
*/
|
||||||
;
|
;
|
||||||
|
|
||||||
/* Parse top level resource definitions etc. */
|
/* Parse top level resource definitions etc. */
|
||||||
|
@ -459,7 +511,8 @@ resource
|
||||||
dont_want_id = 1;
|
dont_want_id = 1;
|
||||||
|
|
||||||
if(yychar == tNL)
|
if(yychar == tNL)
|
||||||
yychar = YYEMPTY;
|
yychar = YYEMPTY; /* Could use 'yyclearin', but we already need the*/
|
||||||
|
/* direct access to yychar in rule 'usrcvt' below. */
|
||||||
else if(yychar == tIDENT)
|
else if(yychar == tIDENT)
|
||||||
yywarning("LANGUAGE statement not delimited with newline; next identifier might be wrong");
|
yywarning("LANGUAGE statement not delimited with newline; next identifier might be wrong");
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ void make_print(char *str)
|
||||||
|
|
||||||
static void generic_msg(const char *s, const char *t, const char *n, va_list ap)
|
static void generic_msg(const char *s, const char *t, const char *n, va_list ap)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s %s: %d, %d: ", t, input_name ? input_name : "stdin", line_number, char_number);
|
fprintf(stderr, "%s:%d:%d: %s: ", input_name ? input_name : "stdin", line_number, char_number, t);
|
||||||
vfprintf(stderr, s, ap);
|
vfprintf(stderr, s, ap);
|
||||||
#ifdef WANT_NEAR_INDICATION
|
#ifdef WANT_NEAR_INDICATION
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
#define WRC_MAJOR_VERSION 1
|
#define WRC_MAJOR_VERSION 1
|
||||||
#define WRC_MINOR_VERSION 1
|
#define WRC_MINOR_VERSION 1
|
||||||
#define WRC_MICRO_VERSION 6
|
#define WRC_MICRO_VERSION 7
|
||||||
#define WRC_RELEASEDATE "(05-Jul-2000)"
|
#define WRC_RELEASEDATE "(24-Jul-2000)"
|
||||||
|
|
||||||
#define WRC_STRINGIZE(a) #a
|
#define WRC_STRINGIZE(a) #a
|
||||||
#define WRC_EXP_STRINGIZE(a) WRC_STRINGIZE(a)
|
#define WRC_EXP_STRINGIZE(a) WRC_STRINGIZE(a)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH WRC 1 "July 05, 2000" "Version 1.1.6" "Wine Resource Compiler"
|
.TH WRC 1 "July 24, 2000" "Version 1.1.7" "Wine Resource Compiler"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
wrc \- Wine Resource Compiler
|
wrc \- Wine Resource Compiler
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -44,9 +44,9 @@ Create an assembly file from a binary \fB.res\fR file.
|
||||||
.TP
|
.TP
|
||||||
.I \-B x
|
.I \-B x
|
||||||
Win32 only; set output byte\-ordering, where \fIx\fR is one of n[ative],
|
Win32 only; set output byte\-ordering, where \fIx\fR is one of n[ative],
|
||||||
l[ittle] or b[ig]. Only resource in source-form can be reorderd. Native
|
l[ittle] or b[ig]. Only resources in source-form can be reorderd. Native
|
||||||
ordering depends on the system on which \fBwrc\fR was built. You can see
|
ordering depends on the system on which \fBwrc\fR was built. You can see
|
||||||
the native ordering by typing \fI\"wrc \-?\"\fR.
|
the native ordering by typing \fIwrc \-?\fR.
|
||||||
.TP
|
.TP
|
||||||
.I \-c
|
.I \-c
|
||||||
Add 'const' prefix to C constants when writing header files.
|
Add 'const' prefix to C constants when writing header files.
|
||||||
|
@ -182,6 +182,16 @@ Win32 compilation mode also sets __WIN32__ to 1 and __FLAT__ to 1.
|
||||||
.PP
|
.PP
|
||||||
Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also
|
Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also
|
||||||
recognized and expand to their respective equivalent.
|
recognized and expand to their respective equivalent.
|
||||||
|
.SH "ERROR REPORTING"
|
||||||
|
All errors and warnings are written to standard error and report:
|
||||||
|
.br
|
||||||
|
\fIfilename\fR:\fIline\-number\fR:\fIcharacter\-pos\fR:\fI{Error,Warning}\fR:\fI<message>\fR
|
||||||
|
.br
|
||||||
|
The character\-position is always at the next token. I.e. the error
|
||||||
|
or warning happened before. The line\-number suffers from the same
|
||||||
|
problem if the error occurred at the last token of the previous line.
|
||||||
|
The line\-number will be several lines off when the error was followed
|
||||||
|
by several empry lines. See also \fBBUGS\fR.
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
.B wrc
|
.B wrc
|
||||||
was written by Bertho A. Stultiens and is a nearly complete rewrite of
|
was written by Bertho A. Stultiens and is a nearly complete rewrite of
|
||||||
|
@ -192,6 +202,8 @@ den Haan. Bugfixes have been contributed by many wine developpers.
|
||||||
\- The preprocessor recognizes variable argument macros, but does not
|
\- The preprocessor recognizes variable argument macros, but does not
|
||||||
expanded them correctly
|
expanded them correctly
|
||||||
.br
|
.br
|
||||||
|
\- Error reporting should be more to the point (and verbose)
|
||||||
|
.br
|
||||||
\- Codepage/UNICODE translations are not/not correct implemented
|
\- Codepage/UNICODE translations are not/not correct implemented
|
||||||
.br
|
.br
|
||||||
\- Default memory options should differ between win16 and win32.
|
\- Default memory options should differ between win16 and win32.
|
||||||
|
|
Loading…
Reference in New Issue