The SCI Compiler¶
New with SCICompanion version 3, the compiler supports a syntax (which we’ll call Sierra Script) that is nearly identical to the original script that was used by Sierra.
SCI is an object-oriented language with message passing semantics (like Objective-C or SmallTalk). Syntactically, it looks a lot like LISP (due to the plethora of parentheses).
One difference that will be programmers familiar with C++, C# or java, is that expressions use Prefix notation instead of Infix notation. For instance, to add two numbers together and assign them to a variable in C#, might look like this:
// C#
int i = 5 + 6;
But in SCI script it looks like:
; SCI
(= i (+ 5 6))
The topics below describe all the various language features and syntax.
- Differences from SCI Studio syntax
- Classes and instances
- Properties
- Procedures
- Public exports
- Variables
- Variable types
- Comments
- define and enum
- include
- use
- Strings
- said strings
- Synonyms
- Selectors
- self and super
- return
- Assignment operators
- Arithmetic Operators
- Bitwise operators
- Relational operators
- Other operators
- Conditional expressions
- if statements
- cond statements
- switch statement
- switchto statement
- while statement
- repeat statement
- for loop
- break and breakif statements
- continue and contIf statements
- &rest
- Inline assembly
- Object files
- Accessing an object’s header