Le 22 juil. 09 à 06:17, Joel E. Denny a écrit :
On Mon, 20 Jul 2009, Bill Allombert wrote:
Thanks a lot: I sent this question the first time 18 months ago and
this is the
first answer I reveive.
Sorry it took so long. I guess I overlooked it the last time.
Search for %initial-action in the Bison manual.
That works fine, great!
I'm glad it helped.
Maybe the documentation of YYLLOC_DEFAULT should mention that
possibility.
Makes sense to me. I'll keep it on my todo list.
I installed the following on the master, branch-2.5 and branch-2.4.2.
But the first line of the master's commit is broken, sorry :(.
From a022ff418685a490925aed4adf19ebf8ed31239d Mon Sep 17 00:00:00 2001
From: Akim Demaille <demai...@gostai.com>
Date: Wed, 19 Aug 2009 13:34:48 +0200
Subject: [PATCH] doc: %initial-action to initialize yylloc.
Reported by Bill Allombert.
* doc/bison.texinfo: Set fill-column to 76.
(Location Type): Document the use of %initial-action to initialize
yylloc.
(cherry picked from commit d59e456dbf5d9747e2fe0c0539f2ec670ce6f9c4)
---
ChangeLog | 8 ++++++++
THANKS | 1 +
doc/bison.texinfo | 11 +++++++++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 75222ca..86a3c49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-08-19 Akim Demaille <demai...@gostai.com>
+
+ doc: %initial-action to initialize yylloc.
+ Reported by Bill Allombert.
+ * doc/bison.texinfo: Set fill-column to 76.
+ (Location Type): Document the use of %initial-action to initialize
+ yylloc.
+
2009-08-18 Joel E. Denny <jde...@clemson.edu>
maint: update for gnulib's recent update-copyright changes
diff --git a/THANKS b/THANKS
index f7ae63f..b48bb73 100644
--- a/THANKS
+++ b/THANKS
@@ -14,6 +14,7 @@ Art Haas ah...@neosoft.com
Baron Schwartz ba...@sequent.org
Benoit Perrot benoit.per...@epita.fr
Bert Deknuydt bert.deknu...@esat.kuleuven.ac.be
+Bill Allombert bill.allomb...@math.u-bordeaux1.fr
Bob Rossi b...@brasko.net
Brandon Lucia blu...@gmail.com
Bruce Lilly bli...@erols.com
diff --git a/doc/bison.texinfo b/doc/bison.texinfo
index c91a740..8072ae2 100644
--- a/doc/bison.texinfo
+++ b/doc/bison.texinfo
@@ -3800,8 +3800,11 @@ typedef struct YYLTYPE
@} YYLTYPE;
@end example
-At the beginning of the parsing, Bison initializes all these fields to 1
-for @code{yylloc}.
+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, , Performing Actions before Parsing}.
@node Actions and Locations
@subsection Actions and Locations
@@ -10339,6 +10342,10 @@ grammatically indivisible. The piece of text it
represents is a token.
@bye
+...@c Local Variables:
+...@c fill-column: 76
+...@c End:
+
@c LocalWords: texinfo setfilename settitle setchapternewpage finalout
@c LocalWords: ifinfo smallbook shorttitlepage titlepage GPL FIXME iftex
@c LocalWords: akim fn cp syncodeindex vr tp synindex dircategory direntry
--
1.6.4
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison