Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EDT:EGL Language Operators and Expressions"
Line 160: | Line 160: | ||
#We'll have functions in the array type to provide similar behavior. | #We'll have functions in the array type to provide similar behavior. | ||
#We'll have functions in the string type to provide similar behavior. | #We'll have functions in the string type to provide similar behavior. | ||
− | #Date/time math is not supported in EDT. Functions on the timestamp | + | #Date/time math is not supported in EDT. Functions on the date and timestamp types provide similar behavior. |
Revision as of 14:39, 19 July 2011
Please see the parent of this page, EDT:EGL_Language.
Operators and expressions (Table 7)
Operators and expressions1 | Core | JavaScript | Java | Debug |
. (member access) | |
|
|
|
= | |
|
|
|
function invocation | |
|
|
|
new | |
|
|
|
{ } (set-values block) | |
|
|
|
@ | |
|
|
|
[ ] (array access) | |
|
|
|
[ ] (dynamic access) | |
|
|
|
[ ] (substring)2 | |
|
|
|
isa3 | |
|
|
|
as3 | |
|
|
|
unary (+ - ! ~)4, 5 | |
|
|
|
math (+ - * / % **)9 | |
|
|
|
assigning math (+= -= *= /= %= **=)9 | |
|
|
|
:: | |
|
|
|
?: | |
|
|
|
logical (And Or && ||) | |
|
|
|
comparison (< > <= >= == !=) | |
|
|
|
bitwise (& | Xor << >> >>>)4, 5 | |
|
|
|
assigning bitwise (&= |= Xor= <<= >>= >>>=)4, 5 | |
|
|
|
if-then-else (condition ? val1 : val2)6 | |
|
|
|
in7 | |
N/S | N/S | N/S |
like matches8 | |
N/S | N/S | N/S |
Notes on Table 7
- We'll document error conditions of operators and expressions, and their resulting exceptions. Whenever possible this documentation will be comments in the EGL source file for a type.
- Substrings are immutable, so they can't be the target of an assignment or the argument to an inout parameter.
- The type cannot be a nullable type. Nullability is not part of a type signature.
- There are new bitwise operators in EDT. ~ is a bitwise NOT (also called the compliment), << is a left shift, >> is a right shift where the leftmost bits become zero, >>> is a right shift where the sign is copied into the leftmost bits.
- Bitwise operators are only supported on values of type int.
- The if-then-else operator is borrowed from languages like C and Java. The condition's type must be boolean. The two values must have the same type.
- We'll have functions in the array type to provide similar behavior.
- We'll have functions in the string type to provide similar behavior.
- Date/time math is not supported in EDT. Functions on the date and timestamp types provide similar behavior.