help-bison
[Top][All Lists]
Advanced

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

YYLTYPE Data Type of Locations Definition


From: Tys Lefering
Subject: YYLTYPE Data Type of Locations Definition
Date: Thu, 10 Feb 2011 14:38:10 +0100

Hi,
In the GNU Bison manual at '3.6.1 Data Type of Locations'
When YYLTYPE is not defined, Bison uses a default structure
type with four members:
typedef struct YYLTYPE
{
 int first_line;
 int first_column;
 int last_line;
 int last_column;
} YYLTYPE;

But a signed int will start overflow at 2147483647
(2G) number of input lines in the input.

Is this correct and because of POSIX definition ?

Nowadays on 64-bits GNU/Linux machines with big files
this looks like a 32-bits limit in Bison Yacc/GLR
default generated output parsercode.

Maybe the manual can mention the user must add own
macro YYLTYPE with bigger data types for full
64-bits on current 64-bits GNU/Linux machines if
needed when parsing big files.

Checked the generated parser code and for debug
output only own definintion of YY_LOCATION_PRINT
to add at changes, thats all.

Thanks,
Tys.



reply via email to

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