help-bison
[Top][All Lists]
Advanced

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

Re: bison and C++


From: Hans Aberg
Subject: Re: bison and C++
Date: Wed, 13 Dec 2006 00:41:15 +0100

On 13 Dec 2006, at 00:09, Satya wrote:

No, you dont need to use the C++ skeleton. Just put an extern "C"
declaration at the beggining of your parser file (.y file)  e.g.,

extern "C"
{
   int yyparse ( void );
   int yylex   ( void );
   int yywrap  ();
   void yyerror ( char* );
}

Putting the in the .y file would not suffice, as those functions need to be put in a file compiled by the C++ associated C-compiler; one cannot then use C++ containers. If the C-parser is compiled using a C+ + compiler, would it succeed, in view of that support for this has been terminated, then the parser stack will not invoke copy constructors when reallocating: it will only work with POD semantic types.

  Hans Aberg






reply via email to

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