[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ylwrap bug

From: Bruce Korb
Subject: ylwrap bug
Date: Tue, 01 Nov 2011 08:54:14 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11


The bison accepts the option, --header-file=whatever.h
"ylwrap" is a wrapper script meant to canonicalize the invocation
of yacc and bison.  True enough, if you use --header-file you
had better be using bison, but here is the problem:

I am working on a project that will only build in a GNU tools environment.
Therefore, I know that the .l -> .c transformation tool is flex, not
POSIX lex.  The code I am working with presumes that it can use this:
   AM_LFLAGS = @LEX_FL@ --header-file=$(LEX_HEADER) -DYY_NO_INPUT=1
So ylwrap fires off the flex program and it runs just fine, the tiny
problem is that it also removes the temporary directory before I can
salvage the generated header.  This is inconvenient.

So is this:

diff --git a/ b/
index ec3e89b..d8f24f5 100755
--- a/
+++ b/
@@ -1 +1,20 @@
-autoreconf --install --force
\ No newline at end of file
+autoreconf --install --force
+if test -f ylwrap
+    # ylwrap does not preserve the --header-file output.
+    # Help it out.
+    #
+    txt=$(sed 's/$/\\/;$s/.$//' <<- \_EOF_
+       set X *.h
+       case "$2" in
+       y?tab.h | '*.h' ) : ;;
+       * ) mv "$2" .. ;;
+       esac
+       _EOF_
+    )
+    sed -i "/# Remove the directory/a${txt}" ylwrap
+else :

reply via email to

[Prev in Thread] Current Thread [Next in Thread]