|
|
(18 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | [[The Original SCI Documentation]]<br /> | + | [[Official SCI Documentation]]<br /> |
| | | |
| <div align="center"><span style="font-size: 22pt">The Script Programming Language</span><br /> | | <div align="center"><span style="font-size: 22pt">The Script Programming Language</span><br /> |
Line 5: |
Line 5: |
| Date: 4 April 1988</div> | | Date: 4 April 1988</div> |
| | | |
− | *[[The Script Programming Language#Introduction | Introduction]] | + | <blockquote> |
| + | *[[The Script Programming Language/Introduction | Introduction]] |
| *[[The Script Programming Language/Files | Files]] | | *[[The Script Programming Language/Files | Files]] |
| *[[The Script Programming Language/Definitions | Definitions]] | | *[[The Script Programming Language/Definitions | Definitions]] |
Line 19: |
Line 20: |
| *[[The Script Programming Language/Using SC | Using SC]] | | *[[The Script Programming Language/Using SC | Using SC]] |
| *[[The Script Programming Language/Index | Index]] | | *[[The Script Programming Language/Index | Index]] |
− |
| |
− |
| |
− |
| |
− | ==<br /> Introduction ==
| |
− |
| |
− | The Script adventure game language is an object-oriented language with a Lisp-like syntax. It is compiled by the sc compiler into the pseudo-code which is used by the interpreter, sci.
| |
− |
| |
− | We will begin our discussion of the language with its basic Lisp-like characteristics, then go on to the object-oriented parts of the language.
| |
− |
| |
− | As is Lisp, Script is based on parenthesized expressions which return values. An expression is of the form
| |
− |
| |
− | <blockquote>
| |
− | <div class="CodeBlockHeader">Code:</div>
| |
− | <syntaxhighlight lang="sci">
| |
− | (procedure [parameter parameter ...]).
| |
− | </syntaxhighlight>
| |
| </blockquote> | | </blockquote> |
| | | |
− | The parameters to a procedure may themselves be expressions to be evaluated, and may be nested until you lose track of the parentheses. | + | <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 /> |
| | | |
− | Unlike Lisp, the procedure itself may NOT be the result of an evaluation. An example of an expression is
| + | * [[Media:SCRIPT.pdf|Download The Script Programming Language in PDF Form]]<br /> |
| | | |
− | <blockquote>
| |
− | <div class="CodeBlockHeader">Code:</div>
| |
− | <syntaxhighlight lang="sci">
| |
− | (+ (- y 2) (/ x 3))
| |
− | </syntaxhighlight>
| |
− | </blockquote>
| |
| | | |
− | which would be written in infix notation as
| + | |
− | | |
− | <blockquote>
| |
− | <div class="CodeBlockHeader">Code:</div>
| |
− | <syntaxhighlight lang="sci">
| |
− | (y - 2) + (x / 3).
| |
− | </syntaxhighlight>
| |
− | </blockquote>
| |
| | | |
− | All expressions are guaranteed to be evaluated from left to right. Thus,
| + | <span style="float: left"><span class="Inactive">< Previous: </span></span><span style="float: right">[[The Script Programming Language/Introduction|Next: Introduction >]]</span> |
| | | |
− | <blockquote>
| + | |
− | <div class="CodeBlockHeader">Code:</div>
| |
− | <syntaxhighlight lang="sci">
| |
− | (= x 4)
| |
− | (= y (/ (+= x 4) (/= x 2)))
| |
− | </syntaxhighlight>
| |
− | </blockquote>
| |
− | | |
− | will result in y = 2 and x = 4.
| |
− | | |
− | Comments in Script begin with a semi-colon, ';', and continue to the end of the line.
| |
− | | |
− | == <br />Files ==
| |
− | | |
− | == <br /> Definitions ==
| |
− | | |
− | ==<br /> Data Types and Variables ==
| |
− | | |
− | == <br /> Primitive Procedures ==
| |
− | | |
− | ==<br /> Control Flow ==
| |
− | | |
− | ==<br /> Procedures ==
| |
− | | |
− | ==<br /> Using SC ==
| |
− | | |
− | == <br />Index ==
| |
| | | |
− | ! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| + | [[Category:SCI Documentation]] |
− | != . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| + | [[Category:Scripting]] |
− | + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | += . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | -- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | -= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | <nowiki>*</nowiki> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | <nowiki>*=</nowiki> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | /= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | ^ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | ^= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | < . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | << . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | <<= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | <= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | == . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | >= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | >> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | >>= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | & . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | &= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | &rest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20<br />
| |
− | | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | |= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | ~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | arithmetic primitives . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9<br />
| |
− | arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9<br />
| |
− | assignment primitives . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
| |
− | base.sh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
| |
− | boolean primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
| |
− | breakif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
| |
− | characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
| |
− | classdef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
| |
− | classtbl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
| |
− | cond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
| |
− | conditionals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
| |
− | contif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />
| |
− | continue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />
| |
− | define . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
| |
− | enum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
| |
− | extern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21<br />
| |
− | for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
| |
− | global . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
| |
− | if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
| |
− | include . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
| |
− | iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
| |
− | kernal.sh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
| |
− | local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
| |
− | mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
| |
− | not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
| |
− | options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />
| |
− | or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
| |
− | pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />
| |
− | procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19, 20<br />
| |
− | public . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22<br />
| |
− | repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
| |
− | return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
| |
− | sc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />
| |
− | script# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
| |
− | selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
| |
− | <nowiki> literal</nowiki> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
| |
− | SINCLUDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
| |
− | switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
| |
− | synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
| |
− | text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />
| |
− | variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
| |
− | <nowiki> global</nowiki> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
| |
− | <nowiki> local</nowiki> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
| |
− | <nowiki> temporary</nowiki> . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 19<br />
| |
− | vocab.000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
| |
− | while . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
| |
− | word strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
| |