bug-bison
[Top][All Lists]
Advanced

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

Locations and mid-rule actions


From: Frank Heckenbach
Subject: Locations and mid-rule actions
Date: Sat, 28 Jun 2003 05:03:55 +0200

There seems to be a problem in how bison handles the default
location action in the presence of mid-rule actions. The attached
code demonstrates this.

The LALR(1) parser outputs the following, i.e. the parameters to
YYLLOC_DEFAULT seem to be wrong for the mid-rule action:

LOC 0
ab
LOC 4
abc

The GLR parser omits the YYLLOC_DEFAULT for mid-rule actions
entirely:

ab
LOC 4
abc

AFAICS, it would be reasonable to handle mid-rule actions like
regular actions, so YYLLOC_DEFAULT can set their address@hidden' from the
previous symbols (which is needed if the mid-rule action does any
stuff that needs the current location). So in this example it should
say `LOC 2' first.

Frank

-- 
Frank Heckenbach, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)

Attachment: mid-rule-locations.y
Description: Binary data


reply via email to

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