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: Jeff Inman
Subject: Re: inserting into tab.h, after %union
Date: Wed, 6 Dec 2006 07:31:14 -0700


On Dec 6, 2006, at 2:58 AM, Joel E. Denny wrote:
On Wed, 6 Dec 2006, Hans Aberg wrote:

Potentially, but I'm not inclined to complicate the existing directives as we grope in the dark trying to accommodate future target languages that we
haven't even identified yet.

This is what I am saying: you may already have done that by the current
commands.

As far as these directives being complicated, I just don't think they are. Neither did Akim Demaille (who initially proposed the names % provides and %requires), Paul Eggert, Paolo Bonzini, and Pupeno when they first heard of them. Two months later, Paul said he had forgotten what the directives
meant, but he made no further comment.  Jeff Inman's discomfort seems
quite mild, but I'd be glad to hear further discussion from him.

Just to chime in, then ... as with any software tool, if there are just a few awkward terms to learn, I can learn what I need to know from a manual, and re- read it when I have to do maintenance, until the terms just become "natural". The syntax you've described does seem kinda awkward to me, but at least it solves my problem. I would think that %declares{...} and %defines{...} might be a little more clear in multiple languages, but you guys have been looking at this more
than I have.

I like that you are proposing specific syntax for specific functions, instead of having context-sensitive interpretations of simpler syntax. The proposed way seems to me, at first glance, to make things simpler to understand. The language *does* seem to be increasing in complexity, with special-case interpretations for C++ versus C, etc. From a "marketing" point of view, that seems to me like a dangerous trend for bison. The more hairy it becomes, the more pressure there is for someone to come up with a "simpler" tool to replace it. (good luck, I know.) Next thing you know, they make something prettier, but they also make whitespace significant, and no good language
does that!


OFF TOPIC: is there a simple way to use a C++ skeleton but to have the token enumerants generated directly into the std namespace? yy::parser::token::FOO
is a mouthful.  Maybe I could get halfway there with %name-prefix="std".



Regards,

Jeff




Jeff Inman
Parallel and Distributed Visualization
Los Alamos National Laboratory
PO Box 1663, B287 / Los Alamos, NM 87545






reply via email to

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