SCI Programming Language/Files
Author: Jeff Stephenson
Source files for the script compiler traditionally have the extension .sc. Header (include) files traditionally have the extension .sh. Message editor header files traditionally have the extension .shm. Source files may have any filename; two examples are banner.sc and castle.sc. The two output files from the compilation will have the names number.scr and number.hep where number is the script# (defined below) of the module. Following are other files (besides the source file and any user-defined header files) which are involved in a compilation.
This file contains the information about the structure of the classes which have been defined in the application. It is read automatically by the compiler and is rewritten by the compiler after a successful compilation in order to keep it up to date.
This file contains definitions of selectors which are used in object-oriented programming. It is automatically included in a compile and, like classdef, is rewritten after a successful compile. Any symbol in a properties or methods statement or in the selector position in a send to an object is assumed to be a selector and is assigned a selector number included in selector.
This contains the definitions for interfacing with the various system classes and procedures. It also contains the system global variable definitions and defines for keycodes, script numbers, etc. It is automatically included in all compiles.
This contains the definitions for interfacing with the kernel.
This is the game-specific header file. It contains global variables, procedure declarations, and definitions for an individual game. It is automatically included in the compile after system.sh.
This is a text file produced by the compiler that is used by a BRIEF macro to browse the SCI class system.
This is a text file that contains a list of class-selector pairs for frequently used properties. It is used by the compiler to produce 994.voc.
For each class-selector pair in offsets.txt, the compiler writes an entry to this file containing the offset of that property in an SCI object. With this information, the interpreter can access a frequently used property without going through the message-passing mechanism. It is generated by the compiler when the -0 command line parameter is used.
This is the class table. It specifies the number of the script files that contain each class.
This file contains the names of selectors. It is only used by the debugger and in printing error messages.
This read-only file serves as a semaphore, indicating that a compile is occurring in the current directory. This prevents two compiles from trying to do the same task concurrently (updating the same classdef, for instance). $$$sc.lck is created at the beginning of a compile and deleted at the end.
The following two SCI commands deal with source code organization:
The script# command sets the script number of the output file.
sets the output file names to 4.scr and 4.hep, regardless of the actual name of thesource file.
(scriptID 86 0)
Unknown hand written note
This includes a header file in the current source file at the current position.
includes the file /sc/foo.sh. Include files may be nested as deeply as desired.
When compiling or including a file, the compiler first looks in the current directory. If it fails to find it there, it next looks for the file in the directories specified in the environment variable sinclude. This variable is just like the DOS path variable. The search directories are separated by semicolons. To set the compiler to look for include files in f:/games/scilsystem and c:/include if it doesn't find them in the current directory, add the line:
to your autoexec.bat file.