[Top][All Lists]

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

Re: Precedence declarations applied to rules

From: Hans Aberg
Subject: Re: Precedence declarations applied to rules
Date: Mon, 19 May 2003 10:33:34 +0200

At 20:41 +0200 2003/05/18, Frank Heckenbach wrote:
>> But if one should implement a precedence system for rules into Bison,
>> instead of the old one using tokens, then it might look like this:
>>   %precedence {
>>   ...
>>   %left E: E_1 ... E_k
>>   ...
>>   }
>> This should mean that the precedence rules only apply to what is quoted
>> within each %precedence group.
>A minor problem IMHO is that it's a little redundant having to
>repeat the complete rules for the precedence declaration. I'd prefer
>a way to, say, name certain rules and refer to their names. But
>that's only a syntactic detail, of course.

Since we are very far from arriving at any actual implementation, I
deliberately skipped over ideas of notational simplification. :-)

>Another syntactic observation: If %precedence forms a "{}" section
>as in your example, it would lend itself neatly to allowing for
>several independent groups of precendences, as in my first
>suggestion. (Which does not mean that I plan to implement it now;
>for me, the no-default-precedence should be enough.)

That was the idea, that one can have several different, well localized
precedence groups. :-)

A more serious problem is that I do no see the exact relation to the other
method of resolving shift/reduce conflicts by using precedence of tokens.
These two methods, precedence for rules and precedence for tokens, have an
overlap, but properly one would want to see whether the latter method is a
proper subset of the former one or not.

I figure nothing will happen about it now, but I mention, in case the
question will come up in the future.

  Hans Aberg

reply via email to

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