<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-1502</id>
	<title>Nabble - Gnu - Bison</title>
	<updated>2009-12-21T00:53:52Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Gnu---Bison-f1502.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gnu---Bison-f1502.html" />
	<subtitle type="html">Bison is a general-purpose parser generator that converts a grammar description for an LALR context-free grammar into a C program to parse that grammar. Once you are proficient with Bison, you can use it to develop a wide range of language parsers, from those used in simple desk calculators to complex programming languages. Gnu - Bison home is &lt;a href=&quot;http://www.gnu.org/software/bison/bison.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26871564</id>
	<title>Re: remove YYFAIL from lalr1.java and yacc.c</title>
	<published>2009-12-21T00:53:52Z</published>
	<updated>2009-12-21T00:53:52Z</updated>
	<author>
		<name>Paolo Bonzini-2</name>
	</author>
	<content type="html">&lt;br&gt;&amp;gt;&amp;gt; , and I think that
&lt;br&gt;&amp;gt;&amp;gt; breaking YYFAIL now for %error-verbose is fine too.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Google code search turns up an instance where both are used:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%25error-verbose+YYFAIL+file%3A&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%25error-verbose+YYFAIL+file%3A&lt;/a&gt;\.y&amp;sbtn=Search
&lt;br&gt;&lt;br&gt;Hmm, right. &amp;nbsp;They're not relying on the semantics, though and they can 
&lt;br&gt;simply fix it by removing the &amp;quot;|| defined (YYFAIL)&amp;quot;. &amp;nbsp;So it's 
&lt;br&gt;effectively a false positive of the warning. &amp;nbsp;Well, let's live with it.
&lt;br&gt;&lt;br&gt;&amp;gt; I agree we may have to keep it for a long time, but hopefully the warning
&lt;br&gt;&amp;gt; will prompt users to explore at least why YYFAIL is deprecated. &amp;nbsp;Maybe I
&lt;br&gt;&amp;gt; should make the warning even stronger by saying that YYFAIL will
&lt;br&gt;&amp;gt; eventually be removed.
&lt;br&gt;&lt;br&gt;Fine, even if both of us know how likely that is to happen. :-)
&lt;br&gt;&lt;br&gt;Paolo
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remove-YYFAIL-from-lalr1.java-and-yacc.c-tp26858812p26871564.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26871525</id>
	<title>Re: remove YYFAIL from lalr1.java and yacc.c</title>
	<published>2009-12-21T00:42:24Z</published>
	<updated>2009-12-21T00:42:24Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Mon, 21 Dec 2009, Paolo Bonzini wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; I'd like to push the first patch to master, branch-2.5, and branch-2.4.2
&lt;br&gt;&amp;gt; &amp;gt; in order to formally deprecate YYFAIL.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm fine with removing it at once from the Java parser
&lt;br&gt;&lt;br&gt;OK, I'll make that adjustment.
&lt;br&gt;&lt;br&gt;&amp;gt; , and I think that
&lt;br&gt;&amp;gt; breaking YYFAIL now for %error-verbose is fine too.
&lt;br&gt;&lt;br&gt;Google code search turns up an instance where both are used:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%25error-verbose+YYFAIL+file%3A&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%25error-verbose+YYFAIL+file%3A&lt;/a&gt;\.y&amp;sbtn=Search
&lt;br&gt;&lt;br&gt;I'm afraid there may be more instances that are not online.
&lt;br&gt;&lt;br&gt;&amp;gt; However, I'm afraid that
&lt;br&gt;&amp;gt; without verbose errors we should keep it indefinitely though undocumented, so
&lt;br&gt;&amp;gt; there's probably no point in warning.
&lt;br&gt;&lt;br&gt;I agree we may have to keep it for a long time, but hopefully the warning 
&lt;br&gt;will prompt users to explore at least why YYFAIL is deprecated. &amp;nbsp;Maybe I 
&lt;br&gt;should make the warning even stronger by saying that YYFAIL will 
&lt;br&gt;eventually be removed.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remove-YYFAIL-from-lalr1.java-and-yacc.c-tp26858812p26871525.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26870641</id>
	<title>Re: remove YYFAIL from lalr1.java and yacc.c</title>
	<published>2009-12-20T23:19:20Z</published>
	<updated>2009-12-20T23:19:20Z</updated>
	<author>
		<name>Paolo Bonzini-2</name>
	</author>
	<content type="html">&amp;gt; I'd like to push the first patch to master, branch-2.5, and branch-2.4.2
&lt;br&gt;&amp;gt; in order to formally deprecate YYFAIL.
&lt;br&gt;&lt;br&gt;I'm fine with removing it at once from the Java parser, and I think that 
&lt;br&gt;breaking YYFAIL now for %error-verbose is fine too. &amp;nbsp;However, I'm afraid 
&lt;br&gt;that without verbose errors we should keep it indefinitely though 
&lt;br&gt;undocumented, so there's probably no point in warning.
&lt;br&gt;&lt;br&gt;Paolo
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remove-YYFAIL-from-lalr1.java-and-yacc.c-tp26858812p26870641.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26869711</id>
	<title>Re: What is wrong with this simple example?</title>
	<published>2009-12-20T19:48:59Z</published>
	<updated>2009-12-20T19:48:59Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Sun, 20 Dec 2009, Peng Yu wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I try to run the example on
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://tldp.org/HOWTO/Lex-YACC-HOWTO-4.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tldp.org/HOWTO/Lex-YACC-HOWTO-4.html&lt;/a&gt;. But I get the following
&lt;br&gt;&amp;gt; error. Could somebody let me know what I am wrong?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; $ bison -d example4.y
&lt;br&gt;&amp;gt; example4.y:24.1-8: syntax error, unexpected identifier:
&lt;br&gt;&amp;gt; $ cat example4.y
&lt;br&gt;&amp;gt; %{
&lt;br&gt;&amp;gt; #include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;&amp;gt; #include &amp;lt;string.h&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; void yyerror(const char *str)
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fprintf(stderr,&amp;quot;error: %s\n&amp;quot;,str);
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; int yywrap()
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 1;
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; main()
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yyparse();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %token NUMBER TOKHEAT STATE TOKTARGET TOKTEMPERATURE
&lt;/div&gt;&lt;br&gt;You need this here:
&lt;br&gt;&lt;br&gt;&amp;nbsp; %%
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; commands: /* empty */
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | commands command
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; command:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; heat_switch
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; target_set
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; heat_switch:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TOKHEAT STATE
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&amp;quot;\tHeat turned on or off\n&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; target_set:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TOKTARGET TOKTEMPERATURE NUMBER
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&amp;quot;\tTemperature set\n&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26869711&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;help-bison@...&lt;/a&gt; &lt;a href=&quot;http://lists.gnu.org/mailman/listinfo/help-bison&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/mailman/listinfo/help-bison&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Help-f1504.html&quot; embed=&quot;fixTarget[1504]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Help&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/What-is-wrong-with-this-simple-example--tp26869689p26869711.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26869689</id>
	<title>What is wrong with this simple example?</title>
	<published>2009-12-20T19:42:58Z</published>
	<updated>2009-12-20T19:42:58Z</updated>
	<author>
		<name>Peng Yu</name>
	</author>
	<content type="html">I try to run the example on
&lt;br&gt;&lt;a href=&quot;http://tldp.org/HOWTO/Lex-YACC-HOWTO-4.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tldp.org/HOWTO/Lex-YACC-HOWTO-4.html&lt;/a&gt;. But I get the following
&lt;br&gt;error. Could somebody let me know what I am wrong?
&lt;br&gt;&lt;br&gt;$ bison -d example4.y
&lt;br&gt;example4.y:24.1-8: syntax error, unexpected identifier:
&lt;br&gt;$ cat example4.y
&lt;br&gt;%{
&lt;br&gt;#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;#include &amp;lt;string.h&amp;gt;
&lt;br&gt;&lt;br&gt;void yyerror(const char *str)
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fprintf(stderr,&amp;quot;error: %s\n&amp;quot;,str);
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;int yywrap()
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 1;
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;main()
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yyparse();
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;%}
&lt;br&gt;&lt;br&gt;%token NUMBER TOKHEAT STATE TOKTARGET TOKTEMPERATURE
&lt;br&gt;&lt;br&gt;commands: /* empty */
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | commands command
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;
&lt;br&gt;&lt;br&gt;command:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; heat_switch
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; target_set
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;
&lt;br&gt;&lt;br&gt;heat_switch:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TOKHEAT STATE
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&amp;quot;\tHeat turned on or off\n&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;
&lt;br&gt;&lt;br&gt;target_set:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TOKTARGET TOKTEMPERATURE NUMBER
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&amp;quot;\tTemperature set\n&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26869689&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;help-bison@...&lt;/a&gt; &lt;a href=&quot;http://lists.gnu.org/mailman/listinfo/help-bison&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/mailman/listinfo/help-bison&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Help-f1504.html&quot; embed=&quot;fixTarget[1504]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Help&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/What-is-wrong-with-this-simple-example--tp26869689p26869689.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26867313</id>
	<title>Re: [PATCH] lalr1.cc: don't discard non-existent lookahead on syntax error.</title>
	<published>2009-12-20T13:07:45Z</published>
	<updated>2009-12-20T13:07:45Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Sat, 19 Dec 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I pushed this to master. &amp;nbsp;The bug does not exist on branch-2.5. &amp;nbsp;The test 
&lt;br&gt;&amp;gt; case makes this bug look pretty obscure, and maybe that's right, but I 
&lt;br&gt;&amp;gt; really didn't spend much time searching for a simpler test case.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;From d59beda068aef97834ea84ce4f5cc99b487e4b68 Mon Sep 17 00:00:00 2001
&lt;br&gt;&amp;gt; From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26867313&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: Fri, 18 Dec 2009 23:57:18 -0500
&lt;br&gt;&amp;gt; Subject: [PATCH] lalr1.cc: don't discard non-existent lookahead on syntax error.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; * data/lalr1.cc (parser::parse): Check yyempty first.
&lt;br&gt;&amp;gt; * tests/c++.at (Syntax error discarding no lookahead): New test
&lt;br&gt;&amp;gt; group.
&lt;/div&gt;&lt;br&gt;I pushed the following to master.
&lt;br&gt;&lt;br&gt;From 5335b65a79189afbbd27ecb55d76e74a4fe31863 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26867313&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sun, 20 Dec 2009 16:03:07 -0500
&lt;br&gt;Subject: [PATCH] tests: cleanup.
&lt;br&gt;&lt;br&gt;* tests/c++.at (Syntax error discarding no lookahead): Don't
&lt;br&gt;ignore stderr. &amp;nbsp;Instead, eliminate remaining warnings.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;6 ++++++
&lt;br&gt;&amp;nbsp;tests/c++.at | &amp;nbsp; &amp;nbsp;6 +++++-
&lt;br&gt;&amp;nbsp;2 files changed, 11 insertions(+), 1 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 1c15cc5..e984569 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,9 @@
&lt;br&gt;+2009-12-20 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26867313&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	tests: cleanup.
&lt;br&gt;+	* tests/c++.at (Syntax error discarding no lookahead): Don't
&lt;br&gt;+	ignore stderr. &amp;nbsp;Instead, eliminate remaining warnings.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-18 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26867313&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	lalr1.cc: don't discard non-existent lookahead on syntax error.
&lt;br&gt;diff --git a/tests/c++.at b/tests/c++.at
&lt;br&gt;index ce64d6d..6a8d2c5 100644
&lt;br&gt;--- a/tests/c++.at
&lt;br&gt;+++ b/tests/c++.at
&lt;br&gt;@@ -412,6 +412,10 @@ consistent-error:
&lt;br&gt;&amp;nbsp;| /*empty*/ %prec 'a'
&lt;br&gt;&amp;nbsp;;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+// Provide another context in which all rules are useful so that this
&lt;br&gt;+// test case looks a little more realistic.
&lt;br&gt;+start: 'b' consistent-error ;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;%%
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;int
&lt;br&gt;@@ -434,7 +438,7 @@ main (void)
&lt;br&gt;&amp;nbsp; &amp;nbsp;return parser.parse ();
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&amp;nbsp;]])
&lt;br&gt;-AT_BISON_CHECK([[-o input.cc input.yy]], [[0]], [[]], [[ignore-nolog]])
&lt;br&gt;+AT_BISON_CHECK([[-o input.cc input.yy]])
&lt;br&gt;&amp;nbsp;AT_COMPILE_CXX([[input]])
&lt;br&gt;&amp;nbsp;# This used to print &amp;quot;Discarding 'a'.&amp;quot; again at the end.
&lt;br&gt;&amp;nbsp;AT_PARSER_CHECK([[./input]], [[1]], [[]],
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--lalr1.cc%3A-don%27t-discard-non-existent-lookahead-on-syntax-error.-tp26852864p26867313.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26866413</id>
	<title>Re: remove YYFAIL from lalr1.java and yacc.c</title>
	<published>2009-12-20T11:18:38Z</published>
	<updated>2009-12-20T11:18:38Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">Hi Paolo,
&lt;br&gt;&lt;br&gt;On Sun, 20 Dec 2009, Paolo Bonzini wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; No problems for me for lalr1.java; for yacc.c however we have some uses:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=YYFAIL%3B&amp;sbtn=Search&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=YYFAIL%3B&amp;sbtn=Search&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Some of them are my own GNU Smalltalk (no problem, I now switched to recursive
&lt;br&gt;&amp;gt; descent) and of course GCC 1. &amp;nbsp;However there are still about 5-6 other users.
&lt;br&gt;&amp;gt; I don't think it's reasonably possible for YYFAIL to die anytime soon.
&lt;br&gt;&lt;br&gt;Thanks very much for that info.
&lt;br&gt;&lt;br&gt;Here are a couple of patches to begin to phase out YYFAIL. &amp;nbsp;Based on your 
&lt;br&gt;research, the process will have to be very slow.
&lt;br&gt;&lt;br&gt;I'd like to push the first patch to master, branch-2.5, and branch-2.4.2 
&lt;br&gt;in order to formally deprecate YYFAIL.
&lt;br&gt;&lt;br&gt;I'd like to push the second patch to master and branch-2.5 in order to 
&lt;br&gt;generate warnings about uses of YYFAIL. &amp;nbsp;I always worry that attempts to 
&lt;br&gt;decipher literal code from users is error-prone. &amp;nbsp;I'd appreciate any 
&lt;br&gt;corrections or other comments.
&lt;br&gt;&lt;br&gt;From 2ffce5412c9436eefc18b7198b31dce6e1c20e08 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26866413&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sun, 20 Dec 2009 13:38:26 -0500
&lt;br&gt;Subject: [PATCH] YYFAIL: deprecate.
&lt;br&gt;&lt;br&gt;* NEWS (2.4.2): Document deprecation.
&lt;br&gt;* data/lalr1.java (YYStack::YYFAIL): Add comment about
&lt;br&gt;deprecation.
&lt;br&gt;* data/yacc.c (YYFAIL): Likewise.
&lt;br&gt;* doc/bison.texinfo (Java Action Features): Remove YYFAIL
&lt;br&gt;documentation.
&lt;br&gt;(LocalWords): Remove YYFAIL.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; 11 +++++++++++
&lt;br&gt;&amp;nbsp;NEWS &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 27 +++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;data/lalr1.java &amp;nbsp; | &amp;nbsp; &amp;nbsp;3 ++-
&lt;br&gt;&amp;nbsp;data/yacc.c &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;5 ++++-
&lt;br&gt;&amp;nbsp;doc/bison.texinfo | &amp;nbsp; &amp;nbsp;7 +------
&lt;br&gt;&amp;nbsp;5 files changed, 45 insertions(+), 8 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 1c15cc5..aed5998 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,14 @@
&lt;br&gt;+2009-12-20 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26866413&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	YYFAIL: deprecate.
&lt;br&gt;+	* NEWS (2.4.2): Document deprecation.
&lt;br&gt;+	* data/lalr1.java (YYStack::YYFAIL): Add comment about
&lt;br&gt;+	deprecation.
&lt;br&gt;+	* data/yacc.c (YYFAIL): Likewise.
&lt;br&gt;+	* doc/bison.texinfo (Java Action Features): Remove YYFAIL
&lt;br&gt;+	documentation.
&lt;br&gt;+	(LocalWords): Remove YYFAIL.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-18 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26866413&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	lalr1.cc: don't discard non-existent lookahead on syntax error.
&lt;br&gt;diff --git a/NEWS b/NEWS
&lt;br&gt;index 92567dd..7e8bd9f 100644
&lt;br&gt;--- a/NEWS
&lt;br&gt;+++ b/NEWS
&lt;br&gt;@@ -243,6 +243,33 @@ Bison News
&lt;br&gt;&amp;nbsp; &amp;nbsp;Bison's Java feature as a whole including its current usage of %code
&lt;br&gt;&amp;nbsp; &amp;nbsp;is still considered experimental.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+** YYFAIL is deprecated.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;YYFAIL has existed for many years as an undocumented feature of
&lt;br&gt;+ &amp;nbsp;deterministic parsers in C generated by Bison. &amp;nbsp;Previously, it was
&lt;br&gt;+ &amp;nbsp;documented for Bison's experimental Java parsers. &amp;nbsp;YYFAIL is no longer
&lt;br&gt;+ &amp;nbsp;documented for Java parsers and is formally deprecated in both cases.
&lt;br&gt;+ &amp;nbsp;Users are strongly encouraged to migrate to YYERROR, which has been
&lt;br&gt;+ &amp;nbsp;documented for many years.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;Like YYERROR, you can invoke YYFAIL from a semantic action in order to
&lt;br&gt;+ &amp;nbsp;induce a syntax error. &amp;nbsp;The most obvious difference from YYERROR is
&lt;br&gt;+ &amp;nbsp;that YYFAIL will automatically invoke yyerror to report the syntax
&lt;br&gt;+ &amp;nbsp;error so that you don't have to. &amp;nbsp;However, there are several other
&lt;br&gt;+ &amp;nbsp;subtle differences between YYERROR and YYFAIL, and YYFAIL suffers from
&lt;br&gt;+ &amp;nbsp;inherent flaws when %error-verbose is used. &amp;nbsp;For a more detailed
&lt;br&gt;+ &amp;nbsp;discussion, see:
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html&lt;/a&gt;&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;YYFAIL will continue to be maintained for deterministic parsers in C
&lt;br&gt;+ &amp;nbsp;and Java for the immediate future. &amp;nbsp;However, because YYFAIL is already
&lt;br&gt;+ &amp;nbsp;flawed, it would be futile to try to make new Bison features
&lt;br&gt;+ &amp;nbsp;compatible with it. &amp;nbsp;During parser generation, some future release of
&lt;br&gt;+ &amp;nbsp;Bison will begin to produce warnings whenever it discovers YYFAIL in a
&lt;br&gt;+ &amp;nbsp;semantic action. &amp;nbsp;In a later release, YYFAIL will be disabled for
&lt;br&gt;+ &amp;nbsp;%error-verbose. &amp;nbsp;Eventually, it will be removed altogether.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;** Internationalization.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;Fix a regression introduced in Bison 2.4: Under some circumstances,
&lt;br&gt;diff --git a/data/lalr1.java b/data/lalr1.java
&lt;br&gt;index 6637c3a..a9ae873 100644
&lt;br&gt;--- a/data/lalr1.java
&lt;br&gt;+++ b/data/lalr1.java
&lt;br&gt;@@ -352,7 +352,8 @@ b4_lexer_if([[
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;/**
&lt;br&gt;&amp;nbsp; &amp;nbsp; * Returned by a Bison action in order to print an error message and start
&lt;br&gt;- &amp;nbsp; * error recovery. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp; * error recovery. &amp;nbsp;Formally deprecated in Bison 2.4.2's NEWS entry, where
&lt;br&gt;+ &amp;nbsp; * a plan to phase it out is discussed. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;public static final int YYFAIL = 3;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;private static final int YYNEWSTATE = 4;
&lt;br&gt;diff --git a/data/yacc.c b/data/yacc.c
&lt;br&gt;index 11ebbf1..6e74620 100644
&lt;br&gt;--- a/data/yacc.c
&lt;br&gt;+++ b/data/yacc.c
&lt;br&gt;@@ -609,7 +609,10 @@ static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;/* Like YYERROR except do call yyerror. &amp;nbsp;This remains here temporarily
&lt;br&gt;&amp;nbsp; &amp;nbsp; to ease the transition to the new meaning of YYERROR, for GCC.
&lt;br&gt;- &amp;nbsp; Once GCC version 2 has supplanted version 1, this can go. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp; Once GCC version 2 has supplanted version 1, this can go. &amp;nbsp;However,
&lt;br&gt;+ &amp;nbsp; YYFAIL appears to be in use. &amp;nbsp;Nevertheless, it is formally deprecated
&lt;br&gt;+ &amp;nbsp; in Bison 2.4.2's NEWS entry, where a plan to phase it out is
&lt;br&gt;+ &amp;nbsp; discussed. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#define YYFAIL		goto yyerrlab
&lt;br&gt;&amp;nbsp;
&lt;br&gt;diff --git a/doc/bison.texinfo b/doc/bison.texinfo
&lt;br&gt;index 2af8917..ab2cd6c 100644
&lt;br&gt;--- a/doc/bison.texinfo
&lt;br&gt;+++ b/doc/bison.texinfo
&lt;br&gt;@@ -9925,11 +9925,6 @@ Start error recovery without printing an error message.
&lt;br&gt;&amp;nbsp;@xref{Error Recovery}.
&lt;br&gt;&amp;nbsp;@end deffn
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-@deffn {Statement} {return YYFAIL;}
&lt;br&gt;-Print an error message and start error recovery.
&lt;br&gt;-@xref{Error Recovery}.
&lt;br&gt;-@end deffn
&lt;br&gt;-
&lt;br&gt;&amp;nbsp;@deftypefn {Function} {boolean} recovering ()
&lt;br&gt;&amp;nbsp;Return whether error recovery is being done. In this state, the parser
&lt;br&gt;&amp;nbsp;reads token until it reaches a known state, and then restarts normal
&lt;br&gt;@@ -11330,5 +11325,5 @@ grammatically indivisible. &amp;nbsp;The piece of text it represents is a token.
&lt;br&gt;&amp;nbsp;@c LocalWords: superclasses boolean getErrorVerbose setErrorVerbose deftypecv
&lt;br&gt;&amp;nbsp;@c LocalWords: getDebugStream setDebugStream getDebugLevel setDebugLevel url
&lt;br&gt;&amp;nbsp;@c LocalWords: bisonVersion deftypecvx bisonSkeleton getStartPos getEndPos
&lt;br&gt;-@c LocalWords: getLVal defvar YYFAIL deftypefn deftypefnx gotos msgfmt
&lt;br&gt;+@c LocalWords: getLVal defvar deftypefn deftypefnx gotos msgfmt
&lt;br&gt;&amp;nbsp;@c LocalWords: subdirectory Solaris nonassociativity
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;From ceba3986c7b4538001cbfa133a311b5662da158d Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26866413&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sun, 20 Dec 2009 13:47:51 -0500
&lt;br&gt;Subject: [PATCH] YYFAIL: warn about uses.
&lt;br&gt;&lt;br&gt;* NEWS (2.5): Document.
&lt;br&gt;* src/scan-gram.l (SC_BRACED_CODE): Implement.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;6 ++++++
&lt;br&gt;&amp;nbsp;NEWS &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;8 ++++++++
&lt;br&gt;&amp;nbsp;src/scan-gram.l | &amp;nbsp; &amp;nbsp;8 ++++++++
&lt;br&gt;&amp;nbsp;3 files changed, 22 insertions(+), 0 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index aed5998..53dc2c4 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,11 @@
&lt;br&gt;&amp;nbsp;2009-12-20 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26866413&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	YYFAIL: warn about uses.
&lt;br&gt;+	* NEWS (2.5): Document.
&lt;br&gt;+	* src/scan-gram.l (SC_BRACED_CODE): Implement.
&lt;br&gt;+
&lt;br&gt;+2009-12-20 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26866413&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	YYFAIL: deprecate.
&lt;br&gt;&amp;nbsp;	* NEWS (2.4.2): Document deprecation.
&lt;br&gt;&amp;nbsp;	* data/lalr1.java (YYStack::YYFAIL): Add comment about
&lt;br&gt;diff --git a/NEWS b/NEWS
&lt;br&gt;index 7e8bd9f..6b11958 100644
&lt;br&gt;--- a/NEWS
&lt;br&gt;+++ b/NEWS
&lt;br&gt;@@ -169,6 +169,14 @@ Bison News
&lt;br&gt;&amp;nbsp; &amp;nbsp;POSIX Yacc whose use is reported by -Wyacc, and rejected in Yacc
&lt;br&gt;&amp;nbsp; &amp;nbsp;mode (--yacc).
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+** YYFAIL is deprecated and produces warnings.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;YYFAIL has existed for many years as an undocumented feature of
&lt;br&gt;+ &amp;nbsp;deterministic parsers in C generated by Bison. &amp;nbsp;Previously, it was
&lt;br&gt;+ &amp;nbsp;documented for Bison's experimental Java parsers. &amp;nbsp;As discussed in
&lt;br&gt;+ &amp;nbsp;Bison 2.4.2's NEWS entry, YYFAIL has been formally deprecated. &amp;nbsp;Now,
&lt;br&gt;+ &amp;nbsp;any appearance of YYFAIL in a semantic action also produces a warning.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;** Temporary hack for adding a semicolon to the user action.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;Previously, Bison appended a semicolon to every user action for
&lt;br&gt;diff --git a/src/scan-gram.l b/src/scan-gram.l
&lt;br&gt;index aff0769..0971e3f 100644
&lt;br&gt;--- a/src/scan-gram.l
&lt;br&gt;+++ b/src/scan-gram.l
&lt;br&gt;@@ -717,6 +717,14 @@ splice	 (\\[ \f\t\v]*\n)*
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (as `&amp;lt;' `&amp;lt;%'). &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;quot;&amp;lt;&amp;quot;{splice}&amp;quot;&amp;lt;&amp;quot; &amp;nbsp;STRING_GROW;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+ &amp;nbsp;/* YYFAIL is undocumented and was formally deprecated in Bison
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; 2.4.2. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp;&amp;quot;YYFAIL&amp;quot; STRING_GROW; warn_at (*loc, &amp;quot;YYFAIL is deprecated&amp;quot;);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;/* The sole purpose of this is to make sure identifiers that merely
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; contain YYFAIL don't produce the above warning. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp;[A-Za-z_][0-9A-Za-z_]* STRING_GROW;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;lt;&amp;lt;EOF&amp;gt;&amp;gt; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;unexpected_eof (code_start, &amp;quot;}&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;STRING_FINISH;
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remove-YYFAIL-from-lalr1.java-and-yacc.c-tp26858812p26866413.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26862272</id>
	<title>Re: remove YYFAIL from lalr1.java and yacc.c</title>
	<published>2009-12-20T02:27:08Z</published>
	<updated>2009-12-20T02:27:08Z</updated>
	<author>
		<name>Paolo Bonzini-2</name>
	</author>
	<content type="html">On 12/19/2009 10:41 PM, Joel E. Denny wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; a. YYFAIL appears in yacc.c but is not documented for yacc.c. &amp;nbsp;Comments in
&lt;br&gt;&amp;gt; yacc.c describe it as follows:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;/* Like YYERROR except do call yyerror. &amp;nbsp;This remains here temporarily
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; to ease the transition to the new meaning of YYERROR, for GCC.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Once GCC version 2 has supplanted version 1, this can go. &amp;nbsp;*/
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In other words, we've been planning to get rid of it for a long while.
&lt;br&gt;&amp;gt; (However, is there any evidence that users actually use it? &amp;nbsp;Do we need to
&lt;br&gt;&amp;gt; poll them or warn them somehow?)
&lt;/div&gt;&lt;br&gt;No problems for me for lalr1.java; for yacc.c however we have some uses:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=YYFAIL%3B&amp;sbtn=Search&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=YYFAIL%3B&amp;sbtn=Search&lt;/a&gt;&lt;br&gt;&lt;br&gt;Some of them are my own GNU Smalltalk (no problem, I now switched to 
&lt;br&gt;recursive descent) and of course GCC 1. &amp;nbsp;However there are still about 
&lt;br&gt;5-6 other users. &amp;nbsp;I don't think it's reasonably possible for YYFAIL to 
&lt;br&gt;die anytime soon.
&lt;br&gt;&lt;br&gt;Paolo
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remove-YYFAIL-from-lalr1.java-and-yacc.c-tp26858812p26862272.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26861692</id>
	<title>Re: [PATCH] Fix handling of yychar manipulation in user semantic actions.</title>
	<published>2009-12-20T00:17:03Z</published>
	<updated>2009-12-20T00:17:03Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Wed, 16 Dec 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; A few months ago, I started talking about a lookahead correction mechanism 
&lt;br&gt;&amp;gt; I was working on for Bison. &amp;nbsp;Its most obvious benefit is to correct the 
&lt;br&gt;&amp;gt; list of expected tokens in verbose syntax error messages. &amp;nbsp;I'm finally 
&lt;br&gt;&amp;gt; getting back to pushing that patch series through.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The following patch is next. &amp;nbsp;The problem it addresses is that users 
&lt;br&gt;&amp;gt; sometimes write semantic actions that manipulate yychar. &amp;nbsp;Of course, they 
&lt;br&gt;&amp;gt; can do this with YYBACKUP or yyclearin. &amp;nbsp;However, my impression is that 
&lt;br&gt;&amp;gt; many users alter yychar directly. &amp;nbsp;In this case, the translation in 
&lt;br&gt;&amp;gt; yytoken isn't always updated, and bad destructor calls or syntax error 
&lt;br&gt;&amp;gt; messages can result. &amp;nbsp;This patch fixes that.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'd like to push this patch to master and branch-2.5. &amp;nbsp;Any feedback would 
&lt;br&gt;&amp;gt; be appreciated. &amp;nbsp;I'd especially like to hear comments on my analysis of 
&lt;br&gt;&amp;gt; glr.c, lalr1.cc, and lalr1.java.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Don't worry about the unfixed bug I mention in the test suite. &amp;nbsp;The next 
&lt;br&gt;&amp;gt; patch will more thoroughly explain it and fix it.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;From cfdf80e9e688706a449dc68662e5e4ad0674ab01 Mon Sep 17 00:00:00 2001
&lt;br&gt;&amp;gt; From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26861692&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: Wed, 16 Dec 2009 20:55:40 -0500
&lt;br&gt;&amp;gt; Subject: [PATCH] Fix handling of yychar manipulation in user semantic actions.
&lt;/div&gt;&lt;br&gt;I botched the last test group. &amp;nbsp;It exercised the lookahead destructor at 
&lt;br&gt;parser return rather than the one during syntax error recovery. &amp;nbsp;Here's a 
&lt;br&gt;revised patch. &amp;nbsp;I also extended the ChangeLog's discussion of lalr1.cc a 
&lt;br&gt;little.
&lt;br&gt;&lt;br&gt;From 575e4443e4993046e0b812ea1ef5ef3cbd4480a0 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26861692&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sun, 20 Dec 2009 02:22:53 -0500
&lt;br&gt;Subject: [PATCH] Fix handling of yychar manipulation in user semantic actions.
&lt;br&gt;&lt;br&gt;The problem was that yacc.c didn't always update the yychar
&lt;br&gt;translation afterwards. &amp;nbsp;However, other skeletons appear to be
&lt;br&gt;fine. &amp;nbsp;glr.c appears to already translate yychar before every
&lt;br&gt;use. &amp;nbsp;lalr1.cc does not define yychar and does not document its
&lt;br&gt;replacement, yyla, for users. &amp;nbsp;It does provide yyclearin, but
&lt;br&gt;that does not manipulate yyla and thus requires no translation
&lt;br&gt;update. &amp;nbsp;In lalr1.java, yychar is out of scope during semantic
&lt;br&gt;actions.
&lt;br&gt;* NEWS (2.5): Document.
&lt;br&gt;* data/yacc.c (YYBACKUP): Don't bother translating yychar into
&lt;br&gt;yytoken here.
&lt;br&gt;(yyparse, yypush_parse): Instead, translate before every use of
&lt;br&gt;yytoken, and add comments explaining this approach.
&lt;br&gt;* tests/actions.at (Destroying lookahead assigned by semantic
&lt;br&gt;action): New test group checking that translation happens before
&lt;br&gt;lookahead destructor calls at parser return. &amp;nbsp;Previously,
&lt;br&gt;incorrect destructors were called.
&lt;br&gt;* tests/conflicts.at (parse.error=verbose and consistent
&lt;br&gt;errors): New test group checking that translation happens at
&lt;br&gt;syntax error detection before the associated verbose error
&lt;br&gt;message and the associated lookahead destructor calls. &amp;nbsp;While
&lt;br&gt;the destructor call is fixed by this patch, the verbose error
&lt;br&gt;message is currently incorrect due to another bug (see
&lt;br&gt;comments in test group), so this is an expected failure for now.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 28 +++
&lt;br&gt;&amp;nbsp;NEWS &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;7 +
&lt;br&gt;&amp;nbsp;data/yacc.c &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 25 +++-
&lt;br&gt;&amp;nbsp;src/parse-gram.c &amp;nbsp; | &amp;nbsp;522 +++++++++++++++++++++++-----------------------------
&lt;br&gt;&amp;nbsp;src/parse-gram.h &amp;nbsp; | &amp;nbsp; 68 +------
&lt;br&gt;&amp;nbsp;tests/actions.at &amp;nbsp; | &amp;nbsp; 71 +++++++
&lt;br&gt;&amp;nbsp;tests/conflicts.at | &amp;nbsp;124 +++++++++++++
&lt;br&gt;&amp;nbsp;7 files changed, 491 insertions(+), 354 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 1c15cc5..c53baca 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,31 @@
&lt;br&gt;+2009-12-20 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26861692&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	Fix handling of yychar manipulation in user semantic actions.
&lt;br&gt;+	The problem was that yacc.c didn't always update the yychar
&lt;br&gt;+	translation afterwards. &amp;nbsp;However, other skeletons appear to be
&lt;br&gt;+	fine. &amp;nbsp;glr.c appears to already translate yychar before every
&lt;br&gt;+	use. &amp;nbsp;lalr1.cc does not define yychar and does not document its
&lt;br&gt;+	replacement, yyla, for users. &amp;nbsp;It does provide yyclearin, but
&lt;br&gt;+	that does not manipulate yyla and thus requires no translation
&lt;br&gt;+	update. &amp;nbsp;In lalr1.java, yychar is out of scope during semantic
&lt;br&gt;+	actions.
&lt;br&gt;+	* NEWS (2.5): Document.
&lt;br&gt;+	* data/yacc.c (YYBACKUP): Don't bother translating yychar into
&lt;br&gt;+	yytoken here.
&lt;br&gt;+	(yyparse, yypush_parse): Instead, translate before every use of
&lt;br&gt;+	yytoken, and add comments explaining this approach.
&lt;br&gt;+	* tests/actions.at (Destroying lookahead assigned by semantic
&lt;br&gt;+	action): New test group checking that translation happens before
&lt;br&gt;+	lookahead destructor calls at parser return. &amp;nbsp;Previously,
&lt;br&gt;+	incorrect destructors were called.
&lt;br&gt;+	* tests/conflicts.at (parse.error=verbose and consistent
&lt;br&gt;+	errors): New test group checking that translation happens at
&lt;br&gt;+	syntax error detection before the associated verbose error
&lt;br&gt;+	message and the associated lookahead destructor calls. &amp;nbsp;While
&lt;br&gt;+	the destructor call is fixed by this patch, the verbose error
&lt;br&gt;+	message is currently incorrect due to another bug (see
&lt;br&gt;+	comments in test group), so this is an expected failure for now.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-18 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26861692&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	lalr1.cc: don't discard non-existent lookahead on syntax error.
&lt;br&gt;diff --git a/NEWS b/NEWS
&lt;br&gt;index 92567dd..8aaf9e0 100644
&lt;br&gt;--- a/NEWS
&lt;br&gt;+++ b/NEWS
&lt;br&gt;@@ -212,6 +212,13 @@ Bison News
&lt;br&gt;&amp;nbsp; &amp;nbsp;were resolved with %nonassoc. &amp;nbsp;Such tokens are now properly omitted
&lt;br&gt;&amp;nbsp; &amp;nbsp;from the list.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+** Destructor calls fixed for lookaheads altered in semantic actions.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;Previously for deterministic parsers in C, if a user semantic action
&lt;br&gt;+ &amp;nbsp;altered yychar, the parser in some cases used the old yychar value to
&lt;br&gt;+ &amp;nbsp;determine which destructor to call for the lookahead upon a syntax
&lt;br&gt;+ &amp;nbsp;error or upon parser return. &amp;nbsp;This bug has been fixed.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;* Changes in version 2.4.2 (????-??-??):
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;** Detection of GNU M4 1.4.6 or newer during configure is improved.
&lt;br&gt;diff --git a/data/yacc.c b/data/yacc.c
&lt;br&gt;index 11ebbf1..dce9a6a 100644
&lt;br&gt;--- a/data/yacc.c
&lt;br&gt;+++ b/data/yacc.c
&lt;br&gt;@@ -621,7 +621,6 @@ do								\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{								\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yychar = (Token);						\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yylval = (Value);						\
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;yytoken = YYTRANSLATE (yychar);				\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YYPOPSTACK (1);						\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;goto yybackup;						\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}								\
&lt;br&gt;@@ -1420,6 +1419,17 @@ yyreduce:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;]b4_user_actions[
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;default: break;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;/* User semantic actions sometimes alter yychar, and that requires
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; that yytoken be updated with the new translation. &amp;nbsp;We take the
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; approach of translating immediately before every use of yytoken.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; One alternative is translating here after every semantic action,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; but that translation would be missed if the semantic action invokes
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; if it invokes YYBACKUP. &amp;nbsp;In the case of YYABORT or YYACCEPT, an
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; incorrect destructor might then be invoked immediately. &amp;nbsp;In the
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; case of YYERROR or YYBACKUP, subsequent parser actions might lead
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; to an incorrect destructor call or verbose syntax error message
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; before the lookahead is translated. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;YY_SYMBOL_PRINT (&amp;quot;-&amp;gt; $$ =&amp;quot;, yyr1[yyn], &amp;yyval, &amp;yyloc);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;YYPOPSTACK (yylen);
&lt;br&gt;@@ -1448,6 +1458,10 @@ yyreduce:
&lt;br&gt;&amp;nbsp;| yyerrlab -- here on detecting error |
&lt;br&gt;&amp;nbsp;`------------------------------------*/
&lt;br&gt;&amp;nbsp;yyerrlab:
&lt;br&gt;+ &amp;nbsp;/* Make sure we have latest lookahead translation. &amp;nbsp;See comments at
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; user semantic actions for why this is necessary. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp;yytoken = YYTRANSLATE (yychar);
&lt;br&gt;+
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* If not already recovering from an error, report this error. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (!yyerrstatus)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;@@ -1600,8 +1614,13 @@ yyexhaustedlab:
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;yyreturn:
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (yychar != YYEMPTY)
&lt;br&gt;- &amp;nbsp; &amp;nbsp; yydestruct (&amp;quot;Cleanup: discarding lookahead&amp;quot;,
&lt;br&gt;-		 yytoken, &amp;yylval]b4_locations_if([, &amp;yylloc])[]b4_user_args[);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;/* Make sure we have latest lookahead translation. &amp;nbsp;See comments at
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; user semantic actions for why this is necessary. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;yytoken = YYTRANSLATE (yychar);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;yydestruct (&amp;quot;Cleanup: discarding lookahead&amp;quot;,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yytoken, &amp;yylval]b4_locations_if([, &amp;yylloc])[]b4_user_args[);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* Do not reclaim the symbols of the rule which action triggered
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; this YYABORT or YYACCEPT. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;YYPOPSTACK (yylen);
&lt;br&gt;diff --git a/tests/actions.at b/tests/actions.at
&lt;br&gt;index d317920..144791c 100644
&lt;br&gt;--- a/tests/actions.at
&lt;br&gt;+++ b/tests/actions.at
&lt;br&gt;@@ -1408,3 +1408,74 @@ AT_MATCHES_CHECK([input.c], [[// TEST:Y:1 [;{}]*\n;\}$]], &amp;nbsp;[[12]])
&lt;br&gt;&amp;nbsp;AT_MATCHES_CHECK([input.c], [[#define TEST_MACRO_N \\\n\[\]&amp;quot;broken\\&amp;quot; \$ \@ \$\$ \@\$ \[\];\\\nstring;&amp;quot;\}]], [[2]])
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;AT_CLEANUP
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+## -------------------------------------------------- ##
&lt;br&gt;+## Destroying lookahead assigned by semantic action. &amp;nbsp;##
&lt;br&gt;+## -------------------------------------------------- ##
&lt;br&gt;+
&lt;br&gt;+AT_SETUP([[Destroying lookahead assigned by semantic action]])
&lt;br&gt;+
&lt;br&gt;+AT_DATA_GRAMMAR([input.y],
&lt;br&gt;+[[
&lt;br&gt;+%code {
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;assert.h&amp;gt;
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;+ &amp;nbsp;static void yyerror (char const *);
&lt;br&gt;+ &amp;nbsp;static int yylex (void);
&lt;br&gt;+ &amp;nbsp;#define USE(Var)
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+%destructor { fprintf (stderr, &amp;quot;'a' destructor\n&amp;quot;); } 'a'
&lt;br&gt;+%destructor { fprintf (stderr, &amp;quot;'b' destructor\n&amp;quot;); } 'b'
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+// In a previous version of Bison, yychar assigned by the semantic
&lt;br&gt;+// action below was not translated into yytoken before the lookahead was
&lt;br&gt;+// discarded and thus before its destructor (selected according to
&lt;br&gt;+// yytoken) was called in order to return from yyparse. &amp;nbsp;This would
&lt;br&gt;+// happen even if YYACCEPT was performed in a later semantic action as
&lt;br&gt;+// long as only consistent states with default reductions were visited
&lt;br&gt;+// in between. &amp;nbsp;However, we leave YYACCEPT in the same semantic action
&lt;br&gt;+// for this test in order to show that skeletons cannot simply translate
&lt;br&gt;+// immediately after every semantic action because a semantic action
&lt;br&gt;+// that has set yychar might not always return normally. &amp;nbsp;Instead,
&lt;br&gt;+// skeletons must translate before every use of yytoken.
&lt;br&gt;+start: 'a' accept { USE($1); } ;
&lt;br&gt;+accept: /*empty*/ {
&lt;br&gt;+ &amp;nbsp;assert (yychar == YYEMPTY);
&lt;br&gt;+ &amp;nbsp;yychar = 'b';
&lt;br&gt;+ &amp;nbsp;YYACCEPT;
&lt;br&gt;+} ;
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+yyerror (char const *msg)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;fprintf (stderr, &amp;quot;%s\n&amp;quot;, msg);
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+static int
&lt;br&gt;+yylex (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;static char const *input = &amp;quot;a&amp;quot;;
&lt;br&gt;+ &amp;nbsp;return *input++;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+main (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;return yyparse ();
&lt;br&gt;+}
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+AT_BISON_CHECK([[-o input.c input.y]])
&lt;br&gt;+AT_COMPILE([[input]])
&lt;br&gt;+AT_PARSER_CHECK([[./input]], [[0]], [],
&lt;br&gt;+[['b' destructor
&lt;br&gt;+'a' destructor
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+AT_CLEANUP
&lt;br&gt;diff --git a/tests/conflicts.at b/tests/conflicts.at
&lt;br&gt;index 26ec08d..faaa3b9 100644
&lt;br&gt;--- a/tests/conflicts.at
&lt;br&gt;+++ b/tests/conflicts.at
&lt;br&gt;@@ -139,6 +139,130 @@ AT_CLEANUP
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+## ------------------------------------------- ##
&lt;br&gt;+## parse.error=verbose and consistent errors. &amp;nbsp;##
&lt;br&gt;+## ------------------------------------------- ##
&lt;br&gt;+
&lt;br&gt;+AT_SETUP([[parse.error=verbose and consistent errors]])
&lt;br&gt;+
&lt;br&gt;+m4_pushdef([AT_CONSISTENT_ERRORS_CHECK], [
&lt;br&gt;+
&lt;br&gt;+AT_BISON_CHECK([$1[ -o input.c input.y]])
&lt;br&gt;+AT_COMPILE([[input]])
&lt;br&gt;+
&lt;br&gt;+m4_pushdef([AT_EXPECTING], [m4_if($3, [ab], [[, expecting 'a' or 'b']],
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$3, [a], &amp;nbsp;[[, expecting 'a']],
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$3, [b], &amp;nbsp;[[, expecting 'b']])])
&lt;br&gt;+
&lt;br&gt;+AT_PARSER_CHECK([[./input]], [[1]], [],
&lt;br&gt;+[[syntax error, unexpected ]$2[]AT_EXPECTING[
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+m4_popdef([AT_EXPECTING])
&lt;br&gt;+
&lt;br&gt;+])
&lt;br&gt;+
&lt;br&gt;+AT_DATA_GRAMMAR([input.y],
&lt;br&gt;+[[%code {
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;assert.h&amp;gt;
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;+ &amp;nbsp;int yylex (void);
&lt;br&gt;+ &amp;nbsp;void yyerror (char const *);
&lt;br&gt;+ &amp;nbsp;#define USE(Var)
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+%define parse.error verbose
&lt;br&gt;+
&lt;br&gt;+// The point isn't to test IELR here, but state merging happens to
&lt;br&gt;+// complicate the example.
&lt;br&gt;+%define lr.type ielr
&lt;br&gt;+
&lt;br&gt;+%nonassoc 'a'
&lt;br&gt;+
&lt;br&gt;+// If yylval=0 here, then we know that the 'a' destructor is being
&lt;br&gt;+// invoked incorrectly for the 'b' set in the semantic action below.
&lt;br&gt;+// All 'a' tokens are returned by yylex, which sets yylval=1.
&lt;br&gt;+%destructor {
&lt;br&gt;+ &amp;nbsp;if (!$$)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;fprintf (stderr, &amp;quot;Wrong destructor.\n&amp;quot;);
&lt;br&gt;+} 'a'
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+// The lookahead assigned by the semantic action isn't needed before
&lt;br&gt;+// either error action is encountered. &amp;nbsp;In a previous version of Bison,
&lt;br&gt;+// this was a problem as it meant yychar was not translated into yytoken
&lt;br&gt;+// before either error action. &amp;nbsp;The second error action thus invoked a
&lt;br&gt;+// destructor that it selected according to the incorrect yytoken. &amp;nbsp;The
&lt;br&gt;+// first error action would have reported an incorrect unexpected token
&lt;br&gt;+// except that, due to another bug, the unexpected token is not reported
&lt;br&gt;+// at all because the error action is the default action in a consistent
&lt;br&gt;+// state. &amp;nbsp;That bug still needs to be fixed.
&lt;br&gt;+start: error-reduce consistent-error 'a' { USE ($3); } ;
&lt;br&gt;+
&lt;br&gt;+error-reduce:
&lt;br&gt;+ &amp;nbsp;'a' 'a' consistent-reduction consistent-error 'a'
&lt;br&gt;+ &amp;nbsp;{ USE (($1, $2, $5)); }
&lt;br&gt;+| 'a' error
&lt;br&gt;+ &amp;nbsp;{ USE ($1); }
&lt;br&gt;+;
&lt;br&gt;+
&lt;br&gt;+consistent-reduction: /*empty*/ {
&lt;br&gt;+ &amp;nbsp;assert (yychar == YYEMPTY);
&lt;br&gt;+ &amp;nbsp;yylval = 0;
&lt;br&gt;+ &amp;nbsp;yychar = 'b';
&lt;br&gt;+} ;
&lt;br&gt;+
&lt;br&gt;+consistent-error:
&lt;br&gt;+ &amp;nbsp;'a' { USE ($1); }
&lt;br&gt;+| /*empty*/ %prec 'a'
&lt;br&gt;+;
&lt;br&gt;+
&lt;br&gt;+// Provide another context in which all rules are useful so that this
&lt;br&gt;+// test case looks a little more realistic.
&lt;br&gt;+start: 'b' consistent-error 'b' ;
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+yylex (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;static char const *input = &amp;quot;aa&amp;quot;;
&lt;br&gt;+ &amp;nbsp;yylval = 1;
&lt;br&gt;+ &amp;nbsp;return *input++;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+void
&lt;br&gt;+yyerror (char const *msg)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;fprintf (stderr, &amp;quot;%s\n&amp;quot;, msg);
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+main (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;return yyparse ();
&lt;br&gt;+}
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+# See comments in grammar for why this test doesn't succeed.
&lt;br&gt;+AT_XFAIL_IF([[:]])
&lt;br&gt;+
&lt;br&gt;+AT_CONSISTENT_ERRORS_CHECK([], [['b']], [[none]])
&lt;br&gt;+AT_CONSISTENT_ERRORS_CHECK([[-Dlr.default-reductions=consistent]],
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [['b']], [[none]])
&lt;br&gt;+
&lt;br&gt;+# Canonical LR doesn't foresee the error for 'a'!
&lt;br&gt;+AT_CONSISTENT_ERRORS_CHECK([[-Dlr.default-reductions=accepting]],
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [[$end]], [[a]])
&lt;br&gt;+AT_CONSISTENT_ERRORS_CHECK([[-Flr.type=canonical-lr]], [[$end]], [[a]])
&lt;br&gt;+
&lt;br&gt;+m4_popdef([AT_CONSISTENT_ERRORS_CHECK])
&lt;br&gt;+
&lt;br&gt;+AT_CLEANUP
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;## ------------------------- ##
&lt;br&gt;&amp;nbsp;## Unresolved SR Conflicts. &amp;nbsp;##
&lt;br&gt;&amp;nbsp;## ------------------------- ##
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--Fix-handling-of-yychar-manipulation-in-user-semantic-actions.-tp26822157p26861692.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26858812</id>
	<title>remove YYFAIL from lalr1.java and yacc.c</title>
	<published>2009-12-19T13:40:33Z</published>
	<updated>2009-12-19T13:40:33Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">I propose we remove the YYFAIL feature from all skeletons as of release 
&lt;br&gt;2.5. &amp;nbsp;My rationale is as follows:
&lt;br&gt;&lt;br&gt;1. YYFAIL only appears in two skeletons, and removing it from them should 
&lt;br&gt;not create a legitimate backward incompatibility:
&lt;br&gt;&lt;br&gt;a. YYFAIL appears in yacc.c but is not documented for yacc.c. &amp;nbsp;Comments in 
&lt;br&gt;yacc.c describe it as follows:
&lt;br&gt;&lt;br&gt;&amp;nbsp; /* Like YYERROR except do call yyerror. &amp;nbsp;This remains here temporarily
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;to ease the transition to the new meaning of YYERROR, for GCC.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Once GCC version 2 has supplanted version 1, this can go. &amp;nbsp;*/
&lt;br&gt;&lt;br&gt;In other words, we've been planning to get rid of it for a long while. &amp;nbsp;
&lt;br&gt;(However, is there any evidence that users actually use it? &amp;nbsp;Do we need to 
&lt;br&gt;poll them or warn them somehow?)
&lt;br&gt;&lt;br&gt;b. YYFAIL is documented for lalr1.java, but that skeleton is still labeled 
&lt;br&gt;as experimental, so we're free to change its interface.
&lt;br&gt;&lt;br&gt;2. YYFAIL's invocation of yyerror is not useful:
&lt;br&gt;&lt;br&gt;a. If verbose error messages are not enabled, then it's easy for the user 
&lt;br&gt;to just report the simple &amp;quot;syntax error&amp;quot; himself before invoking YYERROR. 
&lt;br&gt;&amp;quot;semantic error&amp;quot; or a more specific message would really be more 
&lt;br&gt;appropriate anyway because any syntactic analysis (at least in one sense) 
&lt;br&gt;cannot predict YYERROR and YYFAIL invocations. &amp;nbsp;That includes the 
&lt;br&gt;syntactic analysis done for verbose error messages....
&lt;br&gt;&lt;br&gt;b. If verbose error messages are enabled, the expected token list it 
&lt;br&gt;reports is almost certainly wrong because YYFAIL rejects some tokens from 
&lt;br&gt;that list. &amp;nbsp;The expected token list might even include the token reported 
&lt;br&gt;as unexpected! &amp;nbsp;For example, try the input &amp;quot;b&amp;quot; for this grammar:
&lt;br&gt;&lt;br&gt;&amp;nbsp; start: { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } 'a'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| { YYFAIL; } 'b'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;The output is:
&lt;br&gt;&lt;br&gt;&amp;nbsp; syntax error, unexpected 'b', expecting 'b'
&lt;br&gt;&lt;br&gt;Of course, expected token lists are broken anyway by state merging and 
&lt;br&gt;default reductions (that's why 'a' is missing in this example), but my 
&lt;br&gt;upcoming lookahead correction technique will address that issue for LALR 
&lt;br&gt;and IELR, and canonical LR already addresses it:
&lt;br&gt;&lt;br&gt;&amp;nbsp; syntax error, unexpected 'b', expecting 'a' or 'b'
&lt;br&gt;&lt;br&gt;3. Unlike YYERROR, YYFAIL does not pop the RHS of the production. &amp;nbsp;Not 
&lt;br&gt;popping could be dangerous if the semantic action already freed or 
&lt;br&gt;otherwise used some of the RHS values. &amp;nbsp;Moreover, it's inconsistent with 
&lt;br&gt;the documented way in which Bison normally handles the RHS. &amp;nbsp;That is, 
&lt;br&gt;YYERROR, YYABORT, and YYACCEPT all pop the RHS so that their values won't 
&lt;br&gt;be freed or reused later.
&lt;br&gt;&lt;br&gt;4. There's one other difference between YYFAIL and YYERROR: if the parser 
&lt;br&gt;has not shifted a token since the error token, YYFAIL will discard the 
&lt;br&gt;lookahead before popping the stack again. &amp;nbsp;In other words, YYFAIL acts 
&lt;br&gt;more like a subsequent syntax error, but YYERROR restarts error recovery. 
&lt;br&gt;It's not clear to me yet which approach is better, but the inconsistency 
&lt;br&gt;is just another undocumented point of confusion. &amp;nbsp;If the user really needs 
&lt;br&gt;to remove the lookahead before invoking YYERROR, yyclearin should be 
&lt;br&gt;provided.
&lt;br&gt;&lt;br&gt;5. Bison development and user documentation would be easier if all 
&lt;br&gt;skeletons made the same decision about whether to support YYFAIL.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remove-YYFAIL-from-lalr1.java-and-yacc.c-tp26858812p26858812.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26858262</id>
	<title>Re: please help me with this</title>
	<published>2009-12-19T12:26:36Z</published>
	<updated>2009-12-19T12:26:36Z</updated>
	<author>
		<name>Philip Herron</name>
	</author>
	<content type="html">On Fri, 2009-12-18 at 01:58 -0500, Tejas Kajarekar wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; My name is Tejas. I am trying to use Flex and Bison to parse (and convert)
&lt;br&gt;&amp;gt; one file to another format. Currently, I am not bothered about conversion,
&lt;br&gt;&amp;gt; just the parsing.
&lt;br&gt;&amp;gt; I have never used either tools, and what my problem is, may be trivial.
&lt;br&gt;&amp;gt; (Worth laughing)
&lt;br&gt;&amp;gt; Here is my problem:
&lt;br&gt;&amp;gt; I am going to attach my .l and .y files and .txt file which is my input.
&lt;br&gt;&amp;gt; Here I will just include the tokenIZING part of .l and grammar of .y.
&lt;br&gt;&amp;gt; This is part of my flex which returns tokens to yyparse:-
&lt;br&gt;&amp;gt; &amp;quot;graph&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;return GRAPH; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; &amp;quot;{&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp;return '{'; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;quot;}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp;return '}'; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;quot;init&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;yylval= yytext;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return INIT; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; {id} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;yylval = yytext;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ID; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; &amp;nbsp;where id = [a-zA-Z_][a-zA-z_0-9]*
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is my bison grammar:-
&lt;br&gt;&amp;gt; %%
&lt;br&gt;&amp;gt; input: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* empty */
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | GRAPH '{' graphitemset '}' &amp;nbsp; &amp;nbsp;{ printf(&amp;quot;GRAPH
&lt;br&gt;&amp;gt; FOUND&amp;quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | error
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; graphitemset: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;responsivestate &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ printf(&amp;quot;RESPONSIVE
&lt;br&gt;&amp;gt; STATE&amp;quot;); &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; responsivestate: &amp;nbsp; &amp;nbsp;INIT statename '{' '}' &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ printf(&amp;quot;INIT %s&amp;quot;,$2);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; statename: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* empty */
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ID
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; %%
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; After running it,
&lt;br&gt;&amp;gt; C:\&amp;gt;gnu\bin\flex -olex.yy.c -i s.l
&lt;br&gt;&amp;gt; C:\&amp;gt;gnu\bin\bison -d s.y
&lt;br&gt;&amp;gt; C:\&amp;gt;gcc -ose s.tab.c lex.yy.c -ly -lfl
&lt;br&gt;&amp;gt; C:\&amp;gt;se &amp;lt; s.txt
&lt;br&gt;&amp;gt; Now if my s.txt = *graph{init{}}*
&lt;br&gt;&amp;gt; then I get output *INIT (null)RESPONSIVE STATEGRAPH FOUND.*
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; However, if I change s.txt to *graph{initnabc{}}*
&lt;br&gt;&amp;gt; then I get *se: syntax error line 0*
&lt;br&gt;&amp;gt; i.e., it only recognizes state names which are empty, otherwise, there is
&lt;br&gt;&amp;gt; some problem with ID.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I want it to recognoze graph, init as well as the state name.
&lt;br&gt;&amp;gt; I think ID definition conflicts with &amp;quot;graph&amp;quot;, or &amp;quot;init&amp;quot;.
&lt;br&gt;&amp;gt; It also generates a warning: No new line at end of file for .l file.
&lt;br&gt;&amp;gt; Please help me with this problem.
&lt;br&gt;&amp;gt; __________________________________________________________________________
&lt;br&gt;&amp;gt; Also, simlar kind of problem, but with very simple files:
&lt;br&gt;&amp;gt; &amp;quot;graph&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;return GRAPH; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; {id} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;yylval = yytext;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ID; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; for tokens
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; input: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GRAPH { printf(&amp;quot;GRAPH FOUND&amp;quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | GRAPH ID { printf(&amp;quot;GRAPH + ID&amp;quot;); &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; the grammar
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; with input graph, its executes to* GRAPH FOUND;*
&lt;br&gt;&amp;gt; with input graphgraph, it gives syntax error; and not GRAPH FOUND twice.,
&lt;br&gt;&amp;gt; nor GRAPH + ID for something like graphbhg.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Do we have to run the tokenizing routing in some loop like while not EOF,
&lt;br&gt;&amp;gt; etc.?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have no idea what to do to get the desired output.
&lt;br&gt;&amp;gt; This may sound very funny, but as I said, I have no experience with these
&lt;br&gt;&amp;gt; two tools.
&lt;br&gt;&amp;gt; I will really appreciate your help.
&lt;br&gt;&amp;gt; The actual input will be quite large, I am just experimenting with
&lt;br&gt;&amp;gt; graph{init{}}, and having problems with that
&lt;br&gt;&amp;gt; Also, sorry for the long email.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; thanking you in advance,
&lt;br&gt;&amp;gt; tejasSK
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26858262&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;help-bison@...&lt;/a&gt; &lt;a href=&quot;http://lists.gnu.org/mailman/listinfo/help-bison&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/mailman/listinfo/help-bison&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;Hey
&lt;br&gt;&lt;br&gt;I think i see your problem, but not quite sure which attachments are
&lt;br&gt;relevant.
&lt;br&gt;&lt;br&gt;Is the s.txt the input data i take it: ``graph { init { } }''
&lt;br&gt;&lt;br&gt;Anyway's not totaly sure on your syntax. But if you want to build a
&lt;br&gt;lexer and parser for this you need to think about your syntax a little
&lt;br&gt;more as in know what is syntax/delimiters/operators and what are
&lt;br&gt;keywords and identifiers.
&lt;br&gt;&lt;br&gt;So from here you only have 3 things to worry about 'lexing' which are
&lt;br&gt;'{', '}' keywords 'graph' 'init' and IDENTIFIERS
&lt;br&gt;&lt;br&gt;So i take it from your s.y grammar you want the syntax to be something
&lt;br&gt;like:
&lt;br&gt;&lt;br&gt;'graph { init &amp;lt;statename&amp;gt; { &amp;lt;parameters&amp;gt; } }'
&lt;br&gt;&lt;br&gt;Well first i see you wanted it to look like 'graph{ initnabc { } }',
&lt;br&gt;your lexer cant split out the 'init' and 'abc' since the regex for that
&lt;br&gt;token will simply return an IDENTIFIER, since it see init&amp;lt;more chars&amp;gt; so
&lt;br&gt;it can't be the INIT keyword it has to be an identifier. So you language
&lt;br&gt;MUST be something like ``'graph { init abcdefg { } }' unless you want to
&lt;br&gt;treat the 'initabc' as an IDENTIFIER and do the lexing your self.
&lt;br&gt;&lt;br&gt;So this leaves making your lexer look like this:
&lt;br&gt;&lt;br&gt;&amp;quot;graph&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp; &amp;nbsp; return GRAPH; &amp;nbsp; }
&lt;br&gt;&amp;quot;{&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp; &amp;nbsp; return '{'; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;quot;}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp; &amp;nbsp; return '}'; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;quot;init&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; return INIT; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;{id} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ yylval.string= strdup(yytext);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return ID; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;Note i have started using 'yylval.&amp;lt;&amp;gt;' you should get in the habit of
&lt;br&gt;using a &amp;lt;%union&amp;gt; in bison since it makes type handling much easier since
&lt;br&gt;YYSTYPE is default int i IIRC and you can do #define YYSTYPE const char*
&lt;br&gt;or somthing but its simply not dynamic enough.
&lt;br&gt;&lt;br&gt;So your lexer if it is the 's.l' needs a simply edit and make sure you
&lt;br&gt;include the header generated by bison in a sec.
&lt;br&gt;&lt;br&gt;In your parser you need to add in your:
&lt;br&gt;&lt;br&gt;%union{ const char* string; &amp;lt;other types you wish to return&amp;gt; }
&lt;br&gt;&lt;br&gt;Then your grammar:
&lt;br&gt;&lt;br&gt;%token GRAPH
&lt;br&gt;%token INIT
&lt;br&gt;%token&amp;lt;string&amp;gt; ID
&lt;br&gt;&lt;br&gt;/* You can also add in %type&amp;lt;union ident type&amp;gt; rule for semantics which
&lt;br&gt;return values using $$=&amp;lt;foo&amp;gt;; */
&lt;br&gt;&lt;br&gt;%start graph
&lt;br&gt;&lt;br&gt;%%
&lt;br&gt;&lt;br&gt;graph: /* empty */
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| GRAPH '{' graphparameters '}'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| error
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;graphparameters: 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;INIT stateid '{' '}'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;stateid: /* empty */
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| ID 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;%%
&lt;br&gt;&lt;br&gt;And then you can add in what you want so your grammar was right. But
&lt;br&gt;with a little cleanup your better ready to handle more semantics easier
&lt;br&gt;using %union :). Remember think about what your syntax means is really
&lt;br&gt;important. I learnt that the hard way ;).
&lt;br&gt;&lt;br&gt;Then you could start handling n length parameters for your state with
&lt;br&gt;grammar like:
&lt;br&gt;&lt;br&gt;%type&amp;lt;string&amp;gt; stateid
&lt;br&gt;%type&amp;lt;paramlist&amp;gt; parameters
&lt;br&gt;%type&amp;lt;symbol&amp;gt; item
&lt;br&gt;&lt;br&gt;%%
&lt;br&gt;&lt;br&gt;graph: /* empty */
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| GRAPH '{' graphparameters '}'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| error
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;graphparameters: 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;INIT stateid '{' parameters '}'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;stateid: /* empty */
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| ID { $$= $1; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;parameters:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;parameters item
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| item
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;item: INTEGER
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| ...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;
&lt;br&gt;&lt;br&gt;Hope this helps.
&lt;br&gt;&lt;br&gt;--Phil
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26858262&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;help-bison@...&lt;/a&gt; &lt;a href=&quot;http://lists.gnu.org/mailman/listinfo/help-bison&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/mailman/listinfo/help-bison&lt;/a&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (204 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26858262/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Help-f1504.html&quot; embed=&quot;fixTarget[1504]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Help&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/please-help-me-with-this-tp26853636p26858262.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26852864</id>
	<title>[PATCH] lalr1.cc: don't discard non-existent lookahead on syntax error.</title>
	<published>2009-12-18T21:17:39Z</published>
	<updated>2009-12-18T21:17:39Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">I pushed this to master. &amp;nbsp;The bug does not exist on branch-2.5. &amp;nbsp;The test 
&lt;br&gt;case makes this bug look pretty obscure, and maybe that's right, but I 
&lt;br&gt;really didn't spend much time searching for a simpler test case.
&lt;br&gt;&lt;br&gt;&amp;gt;From d59beda068aef97834ea84ce4f5cc99b487e4b68 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26852864&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Fri, 18 Dec 2009 23:57:18 -0500
&lt;br&gt;Subject: [PATCH] lalr1.cc: don't discard non-existent lookahead on syntax error.
&lt;br&gt;&lt;br&gt;* data/lalr1.cc (parser::parse): Check yyempty first.
&lt;br&gt;* tests/c++.at (Syntax error discarding no lookahead): New test
&lt;br&gt;group.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;7 +++++
&lt;br&gt;&amp;nbsp;data/lalr1.cc | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;tests/c++.at &amp;nbsp;| &amp;nbsp; 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
&lt;br&gt;&amp;nbsp;3 files changed, 85 insertions(+), 3 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 2926da7..1c15cc5 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,10 @@
&lt;br&gt;+2009-12-18 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26852864&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	lalr1.cc: don't discard non-existent lookahead on syntax error.
&lt;br&gt;+	* data/lalr1.cc (parser::parse): Check yyempty first.
&lt;br&gt;+	* tests/c++.at (Syntax error discarding no lookahead): New test
&lt;br&gt;+	group.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-17 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26852864&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	Code cleanup.
&lt;br&gt;diff --git a/data/lalr1.cc b/data/lalr1.cc
&lt;br&gt;index 9e0d522..6174e82 100644
&lt;br&gt;--- a/data/lalr1.cc
&lt;br&gt;+++ b/data/lalr1.cc
&lt;br&gt;@@ -876,7 +876,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* Return failure if at end of input. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (yyla.type == yyeof_)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YYABORT;
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else if (!yyempty)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yy_destroy_ (&amp;quot;Error: discarding&amp;quot;, yyla);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyempty = true;
&lt;br&gt;diff --git a/tests/c++.at b/tests/c++.at
&lt;br&gt;index beffb1c..ce64d6d 100644
&lt;br&gt;--- a/tests/c++.at
&lt;br&gt;+++ b/tests/c++.at
&lt;br&gt;@@ -286,8 +286,6 @@ AT_CHECK_DOXYGEN([Public])
&lt;br&gt;&amp;nbsp;AT_CHECK_DOXYGEN([Private])
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-
&lt;br&gt;-
&lt;br&gt;&amp;nbsp;## ------------ ##
&lt;br&gt;&amp;nbsp;## Namespaces. &amp;nbsp;##
&lt;br&gt;&amp;nbsp;## ------------ ##
&lt;br&gt;@@ -369,3 +367,80 @@ AT_CHECK_NAMESPACE([[foo[3]::bar::baz]], [[-]])
&lt;br&gt;&amp;nbsp;AT_CHECK_NAMESPACE([[foo::bar,baz]], [[-]])
&lt;br&gt;&amp;nbsp;AT_CHECK_NAMESPACE([[foo::bar::(baz /* Pacify Emacs ) */]], [[-]])
&lt;br&gt;&amp;nbsp;AT_CLEANUP
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+## -------------------------------------- ##
&lt;br&gt;+## Syntax error discarding no lookahead. &amp;nbsp;##
&lt;br&gt;+## -------------------------------------- ##
&lt;br&gt;+
&lt;br&gt;+# After a syntax error, lalr1.cc used to not check whether there
&lt;br&gt;+# actually is a lookahead before discarding the lookahead. &amp;nbsp;As a result,
&lt;br&gt;+# it mistakenly invoked the destructor for the previous lookahead.
&lt;br&gt;+
&lt;br&gt;+AT_SETUP([[Syntax error discarding no lookahead]])
&lt;br&gt;+
&lt;br&gt;+AT_DATA_GRAMMAR([[input.yy]],
&lt;br&gt;+[[%skeleton &amp;quot;lalr1.cc&amp;quot;
&lt;br&gt;+
&lt;br&gt;+%code {
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;string&amp;gt;
&lt;br&gt;+ &amp;nbsp;int yylex (yy::parser::semantic_type *, yy::location *);
&lt;br&gt;+ &amp;nbsp;#define USE(Args)
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+%defines
&lt;br&gt;+%locations
&lt;br&gt;+%define parse.error verbose
&lt;br&gt;+
&lt;br&gt;+%nonassoc 'a' ;
&lt;br&gt;+
&lt;br&gt;+%destructor {
&lt;br&gt;+ &amp;nbsp;std::cerr &amp;lt;&amp;lt; &amp;quot;Discarding 'a'.&amp;quot; &amp;lt;&amp;lt; std::endl;
&lt;br&gt;+} 'a'
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+start: error-reduce consistent-error 'a' { USE ($3); };
&lt;br&gt;+
&lt;br&gt;+error-reduce:
&lt;br&gt;+ &amp;nbsp;'a' 'a' consistent-error 'a' { USE (($1, $2, $4)); }
&lt;br&gt;+| 'a' error { std::cerr &amp;lt;&amp;lt; &amp;quot;Reducing 'a'.&amp;quot; &amp;lt;&amp;lt; std::endl; USE ($1); }
&lt;br&gt;+;
&lt;br&gt;+
&lt;br&gt;+consistent-error:
&lt;br&gt;+ &amp;nbsp;'a'
&lt;br&gt;+| /*empty*/ %prec 'a'
&lt;br&gt;+;
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+yylex (yy::parser::semantic_type *, yy::location *)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;static char const *input = &amp;quot;aa&amp;quot;;
&lt;br&gt;+ &amp;nbsp;return *input++;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+void
&lt;br&gt;+yy::parser::error (const location_type &amp;, const std::string &amp;m)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;std::cerr &amp;lt;&amp;lt; m &amp;lt;&amp;lt; std::endl;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+main (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;yy::parser parser;
&lt;br&gt;+ &amp;nbsp;return parser.parse ();
&lt;br&gt;+}
&lt;br&gt;+]])
&lt;br&gt;+AT_BISON_CHECK([[-o input.cc input.yy]], [[0]], [[]], [[ignore-nolog]])
&lt;br&gt;+AT_COMPILE_CXX([[input]])
&lt;br&gt;+# This used to print &amp;quot;Discarding 'a'.&amp;quot; again at the end.
&lt;br&gt;+AT_PARSER_CHECK([[./input]], [[1]], [[]],
&lt;br&gt;+[[syntax error
&lt;br&gt;+Discarding 'a'.
&lt;br&gt;+Reducing 'a'.
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+AT_CLEANUP
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--lalr1.cc%3A-don%27t-discard-non-existent-lookahead-on-syntax-error.-tp26852864p26852864.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26853636</id>
	<title>please help me with this</title>
	<published>2009-12-17T22:58:09Z</published>
	<updated>2009-12-17T22:58:09Z</updated>
	<author>
		<name>Tejas Kajarekar</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;My name is Tejas. I am trying to use Flex and Bison to parse (and convert)
&lt;br&gt;one file to another format. Currently, I am not bothered about conversion,
&lt;br&gt;just the parsing.
&lt;br&gt;I have never used either tools, and what my problem is, may be trivial.
&lt;br&gt;(Worth laughing)
&lt;br&gt;Here is my problem:
&lt;br&gt;I am going to attach my .l and .y files and .txt file which is my input.
&lt;br&gt;Here I will just include the tokenIZING part of .l and grammar of .y.
&lt;br&gt;This is part of my flex which returns tokens to yyparse:-
&lt;br&gt;&amp;quot;graph&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;return GRAPH; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;quot;{&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp;return '{'; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;quot;}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp;return '}'; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;quot;init&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;yylval= yytext;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return INIT; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;{id} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;yylval = yytext;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ID; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp;where id = [a-zA-Z_][a-zA-z_0-9]*
&lt;br&gt;&lt;br&gt;This is my bison grammar:-
&lt;br&gt;%%
&lt;br&gt;input: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* empty */
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | GRAPH '{' graphitemset '}' &amp;nbsp; &amp;nbsp;{ printf(&amp;quot;GRAPH
&lt;br&gt;FOUND&amp;quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | error
&lt;br&gt;&lt;br&gt;graphitemset: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;responsivestate &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ printf(&amp;quot;RESPONSIVE
&lt;br&gt;STATE&amp;quot;); &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;responsivestate: &amp;nbsp; &amp;nbsp;INIT statename '{' '}' &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ printf(&amp;quot;INIT %s&amp;quot;,$2);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;statename: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* empty */
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ID
&lt;br&gt;&lt;br&gt;%%
&lt;br&gt;&lt;br&gt;After running it,
&lt;br&gt;C:\&amp;gt;gnu\bin\flex -olex.yy.c -i s.l
&lt;br&gt;C:\&amp;gt;gnu\bin\bison -d s.y
&lt;br&gt;C:\&amp;gt;gcc -ose s.tab.c lex.yy.c -ly -lfl
&lt;br&gt;C:\&amp;gt;se &amp;lt; s.txt
&lt;br&gt;Now if my s.txt = *graph{init{}}*
&lt;br&gt;then I get output *INIT (null)RESPONSIVE STATEGRAPH FOUND.*
&lt;br&gt;&lt;br&gt;However, if I change s.txt to *graph{initnabc{}}*
&lt;br&gt;then I get *se: syntax error line 0*
&lt;br&gt;i.e., it only recognizes state names which are empty, otherwise, there is
&lt;br&gt;some problem with ID.
&lt;br&gt;&lt;br&gt;I want it to recognoze graph, init as well as the state name.
&lt;br&gt;I think ID definition conflicts with &amp;quot;graph&amp;quot;, or &amp;quot;init&amp;quot;.
&lt;br&gt;It also generates a warning: No new line at end of file for .l file.
&lt;br&gt;Please help me with this problem.
&lt;br&gt;__________________________________________________________________________
&lt;br&gt;Also, simlar kind of problem, but with very simple files:
&lt;br&gt;&amp;quot;graph&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;return GRAPH; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;{id} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp;yylval = yytext;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ID; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;for tokens
&lt;br&gt;&lt;br&gt;&lt;br&gt;input: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GRAPH { printf(&amp;quot;GRAPH FOUND&amp;quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | GRAPH ID { printf(&amp;quot;GRAPH + ID&amp;quot;); &amp;nbsp; &amp;nbsp;}
&lt;br&gt;the grammar
&lt;br&gt;&lt;br&gt;with input graph, its executes to* GRAPH FOUND;*
&lt;br&gt;with input graphgraph, it gives syntax error; and not GRAPH FOUND twice.,
&lt;br&gt;nor GRAPH + ID for something like graphbhg.
&lt;br&gt;&lt;br&gt;Do we have to run the tokenizing routing in some loop like while not EOF,
&lt;br&gt;etc.?
&lt;br&gt;&lt;br&gt;I have no idea what to do to get the desired output.
&lt;br&gt;This may sound very funny, but as I said, I have no experience with these
&lt;br&gt;two tools.
&lt;br&gt;I will really appreciate your help.
&lt;br&gt;The actual input will be quite large, I am just experimenting with
&lt;br&gt;graph{init{}}, and having problems with that
&lt;br&gt;Also, sorry for the long email.
&lt;br&gt;&lt;br&gt;thanking you in advance,
&lt;br&gt;tejasSK
&lt;br&gt;&lt;br /&gt;graph{init{}}&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26853636&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;help-bison@...&lt;/a&gt; &lt;a href=&quot;http://lists.gnu.org/mailman/listinfo/help-bison&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/mailman/listinfo/help-bison&lt;/a&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;s.y&lt;/strong&gt; (976 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26853636/0/s.y&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;s.l&lt;/strong&gt; (1K) &lt;a href=&quot;http://old.nabble.com/attachment/26853636/1/s.l&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;ex.l&lt;/strong&gt; (340 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26853636/2/ex.l&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;ex.y&lt;/strong&gt; (722 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26853636/3/ex.y&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Help-f1504.html&quot; embed=&quot;fixTarget[1504]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Help&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/please-help-me-with-this-tp26853636p26853636.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26837817</id>
	<title>Can't find yyreset in bison 2.4.1 for linux</title>
	<published>2009-12-17T01:43:52Z</published>
	<updated>2009-12-17T01:43:52Z</updated>
	<author>
		<name>Li, Li-Wei</name>
	</author>
	<content type="html">Hi
&lt;br&gt;&amp;nbsp;
&lt;br&gt;Could someone please tell me where I can find the yyreset definition ?
&lt;br&gt;&amp;nbsp;
&lt;br&gt;I downloaded and build bison 2.4.1 to my redhat 3.6 box, but yyreset is
&lt;br&gt;not there.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;Many thanks in advance.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;/li-wei
&lt;br&gt;&lt;br&gt;&lt;br&gt;This e-mail is confidential and is intended only for the person to whom it is 
&lt;br&gt;addressed. &amp;nbsp;It may be privileged and should not be read, copied or used by
&lt;br&gt;anyone other than the intended recipient. &amp;nbsp;If you are not that person, you are
&lt;br&gt;not permitted to make use of the information and you are requested to notify
&lt;br&gt;the sender immediately that you have received it and then destroy the copy in
&lt;br&gt;your possession without disclosing its contents to any person.
&lt;br&gt;&lt;br&gt;Commerzbank AG may monitor outgoing and incoming e-mails. &amp;nbsp;By replying to this
&lt;br&gt;e-mail you consent to such monitoring. &amp;nbsp;We believe, but do not warrant, that 
&lt;br&gt;this e-mail and any attachments are virus free, but you must take full 
&lt;br&gt;responsibility for virus checking.
&lt;br&gt;&lt;br&gt;This e-mail was sent either by Commerzbank AG, London Branch, or by Commerzbank
&lt;br&gt;Corporates &amp; Markets, a division of Commerzbank AG. &amp;nbsp;Commerzbank AG is a 
&lt;br&gt;company incorporated in the Federal Republic of Germany and registered in 
&lt;br&gt;England (registered number FC008139, place of business 30 Gresham Street, 
&lt;br&gt;London EC2V 7PG) and is authorised by Bundesanstalt fuer 
&lt;br&gt;Finanzdienstleistungsaufsicht (BaFin) and authorised and subject to limited 
&lt;br&gt;regulation by the Financial Services Authority (FSA).
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26837817&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;help-bison@...&lt;/a&gt; &lt;a href=&quot;http://lists.gnu.org/mailman/listinfo/help-bison&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/mailman/listinfo/help-bison&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Help-f1504.html&quot; embed=&quot;fixTarget[1504]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Help&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Can%27t-find-yyreset-in-bison-2.4.1-for-linux-tp26837817p26837817.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26823719</id>
	<title>[PATCH] Code cleanup.</title>
	<published>2009-12-16T22:18:41Z</published>
	<updated>2009-12-16T22:18:41Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">I pushed this to master and branch-2.5.
&lt;br&gt;&lt;br&gt;From 387b4d504728391605f751e74a36fb7d0d441b19 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26823719&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Thu, 17 Dec 2009 01:09:09 -0500
&lt;br&gt;Subject: [PATCH] Code cleanup.
&lt;br&gt;&lt;br&gt;* src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
&lt;br&gt;function, which is no longer used.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;6 ++++++
&lt;br&gt;&amp;nbsp;src/symtab.c | &amp;nbsp; 18 ------------------
&lt;br&gt;&amp;nbsp;src/symtab.h | &amp;nbsp; &amp;nbsp;3 ---
&lt;br&gt;&amp;nbsp;3 files changed, 6 insertions(+), 21 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 2817f11..2926da7 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,9 @@
&lt;br&gt;+2009-12-17 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26823719&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	Code cleanup.
&lt;br&gt;+	* src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
&lt;br&gt;+	function, which is no longer used.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26823719&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	Add gcc's -Wundef to test suite and fix another warning from it.
&lt;br&gt;diff --git a/src/symtab.c b/src/symtab.c
&lt;br&gt;index ce29dfc..ebdf04c 100644
&lt;br&gt;--- a/src/symtab.c
&lt;br&gt;+++ b/src/symtab.c
&lt;br&gt;@@ -219,24 +219,6 @@ symbol_type_set (symbol *sym, uniqstr type_name, location loc)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-/*-----------------------------------.
&lt;br&gt;-| Get the CLASS associated with SYM. |
&lt;br&gt;-`-----------------------------------*/
&lt;br&gt;-
&lt;br&gt;-const char *
&lt;br&gt;-symbol_class_get_string (symbol *sym)
&lt;br&gt;-{
&lt;br&gt;- &amp;nbsp;if (sym-&amp;gt;class)
&lt;br&gt;- &amp;nbsp; &amp;nbsp;{
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;if (sym-&amp;gt;class == token_sym)
&lt;br&gt;-	return &amp;quot;terminal&amp;quot;;
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;else if (sym-&amp;gt;class == nterm_sym)
&lt;br&gt;-	return &amp;quot;nonterminal&amp;quot;;
&lt;br&gt;- &amp;nbsp; &amp;nbsp;}
&lt;br&gt;- &amp;nbsp;return &amp;quot;unknown&amp;quot;;
&lt;br&gt;-}
&lt;br&gt;-
&lt;br&gt;-
&lt;br&gt;&amp;nbsp;/*-----------------------------------------.
&lt;br&gt;&amp;nbsp;| Set the DESTRUCTOR associated with SYM. &amp;nbsp;|
&lt;br&gt;&amp;nbsp;`-----------------------------------------*/
&lt;br&gt;diff --git a/src/symtab.h b/src/symtab.h
&lt;br&gt;index b093af3..6204d90 100644
&lt;br&gt;--- a/src/symtab.h
&lt;br&gt;+++ b/src/symtab.h
&lt;br&gt;@@ -144,9 +144,6 @@ void symbol_make_alias (symbol *sym, symbol *str, location loc);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Do nothing if passed 0 as \c type_name. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;void symbol_type_set (symbol *sym, uniqstr type_name, location loc);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-/** Get the \c class string associated with \c sym. &amp;nbsp;*/
&lt;br&gt;-const char *symbol_class_get_string (symbol *sym);
&lt;br&gt;-
&lt;br&gt;&amp;nbsp;/** Set the \c destructor associated with \c sym. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;void symbol_destructor_set (symbol *sym, code_props const *destructor);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--Code-cleanup.-tp26823719p26823719.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26822157</id>
	<title>[PATCH] Fix handling of yychar manipulation in user semantic actions.</title>
	<published>2009-12-16T18:28:42Z</published>
	<updated>2009-12-16T18:28:42Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">A few months ago, I started talking about a lookahead correction mechanism 
&lt;br&gt;I was working on for Bison. &amp;nbsp;Its most obvious benefit is to correct the 
&lt;br&gt;list of expected tokens in verbose syntax error messages. &amp;nbsp;I'm finally 
&lt;br&gt;getting back to pushing that patch series through.
&lt;br&gt;&lt;br&gt;The following patch is next. &amp;nbsp;The problem it addresses is that users 
&lt;br&gt;sometimes write semantic actions that manipulate yychar. &amp;nbsp;Of course, they 
&lt;br&gt;can do this with YYBACKUP or yyclearin. &amp;nbsp;However, my impression is that 
&lt;br&gt;many users alter yychar directly. &amp;nbsp;In this case, the translation in 
&lt;br&gt;yytoken isn't always updated, and bad destructor calls or syntax error 
&lt;br&gt;messages can result. &amp;nbsp;This patch fixes that.
&lt;br&gt;&lt;br&gt;I'd like to push this patch to master and branch-2.5. &amp;nbsp;Any feedback would 
&lt;br&gt;be appreciated. &amp;nbsp;I'd especially like to hear comments on my analysis of 
&lt;br&gt;glr.c, lalr1.cc, and lalr1.java.
&lt;br&gt;&lt;br&gt;Don't worry about the unfixed bug I mention in the test suite. &amp;nbsp;The next 
&lt;br&gt;patch will more thoroughly explain it and fix it.
&lt;br&gt;&lt;br&gt;From cfdf80e9e688706a449dc68662e5e4ad0674ab01 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26822157&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Wed, 16 Dec 2009 20:55:40 -0500
&lt;br&gt;Subject: [PATCH] Fix handling of yychar manipulation in user semantic actions.
&lt;br&gt;&lt;br&gt;The problem was that yacc.c didn't always update the yychar
&lt;br&gt;translation afterwards. &amp;nbsp;However, other skeletons appear to be
&lt;br&gt;fine. &amp;nbsp;glr.c appears to already translate yychar before every
&lt;br&gt;use. &amp;nbsp;lalr1.cc does not define yychar and does not document its
&lt;br&gt;replacement, yyla, for users. &amp;nbsp;In lalr1.java, yychar is out of
&lt;br&gt;scope during semantic actions.
&lt;br&gt;* NEWS (2.5): Document.
&lt;br&gt;* data/yacc.c (YYBACKUP): Don't bother translating yychar into
&lt;br&gt;yytoken here.
&lt;br&gt;(yyparse, yypush_parse): Instead, translate before every use of
&lt;br&gt;yytoken, and add comments explaining this approach.
&lt;br&gt;* tests/actions.at (Destroying lookahead assigned by semantic
&lt;br&gt;action): New test group checking that translation happens before
&lt;br&gt;lookahead destructor calls at parser return. &amp;nbsp;Previously,
&lt;br&gt;incorrect destructors were called.
&lt;br&gt;* tests/conflicts.at (parse.error=verbose and consistent
&lt;br&gt;errors): New test group checking that translation happens at
&lt;br&gt;syntax error detection before the associated verbose error
&lt;br&gt;message and the associated lookahead destructor calls. &amp;nbsp;While
&lt;br&gt;the destructor call is fixed by this patch, the verbose error
&lt;br&gt;message is currently incorrect due to another bug (see
&lt;br&gt;comments in test group), so this is an expected failure for now.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 26 +++
&lt;br&gt;&amp;nbsp;NEWS &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;7 +
&lt;br&gt;&amp;nbsp;data/yacc.c &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 25 +++-
&lt;br&gt;&amp;nbsp;src/parse-gram.c &amp;nbsp; | &amp;nbsp;522 +++++++++++++++++++++++-----------------------------
&lt;br&gt;&amp;nbsp;src/parse-gram.h &amp;nbsp; | &amp;nbsp; 68 +------
&lt;br&gt;&amp;nbsp;tests/actions.at &amp;nbsp; | &amp;nbsp; 71 +++++++
&lt;br&gt;&amp;nbsp;tests/conflicts.at | &amp;nbsp;115 ++++++++++++
&lt;br&gt;&amp;nbsp;7 files changed, 480 insertions(+), 354 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 2817f11..cd8016a 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,31 @@
&lt;br&gt;&amp;nbsp;2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26822157&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	Fix handling of yychar manipulation in user semantic actions.
&lt;br&gt;+	The problem was that yacc.c didn't always update the yychar
&lt;br&gt;+	translation afterwards. &amp;nbsp;However, other skeletons appear to be
&lt;br&gt;+	fine. &amp;nbsp;glr.c appears to already translate yychar before every
&lt;br&gt;+	use. &amp;nbsp;lalr1.cc does not define yychar and does not document its
&lt;br&gt;+	replacement, yyla, for users. &amp;nbsp;In lalr1.java, yychar is out of
&lt;br&gt;+	scope during semantic actions.
&lt;br&gt;+	* NEWS (2.5): Document.
&lt;br&gt;+	* data/yacc.c (YYBACKUP): Don't bother translating yychar into
&lt;br&gt;+	yytoken here.
&lt;br&gt;+	(yyparse, yypush_parse): Instead, translate before every use of
&lt;br&gt;+	yytoken, and add comments explaining this approach.
&lt;br&gt;+	* tests/actions.at (Destroying lookahead assigned by semantic
&lt;br&gt;+	action): New test group checking that translation happens before
&lt;br&gt;+	lookahead destructor calls at parser return. &amp;nbsp;Previously,
&lt;br&gt;+	incorrect destructors were called.
&lt;br&gt;+	* tests/conflicts.at (parse.error=verbose and consistent
&lt;br&gt;+	errors): New test group checking that translation happens at
&lt;br&gt;+	syntax error detection before the associated verbose error
&lt;br&gt;+	message and the associated lookahead destructor calls. &amp;nbsp;While
&lt;br&gt;+	the destructor call is fixed by this patch, the verbose error
&lt;br&gt;+	message is currently incorrect due to another bug (see
&lt;br&gt;+	comments in test group), so this is an expected failure for now.
&lt;br&gt;+
&lt;br&gt;+2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26822157&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	Add gcc's -Wundef to test suite and fix another warning from it.
&lt;br&gt;&amp;nbsp;	* NEWS (2.4.2): Update description of -Wundef fix.
&lt;br&gt;&amp;nbsp;	* configure.ac (WARN_CXXFLAGS_TEST): New substitution.
&lt;br&gt;diff --git a/NEWS b/NEWS
&lt;br&gt;index 92567dd..8aaf9e0 100644
&lt;br&gt;--- a/NEWS
&lt;br&gt;+++ b/NEWS
&lt;br&gt;@@ -212,6 +212,13 @@ Bison News
&lt;br&gt;&amp;nbsp; &amp;nbsp;were resolved with %nonassoc. &amp;nbsp;Such tokens are now properly omitted
&lt;br&gt;&amp;nbsp; &amp;nbsp;from the list.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+** Destructor calls fixed for lookaheads altered in semantic actions.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;Previously for deterministic parsers in C, if a user semantic action
&lt;br&gt;+ &amp;nbsp;altered yychar, the parser in some cases used the old yychar value to
&lt;br&gt;+ &amp;nbsp;determine which destructor to call for the lookahead upon a syntax
&lt;br&gt;+ &amp;nbsp;error or upon parser return. &amp;nbsp;This bug has been fixed.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;* Changes in version 2.4.2 (????-??-??):
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;** Detection of GNU M4 1.4.6 or newer during configure is improved.
&lt;br&gt;diff --git a/data/yacc.c b/data/yacc.c
&lt;br&gt;index 11ebbf1..dce9a6a 100644
&lt;br&gt;--- a/data/yacc.c
&lt;br&gt;+++ b/data/yacc.c
&lt;br&gt;@@ -621,7 +621,6 @@ do								\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{								\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yychar = (Token);						\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yylval = (Value);						\
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;yytoken = YYTRANSLATE (yychar);				\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YYPOPSTACK (1);						\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;goto yybackup;						\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}								\
&lt;br&gt;@@ -1420,6 +1419,17 @@ yyreduce:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;]b4_user_actions[
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;default: break;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;/* User semantic actions sometimes alter yychar, and that requires
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; that yytoken be updated with the new translation. &amp;nbsp;We take the
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; approach of translating immediately before every use of yytoken.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; One alternative is translating here after every semantic action,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; but that translation would be missed if the semantic action invokes
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; if it invokes YYBACKUP. &amp;nbsp;In the case of YYABORT or YYACCEPT, an
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; incorrect destructor might then be invoked immediately. &amp;nbsp;In the
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; case of YYERROR or YYBACKUP, subsequent parser actions might lead
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; to an incorrect destructor call or verbose syntax error message
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; before the lookahead is translated. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;YY_SYMBOL_PRINT (&amp;quot;-&amp;gt; $$ =&amp;quot;, yyr1[yyn], &amp;yyval, &amp;yyloc);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;YYPOPSTACK (yylen);
&lt;br&gt;@@ -1448,6 +1458,10 @@ yyreduce:
&lt;br&gt;&amp;nbsp;| yyerrlab -- here on detecting error |
&lt;br&gt;&amp;nbsp;`------------------------------------*/
&lt;br&gt;&amp;nbsp;yyerrlab:
&lt;br&gt;+ &amp;nbsp;/* Make sure we have latest lookahead translation. &amp;nbsp;See comments at
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; user semantic actions for why this is necessary. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp;yytoken = YYTRANSLATE (yychar);
&lt;br&gt;+
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* If not already recovering from an error, report this error. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (!yyerrstatus)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;@@ -1600,8 +1614,13 @@ yyexhaustedlab:
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;yyreturn:
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (yychar != YYEMPTY)
&lt;br&gt;- &amp;nbsp; &amp;nbsp; yydestruct (&amp;quot;Cleanup: discarding lookahead&amp;quot;,
&lt;br&gt;-		 yytoken, &amp;yylval]b4_locations_if([, &amp;yylloc])[]b4_user_args[);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;/* Make sure we have latest lookahead translation. &amp;nbsp;See comments at
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; user semantic actions for why this is necessary. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;yytoken = YYTRANSLATE (yychar);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;yydestruct (&amp;quot;Cleanup: discarding lookahead&amp;quot;,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yytoken, &amp;yylval]b4_locations_if([, &amp;yylloc])[]b4_user_args[);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* Do not reclaim the symbols of the rule which action triggered
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; this YYABORT or YYACCEPT. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;YYPOPSTACK (yylen);
&lt;br&gt;diff --git a/tests/actions.at b/tests/actions.at
&lt;br&gt;index d317920..144791c 100644
&lt;br&gt;--- a/tests/actions.at
&lt;br&gt;+++ b/tests/actions.at
&lt;br&gt;@@ -1408,3 +1408,74 @@ AT_MATCHES_CHECK([input.c], [[// TEST:Y:1 [;{}]*\n;\}$]], &amp;nbsp;[[12]])
&lt;br&gt;&amp;nbsp;AT_MATCHES_CHECK([input.c], [[#define TEST_MACRO_N \\\n\[\]&amp;quot;broken\\&amp;quot; \$ \@ \$\$ \@\$ \[\];\\\nstring;&amp;quot;\}]], [[2]])
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;AT_CLEANUP
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+## -------------------------------------------------- ##
&lt;br&gt;+## Destroying lookahead assigned by semantic action. &amp;nbsp;##
&lt;br&gt;+## -------------------------------------------------- ##
&lt;br&gt;+
&lt;br&gt;+AT_SETUP([[Destroying lookahead assigned by semantic action]])
&lt;br&gt;+
&lt;br&gt;+AT_DATA_GRAMMAR([input.y],
&lt;br&gt;+[[
&lt;br&gt;+%code {
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;assert.h&amp;gt;
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;+ &amp;nbsp;static void yyerror (char const *);
&lt;br&gt;+ &amp;nbsp;static int yylex (void);
&lt;br&gt;+ &amp;nbsp;#define USE(Var)
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+%destructor { fprintf (stderr, &amp;quot;'a' destructor\n&amp;quot;); } 'a'
&lt;br&gt;+%destructor { fprintf (stderr, &amp;quot;'b' destructor\n&amp;quot;); } 'b'
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+// In a previous version of Bison, yychar assigned by the semantic
&lt;br&gt;+// action below was not translated into yytoken before the lookahead was
&lt;br&gt;+// discarded and thus before its destructor (selected according to
&lt;br&gt;+// yytoken) was called in order to return from yyparse. &amp;nbsp;This would
&lt;br&gt;+// happen even if YYACCEPT was performed in a later semantic action as
&lt;br&gt;+// long as only consistent states with default reductions were visited
&lt;br&gt;+// in between. &amp;nbsp;However, we leave YYACCEPT in the same semantic action
&lt;br&gt;+// for this test in order to show that skeletons cannot simply translate
&lt;br&gt;+// immediately after every semantic action because a semantic action
&lt;br&gt;+// that has set yychar might not always return normally. &amp;nbsp;Instead,
&lt;br&gt;+// skeletons must translate before every use of yytoken.
&lt;br&gt;+start: 'a' accept { USE($1); } ;
&lt;br&gt;+accept: /*empty*/ {
&lt;br&gt;+ &amp;nbsp;assert (yychar == YYEMPTY);
&lt;br&gt;+ &amp;nbsp;yychar = 'b';
&lt;br&gt;+ &amp;nbsp;YYACCEPT;
&lt;br&gt;+} ;
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+yyerror (char const *msg)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;fprintf (stderr, &amp;quot;%s\n&amp;quot;, msg);
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+static int
&lt;br&gt;+yylex (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;static char const *input = &amp;quot;a&amp;quot;;
&lt;br&gt;+ &amp;nbsp;return *input++;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+main (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;return yyparse ();
&lt;br&gt;+}
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+AT_BISON_CHECK([[-o input.c input.y]])
&lt;br&gt;+AT_COMPILE([[input]])
&lt;br&gt;+AT_PARSER_CHECK([[./input]], [[0]], [],
&lt;br&gt;+[['b' destructor
&lt;br&gt;+'a' destructor
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+AT_CLEANUP
&lt;br&gt;diff --git a/tests/conflicts.at b/tests/conflicts.at
&lt;br&gt;index 26ec08d..11eacd4 100644
&lt;br&gt;--- a/tests/conflicts.at
&lt;br&gt;+++ b/tests/conflicts.at
&lt;br&gt;@@ -139,6 +139,121 @@ AT_CLEANUP
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+## ------------------------------------------- ##
&lt;br&gt;+## parse.error=verbose and consistent errors. &amp;nbsp;##
&lt;br&gt;+## ------------------------------------------- ##
&lt;br&gt;+
&lt;br&gt;+AT_SETUP([[parse.error=verbose and consistent errors]])
&lt;br&gt;+
&lt;br&gt;+m4_pushdef([AT_CONSISTENT_ERRORS_CHECK], [
&lt;br&gt;+
&lt;br&gt;+AT_BISON_CHECK([$1[ -o input.c input.y]])
&lt;br&gt;+AT_COMPILE([[input]])
&lt;br&gt;+
&lt;br&gt;+m4_pushdef([AT_EXPECTING], [m4_if($2, [ab], [[, expecting 'a' or 'b']],
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$2, [a], &amp;nbsp;[[, expecting 'a']],
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$2, [b], &amp;nbsp;[[, expecting 'b']])])
&lt;br&gt;+
&lt;br&gt;+AT_PARSER_CHECK([[./input]], [[1]], [],
&lt;br&gt;+[[syntax error, unexpected $end]AT_EXPECTING[
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+m4_popdef([AT_EXPECTING])
&lt;br&gt;+
&lt;br&gt;+])
&lt;br&gt;+
&lt;br&gt;+AT_DATA_GRAMMAR([input.y],
&lt;br&gt;+[[%code {
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;assert.h&amp;gt;
&lt;br&gt;+ &amp;nbsp;#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;+ &amp;nbsp;int yylex (void);
&lt;br&gt;+ &amp;nbsp;void yyerror (char const *);
&lt;br&gt;+ &amp;nbsp;#define USE(Var)
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+%define parse.error verbose
&lt;br&gt;+
&lt;br&gt;+// The point isn't to test IELR here, but state merging happens to
&lt;br&gt;+// complicate the example.
&lt;br&gt;+%define lr.type ielr
&lt;br&gt;+
&lt;br&gt;+%nonassoc 'a'
&lt;br&gt;+
&lt;br&gt;+// If yylval=0 here, then we know that the 'a' destructor is being
&lt;br&gt;+// invoked incorrectly for the $end set in the semantic action below.
&lt;br&gt;+// All other tokens are returned by yylex, which sets yylval=1.
&lt;br&gt;+%destructor {
&lt;br&gt;+ &amp;nbsp;if (!$$)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;fprintf (stderr, &amp;quot;Wrong destructor.\n&amp;quot;);
&lt;br&gt;+} 'a'
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+// The lookahead isn't needed before the error action is encountered.
&lt;br&gt;+// In a previous version of Bison, this was a problem as it meant yychar
&lt;br&gt;+// was not translated into yytoken before error recovery, which discards
&lt;br&gt;+// the lookahead and thus invokes a destructor that it selected
&lt;br&gt;+// according to the incorrect yytoken. &amp;nbsp;That missing translation also
&lt;br&gt;+// would have caused the wrong unexpected token to be reported except
&lt;br&gt;+// that, due to another bug, the unexpected token is not reported at all
&lt;br&gt;+// because the error is detected in a consistent state with an error
&lt;br&gt;+// action. &amp;nbsp;That bug still needs to be fixed.
&lt;br&gt;+start: consistent-error-on-a-a 'a' { USE ($2); } ;
&lt;br&gt;+
&lt;br&gt;+consistent-error-on-a-a:
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;'a' consistent-reduction
&lt;br&gt;+ &amp;nbsp;| 'a' consistent-reduction 'a' { USE (($1, $3)); }
&lt;br&gt;+ &amp;nbsp;;
&lt;br&gt;+
&lt;br&gt;+consistent-reduction: /*empty*/ {
&lt;br&gt;+ &amp;nbsp;assert (yychar == YYEMPTY);
&lt;br&gt;+ &amp;nbsp;yylval = 0;
&lt;br&gt;+ &amp;nbsp;yychar = 0;
&lt;br&gt;+} ;
&lt;br&gt;+
&lt;br&gt;+// Provide another context in which all rules are useful so that this
&lt;br&gt;+// test case looks a little more realistic.
&lt;br&gt;+start: 'b' consistent-error-on-a-a 'b' ;
&lt;br&gt;+
&lt;br&gt;+%%
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+yylex (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;static char const *input = &amp;quot;a&amp;quot;;
&lt;br&gt;+ &amp;nbsp;yylval = 1;
&lt;br&gt;+ &amp;nbsp;return *input++;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+void
&lt;br&gt;+yyerror (char const *msg)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;fprintf (stderr, &amp;quot;%s\n&amp;quot;, msg);
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+main (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;return yyparse ();
&lt;br&gt;+}
&lt;br&gt;+]])
&lt;br&gt;+
&lt;br&gt;+# See comments in grammar for why this test doesn't succeed.
&lt;br&gt;+AT_XFAIL_IF([[:]])
&lt;br&gt;+
&lt;br&gt;+AT_CONSISTENT_ERRORS_CHECK([], [[none]])
&lt;br&gt;+AT_CONSISTENT_ERRORS_CHECK([[-Dlr.default-reductions=consistent]], [[none]])
&lt;br&gt;+
&lt;br&gt;+# Canonical LR doesn't foresee the error for 'a'!
&lt;br&gt;+AT_CONSISTENT_ERRORS_CHECK([[-Dlr.default-reductions=accepting]], [[a]])
&lt;br&gt;+AT_CONSISTENT_ERRORS_CHECK([[-Flr.type=canonical-lr]], [[a]])
&lt;br&gt;+
&lt;br&gt;+m4_popdef([AT_CONSISTENT_ERRORS_CHECK])
&lt;br&gt;+
&lt;br&gt;+AT_CLEANUP
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;## ------------------------- ##
&lt;br&gt;&amp;nbsp;## Unresolved SR Conflicts. &amp;nbsp;##
&lt;br&gt;&amp;nbsp;## ------------------------- ##
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--Fix-handling-of-yychar-manipulation-in-user-semantic-actions.-tp26822157p26822157.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26816878</id>
	<title>Re: several messages</title>
	<published>2009-12-16T11:21:45Z</published>
	<updated>2009-12-16T11:21:45Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Wed, 16 Dec 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; Avoid warnings from gcc -Wunused y.tab.c.
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; Simplify y.tab.c when location tracking is disabled.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Including the -Wundef correction, I pushed those patches and the following 
&lt;br&gt;&amp;gt; patches to master, branch-2.5, and branch-2.4.2 except that I omitted the 
&lt;br&gt;&amp;gt; b4_locations_if changes from branch-2.4.2.
&lt;br&gt;&lt;br&gt;I also pushed this patch to all three branches to help us avoid this 
&lt;br&gt;problem in the future.
&lt;br&gt;&lt;br&gt;&amp;gt;From a603c6e0bb8b9e79d4136ee0fd0d1bf6a7d010ef Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26816878&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Wed, 16 Dec 2009 13:19:19 -0500
&lt;br&gt;Subject: [PATCH] Add gcc's -Wundef to test suite and fix another warning from it.
&lt;br&gt;&lt;br&gt;* NEWS (2.4.2): Update description of -Wundef fix.
&lt;br&gt;* configure.ac (WARN_CXXFLAGS_TEST): New substitution.
&lt;br&gt;(WARN_CFLAGS_TEST): New substitution.
&lt;br&gt;* data/glr.c: Avoid warning about __STRICT_ANSI__.
&lt;br&gt;* tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
&lt;br&gt;WARN_CFLAGS.
&lt;br&gt;(NO_WERROR_CFLAGS): Likewise.
&lt;br&gt;(CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 12 ++++++++++++
&lt;br&gt;&amp;nbsp;NEWS &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;5 +++--
&lt;br&gt;&amp;nbsp;configure.ac &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;6 ++++++
&lt;br&gt;&amp;nbsp;data/glr.c &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;3 ++-
&lt;br&gt;&amp;nbsp;tests/atlocal.in | &amp;nbsp; &amp;nbsp;6 +++---
&lt;br&gt;&amp;nbsp;5 files changed, 26 insertions(+), 6 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 97c8f6e..2817f11 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,17 @@
&lt;br&gt;&amp;nbsp;2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26816878&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	Add gcc's -Wundef to test suite and fix another warning from it.
&lt;br&gt;+	* NEWS (2.4.2): Update description of -Wundef fix.
&lt;br&gt;+	* configure.ac (WARN_CXXFLAGS_TEST): New substitution.
&lt;br&gt;+	(WARN_CFLAGS_TEST): New substitution.
&lt;br&gt;+	* data/glr.c: Avoid warning about __STRICT_ANSI__.
&lt;br&gt;+	* tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
&lt;br&gt;+	WARN_CFLAGS.
&lt;br&gt;+	(NO_WERROR_CFLAGS): Likewise.
&lt;br&gt;+	(CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
&lt;br&gt;+
&lt;br&gt;+2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26816878&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	* data/yacc.c: Reformat m4 a little.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26816878&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;diff --git a/NEWS b/NEWS
&lt;br&gt;index 186b8e0..92567dd 100644
&lt;br&gt;--- a/NEWS
&lt;br&gt;+++ b/NEWS
&lt;br&gt;@@ -216,8 +216,9 @@ Bison News
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;** Detection of GNU M4 1.4.6 or newer during configure is improved.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS and
&lt;br&gt;- &amp;nbsp; YYLTYPE_IS_TRIVIAL in C/C++ parsers are now avoided.
&lt;br&gt;+** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS,
&lt;br&gt;+ &amp;nbsp; YYLTYPE_IS_TRIVIAL, and __STRICT_ANSI__ in C/C++ parsers are now
&lt;br&gt;+ &amp;nbsp; avoided.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;** %code is now a permanent feature.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;diff --git a/configure.ac b/configure.ac
&lt;br&gt;index 4f1b20f..8e9fc29 100644
&lt;br&gt;--- a/configure.ac
&lt;br&gt;+++ b/configure.ac
&lt;br&gt;@@ -68,6 +68,12 @@ if test &amp;quot;${enableval}&amp;quot; = yes; then
&lt;br&gt;&amp;nbsp; &amp;nbsp;gl_WARN_ADD([-Wshadow])
&lt;br&gt;&amp;nbsp; &amp;nbsp;gl_WARN_ADD([-Wstrict-prototypes])
&lt;br&gt;&amp;nbsp; &amp;nbsp;AC_SUBST([WARN_CFLAGS])
&lt;br&gt;+ &amp;nbsp;# Warnings for the test suite only.
&lt;br&gt;+ &amp;nbsp;gl_WARN_ADD([-Wundef], [WARN_CFLAGS_TEST])
&lt;br&gt;+ &amp;nbsp;WARN_CXXFLAGS_TEST=&amp;quot;$WARN_CXXFLAGS $WARN_CFLAGS_TEST&amp;quot;
&lt;br&gt;+ &amp;nbsp;WARN_CFLAGS_TEST=&amp;quot;$WARN_CFLAGS $WARN_CFLAGS_TEST&amp;quot;
&lt;br&gt;+ &amp;nbsp;AC_SUBST([WARN_CXXFLAGS_TEST])
&lt;br&gt;+ &amp;nbsp;AC_SUBST([WARN_CFLAGS_TEST])
&lt;br&gt;&amp;nbsp; &amp;nbsp;AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
&lt;br&gt;&amp;nbsp;fi
&lt;br&gt;&amp;nbsp;
&lt;br&gt;diff --git a/data/glr.c b/data/glr.c
&lt;br&gt;index e73b251..8c964e5 100644
&lt;br&gt;--- a/data/glr.c
&lt;br&gt;+++ b/data/glr.c
&lt;br&gt;@@ -318,7 +318,8 @@ b4_percent_code_get[]dnl
&lt;br&gt;&amp;nbsp;#ifndef __attribute__
&lt;br&gt;&amp;nbsp;/* This feature is available in gcc versions 2.5 and later. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;# if (! defined __GNUC__ || __GNUC__ &amp;lt; 2 \
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;|| (__GNUC__ == 2 &amp;&amp; __GNUC_MINOR__ &amp;lt; 5) || __STRICT_ANSI__)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| (__GNUC__ == 2 &amp;&amp; __GNUC_MINOR__ &amp;lt; 5) \
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| (defined __STRICT_ANSI__ &amp;&amp; __STRICT_ANSI__))
&lt;br&gt;&amp;nbsp;# &amp;nbsp;define __attribute__(Spec) /* empty */
&lt;br&gt;&amp;nbsp;# endif
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;diff --git a/tests/atlocal.in b/tests/atlocal.in
&lt;br&gt;index fb1cef6..7277a59 100644
&lt;br&gt;--- a/tests/atlocal.in
&lt;br&gt;+++ b/tests/atlocal.in
&lt;br&gt;@@ -8,11 +8,11 @@
&lt;br&gt;&amp;nbsp;: ${CC='@CC@'}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# We want no optimization.
&lt;br&gt;-CFLAGS='@O0CFLAGS@ @WARN_CFLAGS@ @WERROR_CFLAGS@'
&lt;br&gt;+CFLAGS='@O0CFLAGS@ @WARN_CFLAGS_TEST@ @WERROR_CFLAGS@'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Sometimes a test group needs to ignore gcc warnings, so it locally
&lt;br&gt;&amp;nbsp;# sets CFLAGS to this.
&lt;br&gt;-NO_WERROR_CFLAGS='@O0CFLAGS@ @WARN_CFLAGS@'
&lt;br&gt;+NO_WERROR_CFLAGS='@O0CFLAGS@ @WARN_CFLAGS_TEST@'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# We need `config.h'.
&lt;br&gt;&amp;nbsp;CPPFLAGS=&amp;quot;-I$abs_top_builddir/lib @CPPFLAGS@&amp;quot;
&lt;br&gt;@@ -27,7 +27,7 @@ GCC='@GCC@'
&lt;br&gt;&amp;nbsp;BISON_CXX_WORKS='@BISON_CXX_WORKS@'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# We want no optimization with C++, too.
&lt;br&gt;-CXXFLAGS='@O0CXXFLAGS@ @WARN_CXXFLAGS@ @WERROR_CFLAGS@'
&lt;br&gt;+CXXFLAGS='@O0CXXFLAGS@ @WARN_CXXFLAGS_TEST@ @WERROR_CFLAGS@'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Are special link options needed?
&lt;br&gt;&amp;nbsp;LDFLAGS='@LDFLAGS@'
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26816878.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26807059</id>
	<title>Re: several messages</title>
	<published>2009-12-15T23:05:21Z</published>
	<updated>2009-12-15T23:05:21Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Tue, 15 Dec 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; Thanks for the catch. &amp;nbsp;I should have been saying -Wundef all this
&lt;br&gt;&amp;gt; &amp;gt; time.
&lt;br&gt;&lt;br&gt;&amp;gt; Two following two patches follow.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; Avoid warnings from gcc -Wunused y.tab.c.
&lt;br&gt;&amp;gt; &amp;nbsp; Simplify y.tab.c when location tracking is disabled.
&lt;br&gt;&lt;br&gt;Including the -Wundef correction, I pushed those patches and the following 
&lt;br&gt;patches to master, branch-2.5, and branch-2.4.2 except that I omitted the 
&lt;br&gt;b4_locations_if changes from branch-2.4.2.
&lt;br&gt;&lt;br&gt;Thanks again for your contribution.
&lt;br&gt;&lt;br&gt;From c938d650dbddd3d94b3543bab76e1afce99c409d Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Wed, 16 Dec 2009 01:14:44 -0500
&lt;br&gt;Subject: [PATCH] Document gcc -Wundef fix.
&lt;br&gt;&lt;br&gt;* NEWS (2.4.2): Here.
&lt;br&gt;* THANKS (Jonathan Nieder): Add.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog | &amp;nbsp; &amp;nbsp;6 ++++++
&lt;br&gt;&amp;nbsp;NEWS &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;3 +++
&lt;br&gt;&amp;nbsp;THANKS &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;1 +
&lt;br&gt;&amp;nbsp;3 files changed, 10 insertions(+), 0 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 029826f..3fedc38 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,9 @@
&lt;br&gt;+2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	Document gcc -Wundef fix.
&lt;br&gt;+	* NEWS (2.4.2): Here.
&lt;br&gt;+	* THANKS (Jonathan Nieder): Add.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Jonathan Nieder &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt; &amp;nbsp;(tiny change)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	Simplify y.tab.c when location tracking is disabled.
&lt;br&gt;diff --git a/NEWS b/NEWS
&lt;br&gt;index d585139..186b8e0 100644
&lt;br&gt;--- a/NEWS
&lt;br&gt;+++ b/NEWS
&lt;br&gt;@@ -216,6 +216,9 @@ Bison News
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;** Detection of GNU M4 1.4.6 or newer during configure is improved.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS and
&lt;br&gt;+ &amp;nbsp; YYLTYPE_IS_TRIVIAL in C/C++ parsers are now avoided.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;** %code is now a permanent feature.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;A traditional Yacc prologue directive is written in the form:
&lt;br&gt;diff --git a/THANKS b/THANKS
&lt;br&gt;index 67d6663..0a203ed 100644
&lt;br&gt;--- a/THANKS
&lt;br&gt;+++ b/THANKS
&lt;br&gt;@@ -46,6 +46,7 @@ Jesse Thilo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jthilo@...&lt;/a&gt;
&lt;br&gt;&amp;nbsp;Jim Kent &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jkent@...&lt;/a&gt;
&lt;br&gt;&amp;nbsp;Jim Meyering &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jim@...&lt;/a&gt;
&lt;br&gt;&amp;nbsp;Joel E. Denny &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;
&lt;br&gt;+Jonathan Nieder &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;
&lt;br&gt;&amp;nbsp;Juan Manuel Guerrero &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;juan.guerrero@...&lt;/a&gt;
&lt;br&gt;&amp;nbsp;Kees Zeelenberg &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kzlg@...&lt;/a&gt;
&lt;br&gt;&amp;nbsp;Keith Browne &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=10&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kbrowne@...&lt;/a&gt;
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;From 19750d310c1f21b72fc26d0b8905fac08d175130 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Wed, 16 Dec 2009 01:41:17 -0500
&lt;br&gt;Subject: [PATCH] * data/yacc.c: Reformat m4 a little.
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; | &amp;nbsp; &amp;nbsp;4 ++++
&lt;br&gt;&amp;nbsp;data/yacc.c | &amp;nbsp; 13 +++++++------
&lt;br&gt;&amp;nbsp;2 files changed, 11 insertions(+), 6 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 3fedc38..97c8f6e 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,9 @@
&lt;br&gt;&amp;nbsp;2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=12&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	* data/yacc.c: Reformat m4 a little.
&lt;br&gt;+
&lt;br&gt;+2009-12-16 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26807059&amp;i=13&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	Document gcc -Wundef fix.
&lt;br&gt;&amp;nbsp;	* NEWS (2.4.2): Here.
&lt;br&gt;&amp;nbsp;	* THANKS (Jonathan Nieder): Add.
&lt;br&gt;diff --git a/data/yacc.c b/data/yacc.c
&lt;br&gt;index 711d41d..11ebbf1 100644
&lt;br&gt;--- a/data/yacc.c
&lt;br&gt;+++ b/data/yacc.c
&lt;br&gt;@@ -660,9 +660,9 @@ while (YYID (0))
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp;YYRHSLOC (Rhs, 0).last_column;				\
&lt;br&gt;&amp;nbsp;	}								\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;while (YYID (0))
&lt;br&gt;-#endif
&lt;br&gt;+#endif]b4_locations_if([[
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-]b4_locations_if([[
&lt;br&gt;&amp;nbsp;/* YY_LOCATION_PRINT -- Print the location on the stream.
&lt;br&gt;&amp;nbsp; &amp;nbsp; This macro was not mandated originally: define only if we know
&lt;br&gt;&amp;nbsp; &amp;nbsp; we won't break user code: when these are the locations we know. &amp;nbsp;*/
&lt;br&gt;@@ -676,14 +676,15 @@ while (YYID (0))
&lt;br&gt;&amp;nbsp;# else
&lt;br&gt;&amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;nbsp;# endif
&lt;br&gt;-#endif
&lt;br&gt;-]], [[
&lt;br&gt;+#endif]], [[
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;/* This macro is provided for backward compatibility. */
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifndef YY_LOCATION_PRINT
&lt;br&gt;&amp;nbsp;# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;-#endif
&lt;br&gt;-]])[
&lt;br&gt;+#endif]])[
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;/* YYLEX -- calling `yylex' with the right arguments. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26807059.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26806297</id>
	<title>Re: several messages</title>
	<published>2009-12-15T20:56:16Z</published>
	<updated>2009-12-15T20:56:16Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Tue, 15 Dec 2009, Jonathan Nieder wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; By the way, which version of gcc are you using? &amp;nbsp;The versions I've tried 
&lt;br&gt;&amp;gt; &amp;gt; don't produce this warning for -Wunused.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks for the catch. &amp;nbsp;I should have been saying -Wundef all this
&lt;br&gt;&amp;gt; time.
&lt;br&gt;&lt;br&gt;Ah, thanks.
&lt;br&gt;&lt;br&gt;&amp;gt; Could you correct this or should I resend?
&lt;br&gt;&lt;br&gt;I'll get it.
&lt;br&gt;&lt;br&gt;&amp;gt; Sorry for the trouble,
&lt;br&gt;&lt;br&gt;Not a problem.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26806297.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26806263</id>
	<title>Re: several messages</title>
	<published>2009-12-15T20:50:33Z</published>
	<updated>2009-12-15T20:50:33Z</updated>
	<author>
		<name>Jonathan Nieder</name>
	</author>
	<content type="html">Joel E. Denny wrote:
&lt;br&gt;&amp;gt; On Tue, 15 Dec 2009, Jonathan Nieder wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; Avoid warnings from gcc -Wunused y.tab.c.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; By the way, which version of gcc are you using? &amp;nbsp;The versions I've tried 
&lt;br&gt;&amp;gt; don't produce this warning for -Wunused.
&lt;br&gt;&lt;br&gt;Thanks for the catch. &amp;nbsp;I should have been saying -Wundef all this
&lt;br&gt;time.
&lt;br&gt;&lt;br&gt;Could you correct this or should I resend?
&lt;br&gt;&lt;br&gt;Sorry for the trouble,
&lt;br&gt;Jonathan
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26806263.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26806216</id>
	<title>Re: several messages</title>
	<published>2009-12-15T20:40:49Z</published>
	<updated>2009-12-15T20:40:49Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Tue, 15 Dec 2009, Jonathan Nieder wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; I want to include the rest of your changes in release 2.4.2, which is 
&lt;br&gt;&amp;gt; &amp;gt; purely a bug fix release, so please submit the b4_locations_if change in a 
&lt;br&gt;&amp;gt; &amp;gt; separate patch.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Oh! &amp;nbsp;Sorry about that.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Two following two patches follow.
&lt;br&gt;&lt;br&gt;Thanks! &amp;nbsp;I'll push them soon.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; Avoid warnings from gcc -Wunused y.tab.c.
&lt;br&gt;&lt;br&gt;By the way, which version of gcc are you using? &amp;nbsp;The versions I've tried 
&lt;br&gt;don't produce this warning for -Wunused.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26806216.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26806119</id>
	<title>Re: several messages</title>
	<published>2009-12-15T20:20:38Z</published>
	<updated>2009-12-15T20:20:38Z</updated>
	<author>
		<name>Jonathan Nieder</name>
	</author>
	<content type="html">Hi again,
&lt;br&gt;&lt;br&gt;Joel E. Denny wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; I guess I'm just not used to seeing so many emails for one small issue. &amp;nbsp;
&lt;br&gt;&amp;gt; I'm used to seeing patches appended to the main email that introduces 
&lt;br&gt;&amp;gt; them.
&lt;br&gt;&lt;br&gt;Okay, I’ll try this.
&lt;br&gt;&lt;br&gt;&amp;gt; I want to include the rest of your changes in release 2.4.2, which is 
&lt;br&gt;&amp;gt; purely a bug fix release, so please submit the b4_locations_if change in a 
&lt;br&gt;&amp;gt; separate patch.
&lt;br&gt;&lt;br&gt;Oh! &amp;nbsp;Sorry about that.
&lt;br&gt;&lt;br&gt;Two following two patches follow.
&lt;br&gt;&lt;br&gt;&amp;nbsp; Avoid warnings from gcc -Wunused y.tab.c.
&lt;br&gt;&amp;nbsp; Simplify y.tab.c when location tracking is disabled.
&lt;br&gt;&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; | &amp;nbsp; 15 +++++++++++++++
&lt;br&gt;&amp;nbsp;data/glr.c &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;4 ++--
&lt;br&gt;&amp;nbsp;data/lalr1.cc | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;data/yacc.c &amp;nbsp; | &amp;nbsp; 14 ++++++++++----
&lt;br&gt;&amp;nbsp;4 files changed, 28 insertions(+), 7 deletions(-)
&lt;br&gt;&lt;br&gt;-- %&amp;lt; ------- patch 1 -------
&lt;br&gt;From 23d4e466fcf6428cad857149d51c25475a870d4d Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Jonathan Nieder &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26806119&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Tue, 15 Dec 2009 22:03:18 -0600
&lt;br&gt;Subject: Avoid warnings from gcc -Wunused y.tab.c.
&lt;br&gt;&lt;br&gt;* data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
&lt;br&gt;defined before using them.
&lt;br&gt;* data/lalr1.cc: Likewise.
&lt;br&gt;* data/yacc.c: Likewise.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;8 ++++++++
&lt;br&gt;&amp;nbsp;data/glr.c &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;4 ++--
&lt;br&gt;&amp;nbsp;data/lalr1.cc | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;data/yacc.c &amp;nbsp; | &amp;nbsp; &amp;nbsp;6 +++---
&lt;br&gt;&amp;nbsp;4 files changed, 14 insertions(+), 6 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 2c5d33e..e2a323e 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,11 @@
&lt;br&gt;+2009-12-15 &amp;nbsp;Jonathan Nieder &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26806119&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	Avoid warnings from gcc -Wunused y.tab.c.
&lt;br&gt;+	* data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
&lt;br&gt;+	defined before using them.
&lt;br&gt;+	* data/lalr1.cc: Likewise.
&lt;br&gt;+	* data/yacc.c: Likewise.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26806119&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	autoconf: update to latest for fix of M4 detection.
&lt;br&gt;diff --git a/data/glr.c b/data/glr.c
&lt;br&gt;index 6f1f7ee..e73b251 100644
&lt;br&gt;--- a/data/glr.c
&lt;br&gt;+++ b/data/glr.c
&lt;br&gt;@@ -256,7 +256,7 @@ b4_percent_code_get[]dnl
&lt;br&gt;&amp;nbsp;#include &amp;lt;string.h&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifndef YY_
&lt;br&gt;-# if YYENABLE_NLS
&lt;br&gt;+# if defined YYENABLE_NLS &amp;&amp; YYENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp;if ENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp; include &amp;lt;libintl.h&amp;gt; /* INFRINGES ON USER NAME SPACE */
&lt;br&gt;&amp;nbsp;# &amp;nbsp; define YY_(msgid) dgettext (&amp;quot;bison-runtime&amp;quot;, msgid)
&lt;br&gt;@@ -2264,7 +2264,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
&lt;br&gt;&amp;nbsp; &amp;nbsp;yychar = YYEMPTY;
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylval = yyval_default;
&lt;br&gt;&amp;nbsp;]b4_locations_if([
&lt;br&gt;-#if YYLTYPE_IS_TRIVIAL
&lt;br&gt;+#if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylloc.first_line &amp;nbsp; = yylloc.last_line &amp;nbsp; = ]b4_location_initial_line[;
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;diff --git a/data/lalr1.cc b/data/lalr1.cc
&lt;br&gt;index 1a2777e..9e0d522 100644
&lt;br&gt;--- a/data/lalr1.cc
&lt;br&gt;+++ b/data/lalr1.cc
&lt;br&gt;@@ -398,7 +398,7 @@ m4_if(b4_prefix, [yy], [],
&lt;br&gt;&amp;nbsp;b4_percent_code_get[]dnl
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;[#ifndef YY_
&lt;br&gt;-# if YYENABLE_NLS
&lt;br&gt;+# if defined YYENABLE_NLS &amp;&amp; YYENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp;if ENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp; include &amp;lt;libintl.h&amp;gt; /* FIXME: INFRINGES ON USER NAME SPACE */
&lt;br&gt;&amp;nbsp;# &amp;nbsp; define YY_(msgid) dgettext (&amp;quot;bison-runtime&amp;quot;, msgid)
&lt;br&gt;diff --git a/data/yacc.c b/data/yacc.c
&lt;br&gt;index ea2ae14..a7d7948 100644
&lt;br&gt;--- a/data/yacc.c
&lt;br&gt;+++ b/data/yacc.c
&lt;br&gt;@@ -374,7 +374,7 @@ typedef short int yytype_int16;
&lt;br&gt;&amp;nbsp;#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifndef YY_
&lt;br&gt;-# if YYENABLE_NLS
&lt;br&gt;+# if defined YYENABLE_NLS &amp;&amp; YYENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp;if ENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp; include &amp;lt;libintl.h&amp;gt; /* INFRINGES ON USER NAME SPACE */
&lt;br&gt;&amp;nbsp;# &amp;nbsp; define YY_(msgid) dgettext (&amp;quot;bison-runtime&amp;quot;, msgid)
&lt;br&gt;@@ -668,7 +668,7 @@ while (YYID (0))
&lt;br&gt;&amp;nbsp; &amp;nbsp; we won't break user code: when these are the locations we know. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifndef YY_LOCATION_PRINT
&lt;br&gt;-# if YYLTYPE_IS_TRIVIAL
&lt;br&gt;+# if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc)			\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; fprintf (File, &amp;quot;%d.%d-%d.%d&amp;quot;,			\
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp; &amp;nbsp;(Loc).first_line, (Loc).first_column,	\
&lt;br&gt;@@ -1192,7 +1192,7 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
&lt;br&gt;&amp;nbsp; &amp;nbsp;yyvsp = yyvs;]b4_locations_if([[
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylsp = yyls;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#if YYLTYPE_IS_TRIVIAL
&lt;br&gt;+#if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* Initialize the default location before parsing starts. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylloc.first_line &amp;nbsp; = yylloc.last_line &amp;nbsp; = ]b4_location_initial_line[;
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
&lt;br&gt;-- 
&lt;br&gt;1.6.5.4
&lt;br&gt;&lt;br&gt;-- &amp;gt;% ----- end of patch 1 -----
&lt;br&gt;-- %&amp;lt; ----- patch 2 -----
&lt;br&gt;From 83e581279b9485ddd26a25c84cbd9c9633e4f5da Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Jonathan Nieder &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26806119&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Tue, 15 Dec 2009 22:07:46 -0600
&lt;br&gt;Subject: Simplify y.tab.c when location tracking is disabled.
&lt;br&gt;&lt;br&gt;* data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
&lt;br&gt;tracking is not enabled. &amp;nbsp;Instead, unconditionally define
&lt;br&gt;YY_LOCATION_PRINT as a no-op for backward compatibility.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; | &amp;nbsp; &amp;nbsp;7 +++++++
&lt;br&gt;&amp;nbsp;data/yacc.c | &amp;nbsp; &amp;nbsp;8 +++++++-
&lt;br&gt;&amp;nbsp;2 files changed, 14 insertions(+), 1 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index e2a323e..30aa283 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,12 @@
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Jonathan Nieder &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26806119&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	Simplify y.tab.c when location tracking is disabled.
&lt;br&gt;+	* data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
&lt;br&gt;+	tracking is not enabled. &amp;nbsp;Instead, unconditionally define
&lt;br&gt;+	YY_LOCATION_PRINT as a no-op for backward compatibility.
&lt;br&gt;+
&lt;br&gt;+2009-12-15 &amp;nbsp;Jonathan Nieder &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26806119&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	Avoid warnings from gcc -Wunused y.tab.c.
&lt;br&gt;&amp;nbsp;	* data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
&lt;br&gt;&amp;nbsp;	defined before using them.
&lt;br&gt;diff --git a/data/yacc.c b/data/yacc.c
&lt;br&gt;index a7d7948..711d41d 100644
&lt;br&gt;--- a/data/yacc.c
&lt;br&gt;+++ b/data/yacc.c
&lt;br&gt;@@ -662,7 +662,7 @@ while (YYID (0))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;while (YYID (0))
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-
&lt;br&gt;+]b4_locations_if([[
&lt;br&gt;&amp;nbsp;/* YY_LOCATION_PRINT -- Print the location on the stream.
&lt;br&gt;&amp;nbsp; &amp;nbsp; This macro was not mandated originally: define only if we know
&lt;br&gt;&amp;nbsp; &amp;nbsp; we won't break user code: when these are the locations we know. &amp;nbsp;*/
&lt;br&gt;@@ -677,7 +677,13 @@ while (YYID (0))
&lt;br&gt;&amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;nbsp;# endif
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;+]], [[
&lt;br&gt;+/* This macro is provided for backward compatibility. */
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+#ifndef YY_LOCATION_PRINT
&lt;br&gt;+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;+#endif
&lt;br&gt;+]])[
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;/* YYLEX -- calling `yylex' with the right arguments. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-- 
&lt;br&gt;1.6.5.4
&lt;br&gt;&lt;br&gt;-- &amp;gt;% ------ end of patch 2 -----
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26806119.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26805984</id>
	<title>Re: [PATCH v2] Avoid warnings from gcc -Wunused y.tab.c</title>
	<published>2009-12-15T20:00:12Z</published>
	<updated>2009-12-15T20:00:12Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">Hi Jonathan,
&lt;br&gt;&lt;br&gt;On Tue, 15 Dec 2009, Jonathan Nieder wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Here is an updated patch incorporating all your suggestions except for
&lt;br&gt;&amp;gt; the last one.
&lt;br&gt;&lt;br&gt;I didn't see this before responding to your previous email.
&lt;br&gt;&lt;br&gt;&amp;gt; Joel E. Denny wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; How does the b4_locations_if part of this change help? &amp;nbsp;If it isn't really 
&lt;br&gt;&amp;gt; &amp;gt; necessary, then let's drop it. &amp;nbsp;As far as I can tell, the addition of 
&lt;br&gt;&amp;gt; &amp;gt; `defined YYLTYPE_IS_TRIVIAL &amp;&amp;' is sufficient.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I tried to make it a little clearer what the conditional is for in
&lt;br&gt;&amp;gt; this version. &amp;nbsp;If you still think the conditional should be dropped,
&lt;br&gt;&amp;gt; let me know and I’ll send a version without it.
&lt;br&gt;&lt;br&gt;Ok, thanks, but I'd still like it to be a separate patch.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;From 81895390b3b97540e4ade42031449700d10d62bd Mon Sep 17 00:00:00 2001
&lt;br&gt;&amp;gt; From: Jonathan Nieder &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26805984&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: Sat, 12 Dec 2009 15:43:18 -0600
&lt;br&gt;&amp;gt; Subject: [PATCH] Avoid warnings from gcc -Wunused y.tab.c
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Building bison-produced parsers can result in a few warnings:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	y.tab.c:383:6: warning: &amp;quot;YYENABLE_NLS&amp;quot; is not defined
&lt;br&gt;&amp;gt; 	y.tab.c:1271:6: warning: &amp;quot;YYLTYPE_IS_TRIVIAL&amp;quot; is not defined
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; These warnings are not revealing any actual problem (it is
&lt;br&gt;&amp;gt; perfectly reasonable to use #if FOO even if FOO is not defined).
&lt;br&gt;&amp;gt; Suppress them by checking if preprocessor symbols are defined
&lt;br&gt;&amp;gt; before using their values.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; While at it, do not use the YYLTYPE_IS_TRIVIAL symbol in the
&lt;br&gt;&amp;gt; generated parser source if location tracking is not enabled.
&lt;br&gt;&amp;gt; (Most uses were protected by b4_locations_if already.)
&lt;/div&gt;&lt;/div&gt;I'm sorry I didn't make this clear before, but ChangeLog entries and git 
&lt;br&gt;log entries should be the same (except that the blank line following the 
&lt;br&gt;first line of a git log entry is usually removed in the ChangeLog entry).
&lt;br&gt;&lt;br&gt;If you'd like, I can go ahead and revise your patch. &amp;nbsp;If I don't hear from 
&lt;br&gt;you again by tomorrow, I'll probably just go ahead and do that.
&lt;br&gt;&lt;br&gt;Thanks.&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26805984.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26805819</id>
	<title>Re: several messages</title>
	<published>2009-12-15T19:37:54Z</published>
	<updated>2009-12-15T19:37:54Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Tue, 15 Dec 2009, Jonathan Nieder wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; 3. After committing in your local repo, email us the output of:
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; git format-patch --stdout -1
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; That will make your patch easier to apply.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am not sure I understand this one.
&lt;br&gt;&lt;br&gt;My mistake. &amp;nbsp;By the time I wrote that, I forgot you were actually using 
&lt;br&gt;format-patch, and so I just wrote the usual recipe.
&lt;br&gt;&lt;br&gt;&amp;gt; Do you mean that I should keep
&lt;br&gt;&amp;gt; the &amp;quot;From &amp;quot; mbox delimiter and From:, Date:, etc fields inline in my
&lt;br&gt;&amp;gt; message?
&lt;br&gt;&lt;br&gt;I guess I'm just not used to seeing so many emails for one small issue. &amp;nbsp;
&lt;br&gt;I'm used to seeing patches appended to the main email that introduces 
&lt;br&gt;them. &amp;nbsp;However, feel free to send patches separately if that's somehow 
&lt;br&gt;easier for you.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; --- a/data/yacc.c
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; +++ b/data/yacc.c
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; @@ -668,7 +668,7 @@ while (YYID (0))
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; we won't break user code: when these are the locations we know. &amp;nbsp;*/
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp;#ifndef YY_LOCATION_PRINT
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; -# if YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; +]b4_locations_if([[# if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc)			\
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; fprintf (File, &amp;quot;%d.%d-%d.%d&amp;quot;,			\
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp;	 &amp;nbsp; &amp;nbsp; &amp;nbsp;(Loc).first_line, (Loc).first_column,	\
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; @@ -676,7 +676,9 @@ while (YYID (0))
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp;# else
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp;# endif
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; -#endif
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; +]], [[ /* This macro is maintained here in case user code is relying on it. */
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; +# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; +]])[#endif
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; How does the b4_locations_if part of this change help?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Not much, admittedly. &amp;nbsp;Here is why I did it anyway:
&lt;/div&gt;&lt;br&gt;I understand your reasoning, but it sounds like this change is distinct 
&lt;br&gt;from the rest of your changes, it does not fix any bugs, and it might 
&lt;br&gt;somehow create a backward compatibility issue for someone somewhere. &amp;nbsp;
&lt;br&gt;That is, even though neither YY_LOCATION_PRINT nor YYLTYPE_IS_TRIVIAL is 
&lt;br&gt;actually documented for users, YY_LOCATION_PRINT was put there for some 
&lt;br&gt;purpose, and the discrepancy you're eliminating between yacc.c and glr.c 
&lt;br&gt;might somehow be intentional.
&lt;br&gt;&lt;br&gt;I want to include the rest of your changes in release 2.4.2, which is 
&lt;br&gt;purely a bug fix release, so please submit the b4_locations_if change in a 
&lt;br&gt;separate patch.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26805819.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26805780</id>
	<title>[PATCH v2] Avoid warnings from gcc -Wunused y.tab.c</title>
	<published>2009-12-15T19:33:02Z</published>
	<updated>2009-12-15T19:33:02Z</updated>
	<author>
		<name>Jonathan Nieder</name>
	</author>
	<content type="html">Hi Joel,
&lt;br&gt;&lt;br&gt;Here is an updated patch incorporating all your suggestions except for
&lt;br&gt;the last one.
&lt;br&gt;&lt;br&gt;Joel E. Denny wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; How does the b4_locations_if part of this change help? &amp;nbsp;If it isn't really 
&lt;br&gt;&amp;gt; necessary, then let's drop it. &amp;nbsp;As far as I can tell, the addition of 
&lt;br&gt;&amp;gt; `defined YYLTYPE_IS_TRIVIAL &amp;&amp;' is sufficient.
&lt;br&gt;&lt;br&gt;I tried to make it a little clearer what the conditional is for in
&lt;br&gt;this version. &amp;nbsp;If you still think the conditional should be dropped,
&lt;br&gt;let me know and I’ll send a version without it.
&lt;br&gt;&lt;br&gt;Ciao,
&lt;br&gt;-- %&amp;lt; --
&lt;br&gt;From 81895390b3b97540e4ade42031449700d10d62bd Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Jonathan Nieder &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26805780&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sat, 12 Dec 2009 15:43:18 -0600
&lt;br&gt;Subject: [PATCH] Avoid warnings from gcc -Wunused y.tab.c
&lt;br&gt;&lt;br&gt;Building bison-produced parsers can result in a few warnings:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y.tab.c:383:6: warning: &amp;quot;YYENABLE_NLS&amp;quot; is not defined
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y.tab.c:1271:6: warning: &amp;quot;YYLTYPE_IS_TRIVIAL&amp;quot; is not defined
&lt;br&gt;&lt;br&gt;These warnings are not revealing any actual problem (it is
&lt;br&gt;perfectly reasonable to use #if FOO even if FOO is not defined).
&lt;br&gt;Suppress them by checking if preprocessor symbols are defined
&lt;br&gt;before using their values.
&lt;br&gt;&lt;br&gt;While at it, do not use the YYLTYPE_IS_TRIVIAL symbol in the
&lt;br&gt;generated parser source if location tracking is not enabled.
&lt;br&gt;(Most uses were protected by b4_locations_if already.)
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; | &amp;nbsp; 15 +++++++++++++++
&lt;br&gt;&amp;nbsp;data/glr.c &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;4 ++--
&lt;br&gt;&amp;nbsp;data/lalr1.cc | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;data/yacc.c &amp;nbsp; | &amp;nbsp; 14 ++++++++++----
&lt;br&gt;&amp;nbsp;4 files changed, 28 insertions(+), 7 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 2c5d33e..1f7fd6b 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,18 @@
&lt;br&gt;+2009-12-15 &amp;nbsp;Jonathan Nieder &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26805780&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jrnieder@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	Check defined FOO &amp;&amp; FOO instead of FOO when testing
&lt;br&gt;+	user-defined preprocessor symbols.
&lt;br&gt;+	This avoids warnings from gcc -Wunused y.tab.c.
&lt;br&gt;+	* data/glr.c: Test if YYENABLE_NLS is defined before using it.
&lt;br&gt;+	* data/lalr1.cc: Likewise.
&lt;br&gt;+	* data/yacc.c: Likewise.
&lt;br&gt;+	* data/glr.c: Test if YYLTYPE_IS_TRIVIAL is defined before
&lt;br&gt;+	using it.
&lt;br&gt;+	* data/yacc.c: If location tracking is enabled, test if
&lt;br&gt;+	YYLTYPE_IS_TRIVIAL is defined before using it. &amp;nbsp;Otherwise, do
&lt;br&gt;+	not use it: define YY_LOCATION_PRINT as a no-op unconditionally
&lt;br&gt;+	and add a comment explaining why.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26805780&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	autoconf: update to latest for fix of M4 detection.
&lt;br&gt;diff --git a/data/glr.c b/data/glr.c
&lt;br&gt;index 6f1f7ee..e73b251 100644
&lt;br&gt;--- a/data/glr.c
&lt;br&gt;+++ b/data/glr.c
&lt;br&gt;@@ -256,7 +256,7 @@ b4_percent_code_get[]dnl
&lt;br&gt;&amp;nbsp;#include &amp;lt;string.h&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifndef YY_
&lt;br&gt;-# if YYENABLE_NLS
&lt;br&gt;+# if defined YYENABLE_NLS &amp;&amp; YYENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp;if ENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp; include &amp;lt;libintl.h&amp;gt; /* INFRINGES ON USER NAME SPACE */
&lt;br&gt;&amp;nbsp;# &amp;nbsp; define YY_(msgid) dgettext (&amp;quot;bison-runtime&amp;quot;, msgid)
&lt;br&gt;@@ -2264,7 +2264,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
&lt;br&gt;&amp;nbsp; &amp;nbsp;yychar = YYEMPTY;
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylval = yyval_default;
&lt;br&gt;&amp;nbsp;]b4_locations_if([
&lt;br&gt;-#if YYLTYPE_IS_TRIVIAL
&lt;br&gt;+#if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylloc.first_line &amp;nbsp; = yylloc.last_line &amp;nbsp; = ]b4_location_initial_line[;
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;diff --git a/data/lalr1.cc b/data/lalr1.cc
&lt;br&gt;index 1a2777e..9e0d522 100644
&lt;br&gt;--- a/data/lalr1.cc
&lt;br&gt;+++ b/data/lalr1.cc
&lt;br&gt;@@ -398,7 +398,7 @@ m4_if(b4_prefix, [yy], [],
&lt;br&gt;&amp;nbsp;b4_percent_code_get[]dnl
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;[#ifndef YY_
&lt;br&gt;-# if YYENABLE_NLS
&lt;br&gt;+# if defined YYENABLE_NLS &amp;&amp; YYENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp;if ENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp; include &amp;lt;libintl.h&amp;gt; /* FIXME: INFRINGES ON USER NAME SPACE */
&lt;br&gt;&amp;nbsp;# &amp;nbsp; define YY_(msgid) dgettext (&amp;quot;bison-runtime&amp;quot;, msgid)
&lt;br&gt;diff --git a/data/yacc.c b/data/yacc.c
&lt;br&gt;index ea2ae14..04c6a90 100644
&lt;br&gt;--- a/data/yacc.c
&lt;br&gt;+++ b/data/yacc.c
&lt;br&gt;@@ -374,7 +374,7 @@ typedef short int yytype_int16;
&lt;br&gt;&amp;nbsp;#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifndef YY_
&lt;br&gt;-# if YYENABLE_NLS
&lt;br&gt;+# if defined YYENABLE_NLS &amp;&amp; YYENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp;if ENABLE_NLS
&lt;br&gt;&amp;nbsp;# &amp;nbsp; include &amp;lt;libintl.h&amp;gt; /* INFRINGES ON USER NAME SPACE */
&lt;br&gt;&amp;nbsp;# &amp;nbsp; define YY_(msgid) dgettext (&amp;quot;bison-runtime&amp;quot;, msgid)
&lt;br&gt;@@ -662,13 +662,13 @@ while (YYID (0))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;while (YYID (0))
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-
&lt;br&gt;+]b4_locations_if([[
&lt;br&gt;&amp;nbsp;/* YY_LOCATION_PRINT -- Print the location on the stream.
&lt;br&gt;&amp;nbsp; &amp;nbsp; This macro was not mandated originally: define only if we know
&lt;br&gt;&amp;nbsp; &amp;nbsp; we won't break user code: when these are the locations we know. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifndef YY_LOCATION_PRINT
&lt;br&gt;-# if YYLTYPE_IS_TRIVIAL
&lt;br&gt;+# if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc)			\
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; fprintf (File, &amp;quot;%d.%d-%d.%d&amp;quot;,			\
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp; &amp;nbsp;(Loc).first_line, (Loc).first_column,	\
&lt;br&gt;@@ -677,7 +677,13 @@ while (YYID (0))
&lt;br&gt;&amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;nbsp;# endif
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;+]], [[
&lt;br&gt;+/* This macro is provided for backwards compatibility. */
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+#ifndef YY_LOCATION_PRINT
&lt;br&gt;+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;+#endif
&lt;br&gt;+]])[
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;/* YYLEX -- calling `yylex' with the right arguments. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;@@ -1192,7 +1198,7 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
&lt;br&gt;&amp;nbsp; &amp;nbsp;yyvsp = yyvs;]b4_locations_if([[
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylsp = yyls;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#if YYLTYPE_IS_TRIVIAL
&lt;br&gt;+#if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* Initialize the default location before parsing starts. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylloc.first_line &amp;nbsp; = yylloc.last_line &amp;nbsp; = ]b4_location_initial_line[;
&lt;br&gt;&amp;nbsp; &amp;nbsp;yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
&lt;br&gt;-- 
&lt;br&gt;1.6.5.4
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26805780.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26805166</id>
	<title>Re: several messages</title>
	<published>2009-12-15T18:10:14Z</published>
	<updated>2009-12-15T18:10:14Z</updated>
	<author>
		<name>Jonathan Nieder</name>
	</author>
	<content type="html">Joel E. Denny wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; If you have time, please do the following:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1. Address the comments I've inlined in your patches below.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 2. Write a ChangeLog entry. &amp;nbsp;One for all of the changes you posted seems 
&lt;br&gt;&amp;gt; fine. &amp;nbsp;Please try to follow the format you see in existing ChangeLog 
&lt;br&gt;&amp;gt; entries.
&lt;br&gt;&lt;br&gt;Sure thing. &amp;nbsp;Thanks for the tips.
&lt;br&gt;&lt;br&gt;&amp;gt; 3. After committing in your local repo, email us the output of:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; git format-patch --stdout -1
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; That will make your patch easier to apply.
&lt;br&gt;&lt;br&gt;I am not sure I understand this one. &amp;nbsp;Do you mean that I should keep
&lt;br&gt;the &amp;quot;From &amp;quot; mbox delimiter and From:, Date:, etc fields inline in my
&lt;br&gt;message?
&lt;br&gt;&lt;br&gt;&amp;gt; On Sat, 12 Dec 2009, Jonathan Nieder wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; diff --git a/src/parse-gram.c b/src/parse-gram.c
&lt;br&gt;&amp;gt;&amp;gt; index 4b6d559..0f509e6 100644
&lt;br&gt;&amp;gt;&amp;gt; --- a/src/parse-gram.c
&lt;br&gt;&amp;gt;&amp;gt; +++ b/src/parse-gram.c
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; diff --git a/src/parse-gram.h b/src/parse-gram.h
&lt;br&gt;&amp;gt;&amp;gt; index 894b5dd..fcf3255 100644
&lt;br&gt;&amp;gt;&amp;gt; --- a/src/parse-gram.h
&lt;br&gt;&amp;gt;&amp;gt; +++ b/src/parse-gram.h
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; When posting patches, it's best if you remove all changes that were 
&lt;br&gt;&amp;gt; automatically generated during the build. &amp;nbsp;We can regenerate those 
&lt;br&gt;&amp;gt; ourselves, and we don't want to read them while reviewing your patches.
&lt;/div&gt;&lt;br&gt;That patch consisted only of automatically generated changes. &amp;nbsp;I’ll
&lt;br&gt;omit it and combine the other two when I reroll.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; --- a/data/yacc.c
&lt;br&gt;&amp;gt;&amp;gt; +++ b/data/yacc.c
&lt;br&gt;&amp;gt;&amp;gt; @@ -668,7 +668,7 @@ while (YYID (0))
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; we won't break user code: when these are the locations we know. &amp;nbsp;*/
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;#ifndef YY_LOCATION_PRINT
&lt;br&gt;&amp;gt;&amp;gt; -# if YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;gt;&amp;gt; +]b4_locations_if([[# if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc)			\
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; fprintf (File, &amp;quot;%d.%d-%d.%d&amp;quot;,			\
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;	 &amp;nbsp; &amp;nbsp; &amp;nbsp;(Loc).first_line, (Loc).first_column,	\
&lt;br&gt;&amp;gt;&amp;gt; @@ -676,7 +676,9 @@ while (YYID (0))
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;# else
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;# endif
&lt;br&gt;&amp;gt;&amp;gt; -#endif
&lt;br&gt;&amp;gt;&amp;gt; +]], [[ /* This macro is maintained here in case user code is relying on it. */
&lt;br&gt;&amp;gt;&amp;gt; +# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;gt;&amp;gt; +]])[#endif
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How does the b4_locations_if part of this change help?
&lt;/div&gt;&lt;br&gt;Not much, admittedly. &amp;nbsp;Here is why I did it anyway:
&lt;br&gt;&lt;br&gt;&amp;nbsp;1. It makes sure that YYLTYPE_IS_TRIVIAL does not get used if
&lt;br&gt;&amp;nbsp; &amp;nbsp; locations are turned off. &amp;nbsp;Since that symbol is in yacc’s
&lt;br&gt;&amp;nbsp; &amp;nbsp; namespace anyway, that is not a big deal. &amp;nbsp;But every other
&lt;br&gt;&amp;nbsp; &amp;nbsp; use of YYLTYPE_IS_TRIVIAL is already protected, and for peace
&lt;br&gt;&amp;nbsp; &amp;nbsp; of mind I think that is worth maintaining.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; In particular, it is a little clearer that this preprocessor
&lt;br&gt;&amp;nbsp; &amp;nbsp; symbol is not the cause of any problem that appears with
&lt;br&gt;&amp;nbsp; &amp;nbsp; locations turned off when grepping for YYLTPYE_IS_TRIVIAL in
&lt;br&gt;&amp;nbsp; &amp;nbsp; the generated parser yields no matches.
&lt;br&gt;&lt;br&gt;&amp;nbsp;2. It makes the generated y.tab.c simpler if locations are turned
&lt;br&gt;&amp;nbsp; &amp;nbsp; off. &amp;nbsp;I do think that making the y.tab.c less mysterious when
&lt;br&gt;&amp;nbsp; &amp;nbsp; possible is worth while.
&lt;br&gt;&lt;br&gt;&amp;nbsp;3. It makes what happens in the locations-turned-off case a little
&lt;br&gt;&amp;nbsp; &amp;nbsp; clearer. &amp;nbsp;In my opinion, except for compatibility reasons, it
&lt;br&gt;&amp;nbsp; &amp;nbsp; doesn’t make sense to define the YY_LOCATION_PRINT macro when
&lt;br&gt;&amp;nbsp; &amp;nbsp; locations are turned off. &amp;nbsp;Writing the code this way clarifies
&lt;br&gt;&amp;nbsp; &amp;nbsp; that we are aware we are defining it and why.
&lt;br&gt;&lt;br&gt;On the other hand, it makes the source uglier. &amp;nbsp;So I’m not sure what
&lt;br&gt;the right thing to do is.
&lt;br&gt;&lt;br&gt;Jonathan
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26805166.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26804579</id>
	<title>Re: several messages</title>
	<published>2009-12-15T16:58:31Z</published>
	<updated>2009-12-15T16:58:31Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Sat, 12 Dec 2009, Jonathan Nieder wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I noticed a few warnings when building mawk:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; compiling parse.c
&lt;br&gt;&amp;gt; y.tab.c:383:6: warning: &amp;quot;YYENABLE_NLS&amp;quot; is not defined
&lt;br&gt;&amp;gt; y.tab.c:1271:6: warning: &amp;quot;YYLTYPE_IS_TRIVIAL&amp;quot; is not defined
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; These warnings are not revealing any actual problem (it is perfectly
&lt;br&gt;&amp;gt; reasonable to use #if FOO even if FOO is not defined). &amp;nbsp;They look
&lt;br&gt;&amp;gt; simple to fix, and a quick Google search shows all kinds of projects
&lt;br&gt;&amp;gt; unnecessarily defining these symbols to work around the warnings, so I
&lt;br&gt;&amp;gt; figure, why not suppress them here at the source?
&lt;/div&gt;&lt;br&gt;Sounds good to me.
&lt;br&gt;&lt;br&gt;&amp;gt; These two patches do that. &amp;nbsp;Perhaps they could be useful. &amp;nbsp;The result
&lt;br&gt;&amp;gt; still passes the test suite here.
&lt;br&gt;&lt;br&gt;Thanks.
&lt;br&gt;&lt;br&gt;&amp;gt; Jonathan Nieder (2):
&lt;br&gt;&amp;gt; &amp;nbsp; Check if YYENABLE_NLS is defined before checking its value
&lt;br&gt;&amp;gt; &amp;nbsp; Do not depend on YYLTYPE_IS_TRIVIAL unless locations are requested
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp;data/glr.c &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;4 ++--
&lt;br&gt;&amp;gt; &amp;nbsp;data/lalr1.cc | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;gt; &amp;nbsp;data/yacc.c &amp;nbsp; | &amp;nbsp; 10 ++++++----
&lt;br&gt;&amp;gt; &amp;nbsp;3 files changed, 9 insertions(+), 7 deletions(-)
&lt;br&gt;&lt;br&gt;Good, you're using git. &amp;nbsp;If you have time, please do the following:
&lt;br&gt;&lt;br&gt;1. Address the comments I've inlined in your patches below.
&lt;br&gt;&lt;br&gt;2. Write a ChangeLog entry. &amp;nbsp;One for all of the changes you posted seems 
&lt;br&gt;fine. &amp;nbsp;Please try to follow the format you see in existing ChangeLog 
&lt;br&gt;entries.
&lt;br&gt;&lt;br&gt;3. After committing in your local repo, email us the output of:
&lt;br&gt;&lt;br&gt;&amp;nbsp; git format-patch --stdout -1
&lt;br&gt;&lt;br&gt;That will make your patch easier to apply.
&lt;br&gt;&lt;br&gt;&amp;gt; diff --git a/src/parse-gram.c b/src/parse-gram.c
&lt;br&gt;&amp;gt; index 4b6d559..0f509e6 100644
&lt;br&gt;&amp;gt; --- a/src/parse-gram.c
&lt;br&gt;&amp;gt; +++ b/src/parse-gram.c
&lt;br&gt;&lt;br&gt;&amp;gt; diff --git a/src/parse-gram.h b/src/parse-gram.h
&lt;br&gt;&amp;gt; index 894b5dd..fcf3255 100644
&lt;br&gt;&amp;gt; --- a/src/parse-gram.h
&lt;br&gt;&amp;gt; +++ b/src/parse-gram.h
&lt;br&gt;&lt;br&gt;When posting patches, it's best if you remove all changes that were 
&lt;br&gt;automatically generated during the build. &amp;nbsp;We can regenerate those 
&lt;br&gt;ourselves, and we don't want to read them while reviewing your patches.
&lt;br&gt;&lt;br&gt;&amp;gt; Also check if YYLTYPE_IS_TRIVIAL is defined when using its value,
&lt;br&gt;&amp;gt; to avoid warnings if it is not defined.
&lt;br&gt;&amp;gt; ---
&lt;br&gt;&amp;gt; I could not tell from the documentation whether YY_LOCATION_PRINT
&lt;br&gt;&amp;gt; needs to be defined when locations are disabled. &amp;nbsp;This patches
&lt;br&gt;&amp;gt; leaves it in to be safe.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; diff --git a/data/yacc.c b/data/yacc.c
&lt;br&gt;&amp;gt; index af38314..0d171a7 100644
&lt;br&gt;&amp;gt; --- a/data/yacc.c
&lt;br&gt;&amp;gt; +++ b/data/yacc.c
&lt;br&gt;&amp;gt; @@ -668,7 +668,7 @@ while (YYID (0))
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; we won't break user code: when these are the locations we know. &amp;nbsp;*/
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;#ifndef YY_LOCATION_PRINT
&lt;br&gt;&amp;gt; -# if YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;gt; +]b4_locations_if([[# if defined YYLTYPE_IS_TRIVIAL &amp;&amp; YYLTYPE_IS_TRIVIAL
&lt;br&gt;&amp;gt; &amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc)			\
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; fprintf (File, &amp;quot;%d.%d-%d.%d&amp;quot;,			\
&lt;br&gt;&amp;gt; &amp;nbsp;	 &amp;nbsp; &amp;nbsp; &amp;nbsp;(Loc).first_line, (Loc).first_column,	\
&lt;br&gt;&amp;gt; @@ -676,7 +676,9 @@ while (YYID (0))
&lt;br&gt;&amp;gt; &amp;nbsp;# else
&lt;br&gt;&amp;gt; &amp;nbsp;# &amp;nbsp;define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;gt; &amp;nbsp;# endif
&lt;br&gt;&amp;gt; -#endif
&lt;br&gt;&amp;gt; +]], [[ /* This macro is maintained here in case user code is relying on it. */
&lt;br&gt;&amp;gt; +# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
&lt;br&gt;&amp;gt; +]])[#endif
&lt;/div&gt;&lt;br&gt;How does the b4_locations_if part of this change help? &amp;nbsp;If it isn't really 
&lt;br&gt;necessary, then let's drop it. &amp;nbsp;As far as I can tell, the addition of 
&lt;br&gt;`defined YYLTYPE_IS_TRIVIAL &amp;&amp;' is sufficient.
&lt;br&gt;&lt;br&gt;Thanks again.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH-0-2--avoid-some-warnings-from-gcc--c--Wall--W-y.tab.c-tp26763701p26804579.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26804260</id>
	<title>Re: Non-portable m4 check in autoconf 2.64, 2.65, HEAD</title>
	<published>2009-12-15T16:18:01Z</published>
	<updated>2009-12-15T16:18:01Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">Hi Eric,
&lt;br&gt;&lt;br&gt;On Fri, 27 Nov 2009, Eric Blake wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; According to Harald van Dĳk on 11/26/2009 11:32 AM:
&lt;br&gt;&amp;gt; &amp;gt; The configure script of autoconf 2.64/2.65/HEAD fails to detect a
&lt;br&gt;&amp;gt; &amp;gt; suitable m4 on my system.
&lt;br&gt;&amp;gt; &amp;gt; I have GNU M4 1.4.13. The problem is that I'm using dash for /bin/sh
&lt;br&gt;&amp;gt; &amp;gt; (and my dash supports LINENO so configure doesn't silently use bash
&lt;br&gt;&amp;gt; &amp;gt; instead), and the m4 detection doesn't work when echo \1 prints ^A.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; That means bison needs to update its autoconf submodule to today, or it
&lt;br&gt;&amp;gt; will suffer from the same problem in its reuse of the broken m4.m4 test.
&lt;br&gt;&lt;br&gt;Thanks. &amp;nbsp;I pushed the first patch below to master and branch-2.5. &amp;nbsp;I 
&lt;br&gt;pushed the second to branch-2.4.2.
&lt;br&gt;&lt;br&gt;From c843aaab352ab1f40c7d218fb5bb2c6fd6fd3a88 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26804260&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Tue, 15 Dec 2009 18:56:52 -0500
&lt;br&gt;Subject: [PATCH] autoconf: update to latest for fix of M4 detection.
&lt;br&gt;&lt;br&gt;Reported by Eric Blake.
&lt;br&gt;* submodules/autoconf: Update.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;6 ++++++
&lt;br&gt;&amp;nbsp;submodules/autoconf | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;2 files changed, 7 insertions(+), 1 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 897b54a..2c5d33e 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,11 @@
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26804260&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	autoconf: update to latest for fix of M4 detection.
&lt;br&gt;+	Reported by Eric Blake.
&lt;br&gt;+	* submodules/autoconf: Update.
&lt;br&gt;+
&lt;br&gt;+2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26804260&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	portability: use -DGNULIB_POSIXCHECK.
&lt;br&gt;&amp;nbsp;	Reported by Eric Blake. &amp;nbsp;See discussions at
&lt;br&gt;&amp;nbsp;	&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&lt;/a&gt;&amp;gt;
&lt;br&gt;diff --git a/submodules/autoconf b/submodules/autoconf
&lt;br&gt;index 936160f..81074ea 160000
&lt;br&gt;--- a/submodules/autoconf
&lt;br&gt;+++ b/submodules/autoconf
&lt;br&gt;@@ -1 +1 @@
&lt;br&gt;-Subproject commit 936160f7619cb7fddbc424bb5cb9a2f997d8e166
&lt;br&gt;+Subproject commit 81074eaa201a289d11b6be05e0c78afbe5ff79f5
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;From dfff6628178e75cc2d23ad574f14bc540249258c Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26804260&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Tue, 15 Dec 2009 19:11:42 -0500
&lt;br&gt;Subject: [PATCH] Import M4 detection fix from Autoconf.
&lt;br&gt;&lt;br&gt;Reported by Eric Blake.
&lt;br&gt;* m4/m4.m4: Copy serial 10.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog | &amp;nbsp; &amp;nbsp;6 ++++++
&lt;br&gt;&amp;nbsp;m4/m4.m4 &amp;nbsp;| &amp;nbsp; &amp;nbsp;4 ++--
&lt;br&gt;&amp;nbsp;2 files changed, 8 insertions(+), 2 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index c6a2750..d419d50 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,9 @@
&lt;br&gt;+2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26804260&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	Import M4 detection fix from Autoconf.
&lt;br&gt;+	Reported by Eric Blake.
&lt;br&gt;+	* m4/m4.m4: Copy serial 10.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-14 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26804260&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	Enable assertion output and --disable-assert for configure.
&lt;br&gt;diff --git a/m4/m4.m4 b/m4/m4.m4
&lt;br&gt;index 096fb28..c6b64b0 100644
&lt;br&gt;--- a/m4/m4.m4
&lt;br&gt;+++ b/m4/m4.m4
&lt;br&gt;@@ -1,4 +1,4 @@
&lt;br&gt;-# m4.m4 serial 9
&lt;br&gt;+# m4.m4 serial 10
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Copyright (C) 2000, 2006, 2007, 2008, 2009 Free Software Foundation,
&lt;br&gt;&amp;nbsp;# Inc.
&lt;br&gt;@@ -29,7 +29,7 @@ AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4 gnum4],
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ac_snippet=change'quote(&amp;lt;,&amp;gt;)in''dir(&amp;lt;if''def&amp;gt;,mac,bug)'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ac_snippet=${ac_snippet}pat'subst(a,\(b\)\|\(a\),\1)d'nl
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;test -z &amp;quot;`$ac_path_M4 -F conftest.m4f &amp;lt;/dev/null 2&amp;gt;&amp;1`&amp;quot; \
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;&amp; test -z &amp;quot;`echo $ac_snippet | $ac_path_M4 --trace=mac 2&amp;gt;&amp;1`&amp;quot; \
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;&amp; test -z &amp;quot;`AS_ECHO([$ac_snippet]) | $ac_path_M4 --trace=mac 2&amp;gt;&amp;1`&amp;quot; \
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;&amp; test -f conftest.m4f \
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;&amp; ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rm -f conftest.m4f],
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Bugs-f1503.html&quot; embed=&quot;fixTarget[1503]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Non-portable-m4-check-in-autoconf-2.64%2C-2.65%2C-HEAD-tp26542135p26804260.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26803846</id>
	<title>Re: [PATCH] build: avoid printf format mismatch warnings</title>
	<published>2009-12-15T15:33:43Z</published>
	<updated>2009-12-15T15:33:43Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Sun, 11 Oct 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &lt;a href=&quot;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Based on that discussion, I'm thinking of pushing the following. &amp;nbsp;I'm 
&lt;br&gt;&amp;gt; hesitating for a few reasons:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1. I'm not sure why bootstrap.conf was careful to exclude 
&lt;br&gt;&amp;gt; m4/printf-posix.m4. &amp;nbsp;Maybe to avoid bloat?
&lt;br&gt;&lt;br&gt;Given that the comments say &amp;quot;we don't need them&amp;quot;, I'm assuming the point 
&lt;br&gt;was to avoid bloat. &amp;nbsp;However, -DGNULIB_POSIXCHECK recommends printf-posix, 
&lt;br&gt;so I'm removing the exclusion of m4/printf-posix.m4.
&lt;br&gt;&lt;br&gt;&amp;gt; 2. -DGNULIB_POSIXCHECK suggests realloc-posix for the sake of 
&lt;br&gt;&amp;gt; vasnprintf.c, so it seems realloc-posix ought to be a dependency of 
&lt;br&gt;&amp;gt; vasnprintf-posix. &amp;nbsp;I'll explore further later and maybe take it to the 
&lt;br&gt;&amp;gt; gnulib maintainers.
&lt;br&gt;&lt;br&gt;On second thought, maybe realloc-posix doesn't fix any feature of realloc 
&lt;br&gt;actually needed by vasnprintf-posix, but -DGNULIB_POSIXCHECK of course 
&lt;br&gt;isn't precise enough to realize that. &amp;nbsp;I'm not going to pursue this with 
&lt;br&gt;the gnulib maintainers.
&lt;br&gt;&lt;br&gt;&amp;gt; 3. -DGNULIB_POSIXCHECK is suggesting a lot of other modules. &amp;nbsp;We need to 
&lt;br&gt;&amp;gt; explore those at some point.
&lt;br&gt;&lt;br&gt;Later.
&lt;br&gt;&lt;br&gt;&amp;gt; 4. I'm trying to decide whether to apply the patch to branch-2.4.2.
&lt;br&gt;&lt;br&gt;Because I really don't know what I'm doing, I'm not going to risk that.
&lt;br&gt;&lt;br&gt;I pushed the following to master and branch-2.5. &amp;nbsp;It extends the patch I 
&lt;br&gt;proposed in the previous email by linking gnulib libraries in the test 
&lt;br&gt;suite parsers. &amp;nbsp;Some tests were failing without that.
&lt;br&gt;&lt;br&gt;&amp;gt;From 5c99151aeb4396bf35b482e27075948c33088afa Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803846&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Tue, 15 Dec 2009 00:15:41 -0500
&lt;br&gt;Subject: [PATCH] portability: use -DGNULIB_POSIXCHECK.
&lt;br&gt;&lt;br&gt;Reported by Eric Blake. &amp;nbsp;See discussions at
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&lt;/a&gt;&amp;gt;
&lt;br&gt;and
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;* HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
&lt;br&gt;* bootstrap.conf (gnulib_modules): Add all the printf modules
&lt;br&gt;suggested by -DGNULIB_POSIXCHECK. &amp;nbsp;Add realloc-posix as
&lt;br&gt;suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
&lt;br&gt;(excluded_files): Remove m4/printf-posix.m4.
&lt;br&gt;* tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
&lt;br&gt;lib/libbison.a so gnulib libraries can be linked.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 15 +++++++++++++++
&lt;br&gt;&amp;nbsp;HACKING &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;3 +++
&lt;br&gt;&amp;nbsp;bootstrap.conf &amp;nbsp; | &amp;nbsp; 11 +++++++----
&lt;br&gt;&amp;nbsp;lib/.cvsignore &amp;nbsp; | &amp;nbsp; 42 ++++++++++++++++++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;lib/.gitignore &amp;nbsp; | &amp;nbsp; 42 ++++++++++++++++++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;m4/.cvsignore &amp;nbsp; &amp;nbsp;| &amp;nbsp; 33 +++++++++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;m4/.gitignore &amp;nbsp; &amp;nbsp;| &amp;nbsp; 33 +++++++++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;tests/atlocal.in | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;8 files changed, 176 insertions(+), 5 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 2c4baf4..897b54a 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,20 @@
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803846&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	portability: use -DGNULIB_POSIXCHECK.
&lt;br&gt;+	Reported by Eric Blake. &amp;nbsp;See discussions at
&lt;br&gt;+	&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&lt;/a&gt;&amp;gt;
&lt;br&gt;+	and
&lt;br&gt;+	&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;+	* HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
&lt;br&gt;+	* bootstrap.conf (gnulib_modules): Add all the printf modules
&lt;br&gt;+	suggested by -DGNULIB_POSIXCHECK. &amp;nbsp;Add realloc-posix as
&lt;br&gt;+	suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
&lt;br&gt;+	(excluded_files): Remove m4/printf-posix.m4.
&lt;br&gt;+	* tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
&lt;br&gt;+	lib/libbison.a so gnulib libraries can be linked.
&lt;br&gt;+
&lt;br&gt;+2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803846&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	gnulib: update for fix of fprintf-posix, which we'll use soon.
&lt;br&gt;&amp;nbsp;	* etc/prefix-gnulib-mk (prefix): Adjust regex for make file
&lt;br&gt;&amp;nbsp;	targets so that gnulib's new arg-nonnull.h and link-warning.h
&lt;br&gt;diff --git a/HACKING b/HACKING
&lt;br&gt;index 82f07bb..4edb98b 100644
&lt;br&gt;--- a/HACKING
&lt;br&gt;+++ b/HACKING
&lt;br&gt;@@ -172,6 +172,9 @@ release:
&lt;br&gt;&amp;nbsp; &amp;nbsp;that 1. Bison compiles cleanly, 2. the parsers it produces compile
&lt;br&gt;&amp;nbsp; &amp;nbsp;cleanly too.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+- Build with -DGNULIB_POSIXCHECK. &amp;nbsp;It suggests gnulib modules that can
&lt;br&gt;+ &amp;nbsp;fix portability issues.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;- run `make maintainer-check' which:
&lt;br&gt;&amp;nbsp; &amp;nbsp;- runs `valgrind -q bison' to run Bison under Valgrind.
&lt;br&gt;&amp;nbsp; &amp;nbsp;- runs the parsers under Valgrind.
&lt;br&gt;diff --git a/bootstrap.conf b/bootstrap.conf
&lt;br&gt;index dff8d80..4522d8c 100644
&lt;br&gt;--- a/bootstrap.conf
&lt;br&gt;+++ b/bootstrap.conf
&lt;br&gt;@@ -20,9 +20,13 @@ gnulib_modules='
&lt;br&gt;&amp;nbsp; &amp;nbsp;announce-gen argmatch assert config-h c-strcase configmake dirname
&lt;br&gt;&amp;nbsp; &amp;nbsp;error extensions fopen-safer gendocs getopt-gnu gettext
&lt;br&gt;&amp;nbsp; &amp;nbsp;git-version-gen hash inttypes javacomp-script javaexec-script
&lt;br&gt;- &amp;nbsp;maintainer-makefile malloc mbswidth obstack quote quotearg stdbool
&lt;br&gt;- &amp;nbsp;stpcpy strerror strtoul strverscmp unistd unistd-safer unlocked-io
&lt;br&gt;- &amp;nbsp;update-copyright unsetenv verify warnings xalloc xalloc-die xstrndup
&lt;br&gt;+ &amp;nbsp;maintainer-makefile malloc mbswidth obstack quote quotearg
&lt;br&gt;+ &amp;nbsp;realloc-posix stdbool stpcpy strerror strtoul strverscmp unistd
&lt;br&gt;+ &amp;nbsp;unistd-safer unlocked-io update-copyright unsetenv verify warnings
&lt;br&gt;+ &amp;nbsp;xalloc xalloc-die xstrndup
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;fprintf-posix printf-posix snprintf-posix sprintf-posix
&lt;br&gt;+ &amp;nbsp;vsnprintf-posix vsprintf-posix
&lt;br&gt;&amp;nbsp;'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Additional xgettext options to use. &amp;nbsp;Use &amp;quot;\\\newline&amp;quot; to break lines.
&lt;br&gt;@@ -52,7 +56,6 @@ excluded_files='
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/lcmessage.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/lock.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/longdouble.m4
&lt;br&gt;- &amp;nbsp; &amp;nbsp;m4/printf-posix.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/signed.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/size_max.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/uintmax_t.m4
&lt;br&gt;diff --git a/tests/atlocal.in b/tests/atlocal.in
&lt;br&gt;index 9264a40..fb1cef6 100644
&lt;br&gt;--- a/tests/atlocal.in
&lt;br&gt;+++ b/tests/atlocal.in
&lt;br&gt;@@ -33,7 +33,7 @@ CXXFLAGS='@O0CXXFLAGS@ @WARN_CXXFLAGS@ @WERROR_CFLAGS@'
&lt;br&gt;&amp;nbsp;LDFLAGS='@LDFLAGS@'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Are special libraries needed?
&lt;br&gt;-LIBS='@LIBS@ @INTLLIBS@'
&lt;br&gt;+LIBS=&amp;quot;$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@&amp;quot;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Empty if no javac was found
&lt;br&gt;&amp;nbsp;CONF_JAVAC='@CONF_JAVAC@'
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--PATCH--build%3A-avoid-printf-format-mismatch-warnings-tp25848959p26803846.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26803843</id>
	<title>Re: [PATCH] build: avoid printf format mismatch warnings</title>
	<published>2009-12-15T15:33:43Z</published>
	<updated>2009-12-15T15:33:43Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Sun, 11 Oct 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &lt;a href=&quot;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Based on that discussion, I'm thinking of pushing the following. &amp;nbsp;I'm 
&lt;br&gt;&amp;gt; hesitating for a few reasons:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1. I'm not sure why bootstrap.conf was careful to exclude 
&lt;br&gt;&amp;gt; m4/printf-posix.m4. &amp;nbsp;Maybe to avoid bloat?
&lt;br&gt;&lt;br&gt;Given that the comments say &amp;quot;we don't need them&amp;quot;, I'm assuming the point 
&lt;br&gt;was to avoid bloat. &amp;nbsp;However, -DGNULIB_POSIXCHECK recommends printf-posix, 
&lt;br&gt;so I'm removing the exclusion of m4/printf-posix.m4.
&lt;br&gt;&lt;br&gt;&amp;gt; 2. -DGNULIB_POSIXCHECK suggests realloc-posix for the sake of 
&lt;br&gt;&amp;gt; vasnprintf.c, so it seems realloc-posix ought to be a dependency of 
&lt;br&gt;&amp;gt; vasnprintf-posix. &amp;nbsp;I'll explore further later and maybe take it to the 
&lt;br&gt;&amp;gt; gnulib maintainers.
&lt;br&gt;&lt;br&gt;On second thought, maybe realloc-posix doesn't fix any feature of realloc 
&lt;br&gt;actually needed by vasnprintf-posix, but -DGNULIB_POSIXCHECK of course 
&lt;br&gt;isn't precise enough to realize that. &amp;nbsp;I'm not going to pursue this with 
&lt;br&gt;the gnulib maintainers.
&lt;br&gt;&lt;br&gt;&amp;gt; 3. -DGNULIB_POSIXCHECK is suggesting a lot of other modules. &amp;nbsp;We need to 
&lt;br&gt;&amp;gt; explore those at some point.
&lt;br&gt;&lt;br&gt;Later.
&lt;br&gt;&lt;br&gt;&amp;gt; 4. I'm trying to decide whether to apply the patch to branch-2.4.2.
&lt;br&gt;&lt;br&gt;Because I really don't know what I'm doing, I'm not going to risk that.
&lt;br&gt;&lt;br&gt;I pushed the following to master and branch-2.5. &amp;nbsp;It extends the patch I 
&lt;br&gt;proposed in the previous email by linking gnulib libraries in the test 
&lt;br&gt;suite parsers. &amp;nbsp;Some tests were failing without that.
&lt;br&gt;&lt;br&gt;&amp;gt;From 5c99151aeb4396bf35b482e27075948c33088afa Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803843&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Tue, 15 Dec 2009 00:15:41 -0500
&lt;br&gt;Subject: [PATCH] portability: use -DGNULIB_POSIXCHECK.
&lt;br&gt;&lt;br&gt;Reported by Eric Blake. &amp;nbsp;See discussions at
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&lt;/a&gt;&amp;gt;
&lt;br&gt;and
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;* HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
&lt;br&gt;* bootstrap.conf (gnulib_modules): Add all the printf modules
&lt;br&gt;suggested by -DGNULIB_POSIXCHECK. &amp;nbsp;Add realloc-posix as
&lt;br&gt;suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
&lt;br&gt;(excluded_files): Remove m4/printf-posix.m4.
&lt;br&gt;* tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
&lt;br&gt;lib/libbison.a so gnulib libraries can be linked.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 15 +++++++++++++++
&lt;br&gt;&amp;nbsp;HACKING &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;3 +++
&lt;br&gt;&amp;nbsp;bootstrap.conf &amp;nbsp; | &amp;nbsp; 11 +++++++----
&lt;br&gt;&amp;nbsp;lib/.cvsignore &amp;nbsp; | &amp;nbsp; 42 ++++++++++++++++++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;lib/.gitignore &amp;nbsp; | &amp;nbsp; 42 ++++++++++++++++++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;m4/.cvsignore &amp;nbsp; &amp;nbsp;| &amp;nbsp; 33 +++++++++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;m4/.gitignore &amp;nbsp; &amp;nbsp;| &amp;nbsp; 33 +++++++++++++++++++++++++++++++++
&lt;br&gt;&amp;nbsp;tests/atlocal.in | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;8 files changed, 176 insertions(+), 5 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 2c4baf4..897b54a 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,20 @@
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803843&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	portability: use -DGNULIB_POSIXCHECK.
&lt;br&gt;+	Reported by Eric Blake. &amp;nbsp;See discussions at
&lt;br&gt;+	&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html&lt;/a&gt;&amp;gt;
&lt;br&gt;+	and
&lt;br&gt;+	&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;+	* HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
&lt;br&gt;+	* bootstrap.conf (gnulib_modules): Add all the printf modules
&lt;br&gt;+	suggested by -DGNULIB_POSIXCHECK. &amp;nbsp;Add realloc-posix as
&lt;br&gt;+	suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
&lt;br&gt;+	(excluded_files): Remove m4/printf-posix.m4.
&lt;br&gt;+	* tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
&lt;br&gt;+	lib/libbison.a so gnulib libraries can be linked.
&lt;br&gt;+
&lt;br&gt;+2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803843&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	gnulib: update for fix of fprintf-posix, which we'll use soon.
&lt;br&gt;&amp;nbsp;	* etc/prefix-gnulib-mk (prefix): Adjust regex for make file
&lt;br&gt;&amp;nbsp;	targets so that gnulib's new arg-nonnull.h and link-warning.h
&lt;br&gt;diff --git a/HACKING b/HACKING
&lt;br&gt;index 82f07bb..4edb98b 100644
&lt;br&gt;--- a/HACKING
&lt;br&gt;+++ b/HACKING
&lt;br&gt;@@ -172,6 +172,9 @@ release:
&lt;br&gt;&amp;nbsp; &amp;nbsp;that 1. Bison compiles cleanly, 2. the parsers it produces compile
&lt;br&gt;&amp;nbsp; &amp;nbsp;cleanly too.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+- Build with -DGNULIB_POSIXCHECK. &amp;nbsp;It suggests gnulib modules that can
&lt;br&gt;+ &amp;nbsp;fix portability issues.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;- run `make maintainer-check' which:
&lt;br&gt;&amp;nbsp; &amp;nbsp;- runs `valgrind -q bison' to run Bison under Valgrind.
&lt;br&gt;&amp;nbsp; &amp;nbsp;- runs the parsers under Valgrind.
&lt;br&gt;diff --git a/bootstrap.conf b/bootstrap.conf
&lt;br&gt;index dff8d80..4522d8c 100644
&lt;br&gt;--- a/bootstrap.conf
&lt;br&gt;+++ b/bootstrap.conf
&lt;br&gt;@@ -20,9 +20,13 @@ gnulib_modules='
&lt;br&gt;&amp;nbsp; &amp;nbsp;announce-gen argmatch assert config-h c-strcase configmake dirname
&lt;br&gt;&amp;nbsp; &amp;nbsp;error extensions fopen-safer gendocs getopt-gnu gettext
&lt;br&gt;&amp;nbsp; &amp;nbsp;git-version-gen hash inttypes javacomp-script javaexec-script
&lt;br&gt;- &amp;nbsp;maintainer-makefile malloc mbswidth obstack quote quotearg stdbool
&lt;br&gt;- &amp;nbsp;stpcpy strerror strtoul strverscmp unistd unistd-safer unlocked-io
&lt;br&gt;- &amp;nbsp;update-copyright unsetenv verify warnings xalloc xalloc-die xstrndup
&lt;br&gt;+ &amp;nbsp;maintainer-makefile malloc mbswidth obstack quote quotearg
&lt;br&gt;+ &amp;nbsp;realloc-posix stdbool stpcpy strerror strtoul strverscmp unistd
&lt;br&gt;+ &amp;nbsp;unistd-safer unlocked-io update-copyright unsetenv verify warnings
&lt;br&gt;+ &amp;nbsp;xalloc xalloc-die xstrndup
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;fprintf-posix printf-posix snprintf-posix sprintf-posix
&lt;br&gt;+ &amp;nbsp;vsnprintf-posix vsprintf-posix
&lt;br&gt;&amp;nbsp;'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Additional xgettext options to use. &amp;nbsp;Use &amp;quot;\\\newline&amp;quot; to break lines.
&lt;br&gt;@@ -52,7 +56,6 @@ excluded_files='
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/lcmessage.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/lock.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/longdouble.m4
&lt;br&gt;- &amp;nbsp; &amp;nbsp;m4/printf-posix.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/signed.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/size_max.m4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;m4/uintmax_t.m4
&lt;br&gt;diff --git a/tests/atlocal.in b/tests/atlocal.in
&lt;br&gt;index 9264a40..fb1cef6 100644
&lt;br&gt;--- a/tests/atlocal.in
&lt;br&gt;+++ b/tests/atlocal.in
&lt;br&gt;@@ -33,7 +33,7 @@ CXXFLAGS='@O0CXXFLAGS@ @WARN_CXXFLAGS@ @WERROR_CFLAGS@'
&lt;br&gt;&amp;nbsp;LDFLAGS='@LDFLAGS@'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Are special libraries needed?
&lt;br&gt;-LIBS='@LIBS@ @INTLLIBS@'
&lt;br&gt;+LIBS=&amp;quot;$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@&amp;quot;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Empty if no javac was found
&lt;br&gt;&amp;nbsp;CONF_JAVAC='@CONF_JAVAC@'
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Bugs-f1503.html&quot; embed=&quot;fixTarget[1503]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--build%3A-avoid-printf-format-mismatch-warnings-tp25657534p26803843.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26802922</id>
	<title>[PATCH] gnulib: update for fix of fprintf-posix, which we'll use soon.</title>
	<published>2009-12-15T14:26:23Z</published>
	<updated>2009-12-15T14:26:23Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">I pushed this to master.
&lt;br&gt;&lt;br&gt;From 75f94c6ddfe609b1b4dca76ea447b6271593265e Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26802922&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Tue, 15 Dec 2009 17:20:31 -0500
&lt;br&gt;Subject: [PATCH] gnulib: update for fix of fprintf-posix, which we'll use soon.
&lt;br&gt;&lt;br&gt;* etc/prefix-gnulib-mk (prefix): Adjust regex for make file
&lt;br&gt;targets so that gnulib's new arg-nonnull.h and link-warning.h
&lt;br&gt;are matched.
&lt;br&gt;* gnulib: Update.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;8 ++++++++
&lt;br&gt;&amp;nbsp;build-aux/.cvsignore | &amp;nbsp; &amp;nbsp;1 +
&lt;br&gt;&amp;nbsp;build-aux/.gitignore | &amp;nbsp; &amp;nbsp;1 +
&lt;br&gt;&amp;nbsp;etc/prefix-gnulib-mk | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;gnulib &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;nbsp;lib/.cvsignore &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;5 +++++
&lt;br&gt;&amp;nbsp;lib/.gitignore &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;5 +++++
&lt;br&gt;&amp;nbsp;m4/.cvsignore &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;3 +++
&lt;br&gt;&amp;nbsp;m4/.gitignore &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;3 +++
&lt;br&gt;&amp;nbsp;9 files changed, 28 insertions(+), 2 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index e465744..2c4baf4 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,11 @@
&lt;br&gt;+2009-12-15 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26802922&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	gnulib: update for fix of fprintf-posix, which we'll use soon.
&lt;br&gt;+	* etc/prefix-gnulib-mk (prefix): Adjust regex for make file
&lt;br&gt;+	targets so that gnulib's new arg-nonnull.h and link-warning.h
&lt;br&gt;+	are matched.
&lt;br&gt;+	* gnulib: Update.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-14 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26802922&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	Enable assertion output and --disable-assert for configure.
&lt;br&gt;diff --git a/etc/prefix-gnulib-mk b/etc/prefix-gnulib-mk
&lt;br&gt;index e969663..1bff69b 100755
&lt;br&gt;--- a/etc/prefix-gnulib-mk
&lt;br&gt;+++ b/etc/prefix-gnulib-mk
&lt;br&gt;@@ -90,7 +90,7 @@ sub prefix ($)
&lt;br&gt;&amp;nbsp; &amp;nbsp;# Prefix all the occurrence of files in rules. &amp;nbsp;If there is nothing
&lt;br&gt;&amp;nbsp; &amp;nbsp;# after in the :, it's probably a phony target, or a suffix rule.
&lt;br&gt;&amp;nbsp; &amp;nbsp;# Don't touch it.
&lt;br&gt;- &amp;nbsp;s{^([\w./]+ *: *\w.*)$}
&lt;br&gt;+ &amp;nbsp;s{^([-\w/]+\.[-\w.]+ *: *\S.*)$}
&lt;br&gt;&amp;nbsp; &amp;nbsp; {prefix_words($1)}gem;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;# Prefix files in variables.
&lt;br&gt;diff --git a/gnulib b/gnulib
&lt;br&gt;index 3ef6401..3fd9a2d 160000
&lt;br&gt;--- a/gnulib
&lt;br&gt;+++ b/gnulib
&lt;br&gt;@@ -1 +1 @@
&lt;br&gt;-Subproject commit 3ef64012bf653379fda629f5a6b619be4c1f2e69
&lt;br&gt;+Subproject commit 3fd9a2df88c558b27be3a585ca2978dbf9b5da53
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--gnulib%3A-update-for-fix-of-fprintf-posix%2C-which-we%27ll-use-soon.-tp26802922p26802922.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26789366</id>
	<title>Re: AT_DATA and AS_ECHO_N</title>
	<published>2009-12-14T20:33:39Z</published>
	<updated>2009-12-14T20:33:39Z</updated>
	<author>
		<name>Eric Blake</name>
	</author>
	<content type="html">-----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;Hash: SHA1
&lt;br&gt;&lt;br&gt;According to Joel E. Denny on 12/14/2009 2:53 PM:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I've been meaning to add a new macro to autotest to allow more flexibility in 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; generating files (no trailing newline, and/or allowing shell expansions) but it 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; will not be in time for autoconf 2.64. &amp;nbsp;Feel free to ping the autoconf list, so 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; that I'll have a reminder email.
&lt;br&gt;&amp;gt;&amp;gt; Is it necessary to have a new macro for omitting the trailing newline? &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; Couldn't AT_DATA detect whether a trailing newline is present in the 
&lt;br&gt;&amp;gt;&amp;gt; expansion and then work whatever magic is necessary to print the last line 
&lt;br&gt;&amp;gt;&amp;gt; correctly?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I'll try to remember to ping again later.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I was just clearing out some old emails and noticed that I never pinged 
&lt;br&gt;&amp;gt; you about this. &amp;nbsp;Have you had a chance to work on it? &amp;nbsp;I don't see 
&lt;br&gt;&amp;gt; anything in NEWS or the manual about it, so I assume you haven't. &amp;nbsp;I'm 
&lt;br&gt;&amp;gt; still interested, but I'm afraid I don't have time to help, so don't worry 
&lt;br&gt;&amp;gt; about it if you don't have time either.
&lt;/div&gt;&lt;br&gt;Sorry, this still hasn't percolated to the top of my list (yes, I also
&lt;br&gt;have a backlog of old emails). &amp;nbsp;But thanks for another ping.
&lt;br&gt;&lt;br&gt;- --
&lt;br&gt;Don't work too hard, make some time for fun as well!
&lt;br&gt;&lt;br&gt;Eric Blake &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26789366&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ebb9@...&lt;/a&gt;
&lt;br&gt;-----BEGIN PGP SIGNATURE-----
&lt;br&gt;Version: GnuPG v1.4.9 (Cygwin)
&lt;br&gt;Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
&lt;br&gt;Comment: Using GnuPG with Mozilla - &lt;a href=&quot;http://enigmail.mozdev.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enigmail.mozdev.org/&lt;/a&gt;&lt;br&gt;&lt;br&gt;iEYEARECAAYFAksnEaMACgkQ84KuGfSFAYDpjQCg1dNSOnpifaBpwDDb47OUD1nJ
&lt;br&gt;5MwAni7md0OL/dxbW3Pel9cL6hQ/L6Cc
&lt;br&gt;=1IoA
&lt;br&gt;-----END PGP SIGNATURE-----
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Warn-about-character-literals-not-of-length-one.-tp24631583p26789366.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26787090</id>
	<title>Re: Help with create_pipe_bidi</title>
	<published>2009-12-14T15:43:04Z</published>
	<updated>2009-12-14T15:43:04Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Mon, 7 Sep 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, 7 Sep 2009, Akim Demaille wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I can understand the concerns of Paul wrt the space-footprint of assert,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm probably showing my ignorance here, but are we talking about the size 
&lt;br&gt;&amp;gt; of the bison executable? &amp;nbsp;I didn't know what Paul meant by &amp;quot;heavyweight&amp;quot;.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On my system, src/bison increases from 988K to 1000K when I adjust 
&lt;br&gt;&amp;gt; src/system.h as follows:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; -static inline void
&lt;br&gt;&amp;gt; &amp;nbsp; -aver (bool assertion)
&lt;br&gt;&amp;gt; &amp;nbsp; -{
&lt;br&gt;&amp;gt; &amp;nbsp; - &amp;nbsp;if (! assertion)
&lt;br&gt;&amp;gt; &amp;nbsp; - &amp;nbsp; &amp;nbsp;abort ();
&lt;br&gt;&amp;gt; &amp;nbsp; -}
&lt;br&gt;&amp;gt; &amp;nbsp; -
&lt;br&gt;&amp;gt; &amp;nbsp; +#include &amp;lt;assert.h&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; +#define aver assert
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; After stripping, it's 300K and 312K. &amp;nbsp;Will anyone be bothered by 12K?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; that's why I meant to twist the meaning of NDEBUG into &amp;quot;smaller foot-print&amp;quot;.
&lt;br&gt;&amp;gt; &amp;gt; I would make --disable-asserts equivalent to NDEBUG, so it would move from
&lt;br&gt;&amp;gt; &amp;gt; classical assert to our current aver.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; We can also provide a three-state --disable-asserts:
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; - yes: fully blown assert,
&lt;br&gt;&amp;gt; &amp;gt; - no: our current aver, same as NDEBUG,
&lt;br&gt;&amp;gt; &amp;gt; - totally: completely remove the assertions.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; During development, assert's output could prove helpful. &amp;nbsp;Also, if a user 
&lt;br&gt;&amp;gt; ever sees an assertion failure, it might be nice that he can report the 
&lt;br&gt;&amp;gt; assert output to bug-bison. &amp;nbsp;I can also understand the motivation to 
&lt;br&gt;&amp;gt; suppress NDEBUG's effect. &amp;nbsp;So, assert ignoring NDEBUG seems good to me. &amp;nbsp;
&lt;br&gt;&amp;gt; I don't yet see much motivation for other options, but I'm not opposed to 
&lt;br&gt;&amp;gt; bison providing them if you think people would find them useful.
&lt;/div&gt;&lt;br&gt;I want assert's output as it can facilitate development and bug reporting, 
&lt;br&gt;so I pushed the following to master, branch-2.5, and branch-2.4.2. &amp;nbsp;I 
&lt;br&gt;decided to simply do `#define aver assert'. &amp;nbsp;I also added gnulib's assert 
&lt;br&gt;module. &amp;nbsp;We can address the remaining concerns later once we've figured 
&lt;br&gt;out what's really needed.
&lt;br&gt;&lt;br&gt;Does anyone feel that these changes are NEWS-worthy?
&lt;br&gt;&lt;br&gt;&amp;gt;From ca01f454f01645533622a59ef0df335ee07679e5 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26787090&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Mon, 14 Dec 2009 18:04:57 -0500
&lt;br&gt;Subject: [PATCH] Enable assertion output and --disable-assert for configure.
&lt;br&gt;&lt;br&gt;* bootstrap.conf (gnulib_modules): Add assert module.
&lt;br&gt;* src/system.h (aver): Define as assert, and summarize the
&lt;br&gt;discussion on this issue.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;7 +++++++
&lt;br&gt;&amp;nbsp;bootstrap.conf | &amp;nbsp; 12 ++++++------
&lt;br&gt;&amp;nbsp;m4/.cvsignore &amp;nbsp;| &amp;nbsp; &amp;nbsp;1 +
&lt;br&gt;&amp;nbsp;m4/.gitignore &amp;nbsp;| &amp;nbsp; &amp;nbsp;1 +
&lt;br&gt;&amp;nbsp;src/system.h &amp;nbsp; | &amp;nbsp; 25 +++++++++++++++++--------
&lt;br&gt;&amp;nbsp;5 files changed, 32 insertions(+), 14 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 549b084..e465744 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,5 +1,12 @@
&lt;br&gt;&amp;nbsp;2009-12-14 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26787090&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	Enable assertion output and --disable-assert for configure.
&lt;br&gt;+	* bootstrap.conf (gnulib_modules): Add assert module.
&lt;br&gt;+	* src/system.h (aver): Define as assert, and summarize the
&lt;br&gt;+	discussion on this issue.
&lt;br&gt;+
&lt;br&gt;+2009-12-14 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26787090&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	Expand GLR acronym in summary of Bison.
&lt;br&gt;&amp;nbsp;	Based on discussion with Akim Demaille starting at
&lt;br&gt;&amp;nbsp;	&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;diff --git a/bootstrap.conf b/bootstrap.conf
&lt;br&gt;index 1cef2f0..dff8d80 100644
&lt;br&gt;--- a/bootstrap.conf
&lt;br&gt;+++ b/bootstrap.conf
&lt;br&gt;@@ -17,12 +17,12 @@
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# gnulib modules used by this package.
&lt;br&gt;&amp;nbsp;gnulib_modules='
&lt;br&gt;- &amp;nbsp;announce-gen argmatch config-h c-strcase configmake dirname error
&lt;br&gt;- &amp;nbsp;extensions fopen-safer gendocs getopt-gnu gettext git-version-gen hash
&lt;br&gt;- &amp;nbsp;inttypes javacomp-script javaexec-script maintainer-makefile malloc
&lt;br&gt;- &amp;nbsp;mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul
&lt;br&gt;- &amp;nbsp;strverscmp unistd unistd-safer unlocked-io update-copyright unsetenv
&lt;br&gt;- &amp;nbsp;verify warnings xalloc xalloc-die xstrndup
&lt;br&gt;+ &amp;nbsp;announce-gen argmatch assert config-h c-strcase configmake dirname
&lt;br&gt;+ &amp;nbsp;error extensions fopen-safer gendocs getopt-gnu gettext
&lt;br&gt;+ &amp;nbsp;git-version-gen hash inttypes javacomp-script javaexec-script
&lt;br&gt;+ &amp;nbsp;maintainer-makefile malloc mbswidth obstack quote quotearg stdbool
&lt;br&gt;+ &amp;nbsp;stpcpy strerror strtoul strverscmp unistd unistd-safer unlocked-io
&lt;br&gt;+ &amp;nbsp;update-copyright unsetenv verify warnings xalloc xalloc-die xstrndup
&lt;br&gt;&amp;nbsp;'
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Additional xgettext options to use. &amp;nbsp;Use &amp;quot;\\\newline&amp;quot; to break lines.
&lt;br&gt;diff --git a/src/system.h b/src/system.h
&lt;br&gt;index 8ea5653..8d2358c 100644
&lt;br&gt;--- a/src/system.h
&lt;br&gt;+++ b/src/system.h
&lt;br&gt;@@ -123,17 +123,26 @@ typedef size_t uintptr_t;
&lt;br&gt;&amp;nbsp;| Assertions. &amp;nbsp;|
&lt;br&gt;&amp;nbsp;`-------------*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-/* &amp;lt;assert.h&amp;gt;'s assertions are too heavyweight, and can be disabled
&lt;br&gt;- &amp;nbsp; too easily, so use aver rather than assert. &amp;nbsp;See discussions at
&lt;br&gt;+/* In the past, Bison defined aver to simply invoke abort in the case of
&lt;br&gt;+ &amp;nbsp; a failed assertion. &amp;nbsp;The rationale was that &amp;lt;assert.h&amp;gt;'s assertions
&lt;br&gt;+ &amp;nbsp; were too heavyweight and could be disabled too easily. &amp;nbsp;See
&lt;br&gt;+ &amp;nbsp; discussions at
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00080.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00080.html&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00111.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00111.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; However, normal assert output can be helpful during development and
&lt;br&gt;+ &amp;nbsp; in bug reports from users. &amp;nbsp;Moreover, it's not clear now that
&lt;br&gt;+ &amp;nbsp; &amp;lt;assert.h&amp;gt;'s assertions are significantly heavyweight. &amp;nbsp;Finally, if
&lt;br&gt;+ &amp;nbsp; users want to experiment with disabling assertions, it's debatable
&lt;br&gt;+ &amp;nbsp; whether it's our responsibility to stop them. &amp;nbsp;See discussion
&lt;br&gt;+ &amp;nbsp; starting at
&lt;br&gt;+ &amp;nbsp; &amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00013.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00013.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; For now, we use assert but we call it aver throughout Bison in case
&lt;br&gt;+ &amp;nbsp; we later wish to try another scheme.
&lt;br&gt;&amp;nbsp;*/
&lt;br&gt;-static inline void
&lt;br&gt;-aver (bool assertion)
&lt;br&gt;-{
&lt;br&gt;- &amp;nbsp;if (! assertion)
&lt;br&gt;- &amp;nbsp; &amp;nbsp;abort ();
&lt;br&gt;-}
&lt;br&gt;+#include &amp;lt;assert.h&amp;gt;
&lt;br&gt;+#define aver assert
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;/*-----------.
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Help-with-create_pipe_bidi-tp24548403p26787090.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26785624</id>
	<title>Re: AT_DATA and AS_ECHO_N (was: Re: Warn about character literals not of length one.)</title>
	<published>2009-12-14T13:53:47Z</published>
	<updated>2009-12-14T13:53:47Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">Hi Eric,
&lt;br&gt;&lt;br&gt;On Fri, 24 Jul 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; I've been meaning to add a new macro to autotest to allow more flexibility in 
&lt;br&gt;&amp;gt; &amp;gt; generating files (no trailing newline, and/or allowing shell expansions) but it 
&lt;br&gt;&amp;gt; &amp;gt; will not be in time for autoconf 2.64. &amp;nbsp;Feel free to ping the autoconf list, so 
&lt;br&gt;&amp;gt; &amp;gt; that I'll have a reminder email.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is it necessary to have a new macro for omitting the trailing newline? &amp;nbsp;
&lt;br&gt;&amp;gt; Couldn't AT_DATA detect whether a trailing newline is present in the 
&lt;br&gt;&amp;gt; expansion and then work whatever magic is necessary to print the last line 
&lt;br&gt;&amp;gt; correctly?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'll try to remember to ping again later.
&lt;/div&gt;&lt;br&gt;I was just clearing out some old emails and noticed that I never pinged 
&lt;br&gt;you about this. &amp;nbsp;Have you had a chance to work on it? &amp;nbsp;I don't see 
&lt;br&gt;anything in NEWS or the manual about it, so I assume you haven't. &amp;nbsp;I'm 
&lt;br&gt;still interested, but I'm afraid I don't have time to help, so don't worry 
&lt;br&gt;about it if you don't have time either.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Warn-about-character-literals-not-of-length-one.-tp24631583p26785624.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26785139</id>
	<title>Re: [PATCH] Document %define lr.type and lr.default_rules.</title>
	<published>2009-12-14T13:19:17Z</published>
	<updated>2009-12-14T13:19:17Z</updated>
	<author>
		<name>Joel E. Denny-4</name>
	</author>
	<content type="html">On Wed, 6 May 2009, Joel E. Denny wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, 6 May 2009, Akim Demaille wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Generate a deterministic LR or GLR parser employing LALR(1),
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; IELR(1), or canonical LR(1) parser tables.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; What do you think?
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I regret that we don't explicit the &amp;quot;generalized&amp;quot; word, but I see your point
&lt;br&gt;&amp;gt; &amp;gt; too. Yet I would say that if the reader is not expected to understand
&lt;br&gt;&amp;gt; &amp;gt; &amp;quot;generalized&amp;quot;, he will probably not understand &amp;quot;canonical&amp;quot; either.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm not sure about that. &amp;nbsp;It is not clear to me that a &amp;quot;generalized 
&lt;br&gt;&amp;gt; parser&amp;quot; or even a &amp;quot;generalized shift/reduce parser&amp;quot; necessarily employs 
&lt;br&gt;&amp;gt; the GLR algorithm. &amp;nbsp;For example, backtracking is another way to generalize 
&lt;br&gt;&amp;gt; LR. &amp;nbsp;However, the meaning of &amp;quot;canonical&amp;quot; from English (the sense of 
&lt;br&gt;&amp;gt; &amp;quot;classic&amp;quot; or &amp;quot;standard&amp;quot;) alone seems sufficient to convey the meaning of 
&lt;br&gt;&amp;gt; &amp;quot;canonical&amp;quot; in &amp;quot;canonical LR&amp;quot;.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; We may also escape the LR repetition with &amp;quot;generate a deterministic or
&lt;br&gt;&amp;gt; &amp;gt; generalized shift/reduce parser employing LALR(1), IELR(1) or LR(1) parser
&lt;br&gt;&amp;gt; &amp;gt; tables&amp;quot;.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Googling/grepping for &amp;quot;GLR&amp;quot; or &amp;quot;canonical LR&amp;quot; would not return a hit for 
&lt;br&gt;&amp;gt; this sentence. &amp;nbsp;That loss bothers me more than repetition of &amp;quot;LR&amp;quot;. &amp;nbsp;What 
&lt;br&gt;&amp;gt; about the following?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;quot;Generate a GLR (generalized LR) or deterministic shift/reduce parser 
&lt;br&gt;&amp;gt; employing LALR(1), IELR(1) or canonical LR(1) parser tables.&amp;quot;
&lt;/div&gt;&lt;br&gt;It's been a long time coming, but I've finally done something about this.
&lt;br&gt;&lt;br&gt;I think this keeps the most important keywords while remaining fairly 
&lt;br&gt;readable:
&lt;br&gt;&lt;br&gt;&amp;nbsp; Generate a deterministic LR or generalized LR (GLR) parser employing
&lt;br&gt;&amp;nbsp; LALR(1), IELR(1), or canonical LR(1) parser tables.
&lt;br&gt;&lt;br&gt;I pushed the following to branch-2.5 and master. &amp;nbsp;We can always revise 
&lt;br&gt;again later if necessary.
&lt;br&gt;&lt;br&gt;From 51c7ca01e2c9cfb5c7a274bed0e14899adbd005c Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Joel E. Denny &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785139&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Mon, 14 Dec 2009 16:04:00 -0500
&lt;br&gt;Subject: [PATCH] Expand GLR acronym in summary of Bison.
&lt;br&gt;&lt;br&gt;Based on discussion with Akim Demaille starting at
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;* doc/bison.texinfo (Introduction): Here.
&lt;br&gt;* src/getargs.c (usage): Here.
&lt;br&gt;---
&lt;br&gt;&amp;nbsp;ChangeLog &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;8 ++++++++
&lt;br&gt;&amp;nbsp;doc/bison.texinfo | &amp;nbsp; &amp;nbsp;7 ++++---
&lt;br&gt;&amp;nbsp;src/getargs.c &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;4 ++--
&lt;br&gt;&amp;nbsp;3 files changed, 14 insertions(+), 5 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog b/ChangeLog
&lt;br&gt;index 03660cf..de7790c 100644
&lt;br&gt;--- a/ChangeLog
&lt;br&gt;+++ b/ChangeLog
&lt;br&gt;@@ -1,3 +1,11 @@
&lt;br&gt;+2009-12-14 &amp;nbsp;Joel E. Denny &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785139&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jdenny@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	Expand GLR acronym in summary of Bison.
&lt;br&gt;+	Based on discussion with Akim Demaille starting at
&lt;br&gt;+	&amp;lt;&lt;a href=&quot;http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html&lt;/a&gt;&amp;gt;.
&lt;br&gt;+	* doc/bison.texinfo (Introduction): Here.
&lt;br&gt;+	* src/getargs.c (usage): Here.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-10-03 &amp;nbsp;Alex Rozenman &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785139&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rozenman@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	Document named references.
&lt;br&gt;diff --git a/doc/bison.texinfo b/doc/bison.texinfo
&lt;br&gt;index b0f391b..1906cd9 100644
&lt;br&gt;--- a/doc/bison.texinfo
&lt;br&gt;+++ b/doc/bison.texinfo
&lt;br&gt;@@ -352,9 +352,10 @@ Copying This Manual
&lt;br&gt;&amp;nbsp;@cindex introduction
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;@dfn{Bison} is a general-purpose parser generator that converts an
&lt;br&gt;-annotated context-free grammar into a deterministic or @acronym{GLR}
&lt;br&gt;-parser employing @acronym{LALR}(1), @acronym{IELR}(1), or canonical
&lt;br&gt;-@acronym{LR}(1) parser tables.
&lt;br&gt;+annotated context-free grammar into a deterministic @acronym{LR} or
&lt;br&gt;+generalized @acronym{LR} (@acronym{GLR}) parser employing
&lt;br&gt;+@acronym{LALR}(1), @acronym{IELR}(1), or canonical @acronym{LR}(1)
&lt;br&gt;+parser tables.
&lt;br&gt;&amp;nbsp;Once you are proficient with Bison, you can use it to develop a wide
&lt;br&gt;&amp;nbsp;range of language parsers, from those used in simple desk calculators to
&lt;br&gt;&amp;nbsp;complex programming languages.
&lt;br&gt;diff --git a/src/getargs.c b/src/getargs.c
&lt;br&gt;index 4231cfc..8f7e668 100644
&lt;br&gt;--- a/src/getargs.c
&lt;br&gt;+++ b/src/getargs.c
&lt;br&gt;@@ -257,8 +257,8 @@ usage (int status)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (_(&amp;quot;Usage: %s [OPTION]... FILE\n&amp;quot;), program_name);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fputs (_(&amp;quot;\
&lt;br&gt;-Generate a deterministic or GLR parser employing LALR(1), IELR(1), or\n\
&lt;br&gt;-canonical LR(1) parser tables.\n\
&lt;br&gt;+Generate a deterministic LR or generalized LR (GLR) parser employing\n\
&lt;br&gt;+LALR(1), IELR(1), or canonical LR(1) parser tables.\n\
&lt;br&gt;&amp;nbsp;\n\
&lt;br&gt;&amp;nbsp;&amp;quot;), stdout);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-- 
&lt;br&gt;1.5.4.3
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Gnu---Bison---Patches-f1505.html&quot; embed=&quot;fixTarget[1505]&quot; target=&quot;_top&quot; &gt;Gnu - Bison - Patches&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--Document--define-lr.type-and-lr.default_rules.-tp23153237p26785139.html" />
</entry>

</feed>
