Difference between revisions of "SCI/Specifications/SCI in action/Parser"

Jump to navigation Jump to search
Merging of the SCI documentation. Work in progress.
(Merging of the SCI documentation. Work in progress.)
(Merging of the SCI documentation. Work in progress.)
Line 402: Line 402:
==Said specs==
==Said specs==
To test what the player wanted to say, SCI compares <i>T</i><sub>&pi;</sub> with a second tree, <i>T</i><sub>&Sigma;</sub> , which is built from a so-called Said spec. A Said spec is a variable-sized block in SCI memory which consists of a set of byte-sized operators and special tokens (stored in the range 0xf0 to 0xf9) and word groups (in big-endian notation, so that they don't conflict with the operators); it is terminated by the special token 0xff. The meanings of the operators and special tokens are as follows:
To test what the player wanted to say, SCI compares <i>T</i><sub>&pi;</sub> with a second tree, <i>T</i><sub>&Sigma;</sub> , which is built from a so-called Said spec. A Said spec is a variable-sized block in SCI memory which consists of a set of byte-sized operators and special tokens (stored in the range 0xf0 to 0xf9) and word groups (in big-endian notation, so that they don't conflict with the operators); it is terminated by the special token 0xff. The meanings of the operators and special tokens are as follows:
{| border="1"
|Operator
|Byte representation
|Meaning
|----
|,
|f0
|"OR". Used to specify alternatives to words, such as "take, get".
|----
|&
|f1
|Unknown. Probably used for debugging.
|----
|/
|f2
|Sentence part separator. Only two of these tokens may be used, since sentences are split into a maximum of three parts.
|----
|(
|f3
|Used together with ')' for grouping
|----
|)
|f4
|See '('
|----
|[
|f5
|Used together with ']' for optional grouping. "[a]" means "either <i>a</i> or nothing".
|----
|]
|f6
|See '['.
|----
|#
|f7
|Unknown assumed to have been used for debugging, if at all.
|----
|<
|f8
|Semantic reference operator (as in "get < up").
|----
|>
|f9
|Instructs Said() not to claim the event passed  to the previous Parse() call on a match. Used for succesive matching.
|}


==Notes==
==Notes==
<references/>
<references/>
245

edits

Navigation menu