🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3802

Re: Is yyparse() generated by bison/lex a reentrant function?

#3802
From: Dorin-Ioan MARINCA
Date: Thu, 29 Jul 1999 00:00
32 lines
2094 bytes
Michael Rubenstein wrote:
> 
> On Wed, 28 Jul 1999 12:02:40 +0200, Dorin-Ioan MARINCA
> <marinca@csti.fr> wrote:
> 
> >Hi!
> >
> >please help me with an answer to the question from subject field.
> >
> >I mean: can I call yyparse() from the code parts of a bison/lex rule?
> >I work with bison-1.27-1 on Linux RedHat 5.2.
> 
> Bison has a declaration, %pure_parser, that makes it generate a
> reentrant parser.  This does change how it is called.  See the
> bison documentation for details.
> 
> I have never used this, so I can't guarantee that it works.

Thanks,

Well, now I found that on bison docs. It seams easy to implement an
reentrant parser. The problem is that flex is not compatible with bison
in reentrant mode. flex can be reentrant but only as a C++ class which
doesn't provide a common interface with bison. bison reentrant needs
yylex(YYSTYPE *lvalp, YYLTYPE *llocp) but flex (reentrant or not) offers
yylex(void).

Thus, bison and flex can do their job reentrant but seams that they are
little bit uncompatible at interface and you must mix C/C++ code to make
an reentrant parser with lexer.

D.I.M.
Technical Details
Message-ID: <37A074ED.A94810F4@csti.fr>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <379ED540.C3954455@csti.fr> <37a05f5a.76648454@nntp.ix.netcom.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109f73,e642a3d25e78300,start
X-Google-Attributes: gid109f73,public
X-Google-Thread: f8c9b,e642a3d25e78300,start
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: fc89c,f8ac0240ac44175f
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 1014db,f8ac0240ac44175f
X-Google-Attributes: gid1014db,public
X-Google-Thread: 108717,f8ac0240ac44175f
X-Google-Attributes: gid108717,public
From: Dorin-Ioan MARINCA <marinca@csti.fr>
Subject: Re: Is yyparse() generated by bison/lex a reentrant function?
Date: 1999/07/29
Message-ID: <37A074ED.A94810F4@csti.fr>
X-Deja-AN: 506623950
Content-Transfer-Encoding: 7bit
References: <379ED540.C3954455@csti.fr> <37a05f5a.76648454@nntp.ix.netcom.com>
Organization: CSTI
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: comp.unix.programmer,comp.lang.c,comp.programming,comp.unix.questions,gnu.utils.help