Operator precedence: Difference between revisions

Add Ecstasy table
(Update Lang example: Add the optional get item operator)
(Add Ecstasy table)
 
Line 858:
=={{header|Delphi}}==
See table at [[#Free Pascal|Free Pascal]].
 
=={{header|Ecstasy}}==
 
Ecstasy's precedence table is based loosely on the C family of languages, but with significant tweaks to support the most common patterns without parenthesis. At a given level of precedence, all evaluation is from left to right.
 
{| class="wikitable"
! Order !! Operator !! Description !! Associativity
|-
| 1 || & || Unary reference-of, based on C syntax || Right-to-left
|-
| 2 || ++ || Post-increment || Left-to-right
|-
| || -- || Post-decrement ||
|-
| || () || Invoke method / call function ||
|-
| || [] || Array access ||
|-
| || ? || Postfix conditional ||
|-
| || . || Access object member ||
|-
| || .new || Postfix object creation ||
|-
| || .as || Postfix type assertion ||
|-
| || .is || Postfix type comparison ||
|-
| 3 || ++ || Pre-increment || Right-to-left
|-
| || -- || Pre-decrement ||
|-
| || + || Unary plus ||
|-
| || - || Unary minus ||
|-
| || ! || Logical NOT ||
|-
| || ~ || Bitwise NOT ||
|-
| 4 || ?: || Conditional "Elvis" || Right-to-left
|-
| 5 || * || Multiply || Left-to-right
|-
| || / || Divide ||
|-
| || % || Modulo ||
|-
| || / || Divide with remainder ||
|-
| 6 || + || Add || Left-to-right
|-
| || - || Subtract ||
|-
| 7 || << || Shift left || Left-to-right
|-
| || >> || Arithmetic shift right ||
|-
| || >>> || Logical shift right ||
|-
| || & || And ||
|-
| || ^ || Xor ||
|-
| || <nowiki>|</nowiki> || Or ||
|-
| 8 || .. || Range/intervale || Left-to-right
|-
| 9 || <- || Assignment || Right-to-left
|-
| 10 || < <= > >= || Relational || Left-to-right
|-
| || <=> || Order ||
|-
| 11 || == || Equality || Left-to-right
|-
| || != || Inequality ||
|-
| 12 || && || Conditional AND || Left-to-right
|-
| 13 || ^^ || Conditional XOR || Left-to-right
|-
| || <nowiki>||</nowiki> || Conditional OR ||
|-
| 14 || ? : || Conditional ternary || Right-to-left
|-
| 15 || : || Conditional ELSE || Right-to-left
|}
 
=={{header|Eiffel}}==
162

edits