\infannex{gram}{Grammar summary}

\rSec1[gram.general]{General}

\pnum
\indextext{grammar}%
\indextext{summary!syntax}%
This summary of \Cpp{} grammar is intended to be an aid to comprehension.
It is not an exact statement of the language.
In particular, the grammar described here accepts
a superset of valid \Cpp{} constructs.
Disambiguation rules\iref{stmt.ambig,dcl.spec,class.member.lookup}
are applied to distinguish expressions from declarations.
Further, access control, ambiguity, and type rules are used
to weed out syntactically valid but meaningless constructs.

\rSec1[gram.key]{Keywords}

\pnum
\indextext{keyword}%
New context-dependent keywords are introduced into a program by
\tcode{typedef}\iref{dcl.typedef},
\tcode{namespace}\iref{namespace.def},
class\iref{class}, enumeration\iref{dcl.enum}, and
\keyword{template}\iref{temp}
declarations.

\begin{ncbnf}
typedef-name:\br
	identifier\br
	simple-template-id
\end{ncbnf}

\begin{ncbnf}
namespace-name:\br
	identifier\br
	namespace-alias
\end{ncbnf}

\begin{ncbnf}
namespace-alias:\br
	identifier
\end{ncbnf}

\begin{ncbnf}
class-name:\br
	identifier\br
	simple-template-id
\end{ncbnf}

\begin{ncbnf}
enum-name:\br
	identifier
\end{ncbnf}

\begin{ncbnf}
template-name:\br
	identifier
\end{ncbnf}

\input{std-gram.ext}
