[Win32utils-devel] [OT] Byacc error

Berger, Daniel Daniel.Berger at qwest.com
Wed Jun 25 16:17:28 EDT 2008

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'

Does anyone have any idea what would cause that?

Here's the code I used:

# rename.rb
require 'fileutils'

Dir['sapphire/**/*'].each{ |file|
   # Skip directories
   next unless File.file?(file)

   # Rename 'ruby.h' to 'sapphire.h', for example
   if File.basename(file) =~ /ruby/
      old_file = file.dup
      file = File.join(File.dirname(file),
File.basename(file).gsub('ruby', 'sapphire'))
      File.rename(old_file, file)

   ruby_found = false

   # Do a pass over the file first, looking for 'ruby'.
   IO.foreach(file){ |line|
      if line =~ /ruby/i
         ruby_found = true

   # Skip over files that don't contain the word 'ruby'
   next unless ruby_found

   # Create a temp file
   new_file = file + '.temp'
   FileUtils.cp(file, new_file)

   fh = File.open(new_file, 'wb')

   # Replace all instances of 'Ruby' with 'Sapphire', preserving case
   IO.foreach(file){ |line|
      line.gsub!('ruby', 'sapphire')
      line.gsub!('Ruby', 'Sapphire')
      line.gsub!('RUBY', 'SAPPHIRE')
      fh.print line


   # Rename the temp file to the original file
   File.rename(new_file, file)

This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.

More information about the win32utils-devel mailing list