NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

2.4.2 Integer literals

Integer literals can be decimal (base 10), hexadecimal (base 16) or octal (base 8). A decimal integer literal is a string of decimal digits. An octal literal is &O followed by a string of octal digits. A hexadecimal literal is &H followed by a string of hexadecimal digits. Decimal literals are always signed; octal and hexadecimal literals are always unsigned.

The type of a literal is determined by its value or by the following type character. If no type character is specified, values in the range of the Integer type are typed as Integer; values outside the range for Integer are typed as Long. Octal and hexadecimal literals are treated as a bitwise representation of a signed type for the purpose of determining type; this means that the literal &HFFFFFFFF is typed as an Integer, not a Long. If an integer literal's type is at odds with the size required to hold the integer literal, an error results.

IntegerLiteral ::= IntegralLiteralValue [ IntegralTypeCharacter ]
IntegralTypeCharacter ::=
 ShortCharacter |
 IntegerCharacter |
 LongCharacter |
 IntegerTypeCharacter |
 LongTypeCharacter
ShortCharacter ::= S
IntegerCharacter ::= I
LongCharacter ::= L
IntegralLiteralValue ::= IntLiteral | OctalLiteral | HexLiteral
IntLiteral ::= Digit+
OctalLiteral ::= & O OctalDigit+
HexLiteral ::= & H HexDigit+
OctalDigit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
Digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
HexDigit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F