Difference between revisions of "The Script Programming Language/Files"

From SCI Wiki
Jump to navigationJump to search
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
== <br />Files ==
+
[[The Original SCI Documentation]]<br />
  
 +
<div align="center">
 +
Chapter:
 +
[[The Script Programming Language/Introduction|1]] |
 +
[[The Script Programming Language/Files|2]] |
 +
[[The Script Programming Language/Definitions|3]] |
 +
[[The Script Programming Language/Data Types and Variables|4]] |
 +
[[The Script Programming Language/Primitive Procedures|5]] |
 +
[[The Script Programming Language/Control Flow|6]] |
 +
[[The Script Programming Language/Procedures|7]] |
 +
[[The Script Programming Language/Using SC|8]] |
 +
[[The Script Programming Language/Index|Index]]
 +
</div><br />
 +
 +
<div align="center"><span style="font-size: 22pt">The Script Programming Language</span><br />
 +
<span style="font-size: 22pt">Files</span><br />
 +
''Author: [[Jeff Stephenson]]''</div>
 +
 +
&nbsp;
 +
 +
==<br /> 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.
 
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.
+
There are six files besides the source file and any user-defined header files which are involved in a compilation.<br />
 +
&nbsp;
  
 
===<br /> classdef ===
 
===<br /> classdef ===
Line 9: Line 30:
  
 
===<br /> selector ===
 
===<br /> selector ===
<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><!--
 +
 
 +
===<br /> base.sh ===
 +
<blockquote> </blockquote> -->
  
 
===<br /> kernel.sh ===
 
===<br /> kernel.sh ===
Line 25: Line 49:
 
There are two sc commands for dealing with source code organization:
 
There are two sc commands for dealing with source code organization:
  
===<br /> script#: ===
+
==<br /> script#: ==
  
 
The script# command sets the script number of the output file:
 
The script# command sets the script number of the output file:
Line 36: Line 60:
 
</blockquote>
 
</blockquote>
  
sets the output file name to script.004, regardless of the actual name of  
+
sets the output file name to script.004, regardless of the actual name of the source file.
the source file.
 
  
===<br /> include: ===
+
==<br /> include: ==
 
   
 
   
 
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 64: Line 87:
 
   
 
   
 
<blockquote>
 
<blockquote>
<div class="CodeBlockHeader">Code:</div>
+
<code>set sinclude=f:\games\sci\system;c\include</code>
<syntaxhighlight lang="sci">
 
set sinclude=f:/games/sci/system;c:/include  
 
</syntaxhighlight>
 
 
</blockquote>
 
</blockquote>
  
Line 74: Line 94:
 
&nbsp;
 
&nbsp;
  
[[Adventure Game Interpreter Specifications|Table of Contents]]
+
;Notes
 +
<references />
 +
 
 +
&nbsp;
 +
 
 +
[[The Script Programming Language | Table of Contents]]
 +
 
 +
&nbsp;
 +
 
 +
<span style="float: left">[[The Script Programming Language/Introduction |&lt; Previous: Introduction]]</span><span style="float: right">[[The Script Programming Language/Definitions|Next: Definitions &gt;]]</span>
 +
 
 +
&nbsp;
 +
 
 +
[[Category:SCI Documentation]]
 +
[[Category:Scripting]]

Latest revision as of 20:13, 2 December 2015

The Original SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Index


The Script Programming Language

Files

Author: Jeff Stephenson

 


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.
 


classdef

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.


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.sh

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.


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\include

in your autoexec.bat file.

 

Notes


 

Table of Contents

 

< Previous: IntroductionNext: Definitions >