Script Programming Language/Files: Difference between revisions
No edit summary |
No edit summary |
||
| Line 12: | Line 12: | ||
[[Script Programming Language/Using SC|8]] | | [[Script Programming Language/Using SC|8]] | | ||
[[Script Programming Language/Index|Index]] | [[Script Programming Language/Index|Index]] | ||
</div | </div> | ||
<div align="center"><span style="font-size: 22pt">The Script Programming Language/Introduction</span><br />''Author: [[Jeff Stephenson]]''<br />''1988-04-04''</div></div> | |||
<div align="center"><span style="font-size: 22pt">The Script Programming Language | |||
''Author: [[Jeff Stephenson]]''</div> | |||
<br /> | |||
==<br /> Files == | ==<br /> Files == | ||
<blockquote> | |||
Source files for the script compiler have the extension .sc, header (include) files have the extension .sh. Source files may have any filename -- banner.sc and castle.sc are two examples. The output file from the compilation will have the name script.nnn where nnn is determined from the script# command (covered below) which is present in the file. | Source files for the script compiler have the extension .sc, header (include) files have the extension .sh. Source files may have any filename -- banner.sc and castle.sc are two examples. The output file from the compilation will have the name script.nnn where nnn is determined from the script# command (covered below) which is present in the file. | ||
| Line 28: | Line 25: | ||
===<br /> classdef === | ===<br /> classdef === | ||
<blockquote>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. The user need not be concerned with it.</blockquote> | <blockquote>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. The user need not be concerned with it.</blockquote> | ||
</blockquote> | |||
===<br /> selector === | ===<br /> selector === | ||
<blockquote> | |||
<blockquote>This 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 in included in selector.</blockquote><!-- | <blockquote>This 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 in included in selector.</blockquote><!-- | ||
| Line 37: | Line 37: | ||
===<br /> kernel.sh === | ===<br /> kernel.sh === | ||
<blockquote>This contains the definitions for interfacing with the kernel (the machine language interpreter). It is maintained by the kernel programmers and is automatically included in system.sh.</blockquote> | <blockquote>This contains the definitions for interfacing with the kernel (the machine language interpreter). It is maintained by the kernel programmers and is automatically included in system.sh.</blockquote> | ||
</blockquote> | |||
===<br /> system.sh === | ===<br /> system.sh === | ||
| Line 45: | Line 46: | ||
===<br /> classtbl === | ===<br /> classtbl === | ||
<blockquote> | |||
<blockquote>This is an output file of the compiler which is used by the kernel to determine which script a given class is defined in. You needn't do anything to it other than not delete it.</blockquote> | <blockquote>This is an output file of the compiler which is used by the kernel to determine which script a given class is defined in. You needn't do anything to it other than not delete it.</blockquote> | ||
There are two sc commands for dealing with source code organization: | There are two sc commands for dealing with source code organization: | ||
</blockquote> | |||
==<br /> script#: == | ==<br /> script#: == | ||
<blockquote> | |||
The script# command sets the script number of the output file: | The script# command sets the script number of the output file: | ||
<div class="CodeBlockHeader">Code:</div> | <div class="CodeBlockHeader">Code:</div> | ||
<syntaxhighlight lang="sci"> | <syntaxhighlight lang="sci"> | ||
| Line 61: | Line 65: | ||
sets the output file name to script.004, regardless of the actual name of the source file. | sets the output file name to script.004, regardless of the actual name of the source file. | ||
</blockquote> | |||
==<br /> include: == | ==<br /> include: == | ||
<blockquote> | |||
This includes a header file in the current source file at the current position. | This includes a header file in the current source file at the current position. | ||
| Line 91: | Line 97: | ||
in your autoexec.bat file. | in your autoexec.bat file. | ||
<blockquote> | |||
==<br /> References == | |||
<references /><!-- Do not edit this section. It is autopopulated by <ref></ref> tags --> | |||
==<br /> Also See == | |||
< | |||
* [[:Category:Official Documentation|Official Documentation]] | |||
* [[:Category:Scripting Articles|Scripting Articles]] | |||
| | ||
[[Script Programming Language | Table of Contents]] | [[ Official SCI Documentation]]<br /> | ||
[[The Script Programming Language | Table of Contents]] | |||
<span style="float: left">[[Script Programming Language/Introduction |< Previous: Introduction]]</span><span style="float: right">[[Script Programming Language/Definitions|Next: Definitions >]]</span> | <span style="float: left">[[Script Programming Language/Introduction |< Previous: Introduction]]</span><span style="float: right">[[Script Programming Language/Definitions|Next: Definitions >]]</span> | ||
| | ||
[[Category:References]] | |||
[[Category: | [[Category:Historical Pages]] | ||
[[Category:Scripting]] | [[Category:Development]] | ||
[[Category:Documentation]] | |||
[[Category:Official Documentation]] | |||
[[Category:Technical Info]] | |||
[[Category:Scripting Articles]] | |||
Revision as of 19:33, 28 December 2025
The Original SCI Documentation
Files
Source files for the script compiler have the extension .sc, header (include) files have the extension .sh. Source files may have any filename -- banner.sc and castle.sc are two examples. The output file from the compilation will have the name script.nnn where nnn is determined from the script# command (covered below) which is present in the file.
There are six files besides the source file and any user-defined header files which are involved in a compilation.
classdefThis 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. The user need not be concerned with it.
selector
This 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 in included in selector.
kernel.shThis contains the definitions for interfacing with the kernel (the machine language interpreter). It is maintained by the kernel programmers and is automatically included in system.sh.
system.sh
This contains the definitions for interfacing with the various system classes. It is initially provided by the kernel programmers. If you wish to tweak the system scripts yourself, you will also be responsible for maintaining your copy of system.sh. It should be included in all compiles.
vocab.000
This is the compiled output of vocab.txt, generated by the vocabulary compiler vc. It is automatically included in a compile.
classtbl
This is an output file of the compiler which is used by the kernel to determine which script a given class is defined in. You needn't do anything to it other than not delete it.
There are two sc commands for dealing with source code organization:
script#:
The script# command sets the script number of the output file:
Code:(script# 4)
sets the output file name to script.004, regardless of the actual name of the source file.
include:
This includes a header file in the current source file at the current position.
Code:(include "/sc/foo.sh")or
Code:(include /sc/foo.sh)include the file /sc/foo.sh. Include files may be nested as deeply as desired.
When including a file, the compiler first looks for the file in the current directory. If it fails to find it there, it then looks for it in the directories specified in the environment variable SINCLUDE. This variable is just like the DOS PATH variable -- the directories to search are separated by semi-colons. Thus, if you want the compiler to look for include files in f:/games/sci/system and c:/include if it doesn't find them in the current directory, you put the line
set sinclude=f:\games\sci\system;c\includein your autoexec.bat file.
References
Also See