The SCI Script Compiler

Brian_Provinciano Wohoo!

The script compiler has always worked perfectly when running it once to compile a script. However, when it is used to compile script after script, it could come into problems because certain variables aren't initialized, etc.

For some reason, the debugger doesn't work when running the compiler through SCI Studio, so I went back to using the command line version. After a great deal of debugging, initializing uninitialized variables, freeing unfreed alloced data, and all that stuff, I finally have what I believe to be a completely stable version.

One of my problems was that I did
memset(TotalVar,0,4);
rather than
memset(TotalVar,0,sizeof(TotalVar));

This was causing serious trouble if compiling a script with no locals after one with them.

Also, it would continue the compile even if certain vocabs were missing, then crash out because of the lack of them. It now gives errors and exits rather than warning.

All in all, I finally have what I believe to be a fully stable compiler! It will be released with the next version of SCI Studio (soon), along with long awaited command line version updates. I may release a Mac version of it too, since I wrote it in ANSI C.