chiark / gitweb /
doc/syntax.tex: Fix up the syntax notation.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 10 Jan 2016 13:51:04 +0000 (13:51 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 29 May 2016 13:40:39 +0000 (14:40 +0100)
Also correct some pieces which are badly out of date.

  * Fix typesetting of concrete parameters to parametrized nonterminals.

  * Now that <foo-list> isn't reserved, use it for <argument-list>.

  * Fix the <message-item> and <method-item> syntaxes to use the correct
    declarator nonterminals.

doc/syntax.tex
src/sod-module.5

index 19635e806c87fb7a3f86ae17ea5aa25564f9a75b..2059caf832202ad66f222681537808cfde102611 100644 (file)
@@ -338,7 +338,7 @@ The @<s-expression> is evaluated immediately.  It can do anything it likes.
 
 \begin{grammar}
 <typename-definition> ::=
-  "typename" <list>@[<identifier>@] ";"
+  "typename" <list>$[\mbox{@<identifier>}]$ ";"
 \end{grammar}
 
 Each @<identifier> is declared as naming a C type.  This is important because
@@ -355,7 +355,7 @@ declarations instead.
   "code" <identifier> ":" <identifier> @[<constraints>@]
   "{" <c-fragment> "}"
 
-<constraints> ::= "[" <list>@[<constraint>@] "]"
+<constraints> ::= "[" <list>$[\mbox{@<constraint>}]$ "]"
 
 <constraint> ::= @<identifier>^+
 \end{grammar}
@@ -387,7 +387,7 @@ elsewhere in the generated output files.
 \subsection{Property sets} \label{sec:syntax.propset}
 
 \begin{grammar}
-<properties> ::= "[" <list>@[<property>@] "]"
+<properties> ::= "[" <list>$[\mbox{@<property>}]$ "]"
 
 <property> ::= <identifier> "=" <expression>
 \end{grammar}
@@ -487,18 +487,16 @@ All of these have their usual C meanings.
 <declarator-suffix> ::= "[" <c-fragment> "]"
 \alt "(" <arguments> ")"
 
-<arguments> ::= $\epsilon$ | "..."
-\alt <list>@[<argument>@] @["," "..."@]
+<argument-list> ::= $\epsilon$ | "..."
+\alt <list>$[\mbox{@<argument>}]$ @["," "..."@]
 
 <argument> ::= @<declaration-specifier>^+ <argument-declarator>
 
-<argument-declarator> ::= <declarator>@[<identifier> @! $\epsilon$@]
+<argument-declarator> ::= <declarator>$[\mbox{@<identifier> @! $\epsilon$}]$
 
-<simple-declarator> ::= <declarator>@[<identifier>@]
+<simple-declarator> ::= <declarator>$[\mbox{@<identifier>}]$
 
 <dotted-name> ::= <identifier> "." <identifier>
-
-<dotted-declarator> ::= <declarator>@[<dotted-name>@]
 \end{grammar}
 
 The declarator syntax is taken from C, but with some differences.
@@ -545,8 +543,8 @@ class Sub : Super {
 \begin{grammar}
 <full-class-definition> ::=
   @[<properties>@]
-  "class" <identifier> ":" <list>@[<identifier>@]
-  "{" @<class-item>^* "}"
+  "class" <identifier> ":" <list>$[\mbox{@<identifier>}]$
+  "{" @<properties-class-item>^* "}"
 
 <class-item> ::= <slot-item> ";"
 \alt <initializer-item> ";"
@@ -561,8 +559,9 @@ give the name of an existing class (other than a forward-referenced class),
 or an existing type name.  It is conventional to give classes `MixedCase'
 names, to distinguish them from other kinds of identifiers.
 
-The @<list>@[<identifier>@] names the direct superclasses for the new class.  It
-is an error if any of these @<identifier>s does not name a defined class.
+The @<list>$[\mbox{@<identifier>}]$ names the direct superclasses for the new
+class.  It is an error if any of these @<identifier>s does not name a defined
+class.
 
 The @<properties> provide additional information.  The standard class
 properties are as follows.
@@ -592,7 +591,7 @@ These items are discussed on the following sections.
 \begin{grammar}
 <slot-item> ::=
   @[<properties>@]
-  @<declaration-specifier>^+ <list>@[<init-declarator>@]
+  @<declaration-specifier>^+ <list>$[\mbox{@<init-declarator>}]$ ";"
 
 <init-declarator> ::= <simple-declarator> @["=" <initializer>@]
 \end{grammar}
@@ -627,7 +626,7 @@ class Example : Super {
 \subsubsection{Initializer items} \label{sec:syntax.class.init}
 
 \begin{grammar}
-<initializer-item> ::= @["class"@] <list>@[<slot-initializer>@]
+<initializer-item> ::= @["class"@] <list>$[\mbox{@<slot-initializer>}]$
 
 <slot-initializer> ::= <dotted-name> "=" <initializer>
 
@@ -657,7 +656,7 @@ The initializer has one of two forms.
 \begin{grammar}
 <message-item> ::=
   @[<properties>@]
-  @<declaration-specifier>^+ <declarator> @[<method-body>@]
+  @<declaration-specifier>^+ <simple-declarator> @[<method-body>@]
 \end{grammar}
 
 \subsubsection{Method items} \label{sec:syntax.class.method}
@@ -665,7 +664,8 @@ The initializer has one of two forms.
 \begin{grammar}
 <method-item> ::=
   @[<properties>@]
-  @<declaration-specifier>^+ <declarator> <method-body>
+  @<declaration-specifier>^+ <declarator>$[\mbox{@<dotted-name>}]$
+  <method-body>
 
 <method-body> ::= "{" <c-fragment> "}" | "extern" ";"
 \end{grammar}
index 4d59011e32c8f30e8b8f273aaba4bde07ae2e691..5de843253f2814bad5406bd26186ef7c94288b32 100644 (file)
@@ -788,10 +788,10 @@ and one of the following, up to reordering.
 .B ]
 .|
 .B (
-.I arguments
+.I argument-list
 .B )
 .br
-.I arguments
+.I argument-list
 ::=
 \*e |
 .B ...