Bill Allombert wrote:

> On Thu, Oct 18, 2012 at 06:52:41PM +0200, Frank Heckenbach wrote:
> > Bill Allombert wrote:
> > 
> > We do compile our Bison output with g++ (yes, we should probably use
> > the C++ skeleton, but we haven't gotten around to it yet), and we
> > don't use extern "C" -- in fact we use two different parsers in one
> > executable and we put them in different C++ namespaces to avoid
> > conflicts. (After the recent changes, this may no more be necessary
> > as I understand, we'll have to check this after an upgrade ...)
> 
> How do you put them in separate namespace ?

foo.y:

%{

#define IN_BISON

#include "foo.h"

namespace foo
{

// some declarations, including yyerror

%}

// grammar and everything

%%
}

foo.h:

#include <...>

namespace foo
{

// various other declarations

#ifndef IN_BISON
int yyparse (...);
#endif

}

Not sure if it's supposed to work like this, but currently it does. :)

Frank


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to