EDT:EGL Language Operators and Expressions

From Eclipsepedia

Jump to: navigation, search

Please see the parent of this page, EDT:EGL Language.

Operators and expressions (Table 7)

Operators and expressions1 Core JavaScript Java
. (member access) done
done
done
= done
done
done
function invocation
done
done
done
new done
done
done
{ } (set-values block)
done
0.5d
done
@
done
done (no work for generators)
done (no work for generators)
[ ] (array access)
done
done
done
[ ] (dynamic access) done
1d
done bug 353653
[ ] (substring)2 done bug 354165
done
done
isa3
done bug 354167
1d
done bug 353654
as3
done
done
done bug 353655
unary (~)4, 5
done
0.5d bug 366875
0.5d bug 366876
unary (+ - !) done done done
math (+ - * / % **)9
done
1d
done
assigning math (+= -= *= /= %= **=)9
done
0.5d
done
::
done
0.5d
done bug 353656
?:
done
0.5d
done bug 353656
logical (And Or && ||)
done
done
done
comparison (< > <= >= == !=)
done
2d
2d bug 353657
bitwise (& | Xor)5 done 0.5d
0.25d bug 353658
assigning bitwise (&= |= Xor=)5 done 0.5d
0.5d bug 353658
bit shifting (<< >> >>> <<= >>= >>>=)4,5 done

Validation needs to allow these operators

0.5d 0.5d
in7 1d N/S N/S
like matches8
1d
done
(see IR bug)
N/S
is/not done N/S N/S
Ternary Operator 
(condition ? val1 : val2)6
3d bug 366872
.5d bug 366873
.5d bug 366874

Object Expression 
{key : value,

"key" : value}10

donebug 366742
bug 366860
bug 366861

Notes on Table 7

  1. 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.
  2. Substrings are immutable, so they can't be the target of an assignment or the argument to an inout parameter.
  3. The type cannot be a nullable type. Nullability is not part of a type signature.
  4. 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 (logical), >> is a right shift where the sign is copied into the leftmost bits (arithmetic).
  5. Bitwise operators are only supported on values of type int.
  6. 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.
  7. We'll have functions in the array type to provide similar behavior.
  8. We'll have functions in the string type to provide similar behavior.
  9. Date/time math is not supported in EDT. Functions on the date and timestamp types provide similar behavior.
  10. Object expression is borrowed from java script, which allows an object to be created "on the fly". The key can either be an ID or a string and the value can be any expression that is valid on the right hand side of an assignment.