help-bison
[Top][All Lists]
Advanced

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

Should YYLTYPE represent the location or the position


From: Arthur Schwarz
Subject: Should YYLTYPE represent the location or the position
Date: Fri, 13 Dec 2013 15:47:52 -0800 (PST)

The manual doesn't make clear whether YYLTYPE should represent the 
location_type or the position_type. It is inferred that YYLTYPE refers to the 
position_type, because the position of atoken should be returned by the 
scanner. The terminology and macros seem to indicate a location rather than a 
position. I wonder if in future versions of the manual it can be made clear 
that there is a distinction between the position_type and the location_type, 
and that the location_type is a calculated quantity within the parser and that 
location_type is used exclusively with the scanner. And in the same light, 
maybe change the terminology to reflect this understanding, such as using plocp 
instead of llocp, et alia. The alternative is to change the classes, 
structures, and manual so that location means position and position means 
location. As it stands now, oftentimes location seems to mean position.

This all leads up to the question of "who's on first". The flex manual always 
uses location to refer to position, and in consequence, all terminology and 
names reflect location. This terminology is carried over into Bison but here, 
location means position. The manual should at least describe what is going on 
if not make the terminology, classes, and macros consistent.



reply via email to

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