CharacterStringLiteral =
"'" { CharacterLiteral } "'".
CharacterLiteral =
NonSpecialCharacterLiteral | SpecialCharacterLiteral |
HexadecimalCharacterLiteral.
NonSpecialCharacterLiteral =
any ASCII character except apostrophe ('),
double quote ("), back slash (\), and new line.
SpecialCharacterLiteral =
"\n" | "\t" | "\v" | "\b" | "\r" | "\f" |
"\\" | "\'" | '\"' .
HexadecimalCharacterLiteral = .
"\x" HexadecimalDigit HexadecimalDigit.
Digit =
"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
"8" | "9".
HexadecimalDigit =
Digit |
"A" | "B" | "C" | "D" | "E" | "F" |
"a" | "b" | "c" | "d" | "e" | "f".
'A' 'a' '7' '$'
New line (line feed) HL (LF) '\n'
Horizontal tabulation HT '\t'
Backspace BS '\b'
Carriage return CR '\r'
Form feed FF '\f'
Back slash \ '\\'
Apostrophe ' '\''
Double quote " '\"'
\xZZ
where ZZ are two hexadecimal
digits, corresponding to the one-byte code of the character.For example, \x2A и \x2a are equivalent to *.
'ABC'
'123'
'\"I don\'t like swimming!\" - said a little girl.'
'A' 'B' 'C'
'A''B''C'
'ABC'