9.3.20 StringLiteralExpCS
该规则代表了一个字符串字面量表达式。具体语法包括零个或多个字符或由单引号包含的转义字符序列。格式[B]的相邻字符串允许一个长字符串字面量可以分为多个片段跨行编写。
[A] StringLiteralExpCS ::= #x27 StringChar* #x27
[B] StringLiteralExpCS[1] ::= StringLiteralExpCS[2] WhiteSpaceChar* #x27 StringChar* #x27
其中
StringChar ::= Char | EscapeSequence
WhiteSpaceChar ::= #x09 | #x0a | #x0c | #x0d | #x20
Char ::= [#x20-#x26] | [#x28-#x5B] | [#x5D-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
EscapeSequence ::= '\' 'b' -- #x08: backspace BS
| '\' 't' -- #x09: horizontal tab HT
| '\' 'n' -- #x0a: linefeed LF
| '\' 'f' -- #x0c: form feed FF
| '\' 'r' -- #x0d: carriage return CR
| '\' '"' -- #x22: double quote "
| '\' ''' -- #x27: single quote '
| '\' '\' -- #x5c: backslash \
| '\' 'x' Hex Hex -- #x00 to #xFF
| '\' 'u' Hex Hex Hex Hex -- #x0000 to #xFFFF
Hex ::= [0-9] | [A-F] | [a-f]
抽象语法映射
StringLiteralExpCS.ast : StringLiteralExp
合成的属性
[A] StringLiteralExpCS.ast.symbol = <CodePoints of StringChar*>
[B] StringLiteralExpCS.ast.symbol = StringLiteralExpCS[2] + <CodePoints of StringChar*>
继承的属性
--none
歧义消除规则
--none