*BSD News Article 29360


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!library.ucla.edu!agate!asami
From: asami@cs.berkeley.edu (Satoshi ASAMI)
Newsgroups: comp.os.386bsd.questions
Subject: Re: yacc lex and *BSD how to get it working
Date: 15 Apr 94 02:28:17
Organization: CS Div. - EECS, University of California, Berkeley, CA 94720
Lines: 104
Message-ID: <ASAMI.94Apr15022817@forgery.cs.berkeley.edu>
References: <1994Apr14.144305.16368@news.uit.no>
NNTP-Posting-Host: forgery.cs.berkeley.edu
In-reply-to: finns@cc.uit.no's message of Thu, 14 Apr 1994 06:43:05 PST

In article <1994Apr14.144305.16368@news.uit.no>
        finns@cc.uit.no (Finn Stensvik) writes:

 * lex get a parse-error when chewing on a file produced by yacc.
 * 
 * The errormsg is:
 * lex.l:90: parse error before '1'

This is because the grammar file tries an yywrap() when it is already
defined as a macro or something.  I just commented it out, the "real"
way to solve it is to #ifndef yywrap or something.

 * If I'm not to mistaken, others have had this problem too.
 * 
 * Is there someone out there with a longer memory than mine, who remember
 * what the solution was?

I don't have a longer memory than yours, but I happened to save the
patch I needed to compile piewm on FreeBSD.  It should be more or less
the same for tvtwm (but you obviously need to take out the parts about
xpm).  If it works for you, please post how it goes.

Satoshi (FreeBSD 1.1-BETA on a 486PC)
asami@cs.berkeley.edu
---
--- piewm/gram.y.org    Wed Oct  7 23:41:14 1992
+++ piewm/gram.y        Mon Mar 21 02:19:39 1994
@@ -71,7 +71,7 @@
 extern int do_single_keyword(), do_string_keyword(), do_number_keyword();
 extern name_list **do_colorlist_keyword();
 extern int do_color_keyword();
-extern int yylineno;
+int yylineno;
 %}
 
 %union
--- piewm/menus.c.org   Sun Nov 15 10:04:29 1992
+++ piewm/menus.c       Mon Mar 21 02:19:40 1994
@@ -673,7 +673,7 @@
        FD_ZERO(&exceptfds); FD_SET(fd, &exceptfds); 
 
        if (!deferred) {
-           select(fd + 1, &readfds, &exceptfds, NULL);
+           select(fd + 1, &readfds, NULL, &exceptfds, NULL);
        } else {
            gettimeofday(&now_time, NULL);
            now_time.tv_sec -= start_time.tv_sec;
--- piewm/Imakefile.org Mon Nov 23 15:50:01 1992
+++ piewm/Imakefile     Mon Mar 21 03:08:43 1994
@@ -22,10 +22,10 @@
 /**/# <X11/xpm.h>.
 /**/#
 
-       PIEWMDIR = /usr/local/lib/piewm
+       PIEWMDIR = /usr/local/X11/lib/X11/piewm
          XPMLIB        = -L../xpm -lXpm
         XPM_DEF = -DXPM -I../xpm
-    XLOADIM_DEF = -DXLOADIMAGE=\"/usr/local/bin/xloadimage\"
+    XLOADIM_DEF = -DXLOADIMAGE=\"/usr/local/X11/bin/xloadimage\"
         MATHLIB = -lm
 
 /**/#   Ultrix doesn't have a mkstemp in libc...
@@ -36,7 +36,7 @@
   LOCAL_DEFINES = $(XPM_DEF)
 #endif
 
-LOCAL_LIBRARIES = $(XMULIB) $(EXTENSIONLIB) $(XPMLIB) $(XLIB) $(MATHLIB)
+LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(EXTENSIONLIB) $(XPMLIB) $(XLIB) $(MATHLIB)
        LINTLIBS = $(LINTXMU) $(LINTEXTENSIONLIB) $(LINTXLIB)
         DEFINES = ExtensionDefines $(LOCAL_DEFINES) $(SIGNAL_DEFINES)
 
@@ -61,8 +61,8 @@
 ComplexProgramTarget(piewm)
 NormalProgramTarget(ssetroot,ssetroot.o,,$(LOCAL_LIBRARIES),)
 
-MakeDirectories(install,$(TWMDIR))
-InstallNonExec(system.twmrc,$(TWMDIR))
+MakeDirectories(install,$(PIEWMDIR))
+InstallNonExec(system.twmrc,$(PIEWMDIR))
 /**/# InstallNamedProg(ssetroot,xsetroot,$(BINDIR))
 
 gram.h gram.c: gram.y
--- piewm/lex.l.org     Mon Mar 21 02:31:51 1994
+++ piewm/lex.l Mon Mar 21 02:31:58 1994
@@ -88,7 +88,7 @@
                                  ParseError = 1;
                                }
 %%
-yywrap() { return(1);}
+/* yywrap() { return(1);} */
 
 #undef unput
 #undef input
--- xpm/Imakefile.org   Mon Nov 23 15:30:24 1992
+++ xpm/Imakefile       Mon Mar 21 02:19:40 1994
@@ -24,7 +24,7 @@
 ## if your system doesn't provide strcasecmp add -DNEED_STRCASECMP
 ## if your system doesn't provide strdup add -DNEED_STRDUP
 ## if your system doesn't provide pipe remove -DZPIPE
-DEFINES = -DZPIPE -DNEED_STRDUP
+DEFINES = -DZPIPE
 
 HEADERS = xpm.h
   SRCS1 = data.c create.c misc.c rgb.c scan.c parse.c \