Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be 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"

 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
== Literals (Table 6)  ==
 
== Literals (Table 6)  ==
  
{| width="400" cellspacing="1" cellpadding="1" border="1"
+
{| cellspacing="1" cellpadding="1" border="1" width="400"
 
|-
 
|-
 
| bgcolor="#999999" align="center" | '''''Literals'''''  
 
| bgcolor="#999999" align="center" | '''''Literals'''''  
Line 20: Line 20:
 
| done<br>
 
| done<br>
 
|-
 
|-
| bgcolor="#cccccc" | ''integer<sup>2</sup>''  
+
| bgcolor="#FFA500" | ''integer<sup>2</sup>''  
| done<br>  
+
| bgcolor="#FFA500" | done<br>  
| done<br>  
+
| bgcolor="#FFA500" | done<br>  
| done<br>
+
| bgcolor="#FFA500" | done<br>
 
|-
 
|-
 
| bgcolor="#cccccc" | ''fixed-decimal<sup>3</sup>''  
 
| bgcolor="#cccccc" | ''fixed-decimal<sup>3</sup>''  
Line 30: Line 30:
 
| done<br>
 
| done<br>
 
|-
 
|-
| bgcolor="#cccccc" | ''floating point''  
+
| bgcolor="#FFA500" | ''floating point<sup>4</sup>''  
| <br>done
+
| bgcolor="#FFA500" | done <br>  
| done<br>  
+
| bgcolor="#FFA500" | done<br>  
| done<br>
+
| bgcolor="#FFA500" | done<br>
 
|-
 
|-
| bgcolor="#cccccc" | ''string<sup>4</sup>''  
+
| bgcolor="#cccccc" | ''string<sup>5</sup>''  
 
| <br>done  
 
| <br>done  
 
| 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>  
| 0.5d {{bug|353637}}
+
| done {{bug|353637}}
 
|-
 
|-
| bgcolor="#ffff00" | ''bytes<sup>5</sup>''  
+
| bgcolor="#ffff00" | ''bytes<sup>6</sup>''  
| bgcolor="#ffff00" | 2d<br>  
+
| bgcolor="#ffff00" | done<br>  
 
| bgcolor="#ffff00" | 0.5d<br>  
 
| bgcolor="#ffff00" | 0.5d<br>  
 
| bgcolor="#ffff00" | 0.5d<br>
 
| bgcolor="#ffff00" | 0.5d<br>
Line 74: Line 74:
  
 
#As in RBD, there are four boolean literals: true false yes no  
 
#As in RBD, there are four boolean literals: true false yes no  
#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.  
+
#<span style="background-color:#FFA500;">There are three types of integer literals: smallint, int, and bigint. They are comprised of digits, an optional leading sign, and no decimal point. A smallint literal ends with a lowercase 'i': 1234i. A bigint literal ends with an uppercase 'I': 1234I. An int literal does not end with a letter: 1234.</span>
 
#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.  
 
#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.  
 +
#<span style="background-color:#FFA500;">There are two types of floating point literals: float and smallfloat. They are comprised of digits, an optional leading sign, and an optional decimal point. A smallfloat literal ends with a lowercase 'f': 123.45f. A float literal has two formats; it can end with an uppercase 'F': 123.45F, or it can be written in scientific notation: 1.2345e2.</span>
 
#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.  
 
#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.  
 
#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).
 
#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).

Latest revision as of 10:55, 19 June 2012

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

Literals (Table 6)

Literals Core JavaScript Java
null
done
done
done
boolean1 done
done
done
integer2 done
done
done
fixed-decimal3
done
done
done
floating point4 done
done
done
string5
done
done
(see this IR bug)
done bug 353637
bytes6 done
0.5d
0.5d
array
done
done
done
char
done
N/S N/S
mbchar
done
N/S N/S
dbchar
done
N/S N/S
hex
done
N/S N/S

Notes on Table 6

  1. As in RBD, there are four boolean literals: true false yes no
  2. There are three types of integer literals: smallint, int, and bigint. They are comprised of digits, an optional leading sign, and no decimal point. A smallint literal ends with a lowercase 'i': 1234i. A bigint literal ends with an uppercase 'I': 1234I. An int literal does not end with a letter: 1234.
  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. There are two types of floating point literals: float and smallfloat. They are comprised of digits, an optional leading sign, and an optional decimal point. A smallfloat literal ends with a lowercase 'f': 123.45f. A float literal has two formats; it can end with an uppercase 'F': 123.45F, or it can be written in scientific notation: 1.2345e2.
  5. 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.
  6. 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