X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/3934b7ee2c441fc30d64e401facd0e798fe4978f..b04739d01153eb539fd6b05095368e60b0d32bf6:/doc/refintro.tex diff --git a/doc/refintro.tex b/doc/refintro.tex index 349f7b0..6f3938a 100644 --- a/doc/refintro.tex +++ b/doc/refintro.tex @@ -104,7 +104,7 @@ The letter $\epsilon$ denotes the empty nonterminal Parentheses are used for grouping of alternatives within the right-hand side of a production rule. Specifically, a right-hand side \begin{quote} - \syntax{$\alpha$ @($\beta_1$ @! $\beta_2$ $| \cdots |$ $\beta_n$@) $\gamma$} + \syntax{$\alpha$ @($\beta_1$ | $\beta_2$ | $\cdots$ | $\beta_n$@) $\gamma$} \end{quote} where $\alpha$, $\beta_i$, and $\gamma$ are any sequence of nonterminal symbols or parenthesized groups, is equivalent to the right-hand side @@ -113,13 +113,13 @@ symbols or parenthesized groups, is equivalent to the right-hand side \end{quote} together with the new production \begin{quote} - \syntax{$b$ ::= $\beta_1$ @! $\beta_2$ $| \cdots |$ $\beta_n$} + \syntax{$b$ ::= $\beta_1$ | $\beta_2$ | $\cdots$ | $\beta_n$} \end{quote} where $b$ is a new nonterminal symbol. Given the indexed-nonterminal notation described below, one might consider a -group \syntax{@($\beta_1$ @! $\beta_2$ $| \cdots |$ $\beta_n$@)} equivalent -to \syntax{@[$\beta_1$ @! $\beta_2$ $| \cdots |$ $\beta_n$@]}, where +group \syntax{@($\beta_1$ | $\beta_2$ | $\cdots$ | $\beta_n$@)} equivalent to +\syntax{@[$\beta_1$ | $\beta_2$ | $\cdots$ | $\beta_n$@]}, where \begin{quote} \syntax{@[$x$@] ::= $x$} \end{quote} @@ -139,14 +139,14 @@ As a notational convenience, where an indexed nonterminal appears on the right-hand side of a production rule, each actual argument may be a sequence of alternative right-hand sides, separated by `$|$', rather than a a simple terminal or nonterminal symbol. A complex indexing of this form, say -\syntax{$x$@[$\alpha_1^1$ @! $\alpha_1^2$ $| \cdots |$ $\alpha_1^{m_1}, -\ldots,$ $\alpha_n^1$ @! $\alpha_n^2$ $| \cdots |$ $\alpha_n^{m_n}$@]} -means exactly the same as \syntax{$x$@[$a_1, \ldots, a_n$@]} with the -additional rules +\syntax{$x$@[$\alpha_1^1$ | $\alpha_1^2$ | $\cdots$ | $\alpha_1^{m_1}, +\ldots,$ $\alpha_n^1$ | $\alpha_n^2$ | $\cdots$ | $\alpha_n^{m_n}$@]} means +exactly the same as \syntax{$x$@[$a_1, \ldots, a_n$@]} with the additional +rules \begin{quote} - \syntax{$a_1$ ::= $\alpha_1^1$ @! $\alpha_1^2$ $| \cdots |$ $\alpha_1^{m_1}$} \\* + \syntax{$a_1$ ::= $\alpha_1^1$ | $\alpha_1^2$ | $\cdots$ | $\alpha_1^{m_1}$} \\* \hbox{}\qquad $\vdots$ \\* - \syntax{$a_n$ ::= $\alpha_n^1$ @! $\alpha_n^2$ $| \cdots |$ $\alpha_1^{m_n}$} + \syntax{$a_n$ ::= $\alpha_n^1$ | $\alpha_n^2$ | $\cdots$ | $\alpha_1^{m_n}$} \end{quote} where $a_1$, \ldots, $a_n$ are new nonterminal symbols. @@ -159,13 +159,13 @@ enough that they deserve special notation. \item @[$x$@] abbreviates @$[x]$, denoting an optional occurrence of $x$: \begin{quote} - \syntax{@[$x$@] ::= $[x]$ ::= $\epsilon$ @! $x$} + \syntax{@[$x$@] ::= $[x]$ ::= $\epsilon$ | $x$} \end{quote} \item $x^*$ abbreviates @$[x]$, denoting a sequence of zero or more occurrences of $x$: \begin{quote} \syntax{$x^*$ ::= $[x]$ ::= - $\epsilon$ @! $[x]$ $x$} + $\epsilon$ | $[x]$ $x$} \end{quote} \item $x^+$ abbreviates @$[x]$, denoting a sequence of one or more occurrences of $x$: @@ -175,7 +175,7 @@ enough that they deserve special notation. \item @$[x]$ denotes a sequence of one or more occurrences of $x$ separated by commas: \begin{quote} - \syntax{$[x]$ ::= $x$ @! $[x]$ "," $x$} + \syntax{$[x]$ ::= $x$ | $[x]$ "," $x$} \end{quote} \end{itemize}