Date: Tue, 11 Mar 1997 23:29:24 +0200 (IST) From: Eli Zaretskii To: Gregory Allen cc: djgpp AT delorie DOT com Subject: Re: bison asks for .\shared\bison.simple In-Reply-To: <3324F40C.20FC@hawaii.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 10 Mar 1997, Gregory Allen wrote: > I'm using bison for a school project, and I was wondering -- why does > bison fail if it can't find .\shared\bison.simple ? > > I found only bison.sim in the Bsn124b.zip archive from the djgpp > archives. I made a shared dir, and I copied that file into the new dir > as bison.simple, thinking that the dos extension may have truncated it. > No more complaints when I run bison. 1st Q: Was this the correct thing > to do? No, it's not how it's supposed to work. You should have set the environment variable BISON_SIMPLE to point to the full pathname of that file, and then you could put it anywhere you like. The /share subdirectory is the default place built into Bison (that's where that file is usually placed on Unix), but on MSDOS it is inconvenient: if you have more than one disk drive, you'd need to duplicate it on each drive. If you have the standard DJGPP installation (djdev201.zip) you should have a file DJGPP.ENV that already sets BISON_SIMPLE to point to the lib directory where bison.sim unzips. In that case, please make sure that you preserve the directory structure when you unzip bsn124b.zip (did you use the -d switch to PKUNZIP?). And btw, you don't need to bother about the truncation of the filename unless you run Bison from the DOS box on Windows 95. > Now I move to my source file directory and run bison, and I again have > the same error. So when I run bison, I now have to provide a full > pathname to my src file. 2nd Q: Can I change this with a environment > variable, so bison finds, or ignores shared\bison.simple? Yes, see above. > 3rd Q: (trivia fodder for me) what purpose does the bison.simple file > have, and why hard-code it's location? It holds the skeleton of the parser generated by Bison. It is on a file to keep the Bison binary from being much larger, and to let you change the skeleton without recompiling Bison. When Bison generates the parser according to your grammar (blabla.y), it replaces some placeholders in the skeleton (look for the dollar signs) with your code. The hard-coded place is just a default, like I explained above.