|
498 | 498 | \indextext{token!preprocessing|(}%
|
499 | 499 | \begin{bnf}
|
500 | 500 | \nontermdef{preprocessing-token}\br
|
| 501 | + keyword-placeholder\br |
501 | 502 | header-name\br
|
502 |
| - import-keyword\br |
503 |
| - module-keyword\br |
504 |
| - export-keyword\br |
505 |
| - identifier\br |
506 | 503 | pp-number\br
|
| 504 | + identifier\br |
507 | 505 | character-literal\br
|
508 | 506 | user-defined-character-literal\br
|
509 | 507 | string-literal\br
|
|
518 | 516 | In this document,
|
519 | 517 | glyphs are used to identify
|
520 | 518 | elements of the basic character set\iref{lex.charset}.
|
521 |
| -The categories of preprocessing token are: header names, |
522 |
| -placeholder tokens produced by preprocessing \tcode{import} and \tcode{module} directives |
523 |
| -(\grammarterm{import-keyword}, \grammarterm{module-keyword}, and \grammarterm{export-keyword}), |
524 |
| -identifiers, preprocessing numbers, character literals (including user-defined character |
525 |
| -literals), string literals (including user-defined string literals), preprocessing |
526 |
| -operators and punctuators, and single non-whitespace characters that do not lexically |
| 519 | +The categories of preprocessing token are: |
| 520 | +keyword plaeholders\iref{lex.placeholder}, |
| 521 | +header names\iref{lex.header}, |
| 522 | +preprocessing numbers\iref{lex.ppnumber}, |
| 523 | +identifiers\iref{lex.name}, |
| 524 | +character literals\iref{lex.ccon} including user-defined character literals, |
| 525 | +string literals\iref{lex.string} including user-defined string literals, |
| 526 | +preprocessing operators and punctuators\iref{lex.operators}, and |
| 527 | +single non-whitespace characters that do not lexically |
527 | 528 | match the other preprocessing token categories.
|
528 | 529 | If a \unicode{0027}{apostrophe} or a \unicode{0022}{quotation mark} character
|
529 | 530 | matches the last category, the program is ill-formed.
|
|
551 | 552 | shall have the lexical form of a keyword, an identifier, a literal,
|
552 | 553 | or an operator or punctuator.
|
553 | 554 |
|
554 |
| -\pnum |
555 |
| -The \grammarterm{import-keyword} is produced |
556 |
| -by processing an \keyword{import} directive\iref{cpp.import}, |
557 |
| -the \grammarterm{module-keyword} is produced |
558 |
| -by preprocessing a \keyword{module} directive\iref{cpp.module}, and |
559 |
| -the \grammarterm{export-keyword} is produced |
560 |
| -by preprocessing either of the previous two directives. |
561 |
| -\begin{note} |
562 |
| -None has any observable spelling. |
563 |
| -\end{note} |
564 |
| - |
565 | 555 | \pnum
|
566 | 556 | If the input stream has been parsed into preprocessing tokens up to a
|
567 | 557 | given character:
|
|
631 | 621 | \end{example}
|
632 | 622 | \indextext{token!preprocessing|)}
|
633 | 623 |
|
| 624 | +\rSec1[lex.placeholder]{Keyword placeholders} |
| 625 | +\indextext{placeholder!keyword|(}% |
| 626 | + |
| 627 | +\begin{bnf} |
| 628 | +\nontermdef{keyword-placeholder}\br |
| 629 | + export-keyword\br |
| 630 | + import-keyword\br |
| 631 | + module-keyword |
| 632 | +\end{bnf} |
| 633 | + |
| 634 | +\pnum |
| 635 | +Keyword placeholders are produced by preprocessing \keyword{import} |
| 636 | +and \keyword{module} directives. |
| 637 | +The \grammarterm{import-keyword} is produced |
| 638 | +by preprocessing an \keyword{import} directive\iref{cpp.import}, |
| 639 | +the \grammarterm{module-keyword} is produced |
| 640 | +by preprocessing a \keyword{module} directive\iref{cpp.module}, and |
| 641 | +the \grammarterm{export-keyword} is produced |
| 642 | +by preprocessing either of the previous two directives. |
| 643 | + |
| 644 | +\pnum |
| 645 | +\begin{note} |
| 646 | +Keyword placeholders do not have any observable spelling. |
| 647 | +\end{note} |
| 648 | +\indextext{placeholder!keyword|(}% |
| 649 | + |
634 | 650 | \rSec1[lex.header]{Header names}
|
635 | 651 |
|
636 | 652 | \indextext{header!name|(}%
|
|
964 | 980 | \begin{bnf}
|
965 | 981 | \nontermdef{keyword}\br
|
966 | 982 | \textnormal{any identifier listed in \tref{lex.key}}\br
|
967 |
| - \grammarterm{import-keyword}\br |
968 |
| - \grammarterm{module-keyword}\br |
969 |
| - \grammarterm{export-keyword} |
| 983 | + \grammarterm{keyword-placeholder} |
970 | 984 | \end{bnf}
|
971 | 985 |
|
972 | 986 | \pnum
|
|
0 commit comments