Skyrim:Expression Reference

Aus Skript-Wiki
Wechseln zu: Navigation, Suche

<expression>  ::= <and expression> ('||' <and expression>)*

<and expression>   ::= <bool expression> ('&&' <bool expression>)*
<bool expression>  ::= <add expression> (<comparison operator> <add expression>)*
<add expression>   ::= <mult expression> (('+' | '-') <mult expression>)*
<mult expression>  ::= <unary expression> (('*' | '/' | '%') <unary expression>)*
<unary expression> ::= ['-' | '!'] <cast atom>
<cast atom>        ::= <dot atom> ['as' <type>]
<dot atom>         ::= (<array atom> ('.' <array func or id>)*) | <constant>
<array atom>       ::= <atom> ['[' <expression> ']']
<atom>             ::= ('(' <expression> ')') | ('new' <type> '[' <int> ']') | <func or id>
<array func or id> ::= <func or id> ['[' <expression> ']']
<func or id>       ::= <function call> | <identifier> | 'length'

Der elementare Anweisung ist eine Gruppierung von Operatoren, Funktionaufrufen und Variablen, die auf diese Weise zusammen gefügt werden um irgendetwas zu erledigen. Die Operationen befolgen die the Operatorrangfolge, um festzulegen, welche zuerst ausgeführt werden.

Beispiele

<papyrusscript>

fügt 2 dem Wert von 4 mal 10 hinzu (das Ergebnis ist 42)

2 + 4 * 10 </tesscript >
<tesscript >

fügt 2 zu 4 hinzu und multipliziert mit 10 (das Ergebnis ist 60)

(2 + 4) * 10 </tesscript >
<tesscript

ruft eine Funktion auf und erhält eine Property vom Ergebnis

MyFunction().MyProperty </tesscript >
<papyrusscript>

erhält das erste Element im Array, das von der Funktion nach einem Cast zurück gegeben wird. (MyVariable as MyObject).MyFunction()[0]

</tesscript >

Links