bug-bison
[Top][All Lists]
Advanced

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

Re: Locations and mid-rule actions


From: Paul Eggert
Subject: Re: Locations and mid-rule actions
Date: Tue, 21 Dec 2004 23:49:29 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Frank Heckenbach <address@hidden> writes:

> Basically yes. But say I want to get the "location" of the mid-rule
> action itself. Though maybe YYRHSLOC(yyRhs, 0) will help me.

Yes, that's the idea anyway.

> BTW, the documentation (changes of 12 Dec, sorry if it's been
> updated meanwhile) seems a bit unclear on whether or not it is only
> defined if N = 0:
>
> : where @code{YYRHSLOC (rhs, k)} is the location of the @var{k}th symbol
> : in @var{rhs} when @var{k} is positive, and the location of the symbol
> : just before the reduction when @var{k} is zero.
>
> This doesn't say that N = 0 is required.
>
> : For consistency with semantic actions, valid indexes within the
> : right hand side range from 1 to @var{n}.  When @var{n} is zero, only 0 is a
> : valid index, and it refers to the symbol just before the reduction.
>
> But this would imply so. So which one is true?

They're both true.  The first one doesn't state the implication (it
states something else), and the second one does.

> Anyway, for a mid-rule action, having N = 0 always now, I suppose
> YYRHSLOC(yyRhs, 0) is always available, isn't it?

Yes.




reply via email to

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