bison-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: named references


From: Joel E. Denny
Subject: Re: [PATCH] Re: named references
Date: Fri, 20 Mar 2009 17:34:37 -0400 (EDT)

On Fri, 20 Mar 2009, Joel E. Denny wrote:

> A simpler possibility may be to just say "reference is misleading" as in 
> the case where dots cause confusion.  A "refers to" and "possibly meant" 
> will clear up the confusion.  For example:
> 
>   lhs: rhs[first] rhs { $rhs; } ;
> 
> Bison would report:
> 
>   interpreter.ypp:74.43-52: reference is misleading: `$rhs'
>   interpreter.ypp:73.38-46: (refers to: `$[rhs]' at $2)
>   interpreter.ypp:73.38-46: (possibly meant: `$[rhs]' hidden at $1)
> 
> (I didn't update column numbers, so ignore that.)

So there are 2 categories of submessages: "refers to" or "possibly meant".  
Anything in "refers to" is the correct interpretation of a reference.  
Anything in "possibly meant" is an incorrect interpretation: bad 
bracketing, hidden/renamed, or out of scope in the case of mid-rules.  
Bracketing and symbol number are always shown in a submessage as above.  
If the type of incorrect interpretation is not bad bracketing, a word is 
added to indicate the type (like "hidden" in above example).

There are 3 categories of errors:

1. "undefined reference": There are no "refers to" submessages, but there 
may be some "possibly meant" submessages.

2. "ambiguous reference": There is more than one "refers to" submessage, 
and there may be some "possibly meant" submessages.

3. "misleading reference": There is exactly one "refers to" submessage, 
and there is at least one "possibly meant" submessage.

Does this cover every error we've discussed?




reply via email to

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