Category:LSL 演算子
| LSL ポータル | 関数 | イベント | 型 | 演算子 | 定数 | 実行制御 | スクリプトライブラリ | カテゴリ別スクリプトライブラリ | チュートリアル |
Page recreated to house the future revision of the LSL_Operators page into categorized Content. Please do not delete.
if you're looking for the current version, it may be found at LSL_Operators.
演算子の優先順位 (演算順序)
current rough draft of precedence
| 記号 | 説明 | 結合順 |
|---|---|---|
| () [] |
丸括弧(Parenthesis) リスト・コンストラクタ |
中から外 右から左 |
| , | コンマ | 左から右[1] |
| ++ -- | インクリメント/デクリメント | 右から左 |
| (type) ~ ! - |
型キャスト ビット否定 論理否定 否定 |
右から左 |
| / % * | ^ |
除算 Modulus 乗算 ビット単位 OR ビット単位 XOR |
右から左 |
| + - |
加算/連結 減算 |
右から左 |
| << >> | ビットシフト 左/右 | 右から左 |
| < > <= >= |
より小さい/より大きい 以下/以上 |
右から左 |
| == != | 等しい/等しくない | 右から左 |
| & | ビット単位 AND | 右から左 |
| ^ | ビット単位 XOR | 右から左 |
| | | ビット単位 OR | 右から左 |
| && || | 論理積 / 論理和 | 右から左 |
| = += -= /= %= *= |
代入 加算代入/減算代入/除算代入/Modulo/乗算代入 |
右から左[1] |
- ^ コンマと代入演算子は特別なケースです。コンマは全ての演算子を左に進めます。 しかし、丸括弧や角括弧で括られた中では、順番通りに計算します。
<lsl>//-- example: float a; float b; float c;
string uExample( float x, float y ){
return (string)x + " " + (string)y;
}
default{
state_entry(){
string vStrReport = "\n" + (string)(++a) + " " + (string)(++a); //-- first line reports "2.000000 1.000000"
vStrReport += "\n" + (string)[++b, " ", ++b]; //-- second line reports "1.000000 2.000000"
vStrReport += "\n" + uExample( ++c, ++c ); //-- third line reports "1.000000 2.000000"
llOwnerSay( vStrReport );
}
}</lsl> Assigment operators Demote all precedences to the Left of them (but obey all precedences below above increment/decrement. <lsl>//-- example: integer a = 0;
default{
state_entry(){
llOwnerSay( (string)(++a + a *= ++a) ); //-- yields "3" instead of "4"
}
}</lsl>
右から左
- Placeholder for commentary about the LSL compiler and LSO R2L implications.
This category currently contains no pages or media.