[Top][All Lists]

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

Re: glr & locations

From: Claudia Hermann
Subject: Re: glr & locations
Date: Sat, 29 Oct 2005 18:51:05 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Joel E. Denny wrote:
On Sat, 29 Oct 2005, Claudia Hermann wrote:

this patch works fine as long as i do not call yyparse() twice and only use the default YYLTYPE declaration. but once i redeclare YYLTYPE and YYLLOC_DEFAULT and activate glr-parser, as first value of the first node i get the last value of the last node of the previous parsed file.
see also attached file

Bison normally provides the initialization of yylloc. However, in general, whenever you redeclare YYLTYPE, bison cannot know how to initialize it, so you cannot depend on its initial value. This is true regardless of GLR, Paul's patch, and overriding the definition of YYLLOC_DEFAULT. Try:

  %initial-action {
    @$.first_pos = @$.last_pos = 0;

thx, it works

claudia hermann

reply via email to

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