+2011-12-19 Thomas E. Dickey <tom@invisible-island.net>
+
+ * package/debian/changelog, package/byacc.spec, VERSION: bump
+
+ * yacc.1, output.c, main.c, defs.h:
+ add "-s" option to suppress generating #define's based on string contents
+ in a %token statement. For instance
+ %token EQLS "Equals"
+ would generate
+ #define EQLS 256
+ #define Equals 257
+ Simply suppressing the second #define makes the behavior closer to yacc.
+ (report by Paulo Andrade).
+
2011-09-08 Thomas E. Dickey <tom@invisible-island.net>
* package/debian/changelog, package/byacc.spec, VERSION: bump
-/* $Id: defs.h,v 1.35 2011/09/07 08:55:03 tom Exp $ */
+/* $Id: defs.h,v 1.36 2011/12/20 01:31:16 tom Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
extern char iflag;
extern char lflag;
extern char rflag;
+extern char sflag;
extern char tflag;
extern char vflag;
extern const char *symbol_prefix;
-/* $Id: main.c,v 1.36 2011/09/06 22:44:45 tom Exp $ */
+/* $Id: main.c,v 1.37 2011/12/20 01:37:40 tom Exp $ */
#include <signal.h>
#include <unistd.h> /* for _exit() */
char lflag;
static char oflag;
char rflag;
+char sflag;
char tflag;
char vflag;
rflag = 1;
break;
+ case 's':
+ sflag = 1;
+ break;
+
case 't':
tflag = 1;
break;
-/* $Id: output.c,v 1.41 2011/09/08 09:25:40 tom Exp $ */
+/* $Id: output.c,v 1.42 2011/12/20 01:38:18 tom Exp $ */
#include "defs.h"
for (i = 2; i < ntokens; ++i)
{
s = symbol_name[i];
- if (is_C_identifier(s))
+ if (is_C_identifier(s) && (!sflag || *s != '"'))
{
fprintf(fp, "#define ");
c = *s;
Summary: byacc - public domain Berkeley LALR Yacc parser generator
%define AppProgram byacc
-%define AppVersion 20110908
+%define AppVersion 20111219
%define UseProgram yacc
-# $XTermId: byacc.spec,v 1.10 2011/09/08 09:45:02 tom Exp $
+# $XTermId: byacc.spec,v 1.11 2011/12/20 01:53:34 tom Exp $
Name: %{AppProgram}
Version: %{AppVersion}
Release: 1
+byacc (20111219) unstable; urgency=low
+
+ * add "-s" option.
+
+ -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 19 Dec 2011 20:54:09 -0500
+
byacc (20110908) unstable; urgency=low
* add "-i" option.
-.\" $Id: yacc.1,v 1.12 2011/09/08 00:40:44 tom Exp $
+.\" $Id: yacc.1,v 1.13 2011/12/20 01:46:19 tom Exp $
.\"
.\" .TH YACC 1 "July\ 15,\ 1990"
.\" .UC 6
.IR y.tab.c.
The prefix "\fIy.\fP" can be overridden using the \fB\-b\fP option.
.TP
+.B \-s
+suppress "\fB#define\fP" statements generated for string literals in
+a "%token" statement, to more closely match original \fByacc\fP behavior.
+.TP
.B \-t
The
.B \-t