[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: YYLOC v.s YYLLOC
From: |
Joel E. Denny |
Subject: |
Re: YYLOC v.s YYLLOC |
Date: |
Mon, 9 Nov 2009 12:06:21 -0500 (EST) |
User-agent: |
Alpine 1.00 (DEB 882 2007-12-20) |
On Mon, 9 Nov 2009, Putrycy wrote:
> Is there anybody so kind to explain the difference between YYLOC and
> YYLLOC ? I wasnt able to find any informations
> about what exactly is the difference.
In the case of an impure parser, yylloc is a global variable, and the
scanner uses it to return token locations to the parser. In parser
semantic actions, it's thus the location of the lookahead token, if any.
Only the latter statement holds true for a pure parser. You can read
about yylloc in the Bison manual.
yyloc is an internal variable that is not documented for the user, and so
you shouldn't expect its exact functionality to be maintained across Bison
versions. If you're curious, it's used to store the LHS value.