Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "EDT:EGL Language Operators and Expressions"

Line 3: Line 3:
 
== Operators and expressions (Table 7)  ==
 
== Operators and expressions (Table 7)  ==
  
{| width="400" cellspacing="1" cellpadding="1" border="1"
+
{| cellspacing="1" cellpadding="1" border="1" width="400"
 
|-
 
|-
 
| bgcolor="#999999" align="center" | '''''Operators and expressions<sup>1</sup>'''''  
 
| bgcolor="#999999" align="center" | '''''Operators and expressions<sup>1</sup>'''''  
Line 12: Line 12:
 
| bgcolor="#cccccc" | ''. (member access)''  
 
| bgcolor="#cccccc" | ''. (member access)''  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
 
| done<br>
 
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''=''  
 
| bgcolor="#cccccc" | ''=''  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
 
| done<br>
 
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''function invocation''  
 
| bgcolor="#cccccc" | ''function invocation''  
 
| <br>done  
 
| <br>done  
| <br>  
+
| done<br>  
 
| done<br>
 
| done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''new''  
 
| bgcolor="#cccccc" | ''new''  
 
| done<br>  
 
| done<br>  
| <br>  
+
| done<br>  
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 52: Line 52:
 
| bgcolor="#cccccc" | ''[ ] (substring)<sup>2</sup>''  
 
| bgcolor="#cccccc" | ''[ ] (substring)<sup>2</sup>''  
 
| 1d<br>  
 
| 1d<br>  
| <br>  
+
| done<br>  
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 77: Line 77:
 
| bgcolor="#cccccc" | ''assigning math (+= -= *= /=&nbsp;%= **=)<sup>9</sup>''  
 
| bgcolor="#cccccc" | ''assigning math (+= -= *= /=&nbsp;%= **=)<sup>9</sup>''  
 
| <br>done  
 
| <br>done  
| <br>  
+
| 0.5d<br>  
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 92: Line 92:
 
| bgcolor="#cccccc" | ''logical (And Or &amp;&amp; &#124;&#124;)''  
 
| bgcolor="#cccccc" | ''logical (And Or &amp;&amp; &#124;&#124;)''  
 
| <br>done  
 
| <br>done  
| <br>  
+
| done<br>  
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 120: Line 120:
 
| bgcolor="#cccccc" | ''if-then-else'' (condition&nbsp;? val1&nbsp;: val2)''<sup>6</sup>''  
 
| bgcolor="#cccccc" | ''if-then-else'' (condition&nbsp;? val1&nbsp;: val2)''<sup>6</sup>''  
 
| <br>3d  
 
| <br>3d  
| <br>  
+
| 0.5d<br>  
 
| 0.5d<br>
 
| 0.5d<br>
 
|-
 
|-
Line 137: Line 137:
  
 
#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.  
 
#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.  
#<span style="background: #ffa500">Substrings are immutable, so they can't be the target of an assignment or the argument to an inout parameter.</span>  
+
#<span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Substrings are immutable, so they can't be the target of an assignment or the argument to an inout parameter.</span>  
#<span style="background: #ffa500">The type cannot be a nullable type. Nullability is not part of a type signature.</span>  
+
#<span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">The type cannot be a nullable type. Nullability is not part of a type signature.</span>  
 
#There are new bitwise operators in EDT. ~ is a bitwise NOT (also called the compliment), &lt;&lt; is a left shift, &gt;&gt; is a right shift where the leftmost bits become zero, &gt;&gt;&gt; is a right shift where the sign is copied into the leftmost bits.  
 
#There are new bitwise operators in EDT. ~ is a bitwise NOT (also called the compliment), &lt;&lt; is a left shift, &gt;&gt; is a right shift where the leftmost bits become zero, &gt;&gt;&gt; is a right shift where the sign is copied into the leftmost bits.  
 
#Bitwise operators are only supported on values of type int.  
 
#Bitwise operators are only supported on values of type int.  

Revision as of 12:52, 21 July 2011

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

done
@
done
done (no work for generators)
done (no work for generators)
[ ] (array access)
done

done
[ ] (dynamic access) done

1d
[ ] (substring)2 1d
done
done
isa3
1d

1d
as3
see isa

1d
unary (+ - ! ~)4, 5
done

0.5d
math (+ - * / % **)9
done

done
assigning math (+= -= *= /= %= **=)9
done
0.5d
done
::
done

0.5d
?:
done

0.5d
logical (And Or && ||)
done
done
done
comparison (< > <= >= == !=)
done

2d
bitwise (& | Xor << >> >>>)4, 5


2d

Validation needs to allow these operators


0.5d
assigning bitwise (&= |= Xor= <<= >>= >>>=)4, 5


1d

Validation needs to allow these operators


0.5d
if-then-else (condition ? val1 : val2)6
3d
0.5d
0.5d
in7 1d N/S N/S
like matches8
1d
N/S N/S

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, >>> is a right shift where the sign is copied into the leftmost bits.
  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.

Back to the top