From ea08dc5602e822724b99d3ab22dc346d136061db Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 10 Jan 2016 13:51:04 +0000 Subject: [PATCH] doc/syntax.tex: Fix up the syntax notation. Also correct some pieces which are badly out of date. * Fix typesetting of concrete parameters to parametrized nonterminals. * Now that isn't reserved, use it for . * Fix the and syntaxes to use the correct declarator nonterminals. --- doc/syntax.tex | 34 +++++++++++++++++----------------- src/sod-module.5 | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/doc/syntax.tex b/doc/syntax.tex index 19635e8..2059caf 100644 --- a/doc/syntax.tex +++ b/doc/syntax.tex @@ -338,7 +338,7 @@ The @ is evaluated immediately. It can do anything it likes. \begin{grammar} ::= - "typename" @[@] ";" + "typename" $[\mbox{@}]$ ";" \end{grammar} Each @ is declared as naming a C type. This is important because @@ -355,7 +355,7 @@ declarations instead. "code" ":" @[@] "{" "}" - ::= "[" @[@] "]" + ::= "[" $[\mbox{@}]$ "]" ::= @^+ \end{grammar} @@ -387,7 +387,7 @@ elsewhere in the generated output files. \subsection{Property sets} \label{sec:syntax.propset} \begin{grammar} - ::= "[" @[@] "]" + ::= "[" $[\mbox{@}]$ "]" ::= "=" \end{grammar} @@ -487,18 +487,16 @@ All of these have their usual C meanings. ::= "[" "]" \alt "(" ")" - ::= $\epsilon$ | "..." -\alt @[@] @["," "..."@] + ::= $\epsilon$ | "..." +\alt $[\mbox{@}]$ @["," "..."@] ::= @^+ - ::= @[ @! $\epsilon$@] + ::= $[\mbox{@ @! $\epsilon$}]$ - ::= @[@] + ::= $[\mbox{@}]$ ::= "." - - ::= @[@] \end{grammar} The declarator syntax is taken from C, but with some differences. @@ -545,8 +543,8 @@ class Sub : Super { \begin{grammar} ::= @[@] - "class" ":" @[@] - "{" @^* "}" + "class" ":" $[\mbox{@}]$ + "{" @^* "}" ::= ";" \alt ";" @@ -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 @@[@] names the direct superclasses for the new class. It -is an error if any of these @s does not name a defined class. +The @$[\mbox{@}]$ names the direct superclasses for the new +class. It is an error if any of these @s does not name a defined +class. The @ provide additional information. The standard class properties are as follows. @@ -592,7 +591,7 @@ These items are discussed on the following sections. \begin{grammar} ::= @[@] - @^+ @[@] + @^+ $[\mbox{@}]$ ";" ::= @["=" @] \end{grammar} @@ -627,7 +626,7 @@ class Example : Super { \subsubsection{Initializer items} \label{sec:syntax.class.init} \begin{grammar} - ::= @["class"@] @[@] + ::= @["class"@] $[\mbox{@}]$ ::= "=" @@ -657,7 +656,7 @@ The initializer has one of two forms. \begin{grammar} ::= @[@] - @^+ @[@] + @^+ @[@] \end{grammar} \subsubsection{Method items} \label{sec:syntax.class.method} @@ -665,7 +664,8 @@ The initializer has one of two forms. \begin{grammar} ::= @[@] - @^+ + @^+ $[\mbox{@}]$ + ::= "{" "}" | "extern" ";" \end{grammar} diff --git a/src/sod-module.5 b/src/sod-module.5 index 4d59011..5de8432 100644 --- a/src/sod-module.5 +++ b/src/sod-module.5 @@ -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 ... -- 2.11.0