help-bison
[Top][All Lists]
Advanced

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

Re: inserting into tab.h, after %union


From: Hans Aberg
Subject: Re: inserting into tab.h, after %union
Date: Mon, 4 Dec 2006 20:29:27 +0100

On 4 Dec 2006, at 19:33, Joel E. Denny wrote:

, but if your design is still flexible, I'd suggest
using names that are more obvious about where the code will be
generated.  For example:

%header{...}
%both{...}

Or maybe:

%declare{...}
%define{...}
%both{...}

In test release 2.3a, the directives are actually named %before- header, %start-header, %end-header, and %after-header. When considering C and C++ in isolation, I preferred those names although other developers seemed to
find them confusing.  However, we have someone working on adding Java
support, and there could be other target languages some day as well. We chose the current names (%code, %requires, etc) because they describe the
purpose of the directives at a more abstract level that seems to make
sense for Java and hopefully future languages.

The problem is that different languages use different paradigms, and it m,ay not be possible to do this stuff in that context then. It might work for parser specific features, but not language specific feature. In particular, for C++, there is no language requirement of a header-source setup - only a tradition inherited from C. Another language, like Java, or Haskell, or whatever, may use a different setup.

  Hans Aberg






reply via email to

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