bison-patches
[Top][All Lists]
Advanced

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

Re: FYI: default %printer/%destructor


From: Hans Aberg
Subject: Re: FYI: default %printer/%destructor
Date: Tue, 21 Nov 2006 21:23:22 +0100

On 21 Nov 2006, at 19:59, Joel E. Denny wrote:

I think that all that makes the grammar rues harder to read should be
avoided.

Yes, more information will always do that.

Also, it is good if the user as far as possible
can avoid writing repetitions.

So, something like:

  a(name1): b c() d(name2[@,#]) e(name3[$,#,%])

Still ugly, but I like it better than ($#%name), which looks like one long
cryptic variable.

I do not know. Perhaps use "{}" instead of "[]", to indicate it is sets, if not conflicting with action "{}".

One idea I am playing around with is a header/source breakup. The actions would then be put in the source (or in a separate segment), and the rules in the header. One motivation is to make the grammar readable in the case of complicated actions. Another is that if only the actions are altered, Bison needs not recompute the parser states.

The main problem is how to avoid having to write the grammar rules more than once.

Well, I think we're getting ahead of ourselves.  The notation I've
proposed seems to cleanly accommodate what we need now. I think there are
several possible ways to extend it if necessary in the future.

As long as it does not close any doors, if some of the other stuff needs to be implemented, whatever it may be.

  Hans Aberg






reply via email to

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