X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/a888e3acc123993fa6fca9338f291b306aa131e2..e390f74754f630f5b3b143d410addcee3d88f792:/doc/syntax.tex diff --git a/doc/syntax.tex b/doc/syntax.tex index c23e58e..21f835e 100644 --- a/doc/syntax.tex +++ b/doc/syntax.tex @@ -451,8 +451,19 @@ recognized. \alt "bool" | "_Bool" \alt "imaginary" | "_Imaginary" | "complex" | "_Complex" \alt +\alt +\alt - ::= "const" | "volatile" | "restrict" + ::= | "const" | "volatile" | "restrict" + + ::= + "(" @^+ ")" + + ::= "atomic" | "_Atomic" + + ::= "(" ")" + + ::= "alignas" "_Alignas" ::= \end{grammar} @@ -469,9 +480,11 @@ defined in the built-in module. Declaration specifiers may appear in any order. However, not all combinations are permitted. A declaration specifier must consist of zero or -more @s, and one of the following, up to reordering. +more @s, zero or more @s, and one of the +following, up to reordering. \begin{itemize} \item @ +\item @ \item @"struct" @, @"union" @, @"enum" @ \item @"void" \item @"_Bool", @"bool" @@ -509,6 +522,9 @@ All of these have their usual C meanings. ::= @^+ + ::= $[\epsilon, \mbox{@}]$ + + ::= $[\mbox{@ @! $\epsilon$}]$ ::= $[\mbox{@ @! $\epsilon$}, \mbox{@}]$ @@ -585,6 +601,8 @@ class Sub : Super { ::= \alt +\alt +\alt \alt \alt \end{grammar} @@ -662,7 +680,7 @@ class Example : Super { \begin{grammar} ::= @["class"@] $[\mbox{@}]$ ";" - ::= "=" + ::= @["=" @] :: \end{grammar} @@ -675,6 +693,29 @@ The first component of the @ must be the nickname of one of the class's superclasses (including itself); the second must be the name of a slot defined in that superclass. +An @|initarg| property may be set on an instance slot initializer (or a +direct slot definition). See \xref{sec:concepts.lifecycle.birth} for the +details. An initializer item must have either an @|initarg| property, or an +initializer expression, or both. + +Each class may define at most one initializer item with an explicit +initializer expression for a given slot. + +\subsubsection{Initarg items} +\begin{grammar} + ::= + "initarg" + @^+ + $[\mbox{@}]$ ";" +\end{grammar} + +\subsubsection{Fragment items} +\begin{grammar} + ::= "{" "}" + + ::= "init" | "teardown" +\end{grammar} + \subsubsection{Message items} \begin{grammar} ::=