bison-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: named references


From: Alex Rozenman
Subject: Re: [PATCH] Re: named references
Date: Sun, 22 Mar 2009 23:22:28 +0200

Hi,

On Fri, Mar 20, 2009 at 5:17 PM, Joel E. Denny <address@hidden>wrote:

> However, are you implying that the following would not generate a warning
> or error because there are no ambiguities?
>
>  if_stmt: IF expr THEN stmt1 ELSE stmt.list FI
>             { $if_stmt = new IfStmt($expr, $stmt1.ptr, $stmt.list.ptr); };
>
> If so, I understand the lure of that approach.

It certainly was so, but as we've agreed, I will change it.


> In general, it might be nicer if the "may refer to" messages always
> include the full bracketed expressions.  Then there's slightly less to
> read in the above messages:
>   interpreter.ypp:74.50-59: reference is ambiguous: `$stmt.list'
>   interpreter.ypp:73.23-26: (may refer to: `$[stmt].list')
>  interpreter.ypp:73.33-41: (may also refer to: `$[stmt.list]')
> This is a very minor improvement.  Don't worry about it if it's too much
> trouble.

Perhaps only when dots are the issue. Otherwise user will start to add
brackets trying to fix other errors.


> > /* using of mid-rule action */
> > if_stmt: IF expr { $<stmtptr>cond = $expr > 0; } [cond] THEN stmt[then]
> ELSE
> > stmt FI
> >            { $if_stmt = new IfStmt($<stmtptr>cond, $then, $stmt.list); };
> > <no errors, no warnings>
> That [cond] looks like a separate grammar symbol.  I'd prefer that space
> is never allowed before the open bracket whether it appears after a symbol
> or a mid-rule action.
>
I am not sure. Currently spaces and comments are allowed anywhere. I don't
think lexical limitations can help. It is up to user to choose his style.


> > /* forbidden access from mid-rule action */
> > if_stmt: IF expr { $if_stmt = $then; } [cond] THEN stmt[then] ELSE stmt
> FI
> >            { $if_stmt = new IfStmt($<stmtptr>cond, $then, $[stmt].list);
> };
> > interpreter.ypp:73.20-27: `$if_stmt' cannot be accessed from mid-rule
> action
> > interpreter.ypp:73.31-35: `$then' cannot be accessed from mid-rule action
> I believe Bison usually qualifies similar messages with "at $3".  It
> should at least.

OK

-- 
Best regards,
Alex Rozenman (address@hidden).


reply via email to

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