Literals¶
All literal forms that ExpressLexer can emit, with the token they produce.
Strings¶
A simple string is single-quoted; a doubled quote '' escapes a quote inside it
(clause 7.5.4):
Encoded string literal¶
A double-quoted hex string is an encoded (hexadecimal) string literal. Each character is encoded as four octets — the ISO/IEC 10646 group, plane, row and cell — so the hexadecimal digits always come in groups of eight:
e1 : STRING := "000000E9"; -- one character
e2 : STRING := "00000041000000E9"; -- two characters
e3 : STRING := "1F2A3B"; -- not valid: a group is eight digits
The lexer colours e3 as a string literal all the same: it renders the language
rather than validating it, and a partial group is still read as a hexadecimal
string. ISO 10303-11 clause 7.5.4, example 4, treats that literal as invalid,
so a validator should reject it.
Binary literal¶
A % followed by binary digits:
Numbers¶
i1 : INTEGER := 42;
i2 : INTEGER := 0;
r1 : REAL := 3.14;
r2 : REAL := 1.5E-3;
r3 : REAL := 2.0E+10;
r4 : REAL := 1.; -- trailing dot after the integer part
The E/e exponent, +/- signs and % prefix are all handled by the number
and binary rules.