chiark / gitweb /
Static instance support.
[sod] / doc / syntax.tex
index 72329a44199b863b7b0d02f1509ce0caf40c587e..6c05acc45829a45dbe950b44a9619627b9ccd723 100644 (file)
@@ -710,6 +710,27 @@ preprocessor directives in order to declare types and functions for use
 elsewhere in the generated output files.
 
 
+\subsection{Static instance definitions} \label{sec:syntax.module.instance}
+
+\begin{grammar}
+<static-instance-definition> ::=
+  "instance" <identifier> <identifier>
+  @[":" <list>$[\mbox{@<instance-initializer>}]$@] ";"
+
+<instance-initializer> ::= <identifier> "." <identifier> "=" <c-fragment>
+\end{grammar}
+
+Properties:
+\begin{description}
+\item[@"extern"] A boolean flag: if true, then the instance is public, and
+  will be declared in the output header file; if false (the default), then
+  the instance is only available to code defined within the module.
+\item[@"const"] A boolean flag: if true (the default), then the instance is
+  read-only, and may end up in write-protected storage at run-time; if false,
+  then the instance will be writable.
+\end{description}
+
+
 \subsection{Class definitions} \label{sec:syntax.module.class}
 
 \begin{grammar}