X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/a42893dda5f4dd2b89fbfe4e497da261159225ca..c808d837f8b1a3baf4ba5871ddc3a82822de7f9e:/doc/syntax.tex?ds=sidebyside diff --git a/doc/syntax.tex b/doc/syntax.tex index b18acd5..15948cb 100644 --- a/doc/syntax.tex +++ b/doc/syntax.tex @@ -58,7 +58,7 @@ enough that they deserve special notation. \syntax{$x^*$ ::= $[x]$ ::= $\epsilon$ @! $[x]$ $x$} \end{quote} -\item $x^+$ abbreviates @$[x]$, denoting a sequence of zero or +\item $x^+$ abbreviates @$[x]$, denoting a sequence of one or more occurrences of $x$: \begin{quote} \syntax{$x^+$ ::= $[x]$ ::= $[x]$ $x$} @@ -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,7 @@ class Sub : Super { ::= \alt +\alt \alt \alt \alt @@ -663,7 +680,7 @@ class Example : Super { \begin{grammar} ::= @["class"@] $[\mbox{@}]$ ";" - ::= "=" + ::= @["=" @] :: \end{grammar} @@ -676,6 +693,22 @@ 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} ::= "{" "}"