From: jrey AT true DOT net (=?iso-8859-1?Q?Jos=E9_Luis_Rey_Barreira?=) Subject: RE: Bug in byacc/cygwin32 18 Nov 1996 14:05:58 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <01BBD53C.362B9300.cygnus.gnu-win32@jrey.dialup.true.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Original-To: "'Skip Egdorf'" , "gnu-win32 AT cygnus DOT com" Original-Cc: "hwe AT lanl DOT gov" , "noer AT cygnus DOT com" Original-Sender: owner-gnu-win32 AT cygnus DOT com 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:egdorf AT zaphod DOT lanl DOT gov] Enviado: Jueves 14 de Noviembre de 1996 14:46 Para: gnu-win32 AT cygnus DOT com Cc: hwe AT lanl DOT gov; noer AT cygnus DOT com 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 hwe AT lanl DOT gov - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help". - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".