🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #136

Bison -p prefix fails to generate correct foo.tab.h file

#136
From: Mark-Jason Dominus
Date: Sun, 12 Apr 1992 21:02
42 lines
1334 bytes
Bison's -p option fails to work correctly with its -d option.

It changes all occurrences of the given external names, except the
declaration 
	extern YYSTYPE yylval;
in *.tab.h.

For example, if I run bison with
	bison -p foo -d s.y
on this input file:

--- BEGIN INPUT FILE s.y

%token BITE_ME

%%

input: BITE_ME { /* Or don't. */ ; }
--- END INPUT FILE s.y

I get this s.tab.h file:

---- BEGIN OUTPUT FILE s.tab.h
#ifndef YYSTYPE
#define YYSTYPE int
#endif
#define	BITE_ME	258


extern YYSTYPE yylval;
---- END OUTPUT FILE s.tab.h

This is broken because it should be declaring 
	extern YYSTYPE foolval;
instead of
	extern YYSTYPE yylval;
.

I am running bison 1.16 on a Sun 690MP (Sparc) with SunOS 4.1.2.

  The night is pleasing to us because, like memory, it erases idle details.
Mark-Jason Dominus 	  			    mjd@central.cis.upenn.edu 
Technical Details
Message-ID: <9204130502.AA16341@saul.cis.upenn.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!saul.cis.upenn.edu!mjd

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!saul.cis.upenn.edu!mjd
From: mjd@saul.cis.upenn.edu (Mark-Jason Dominus)
Subject: Bison -p prefix fails to generate correct foo.tab.h file
Message-ID: <9204130502.AA16341@saul.cis.upenn.edu>
Sender: gnulists@ai.mit.edu
Organization: Martin Bormann's Cranial Splints
Distribution: gnu
Date: Sun, 12 Apr 1992 21:02:51 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 43