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: Joel E. Denny
Subject: Re: inserting into tab.h, after %union
Date: Wed, 6 Dec 2006 23:25:49 -0500 (EST)

On Wed, 6 Dec 2006, Jeff Inman wrote:

> 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".

Yes, this is what I'm hoping for.  There's always something you must 
memorize, and you will forget it if you don't look at it for several 
months.  However, if it's coherent enough, it should begin to stick in 
your mind after a little practice.

> 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'm not sure %declares and %defines have the right meaning.  Each of the 4 
directives we're discussing can contain both declarations and definitions.

> 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.

Exactly.  This is one of the main problems with %{...%} that I wanted to 
overcome.  We should not have directives whose meaning is determined by a 
list of target-language-dependent and grammar-file-position-dependent 
rules.  Every occurrence of such a directive can end up with a different 
unexpected meaning, and moving a directive slightly can have 
counter-intuitive consequences.

> The language *does*
> seem to be
> increasing in complexity

Yes, that's true.  As I see it, there are two competing qualities.  On the 
one hand, I've wanted badly to avoid the context-sensitive problems we 
just mentioned.  On the other hand, people want common themes across all 
target languages to prevent an explosion of directives (or %define/%code 
variables) as we accommodate every combination of grammar file position 
and target language.  I think users of multiple target languages 
(especially Bison developers) appreciate such themes.  In my opinion, the 
current 4 directives strike a decent compromise... but maybe we can do 
even better.

> , with special-case interpretations for C++ versus C,
> etc.

To be clear, C++ and C basically have the same low-level functionality for 
these directives.  Java, being a significantly different language, 
requires different interpretations.

> 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!

I agree with this sentiment.  I want Bison to remain a popular tool, but 
it needs a lot of polishing.




reply via email to

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