Package: bison-doc
Version: 1:2.3.dfsg-4
Severity: wishlist

Hello Chuan-kai,

The documentation of YYLLOC_DEFAULT states that:
   When defining `YYLLOC_DEFAULT', you should consider that:

   * For consistency with semantic actions, valid indexes within the
     right hand side range from 1 to N.  When N is zero, only 0 is a
     valid index, and it refers to the symbol just before the reduction.
     During error processing N is always positive.

But it does not state what happens if N=0 for the first symbol,
and how YYLLOC_DEFAULT can deal with that.

For example if the grammar is

seq : /* empty */
    | seq item
;

item: '(' seq ')'
;

And the text to parse is "()".

then the first reduction will involve the rule {seq : /* empty */}
for which N=0, but there is no symbol prior to the reduction.
However the second reduction using this rule will have a symbol just before
the reduction.

Cheers,
Bill.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to