Larch/C++ character constants are the same as C++ (single) character constants.
character-constant ::= [
'char-const-char ::= normal-char | std-esc |
"normal-char ::= any character except
\or a newline std-esc ::=
horizontal tab HT|
vertical tab VT|
carriage return CR|
form feed FF|
question mark ?|
single quote '|
double quote "|
octal code o, oo, ooo|
\xhex-digit [ hex-digit ] ... //
hex code xhh...octal-code ::= octal-digit | octal-digit octal-digit | octal-digit octal-digit octal-digit
are character constants.
The sort of a single character constant is
The meaning of a character constant such as
is not uniquely defined by C++
but depends on "the machine's character set"
(section 2.5.2 [Ellis-Stroustrup90]).
Therefore in Larch/C++,
'a', has sort
but its numerical value is not uniquely defined.
A constant that starts with
L, for example
is a wide character constant of sort
Larch/C++ does not support multicharacter constants,
as they are not well-defined.
(See Section 2.5.2 of [Ellis-Stroustrup90]
for a description of multicharacter constants.)
Larch/C++ supports the standard C++ escape sequences. The meaning of such a std-esc is as in C++. In an escape sequence, the octal (or hexadecimal) digit string ends with the first character that is not an octal-digit (or a hex-digit) (see Section 2.5.2 of [Ellis-Stroustrup90]).
Go to the first, previous, next, last section, table of contents.