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.
EDT:EGL Language Literals
Revision as of 14:54, 21 July 2011 by Greer.us.ibm.com (Talk | contribs)
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 point | done |
done |
done |
string4 | done |
done (see this IR bug) |
0.5d |
bytes5 | 2d |
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
- 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.
- 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.
- 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).