Annex A (informative) Grammar summary [gram]

A.12 Preprocessing directives [gram.cpp]

preprocessing-file:
group
module-file
module-file:
pp-global-module-fragment pp-module group pp-private-module-fragment
pp-global-module-fragment:
module ; new-line group
pp-private-module-fragment:
module : private ; new-line group
group:
group-part
group group-part
group-part:
control-line
if-section
text-line
# conditionally-supported-directive
control-line:
# include pp-tokens new-line
pp-import
# define identifier replacement-list new-line
# define identifier lparen identifier-list ) replacement-list new-line
# define identifier lparen ... ) replacement-list new-line
# define identifier lparen identifier-list , ... ) replacement-list new-line
# undef identifier new-line
# line pp-tokens new-line
# error pp-tokens new-line
# pragma pp-tokens new-line
# new-line
if-section:
if-group elif-groups else-group endif-line
if-group:
# if constant-expression new-line group
# ifdef identifier new-line group
# ifndef identifier new-line group
elif-groups:
elif-group
elif-groups elif-group
elif-group:
# elif constant-expression new-line group
else-group:
# else new-line group
endif-line:
# endif new-line
text-line:
pp-tokens new-line
conditionally-supported-directive:
pp-tokens new-line
lparen:
a ( character not immediately preceded by white-space
identifier-list:
identifier
identifier-list , identifier
replacement-list:
pp-tokens
pp-tokens:
preprocessing-token
pp-tokens preprocessing-token
new-line:
the new-line character
defined-macro-expression:
defined identifier
defined ( identifier )
h-preprocessing-token:
any preprocessing-token other than >
h-pp-tokens:
h-preprocessing-token
h-pp-tokens h-preprocessing-token
header-name-tokens:
string-literal
< h-pp-tokens >
has-include-expression:
_­_­has_­include ( header-name )
_­_­has_­include ( header-name-tokens )
has-attribute-expression:
_­_­has_­cpp_­attribute ( pp-tokens )
pp-module:
export module pp-tokens ; new-line
pp-import:
export import header-name pp-tokens ; new-line
export import header-name-tokens pp-tokens ; new-line
export import pp-tokens ; new-line
va-opt-replacement:
__VA_­OPT__ ( pp-tokens )