chiark / gitweb /
doc/syntax.tex: Refactor the <class-definition> syntax.
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)
  * Attach the semicolon terminators to the individual <...-item>
    syntaxes rather than including them in <class-item>.

  * Conversely, pull the property sets out of the individual items and
    into the top-level syntax, on the grounds that all class items have
    property sets as a fundamental part of the high-level syntax.

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

index 2059caf832202ad66f222681537808cfde102611..3727013f5f7e9cfcc3278fcd4ce05eeaf1be1b72 100644 (file)
@@ -546,8 +546,10 @@ class Sub : Super {
   "class" <identifier> ":" <list>$[\mbox{@<identifier>}]$
   "{" @<properties-class-item>^* "}"
 
-<class-item> ::= <slot-item> ";"
-\alt <initializer-item> ";"
+<properties-class-item> ::= @[<properties>@] <class-item>
+
+<class-item> ::= <slot-item>
+\alt <initializer-item>
 \alt <message-item>
 \alt <method-item>
 \end{grammar}
@@ -590,7 +592,6 @@ These items are discussed on the following sections.
 
 \begin{grammar}
 <slot-item> ::=
-  @[<properties>@]
   @<declaration-specifier>^+ <list>$[\mbox{@<init-declarator>}]$ ";"
 
 <init-declarator> ::= <simple-declarator> @["=" <initializer>@]
@@ -626,7 +627,7 @@ class Example : Super {
 \subsubsection{Initializer items} \label{sec:syntax.class.init}
 
 \begin{grammar}
-<initializer-item> ::= @["class"@] <list>$[\mbox{@<slot-initializer>}]$
+<initializer-item> ::= @["class"@] <list>$[\mbox{@<slot-initializer>}]$ ";"
 
 <slot-initializer> ::= <dotted-name> "=" <initializer>
 
@@ -655,16 +656,17 @@ The initializer has one of two forms.
 
 \begin{grammar}
 <message-item> ::=
-  @[<properties>@]
-  @<declaration-specifier>^+ <simple-declarator> @[<method-body>@]
+  @<declaration-specifier>^+
+  <keyword-declarator>$[\mbox{@<identifier>}]$
+  @[<method-body>@]
 \end{grammar}
 
 \subsubsection{Method items} \label{sec:syntax.class.method}
 
 \begin{grammar}
 <method-item> ::=
-  @[<properties>@]
-  @<declaration-specifier>^+ <declarator>$[\mbox{@<dotted-name>}]$
+  @<declaration-specifier>^+
+  <keyword-declarator>$[\mbox{@<dotted-name>}]$
   <method-body>
 
 <method-body> ::= "{" <c-fragment> "}" | "extern" ";"
index 5de843253f2814bad5406bd26186ef7c94288b32..2a1123f6cca4f603babc94064c9eecbc10147682 100644 (file)
@@ -520,9 +520,14 @@ class-definition
 .IR list [ identifier ]
 .<
 .B {
-.IR class-item \**
+.IR properties-class-item \**
 .B }
 .br
+.I properties-class-item
+::=
+.RI [ properties ]
+.I class-item
+.br
 .I class-item
 ::=
 .I slot-item
@@ -536,7 +541,6 @@ class-definition
 .I slot-item
 ::=
 .<
-.RI [ properties ]
 .IR declaration-specifier \*+
 .IR list [ init-declarator ]
 .B ;
@@ -549,7 +553,6 @@ class-definition
 .br
 .I initializer-item
 ::=
-.RI [ properties ]
 .RB [ class ]
 .IR list [ slot-initializer ]
 .B ;
@@ -570,19 +573,16 @@ class-definition
 .br
 .I message-item
 ::=
-.RI [ properties ]
 .<
 .IR declaration-specifier \*+
 .I simple-declarator
-.<
 .RI [ method-body ]
 .br
 .I method-item
-.RI [ properties ]
+::=
 .<
 .IR declaration-specifier \*+
-.I dotted-declarator
-.<
+.IR declarator [ dotted-name ]
 .I method-body
 .br
 .I method-body
@@ -818,11 +818,7 @@ and one of the following, up to reordering.
 .I identifier
 .B .\&
 .I identifier
-.br
-.I dotted-declarator
-::=
-.IR declarator [ dotted-name ]
-
+.
 .\"--------------------------------------------------------------------------
 .SH SEE ALSO
 .BR sod (1),