help-bison
[Top][All Lists]
Advanced

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

Re: %prefix with C++ namespaces


From: Sebastian Pipping
Subject: Re: %prefix with C++ namespaces
Date: Mon, 01 Oct 2007 20:59:25 +0200
User-agent: Thunderbird 1.5.0.13 (X11/20070824)

Joel E. Denny wrote:
Well, if we document how the splitting is done, then I figure they can't complain too much. I certainly don't want to see Bison parse complex C++ constructs. Let the C++ compiler catch those errors.

Wouldn't it be both easy and powerful to solve that namespace thing
using "%define"s?


What I have in mind is one %define each for begin and end of the
namespace, something like this:

  %define "namespace_intro" "namespace Gnu { namespace Bison {"
  %define "namespace_outro" "} }"

The default would be set to

  %define "namespace_intro" "namespace <prefix> {"
  %define "namespace_outro" "}"

If that's possible that would
* take namespace parsing off Bison's shoulders and
* be flexible at the same time.


What do you think?




Sebastian





reply via email to

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