tmp/tmpwuj5m72_/{from.md → to.md}
RENAMED
|
@@ -1,16 +1,40 @@
|
|
| 1 |
## Lexical conventions <a id="gram.lex">[[gram.lex]]</a>
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
``` bnf
|
| 4 |
hex-quad:
|
| 5 |
hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit
|
| 6 |
```
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
``` bnf
|
| 9 |
universal-character-name:
|
| 10 |
'\u' hex-quad
|
| 11 |
'\U' hex-quad hex-quad
|
|
|
|
|
|
|
| 12 |
```
|
| 13 |
|
| 14 |
``` bnf
|
| 15 |
preprocessing-token:
|
| 16 |
header-name
|
|
@@ -22,11 +46,11 @@ preprocessing-token:
|
|
| 22 |
character-literal
|
| 23 |
user-defined-character-literal
|
| 24 |
string-literal
|
| 25 |
user-defined-string-literal
|
| 26 |
preprocessing-op-or-punc
|
| 27 |
-
each non-
|
| 28 |
```
|
| 29 |
|
| 30 |
``` bnf
|
| 31 |
token:
|
| 32 |
identifier
|
|
@@ -47,30 +71,29 @@ h-char-sequence:
|
|
| 47 |
h-char-sequence h-char
|
| 48 |
```
|
| 49 |
|
| 50 |
``` bnf
|
| 51 |
h-char:
|
| 52 |
-
any member of the
|
| 53 |
```
|
| 54 |
|
| 55 |
``` bnf
|
| 56 |
q-char-sequence:
|
| 57 |
q-char
|
| 58 |
q-char-sequence q-char
|
| 59 |
```
|
| 60 |
|
| 61 |
``` bnf
|
| 62 |
q-char:
|
| 63 |
-
any member of the
|
| 64 |
```
|
| 65 |
|
| 66 |
``` bnf
|
| 67 |
pp-number:
|
| 68 |
digit
|
| 69 |
'.' digit
|
| 70 |
-
pp-number
|
| 71 |
-
pp-number identifier-nondigit
|
| 72 |
pp-number ''' digit
|
| 73 |
pp-number ''' nondigit
|
| 74 |
pp-number 'e' sign
|
| 75 |
pp-number 'E' sign
|
| 76 |
pp-number 'p' sign
|
|
@@ -78,19 +101,25 @@ pp-number:
|
|
| 78 |
pp-number '.'
|
| 79 |
```
|
| 80 |
|
| 81 |
``` bnf
|
| 82 |
identifier:
|
| 83 |
-
identifier-
|
| 84 |
-
identifier identifier-
|
| 85 |
-
identifier digit
|
| 86 |
```
|
| 87 |
|
| 88 |
``` bnf
|
| 89 |
-
identifier-
|
| 90 |
nondigit
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
```
|
| 93 |
|
| 94 |
``` bnf
|
| 95 |
nondigit: one of
|
| 96 |
'a b c d e f g h i j k l m'
|
|
@@ -215,12 +244,14 @@ hexadecimal-digit: one of
|
|
| 215 |
|
| 216 |
``` bnf
|
| 217 |
integer-suffix:
|
| 218 |
unsigned-suffix long-suffixₒₚₜ
|
| 219 |
unsigned-suffix long-long-suffixₒₚₜ
|
|
|
|
| 220 |
long-suffix unsigned-suffixₒₚₜ
|
| 221 |
long-long-suffix unsigned-suffixₒₚₜ
|
|
|
|
| 222 |
```
|
| 223 |
|
| 224 |
``` bnf
|
| 225 |
unsigned-suffix: one of
|
| 226 |
'u U'
|
|
@@ -234,10 +265,15 @@ long-suffix: one of
|
|
| 234 |
``` bnf
|
| 235 |
long-long-suffix: one of
|
| 236 |
'll LL'
|
| 237 |
```
|
| 238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
``` bnf
|
| 240 |
character-literal:
|
| 241 |
encoding-prefixₒₚₜ ''' c-char-sequence '''
|
| 242 |
```
|
| 243 |
|
|
@@ -252,39 +288,72 @@ c-char-sequence:
|
|
| 252 |
c-char-sequence c-char
|
| 253 |
```
|
| 254 |
|
| 255 |
``` bnf
|
| 256 |
c-char:
|
| 257 |
-
|
| 258 |
escape-sequence
|
| 259 |
universal-character-name
|
| 260 |
```
|
| 261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
``` bnf
|
| 263 |
escape-sequence:
|
| 264 |
simple-escape-sequence
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
octal-escape-sequence
|
| 266 |
hexadecimal-escape-sequence
|
| 267 |
```
|
| 268 |
|
| 269 |
``` bnf
|
| 270 |
-
simple-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
```
|
| 274 |
|
| 275 |
``` bnf
|
| 276 |
octal-escape-sequence:
|
| 277 |
'\' octal-digit
|
| 278 |
'\' octal-digit octal-digit
|
| 279 |
'\' octal-digit octal-digit octal-digit
|
|
|
|
| 280 |
```
|
| 281 |
|
| 282 |
``` bnf
|
| 283 |
hexadecimal-escape-sequence:
|
| 284 |
-
'\x' hexadecimal-digit
|
| 285 |
-
hexadecimal-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
```
|
| 287 |
|
| 288 |
``` bnf
|
| 289 |
floating-point-literal:
|
| 290 |
decimal-floating-point-literal
|
|
@@ -338,11 +407,11 @@ digit-sequence:
|
|
| 338 |
digit-sequence '''ₒₚₜ digit
|
| 339 |
```
|
| 340 |
|
| 341 |
``` bnf
|
| 342 |
floating-point-suffix: one of
|
| 343 |
-
'f l F L'
|
| 344 |
```
|
| 345 |
|
| 346 |
``` bnf
|
| 347 |
string-literal:
|
| 348 |
encoding-prefixₒₚₜ '"' s-char-sequenceₒₚₜ '"'
|
|
@@ -355,15 +424,21 @@ s-char-sequence:
|
|
| 355 |
s-char-sequence s-char
|
| 356 |
```
|
| 357 |
|
| 358 |
``` bnf
|
| 359 |
s-char:
|
| 360 |
-
|
| 361 |
escape-sequence
|
| 362 |
universal-character-name
|
| 363 |
```
|
| 364 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 365 |
``` bnf
|
| 366 |
raw-string:
|
| 367 |
'"' d-char-sequenceₒₚₜ '(' r-char-sequenceₒₚₜ ')' d-char-sequenceₒₚₜ '"'
|
| 368 |
```
|
| 369 |
|
|
@@ -373,25 +448,25 @@ r-char-sequence:
|
|
| 373 |
r-char-sequence r-char
|
| 374 |
```
|
| 375 |
|
| 376 |
``` bnf
|
| 377 |
r-char:
|
| 378 |
-
any member of the
|
| 379 |
-
the initial *d-char-sequence* (which may be empty) followed by a
|
| 380 |
```
|
| 381 |
|
| 382 |
``` bnf
|
| 383 |
d-char-sequence:
|
| 384 |
d-char
|
| 385 |
d-char-sequence d-char
|
| 386 |
```
|
| 387 |
|
| 388 |
``` bnf
|
| 389 |
d-char:
|
| 390 |
-
any member of the basic
|
| 391 |
-
|
| 392 |
-
|
| 393 |
```
|
| 394 |
|
| 395 |
``` bnf
|
| 396 |
boolean-literal:
|
| 397 |
'false'
|
|
|
|
| 1 |
## Lexical conventions <a id="gram.lex">[[gram.lex]]</a>
|
| 2 |
|
| 3 |
+
``` bnf
|
| 4 |
+
n-char: one of
|
| 5 |
+
any member of the translation character set except the U+007d (right curly bracket) or new-line character
|
| 6 |
+
```
|
| 7 |
+
|
| 8 |
+
``` bnf
|
| 9 |
+
n-char-sequence:
|
| 10 |
+
n-char
|
| 11 |
+
n-char-sequence n-char
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
``` bnf
|
| 15 |
+
named-universal-character:
|
| 16 |
+
'\N{' n-char-sequence '}'
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
``` bnf
|
| 20 |
hex-quad:
|
| 21 |
hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit
|
| 22 |
```
|
| 23 |
|
| 24 |
+
``` bnf
|
| 25 |
+
simple-hexadecimal-digit-sequence:
|
| 26 |
+
hexadecimal-digit
|
| 27 |
+
simple-hexadecimal-digit-sequence hexadecimal-digit
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
``` bnf
|
| 31 |
universal-character-name:
|
| 32 |
'\u' hex-quad
|
| 33 |
'\U' hex-quad hex-quad
|
| 34 |
+
'\u{' simple-hexadecimal-digit-sequence '}'
|
| 35 |
+
named-universal-character
|
| 36 |
```
|
| 37 |
|
| 38 |
``` bnf
|
| 39 |
preprocessing-token:
|
| 40 |
header-name
|
|
|
|
| 46 |
character-literal
|
| 47 |
user-defined-character-literal
|
| 48 |
string-literal
|
| 49 |
user-defined-string-literal
|
| 50 |
preprocessing-op-or-punc
|
| 51 |
+
each non-whitespace character that cannot be one of the above
|
| 52 |
```
|
| 53 |
|
| 54 |
``` bnf
|
| 55 |
token:
|
| 56 |
identifier
|
|
|
|
| 71 |
h-char-sequence h-char
|
| 72 |
```
|
| 73 |
|
| 74 |
``` bnf
|
| 75 |
h-char:
|
| 76 |
+
any member of the translation character set except new-line and U+003e (greater-than sign)
|
| 77 |
```
|
| 78 |
|
| 79 |
``` bnf
|
| 80 |
q-char-sequence:
|
| 81 |
q-char
|
| 82 |
q-char-sequence q-char
|
| 83 |
```
|
| 84 |
|
| 85 |
``` bnf
|
| 86 |
q-char:
|
| 87 |
+
any member of the translation character set except new-line and U+0022 (quotation mark)
|
| 88 |
```
|
| 89 |
|
| 90 |
``` bnf
|
| 91 |
pp-number:
|
| 92 |
digit
|
| 93 |
'.' digit
|
| 94 |
+
pp-number identifier-continue
|
|
|
|
| 95 |
pp-number ''' digit
|
| 96 |
pp-number ''' nondigit
|
| 97 |
pp-number 'e' sign
|
| 98 |
pp-number 'E' sign
|
| 99 |
pp-number 'p' sign
|
|
|
|
| 101 |
pp-number '.'
|
| 102 |
```
|
| 103 |
|
| 104 |
``` bnf
|
| 105 |
identifier:
|
| 106 |
+
identifier-start
|
| 107 |
+
identifier identifier-continue
|
|
|
|
| 108 |
```
|
| 109 |
|
| 110 |
``` bnf
|
| 111 |
+
identifier-start:
|
| 112 |
nondigit
|
| 113 |
+
an element of the translation character set with the Unicode property XID_Start
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
``` bnf
|
| 117 |
+
identifier-continue:
|
| 118 |
+
digit
|
| 119 |
+
nondigit
|
| 120 |
+
an element of the translation character set with the Unicode property XID_Continue
|
| 121 |
```
|
| 122 |
|
| 123 |
``` bnf
|
| 124 |
nondigit: one of
|
| 125 |
'a b c d e f g h i j k l m'
|
|
|
|
| 244 |
|
| 245 |
``` bnf
|
| 246 |
integer-suffix:
|
| 247 |
unsigned-suffix long-suffixₒₚₜ
|
| 248 |
unsigned-suffix long-long-suffixₒₚₜ
|
| 249 |
+
unsigned-suffix size-suffixₒₚₜ
|
| 250 |
long-suffix unsigned-suffixₒₚₜ
|
| 251 |
long-long-suffix unsigned-suffixₒₚₜ
|
| 252 |
+
size-suffix unsigned-suffixₒₚₜ
|
| 253 |
```
|
| 254 |
|
| 255 |
``` bnf
|
| 256 |
unsigned-suffix: one of
|
| 257 |
'u U'
|
|
|
|
| 265 |
``` bnf
|
| 266 |
long-long-suffix: one of
|
| 267 |
'll LL'
|
| 268 |
```
|
| 269 |
|
| 270 |
+
``` bnf
|
| 271 |
+
size-suffix: one of
|
| 272 |
+
'z Z'
|
| 273 |
+
```
|
| 274 |
+
|
| 275 |
``` bnf
|
| 276 |
character-literal:
|
| 277 |
encoding-prefixₒₚₜ ''' c-char-sequence '''
|
| 278 |
```
|
| 279 |
|
|
|
|
| 288 |
c-char-sequence c-char
|
| 289 |
```
|
| 290 |
|
| 291 |
``` bnf
|
| 292 |
c-char:
|
| 293 |
+
basic-c-char
|
| 294 |
escape-sequence
|
| 295 |
universal-character-name
|
| 296 |
```
|
| 297 |
|
| 298 |
+
``` bnf
|
| 299 |
+
basic-c-char:
|
| 300 |
+
any member of the translation character set except the U+0027 (apostrophe),
|
| 301 |
+
U+005c (reverse solidus), or new-line character
|
| 302 |
+
```
|
| 303 |
+
|
| 304 |
``` bnf
|
| 305 |
escape-sequence:
|
| 306 |
simple-escape-sequence
|
| 307 |
+
numeric-escape-sequence
|
| 308 |
+
conditional-escape-sequence
|
| 309 |
+
```
|
| 310 |
+
|
| 311 |
+
``` bnf
|
| 312 |
+
simple-escape-sequence:
|
| 313 |
+
'\' simple-escape-sequence-char
|
| 314 |
+
```
|
| 315 |
+
|
| 316 |
+
``` bnf
|
| 317 |
+
simple-escape-sequence-char: one of
|
| 318 |
+
'' " ? \ a b f n r t v'
|
| 319 |
+
```
|
| 320 |
+
|
| 321 |
+
``` bnf
|
| 322 |
+
numeric-escape-sequence:
|
| 323 |
octal-escape-sequence
|
| 324 |
hexadecimal-escape-sequence
|
| 325 |
```
|
| 326 |
|
| 327 |
``` bnf
|
| 328 |
+
simple-octal-digit-sequence:
|
| 329 |
+
octal-digit
|
| 330 |
+
simple-octal-digit-sequence octal-digit
|
| 331 |
```
|
| 332 |
|
| 333 |
``` bnf
|
| 334 |
octal-escape-sequence:
|
| 335 |
'\' octal-digit
|
| 336 |
'\' octal-digit octal-digit
|
| 337 |
'\' octal-digit octal-digit octal-digit
|
| 338 |
+
'\o{' simple-octal-digit-sequence '}'
|
| 339 |
```
|
| 340 |
|
| 341 |
``` bnf
|
| 342 |
hexadecimal-escape-sequence:
|
| 343 |
+
'\x' simple-hexadecimal-digit-sequence
|
| 344 |
+
'\x{' simple-hexadecimal-digit-sequence '}'
|
| 345 |
+
```
|
| 346 |
+
|
| 347 |
+
``` bnf
|
| 348 |
+
conditional-escape-sequence:
|
| 349 |
+
'\' conditional-escape-sequence-char
|
| 350 |
+
```
|
| 351 |
+
|
| 352 |
+
``` bnf
|
| 353 |
+
conditional-escape-sequence-char:
|
| 354 |
+
any member of the basic character set that is not an octal-digit, a simple-escape-sequence-char, or the characters 'N', 'o', 'u', 'U', or 'x'
|
| 355 |
```
|
| 356 |
|
| 357 |
``` bnf
|
| 358 |
floating-point-literal:
|
| 359 |
decimal-floating-point-literal
|
|
|
|
| 407 |
digit-sequence '''ₒₚₜ digit
|
| 408 |
```
|
| 409 |
|
| 410 |
``` bnf
|
| 411 |
floating-point-suffix: one of
|
| 412 |
+
'f l f16 f32 f64 f128 bf16 F L F16 F32 F64 F128 BF16'
|
| 413 |
```
|
| 414 |
|
| 415 |
``` bnf
|
| 416 |
string-literal:
|
| 417 |
encoding-prefixₒₚₜ '"' s-char-sequenceₒₚₜ '"'
|
|
|
|
| 424 |
s-char-sequence s-char
|
| 425 |
```
|
| 426 |
|
| 427 |
``` bnf
|
| 428 |
s-char:
|
| 429 |
+
basic-s-char
|
| 430 |
escape-sequence
|
| 431 |
universal-character-name
|
| 432 |
```
|
| 433 |
|
| 434 |
+
``` bnf
|
| 435 |
+
basic-s-char:
|
| 436 |
+
any member of the translation character set except the U+0022 (quotation mark),
|
| 437 |
+
U+005c (reverse solidus), or new-line character
|
| 438 |
+
```
|
| 439 |
+
|
| 440 |
``` bnf
|
| 441 |
raw-string:
|
| 442 |
'"' d-char-sequenceₒₚₜ '(' r-char-sequenceₒₚₜ ')' d-char-sequenceₒₚₜ '"'
|
| 443 |
```
|
| 444 |
|
|
|
|
| 448 |
r-char-sequence r-char
|
| 449 |
```
|
| 450 |
|
| 451 |
``` bnf
|
| 452 |
r-char:
|
| 453 |
+
any member of the translation character set, except a U+0029 (right parenthesis) followed by
|
| 454 |
+
the initial *d-char-sequence* (which may be empty) followed by a U+0022 (quotation mark)
|
| 455 |
```
|
| 456 |
|
| 457 |
``` bnf
|
| 458 |
d-char-sequence:
|
| 459 |
d-char
|
| 460 |
d-char-sequence d-char
|
| 461 |
```
|
| 462 |
|
| 463 |
``` bnf
|
| 464 |
d-char:
|
| 465 |
+
any member of the basic character set except:
|
| 466 |
+
U+0020 (space), U+0028 (left parenthesis), U+0029 (right parenthesis), U+005c (reverse solidus),
|
| 467 |
+
U+0009 (character tabulation), U+000b (line tabulation), U+000c (form feed), and new-line
|
| 468 |
```
|
| 469 |
|
| 470 |
``` bnf
|
| 471 |
boolean-literal:
|
| 472 |
'false'
|