bug-bison
[Top][All Lists]
Advanced

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

Re: glr & locations


From: Joel E. Denny
Subject: Re: glr & locations
Date: Sat, 29 Oct 2005 12:23:56 -0400 (EDT)

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;
  }

Joel




reply via email to

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