help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems using bison and flex with C++


From: Hans Aberg
Subject: Re: Problems using bison and flex with C++
Date: Tue, 22 Jun 2004 19:33:07 +0200

At 09:07 -0300 2004/06/22, Carlos Augusto Lains Leitão wrote:
>       My name is Carlos and i am experiencing some problems using flex
>and bison with c++. I have generated the lexical scanner with flex and the
>the parser with bison. When i compile my program with gcc there is no
>problem and everything goes well but when i use g++ to compile the
>compiler points some errors such like: "undefined reference to yylex in
>the parser.tab.c generated by bison, undefined reference to yyparse in
>lex.yy.c generated by flex, undefined reference to yyerror in parser.tab.c
>generated by bison". Colud anyone give me an advice.

The Bison C parser will not work under C++ for several reasons, for
example, its stack does not invoke copy constructors when re-allocating. As
I could not get the Bison C++ parser working directly, I wrote my own. The
details are posted in the Bison-Patches group. Some fellows said that they
were able to follow the instructions to get a working C++ parser on their
own. I think this is the state of the matter, until somebody writes a
(working) C++ parser that comes with the Bison distribution.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]