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