Re: Reentrant flex & bison

indradeep_saha@rediffmail.com (Indradeep)
14 Apr 2004 00:24:14 -0400

          From comp.compilers

Related articles
Reentrant flex & bison cherico@bonbon.net (2004-03-15)
Re: Reentrant flex & bison clint@0lsen.net (Clint Olsen) (2004-03-19)
Re: Reentrant flex & bison bonzini@gnu.org (2004-03-19)
Re: Reentrant flex & bison cherico@bonbon.net (2004-03-26)
Re: Reentrant flex & bison haberg@matematik.su.se (2004-04-03)
Re: Reentrant flex & bison eggert@twinsun.com (Paul Eggert) (2004-04-03)
Re: Reentrant flex & bison bonzini@gnu.org (2004-04-03)
Re: Reentrant flex & bison indradeep_saha@rediffmail.com (2004-04-14)
| List of all articles for this month |
From: indradeep_saha@rediffmail.com (Indradeep)
Newsgroups: comp.compilers
Date: 14 Apr 2004 00:24:14 -0400
Organization: http://groups.google.com
References: 04-03-068
Keywords: yacc, lex, C++
Posted-Date: 14 Apr 2004 00:24:14 EDT

If I get yer question correctly yew would like to make flex and bison
work while writing yer code in c++...


flex with the -+ option generates a c++ class FlexLexer in which yylex
is defined.
but bison thru yyparse() calls yylex()...


to work around this, in yer parser file declare
FlexLexer *lexer = new FlexLexer;
and then define a function


int yylex()
{
return lexer->yylex();
}
this works perfectly well....
bye..




cherico@bonbon.net (cherico) wrote
> I am trying to write a reentrant scanner and parser using
> flex and bison.


Post a followup to this message

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