🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #882

question about multiple uses of a bison parser

#882
From: cal
Date: Sat, 10 Oct 1992 01:35
38 lines
1543 bytes
i have two questions and a bug notification for version 1.10

i am trying to use a flex and bison parser to read several files in succession,
and finding a problem with the state in which the parser is left after the
first file is read

on the second file, i get a message
	unexpected token "" at line 1
(i initialize yylineno before each parse,
and the input file is closed after each parse)

so, my two questions are:
	is this the right forum for questions of this type?
	how can i get the parser to read a real token
		instead of remembering an old one
		(which is what i think is going on)?

separately,
there appears to be a bug in the implementation of the "-t" flag -
the generated C file has a line
#define YYDEBUG
but all the tests of YYDEBUG are of the form
#if YYDEBUG != 0
which gets a "parse error" from the GNU C compiler

either the definition should say
#define YYDEBUG 1
or the tests should read
#ifdef YYDEBUG
(the former is the better solution)

when i explicitly compile the generated file with -DDYYDEBUG,
it works as i expected it to

thanx much for any help

more later,
cal
Technical Details
Message-ID: <199210100135.AA05178@aerospace.aero.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!aero.org!cal

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!aero.org!cal
From: cal@aero.org
Subject: question about multiple uses of a bison parser
Message-ID: <199210100135.AA05178@aerospace.aero.org>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 10 Oct 1992 01:35:13 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 39