<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
On Sat, 2011-09-03 at 11:34 -0700, Alan Coopersmith wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
bison 2.3b added %name-prefix "prefix" and deprecated the older
%name-prefix="prefix" form, but we don't have a check for the bison
version in autoconf.
Without this fix, older bison gives the cryptic error:
.../src/laygram.y:1.14-20: syntax error, unexpected string, expecting =
Signed-off-by: Alan Coopersmith <<A HREF="mailto:alan.coopersmith@oracle.com">alan.coopersmith@oracle.com</A>>
---
Tested on Solaris with bison 2.3, not tested on a later bison with the new
syntax supported. I'm not sure this is the best way to do this, but it
works for me - if anyone has a better idea, lets hear it.
src/laygram.y | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/laygram.y b/src/laygram.y
index 3644dd4..48cbc16 100644
--- a/src/laygram.y
+++ b/src/laygram.y
@@ -1,4 +1,4 @@
-%name-prefix "LayYY"
+%name-prefix="LayYY"
%defines
%{
#include <X11/Xlib.h>
</PRE>
</BLOCKQUOTE>
I have tested the following 3 options on Linux with bison 2.4.1:<BR>
<BR>
1) The patch, as is. Works as advertised.<BR>
<BR>
2) Using <B>AM_YFLAGS = -d -p "LayYY</B>" in lieu of <B>%name-prefix "LayYY"</B> in laygram.y. Looks the same as with the patch to me.<BR>
<BR>
3) Removing all traces of LayYY. It builds, but I have no idea if it is correct. No other modules using lex & yacc use this prefix. I suppose we don't know why it was done in the first place. The stripped library has the same size, so it's a good start.<BR>
<BR>
<BLOCKQUOTE>
<PRE>
diff --git a/src/Layout.c b/src/Layout.c
index 398d9ac..d6c5613 100644
--- a/src/Layout.c
+++ b/src/Layout.c
@@ -98,9 +98,9 @@ static void LayoutLayout (LayoutWidget, Bool);
static void LayoutGetNaturalSize (LayoutWidget, Dimension *, Dimension *);
static void LayoutFreeLayout (BoxPtr);
-extern void LayYYsetsource(char *);
-extern void LayYYsetdest(LayoutPtr *);
-extern int LayYYparse(void);
+extern void yysetsource(char *);
+extern void yysetdest(LayoutPtr *);
+extern int yyparse(void);
#ifdef MOTIF
#define SuperClass ((ConstraintWidgetClass)&xmManagerClassRec)
@@ -211,11 +211,11 @@ CvtStringToLayout (Display *dpy, XrmValue *args, Cardinal *num_args,
{
static BoxPtr tmp;
- LayYYsetsource ((char *) from->addr);
+ yysetsource ((char *) from->addr);
if (!to->addr) to->addr = (XtPointer)&tmp;
- LayYYsetdest ((BoxPtr *) to->addr);
+ yysetdest ((BoxPtr *) to->addr);
to->size = sizeof (BoxPtr *);
- return LayYYparse() ? FALSE : TRUE;
+ return yyparse() ? FALSE : TRUE;
}
/*ARGSUSED*/
diff --git a/src/laygram.y b/src/laygram.y
index 48cbc16..6fe3c6e 100644
--- a/src/laygram.y
+++ b/src/laygram.y
@@ -1,4 +1,3 @@
-%name-prefix="LayYY"
%defines
%{
#include <X11/Xlib.h>
@@ -12,8 +11,6 @@
#include <X11/Xmu/Converters.h>
#include <X11/Xaw3d/LayoutP.h>
-#define yysetdest LayYYsetdest
-#define yywrap LayYYwrap
static LayoutPtr *dest;
diff --git a/src/laylex.l b/src/laylex.l
index e357207..27727c0 100644
--- a/src/laylex.l
+++ b/src/laylex.l
@@ -1,4 +1,3 @@
-%option prefix="LayYY"
%option outfile="lex.yy.c"
%{
#ifndef FLEX_SCANNER
@@ -14,10 +13,6 @@
#include <X11/Xaw3d/LayoutP.h>
#include "laygram.h"
-#define yylval LayYYlval
-#define yyerror LayYYerror
-#define yysetsource LayYYsetsource
-
static char *yysourcebase, *yysource;
#ifndef FLEX_SCANNER
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>