diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2020-05-03 10:46:59 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-05-03 11:28:36 +0200 |
commit | ac2ba46053e3ccecda23f654ccec4d93b1484256 (patch) | |
tree | 0160f3508da698bf4bde65b7b50e9e0e57ad3a37 | |
parent | 2a7a2c1d3ae6e878e17fcf8950bc99357e926f5d (diff) | |
download | bison-ac2ba46053e3ccecda23f654ccec4d93b1484256.tar.gz |
doc: clarify what a location is
Reported by Arthur Schwarz <aschwarz1309@att.net>
https://lists.gnu.org/r/help-bison/2013-12/msg00009.html
* doc/bison.texi (Location Type): here.
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | doc/bison.texi | 9 |
2 files changed, 8 insertions, 2 deletions
@@ -20,6 +20,7 @@ Anthony Heading ajrh@ajrh.net Antonio Silva Correia amsilvacorreia@hotmail.com Arnold Robbins arnold@skeeve.com Art Haas ahaas@neosoft.com +Arthur Schwarz aschwarz1309@att.net Askar Safin safinaskar@mail.ru Balázs Scheidler balazs.scheidler@oneidentity.com Baron Schwartz baron@sequent.org diff --git a/doc/bison.texi b/doc/bison.texi index 32d41924..7a00069f 100644 --- a/doc/bison.texi +++ b/doc/bison.texi @@ -4505,12 +4505,17 @@ typedef struct YYLTYPE @} YYLTYPE; @end example +While default locations represent a range in the source file(s), this is not +a requirement. It could be a single point or just a line number, or even +more complex structures. + When @code{YYLTYPE} is not defined, at the beginning of the parsing, Bison initializes all these fields to 1 for @code{yylloc}. To initialize @code{yylloc} with a custom location type (or to chose a different initialization), use the @code{%initial-action} directive. @xref{Initial Action Decl}. + @node Actions and Locations @subsection Actions and Locations @cindex location actions @@ -14735,8 +14740,8 @@ In semantic actions, it stores the location of the lookahead token. @end deffn @deffn {Type} YYLTYPE -Data type of @code{yylloc}; by default, a structure with four members. -@xref{Location Type}. +Data type of @code{yylloc}. By default in C, a structure with four members +(start/end line/column). @xref{Location Type}. @end deffn @deffn {Variable} yylval |