help-bison
[Top][All Lists]
Advanced

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

Re: %prefix with C++ namespaces


From: Hans Aberg
Subject: Re: %prefix with C++ namespaces
Date: Sun, 30 Sep 2007 10:40:04 +0200

On 30 Sep 2007, at 08:15, Akim Demaille wrote:

(1) %prefix=abc renames function yylex to "abclex"
    instead of putting it in namespace abc.

Well, that was on purpose, to match the lex interface.
I'm unsure it is wise to invite the scanner into the
parser's namespace: we might have to deal with unwanted
collisions.

I think that if Flex puts the lexer function into the namespace, Bison should do likewise, in view of the policy that Bison should be synced with Flex. If there are no C name conflicts, there should be no in C++, as the C++ namespace construct is essentially a language formalization of the C name-space programming technique.

  Hans Aberg






reply via email to

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