[Win32utils-devel] [OT] Byacc error

Heesob Park phasis at gmail.com
Wed Jun 25 21:07:11 EDT 2008


2008/6/26 Berger, Daniel <Daniel.Berger at qwest.com>:
> Hi all,
> Yeah, I'm going OT here...
> I'm not entirely sure I understand how Ruby builds parse.y on Windows,
> but it works. However, when I changed all instances of "Ruby" to
> "Sapphire", and renamed all the source files, I suddenly started getting
> this error:
> byacc  ./parse.y
> 'byacc' is not recognized as an internal or external command,
> operable program or batch file.
> NMAKE : fatal error U1077: 'byacc' : return code '0x1'
> Stop.
> Does anyone have any idea what would cause that?
It is due to the time discrepancy of parse.y and parse.c.
As far as I know, the Ruby source distribution comes with parse.y and
parse.c for the lacking of yacc of windows.

You can find following lines in win32/Makefile.sub

	$(YACC) $(YFLAGS) $(<:\=/)
	sed -e "s!^ *extern char \*getenv();!/* &
*/!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $@
	@del y.tab.c

I guess if you make both parse.y and parse.c same file time, it will skip byacc.

If you would like to build with byacc, you can install byacc.
Refer to http://gnuwin32.sourceforge.net/packages/byacc.htm


Park Heesob

More information about the win32utils-devel mailing list