help-flex
[Top][All Lists]
Advanced

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

Re: How can I use namespaces with the C++ interface ?


From: Hans Aberg
Subject: Re: How can I use namespaces with the C++ interface ?
Date: Thu, 28 Jun 2012 15:18:44 +0200

On 28 Jun 2012, at 14:55, Timothy Madden wrote:

> On 06/28/2012 12:38 PM, Hans Aberg wrote:
>> On 22 Jun 2012, at 19:42, Timothy Madden wrote:
>> 
>>> How could I use a namespace like yy (the same way bison does) for the 
>>> generated scanner with the C++ interface ?
>>> 
>>> I tried to open "namespace yy {" at the %top of the file, and to close it 
>>> "}" at the bottom, but all the included standard headers in the generated 
>>> scanner would be included in the namespace yy this way, instead of the 
>>> expected global namespace.
>>> 
>>> I had no other idea than to explicitly include the C/C++ standard headers 
>>> used by the scanner before I open the yy namespaces, at the top of the 
>>> file, so that when the scanner later includes them, they will each see they 
>>> have been already included and skip over any included content.
>>> 
>>> Can namespaces please be added to flex C++ interface ?
>> 
>> Flex does not currently have active developers, and the C++ lexer was 
>> written a long time ago, before namespaces was a part of C++. You might try 
>> modifying the skeleton file, though.

> Are there alternative projects that can be used with bison and are still 
> being developed or are better than flex ?

[Please keep the cc to the list, so others can follow the issue.]

Not what I am aware of - I add a cc to the Bison help list, to see if somebody 
there knows more.

Bison should be synced with Flex, but as the latter isn't currently being 
developed, that limits.

Hans





reply via email to

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