help-bison
[Top][All Lists]
Advanced

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

Re: bison location tracking ..


From: Hans Aberg
Subject: Re: bison location tracking ..
Date: Wed, 9 Jun 2004 19:37:00 +0200

At 13:26 +0200 2004/06/09, Laurence Finston wrote:
>Thanks for the vote of confidence, but please do cc any follow-ups
>to address@hidden --- someone might have a better answer.

Every newbie seems to disregard his, even if asked to honor it. :-)

>> I've defined yylocation type to struct { offset, size
>> }, and all that's working great.
>>
>> my problem is blank RHS .. offset gets set to zero.
>> so  in rule like
>> atoms:   /* blank */
>>      | atoms ATOM
>> since first blank rule gets fired, the offset & size
>> are set to zero.
>>
>> Do you have any workaround/solution for this

The Bison location tracking feature is currently left essentially
unsupported, in part because no-one seems to agree on what a suitable
location tracking ought to be. The Bison default location tracking rule
attempts to pinpoint the total area of the current grammar symbol. So, for
the empty symbol, there is no location yet.

A more prudent location tracking method for use with error reporting seems
to be to keep track of the location of the current lookahead token, i.e.,
its line number and its location on the line. Then that must be implemented
explicitly. Perhaps a tweak of the skeleton file might help.

  Hans Aberg






reply via email to

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