Reentrant Flex and Bison

richard.lanyon@wadham.oxford.ac.uk (Richard Lanyon)
16 Nov 1999 23:53:13 -0500

          From comp.compilers

Related articles
Reentrant Flex and Bison etetz@my-deja.com (2000-06-03)
Re: Reentrant Flex and Bison rhyde@shoe-size.com (Randall Hyde) (2000-06-06)
Reentrant Flex and Bison richard.lanyon@wadham.oxford.ac.uk (1999-11-16)
Re: Reentrant Flex and Bison perkens@sdm.de (Burkhard Perkens-Golomb) (1999-12-07)
| List of all articles for this month |
From: richard.lanyon@wadham.oxford.ac.uk (Richard Lanyon)
Newsgroups: comp.compilers
Date: 16 Nov 1999 23:53:13 -0500
Organization: Nun
Keywords: lex, yacc, parse, comment

I'm trying to get a lexer + parser combination going using flex and bison.
The problem is that I seem to have to declare yylex (as int yylex()) in
the C declarations section of the bison grammar file.
This wouldn't necessarily be a problem (except that I'm sure I shouldn't
/have/ to) except that if I then want to make a re-entrant (aka "pure")
parser, yylex needs to be declared as
int yylex(YYSTYPE *lvalp)
and YYSTYPE isn't defined in the C declarations section of the Bison
grammar file - it only comes into being in the Bison declaration section.


Any ideas?
--
Richard
[I took a look, didn't see any very satisfactory approaches other than
declaring yylex() without a prototype. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.