Subject: RE: Bug in byacc/cygwin32
From: [email-masked] (José Luis Rey Barreira)

18 Nov 1996 14:05:58 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Original-To: "'Skip Egdorf'" <[email-masked]>,
        "[email-masked]"
	 <[email-masked]>
Original-Cc: "[email-masked]" <[email-masked]>, "[email-masked]" <[email-masked]>
Original-Sender: [email-masked]

I=B4ve run the tests with the same Beta-16 but didn=B4t get the same =
results, in fact the code generated was correct, I also ran the test =
case with DJPP byacc and got good code too.
I used a 16Mb 486dx Win95 box.

----------
De:     	Skip Egdorf[SMTP:[email-masked]]
Enviado: 	Jueves 14 de Noviembre de 1996 14:46
Para:   	[email-masked]
Cc: 	[email-masked]; [email-masked]
Asunto:     	Bug in byacc/cygwin32

Windows-95, Pentium, Beta-16

A %union in a yacc grammer produces bad output from byacc.
I suspect that the problem lies with buffers being output
at the wrong times in cygwin32 rather than a bug in byacc
itself, but I only have the cygwin32 version of byacc to try...
I have reproduced this in two large grammers. Here is a
small case.

this grammer produces correct output:
---
%{
extern int yylex ();
extern void yyerror (char *);
%}

%token A B

%%

test_program:		test_program_sequence
		;
test_program_sequence:	test_program_sequence stmt
		|	/* empty */
		;
stmt:			A
		|	B
		;

%%
---

Adding a %union:
---
%{
extern int yylex ();
extern void yyerror (char *);
%}

%union=20
	{
	long INTEGER;
	double FLOAT;
	}

%token A B

%%

test_program:		test_program_sequence
		;
test_program_sequence:	test_program_sequence stmt
		|	/* empty */
		;
stmt:			A
		|	B
		;

%%
---
and compiling with "byacc -d -o test.c test.y"
causes errors in the .c andf .h files. Here is the
..h file from the grammer above:
---
#define A 257
#define B 258
typedef union=20
	{
	long INTEGER;
	double FLOAT;
	}yerror (char *);
#line 6 "test1.y"
typedef union=20
	{
	long INTEGER;
	double FLOAT;
	} YYSTYPE;
 YYSTYPE;
extern YYSTYPE yylval;
---
Note that the %union generates two typedefs, with the first
walking onto the user-code in the grammer. e.g. the "yerror (char *)"
at the end of the irst typedef is a fragment of the code from
%{
extern int yylex ();
extern void yyerror (char *);
%}

					Skip Egdorf
					[email-masked]
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".