* data/c.m4 (b4_location_initial_column, b4_location_initial_line):

New, default to 1.
* data/yacc.c, data/glr.c, data/location.cc: Use them.
* NEWS, doc/bison.texinfo: The initial column and line are 1 by
default.
* tests/calc.at: Adjust.
This commit is contained in:
Akim Demaille
2006-07-08 20:38:14 +00:00
parent 8ec0a172bc
commit cd48d21d94
8 changed files with 48 additions and 30 deletions

View File

@@ -1998,7 +1998,9 @@ type for storing locations is not needed: we will use the type provided
by default (@pxref{Location Type, ,Data Types of Locations}), which is a
four member structure with the following integer fields:
@code{first_line}, @code{first_column}, @code{last_line} and
@code{last_column}.
@code{last_column}. By conventions, and in accordance with the GNU
Coding Standards and common practice, the line and column count both
start at 1.
@node Ltcalc Rules
@subsection Grammar Rules for @code{ltcalc}
@@ -3512,6 +3514,9 @@ typedef struct YYLTYPE
@} YYLTYPE;
@end example
At the beginning of the parsing, Bison initializes all these fields to 1
for @code{yylloc}.
@node Actions and Locations
@subsection Actions and Locations
@cindex location actions