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 Literals"

Line 1: Line 1:
Please see the parent of this page, [[EDT:EGL_Language]].
+
Please see the parent of this page, [[EDT:EGL Language]].  
  
 
== Literals (Table 6)  ==
 
== Literals (Table 6)  ==
Line 8: Line 8:
 
| bgcolor="#999999" align="center" | '''Core'''  
 
| bgcolor="#999999" align="center" | '''Core'''  
 
| bgcolor="#999999" align="center" | '''JavaScript'''  
 
| bgcolor="#999999" align="center" | '''JavaScript'''  
| bgcolor="#999999" align="center" | '''Java'''
+
| bgcolor="#999999" align="center" | '''Java'''
| bgcolor="#999999" align="center" | '''Debug'''
+
 
|-
 
|-
 
| bgcolor="#cccccc" | ''null''  
 
| bgcolor="#cccccc" | ''null''  
| <br>
 
 
| <br>  
 
| <br>  
 
| <br>  
 
| <br>  
Line 18: Line 16:
 
|-
 
|-
 
| bgcolor="#cccccc" | ''boolean<sup>1</sup>''  
 
| bgcolor="#cccccc" | ''boolean<sup>1</sup>''  
| <br>
 
 
| <br>  
 
| <br>  
 
| <br>  
 
| <br>  
Line 26: Line 23:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>
 
 
| <br>
 
| <br>
 
|-
 
|-
Line 32: Line 28:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>
 
 
| <br>
 
| <br>
 
|-
 
|-
Line 38: Line 33:
 
| <br>  
 
| <br>  
 
| done<br>  
 
| done<br>  
| <br>
 
 
| <br>
 
| <br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''string<sup>4</sup>''  
 
| bgcolor="#cccccc" | ''string<sup>4</sup>''  
 
| <br>  
 
| <br>  
| done<br>(see this [https://bugs.eclipse.org/bugs/show_bug.cgi?id=347208 IR bug])<br>
+
| done<br>(see this [https://bugs.eclipse.org/bugs/show_bug.cgi?id=347208 IR bug])<br>  
 
|  
 
|  
| <br>
 
 
|-
 
|-
 
| bgcolor="#cccccc" | ''bytes<sup>5</sup>''  
 
| bgcolor="#cccccc" | ''bytes<sup>5</sup>''  
| <br>
 
 
| <br>  
 
| <br>  
 
| <br>  
 
| <br>  
Line 54: Line 46:
 
|-
 
|-
 
| bgcolor="#cccccc" | ''array''  
 
| bgcolor="#cccccc" | ''array''  
| <br>
 
 
| <br>  
 
| <br>  
 
| <br>  
 
| <br>  
Line 61: Line 52:
 
| bgcolor="#cccccc" | ''char''  
 
| bgcolor="#cccccc" | ''char''  
 
| <br>  
 
| <br>  
| N/S
 
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
Line 67: Line 57:
 
| bgcolor="#cccccc" | ''mbchar''  
 
| bgcolor="#cccccc" | ''mbchar''  
 
| <br>  
 
| <br>  
| N/S
 
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
Line 73: Line 62:
 
| bgcolor="#cccccc" | ''dbchar''  
 
| bgcolor="#cccccc" | ''dbchar''  
 
| <br>  
 
| <br>  
| N/S
 
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
Line 79: Line 67:
 
| bgcolor="#cccccc" | ''hex''  
 
| bgcolor="#cccccc" | ''hex''  
 
| <br>  
 
| <br>  
| N/S
 
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S

Revision as of 15:17, 19 July 2011

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

Literals (Table 6)

Literals Core JavaScript Java
null


boolean1


integer2
done

fixed-decimal3
done

floating point
done

string4
done
(see this IR bug)
bytes5


array


char
N/S N/S
mbchar
N/S N/S
dbchar
N/S N/S
hex
N/S N/S

Notes on Table 6

  1. As in RBD, there are four boolean literals: true false yes no
  2. Integer literals have 1-32 digits, an optional leading sign, and no decimal point. The type of the literal depends on the value. If the value fits in a smallint, then the type is smallint. If the value doesn't fit in a smallint but it does fit in an int, then the type is int. Similarly for bigint. If the value is too large for a bigint, then the type is decimal(X), where X is the number of digits in the value.
  3. Fixed-decimal literals have 1-32 digits, an optional leading sign, and a decimal point. At least one digit must follow the decimal point, but it's permissible to have no digits before the decimal point. The type of a fixed-decimal literal is decimal(X,Y), where X is the total number of digits and Y is the number of digits to the right of the decimal point.
  4. String literals are enclosed in double quotes. An optional ux prefix may appear before the opening double quote. The ux prefix means the string is defined as Unicode codepoints in hexadecimal. For example "012" and ux"003000310032" have the same value. The letters u and x may be in any case.
  5. A bytes literal is written as 0x or 0X followed by an even number of hexadecimal digits. For example 0x03AB is a literal whose type is bytes(2).

Back to the top