From Jason Turner

[gram.lex]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpno4fwh_a/{from.md → to.md} +79 -18
tmp/tmpno4fwh_a/{from.md → to.md} RENAMED
@@ -12,10 +12,13 @@ universal-character-name:
12
  ```
13
 
14
  ``` bnf
15
  preprocessing-token:
16
  header-name
 
 
 
17
  identifier
18
  pp-number
19
  character-literal
20
  user-defined-character-literal
21
  string-literal
@@ -27,12 +30,11 @@ preprocessing-token:
27
  ``` bnf
28
  token:
29
  identifier
30
  keyword
31
  literal
32
- operator
33
- punctuator
34
  ```
35
 
36
  ``` bnf
37
  header-name:
38
  '<' h-char-sequence '>'
@@ -100,15 +102,48 @@ nondigit: one of
100
  ``` bnf
101
  digit: one of
102
  '0 1 2 3 4 5 6 7 8 9'
103
  ```
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  ``` bnf
106
  literal:
107
  integer-literal
108
  character-literal
109
- floating-literal
110
  string-literal
111
  boolean-literal
112
  pointer-literal
113
  user-defined-literal
114
  ```
@@ -144,13 +179,12 @@ decimal-literal:
144
  hexadecimal-literal:
145
  hexadecimal-prefix hexadecimal-digit-sequence
146
  ```
147
 
148
  ``` bnf
149
- binary-digit:
150
- '0'
151
- '1'
152
  ```
153
 
154
  ``` bnf
155
  octal-digit: one of
156
  '0 1 2 3 4 5 6 7'
@@ -216,10 +250,17 @@ encoding-prefix: one of
216
  c-char-sequence:
217
  c-char
218
  c-char-sequence c-char
219
  ```
220
 
 
 
 
 
 
 
 
221
  ``` bnf
222
  escape-sequence:
223
  simple-escape-sequence
224
  octal-escape-sequence
225
  hexadecimal-escape-sequence
@@ -243,25 +284,25 @@ hexadecimal-escape-sequence:
243
  '\x' hexadecimal-digit
244
  hexadecimal-escape-sequence hexadecimal-digit
245
  ```
246
 
247
  ``` bnf
248
- floating-literal:
249
- decimal-floating-literal
250
- hexadecimal-floating-literal
251
  ```
252
 
253
  ``` bnf
254
- decimal-floating-literal:
255
- fractional-constant exponent-partₒₚₜ floating-suffixₒₚₜ
256
- digit-sequence exponent-part floating-suffixₒₚₜ
257
  ```
258
 
259
  ``` bnf
260
- hexadecimal-floating-literal:
261
- hexadecimal-prefix hexadecimal-fractional-constant binary-exponent-part floating-suffixₒₚₜ
262
- hexadecimal-prefix hexadecimal-digit-sequence binary-exponent-part floating-suffixₒₚₜ
263
  ```
264
 
265
  ``` bnf
266
  fractional-constant:
267
  digit-sequenceₒₚₜ '.' digit-sequence
@@ -296,11 +337,11 @@ digit-sequence:
296
  digit
297
  digit-sequence '''ₒₚₜ digit
298
  ```
299
 
300
  ``` bnf
301
- floating-suffix: one of
302
  'f l F L'
303
  ```
304
 
305
  ``` bnf
306
  string-literal:
@@ -312,10 +353,17 @@ string-literal:
312
  s-char-sequence:
313
  s-char
314
  s-char-sequence s-char
315
  ```
316
 
 
 
 
 
 
 
 
317
  ``` bnf
318
  raw-string:
319
  '"' d-char-sequenceₒₚₜ '(' r-char-sequenceₒₚₜ ')' d-char-sequenceₒₚₜ '"'
320
  ```
321
 
@@ -323,16 +371,29 @@ raw-string:
323
  r-char-sequence:
324
  r-char
325
  r-char-sequence r-char
326
  ```
327
 
 
 
 
 
 
 
328
  ``` bnf
329
  d-char-sequence:
330
  d-char
331
  d-char-sequence d-char
332
  ```
333
 
 
 
 
 
 
 
 
334
  ``` bnf
335
  boolean-literal:
336
  'false'
337
  'true'
338
  ```
@@ -343,11 +404,11 @@ pointer-literal:
343
  ```
344
 
345
  ``` bnf
346
  user-defined-literal:
347
  user-defined-integer-literal
348
- user-defined-floating-literal
349
  user-defined-string-literal
350
  user-defined-character-literal
351
  ```
352
 
353
  ``` bnf
@@ -357,11 +418,11 @@ user-defined-integer-literal:
357
  hexadecimal-literal ud-suffix
358
  binary-literal ud-suffix
359
  ```
360
 
361
  ``` bnf
362
- user-defined-floating-literal:
363
  fractional-constant exponent-partₒₚₜ ud-suffix
364
  digit-sequence exponent-part ud-suffix
365
  hexadecimal-prefix hexadecimal-fractional-constant binary-exponent-part ud-suffix
366
  hexadecimal-prefix hexadecimal-digit-sequence binary-exponent-part ud-suffix
367
  ```
 
12
  ```
13
 
14
  ``` bnf
15
  preprocessing-token:
16
  header-name
17
+ import-keyword
18
+ module-keyword
19
+ export-keyword
20
  identifier
21
  pp-number
22
  character-literal
23
  user-defined-character-literal
24
  string-literal
 
30
  ``` bnf
31
  token:
32
  identifier
33
  keyword
34
  literal
35
+ operator-or-punctuator
 
36
  ```
37
 
38
  ``` bnf
39
  header-name:
40
  '<' h-char-sequence '>'
 
102
  ``` bnf
103
  digit: one of
104
  '0 1 2 3 4 5 6 7 8 9'
105
  ```
106
 
107
+ ``` bnf
108
+ keyword:
109
+ any identifier listed in [[lex.key]]
110
+ *import-keyword*
111
+ *module-keyword*
112
+ *export-keyword*
113
+ ```
114
+
115
+ ``` bnf
116
+ preprocessing-op-or-punc:
117
+ preprocessing-operator
118
+ operator-or-punctuator
119
+ ```
120
+
121
+ ``` bnf
122
+ %% Ed. note: character protrusion would misalign various operators.
123
+ preprocessing-operator: one of
124
+ '# ## %: %:%:'
125
+ ```
126
+
127
+ ``` bnf
128
+ operator-or-punctuator: one of
129
+ '{ } [ ] ( )'
130
+ '<: :> <% %> ; : ...'
131
+ '? :: . .* -> ->* ~'
132
+ '! + - * / % ^ & |'
133
+ '= += -= *= /= %= ^= &= |='
134
+ '== != < > <= >= <=> && ||'
135
+ '<< >> <<= >>= ++ -- ,'
136
+ 'and or xor not bitand bitor compl'
137
+ 'and_eq or_eq xor_eq not_eq'
138
+ ```
139
+
140
  ``` bnf
141
  literal:
142
  integer-literal
143
  character-literal
144
+ floating-point-literal
145
  string-literal
146
  boolean-literal
147
  pointer-literal
148
  user-defined-literal
149
  ```
 
179
  hexadecimal-literal:
180
  hexadecimal-prefix hexadecimal-digit-sequence
181
  ```
182
 
183
  ``` bnf
184
+ binary-digit: one of
185
+ '0 1'
 
186
  ```
187
 
188
  ``` bnf
189
  octal-digit: one of
190
  '0 1 2 3 4 5 6 7'
 
250
  c-char-sequence:
251
  c-char
252
  c-char-sequence c-char
253
  ```
254
 
255
+ ``` bnf
256
+ c-char:
257
+ any member of the basic source character set except the single-quote ''', backslash '\', or new-line character
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
 
284
  '\x' hexadecimal-digit
285
  hexadecimal-escape-sequence hexadecimal-digit
286
  ```
287
 
288
  ``` bnf
289
+ floating-point-literal:
290
+ decimal-floating-point-literal
291
+ hexadecimal-floating-point-literal
292
  ```
293
 
294
  ``` bnf
295
+ decimal-floating-point-literal:
296
+ fractional-constant exponent-partₒₚₜ floating-point-suffixₒₚₜ
297
+ digit-sequence exponent-part floating-point-suffixₒₚₜ
298
  ```
299
 
300
  ``` bnf
301
+ hexadecimal-floating-point-literal:
302
+ hexadecimal-prefix hexadecimal-fractional-constant binary-exponent-part floating-point-suffixₒₚₜ
303
+ hexadecimal-prefix hexadecimal-digit-sequence binary-exponent-part floating-point-suffixₒₚₜ
304
  ```
305
 
306
  ``` bnf
307
  fractional-constant:
308
  digit-sequenceₒₚₜ '.' digit-sequence
 
337
  digit
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:
 
353
  s-char-sequence:
354
  s-char
355
  s-char-sequence s-char
356
  ```
357
 
358
+ ``` bnf
359
+ s-char:
360
+ any member of the basic source character set except the double-quote '"', backslash '\', or new-line character
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
 
 
371
  r-char-sequence:
372
  r-char
373
  r-char-sequence r-char
374
  ```
375
 
376
+ ``` bnf
377
+ r-char:
378
+ any member of the source character set, except a right parenthesis ')' followed by
379
+ the initial *d-char-sequence* (which may be empty) followed by a double quote '"'.
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 source character set except:
391
+ space, the left parenthesis '(', the right parenthesis ')', the backslash '\', and the control characters
392
+ representing horizontal tab, vertical tab, form feed, and newline.
393
+ ```
394
+
395
  ``` bnf
396
  boolean-literal:
397
  'false'
398
  'true'
399
  ```
 
404
  ```
405
 
406
  ``` bnf
407
  user-defined-literal:
408
  user-defined-integer-literal
409
+ user-defined-floating-point-literal
410
  user-defined-string-literal
411
  user-defined-character-literal
412
  ```
413
 
414
  ``` bnf
 
418
  hexadecimal-literal ud-suffix
419
  binary-literal ud-suffix
420
  ```
421
 
422
  ``` bnf
423
+ user-defined-floating-point-literal:
424
  fractional-constant exponent-partₒₚₜ ud-suffix
425
  digit-sequence exponent-part ud-suffix
426
  hexadecimal-prefix hexadecimal-fractional-constant binary-exponent-part ud-suffix
427
  hexadecimal-prefix hexadecimal-digit-sequence binary-exponent-part ud-suffix
428
  ```