From: Mark Wooding Date: Tue, 20 Aug 2019 10:30:52 +0000 (+0100) Subject: doc/syntax.tex: Reformat the various grammar fragments. X-Git-Url: https://git.distorted.org.uk/~mdw/sod/commitdiff_plain/f575cdca18b30a96a76514c105a933c3e59d6311 doc/syntax.tex: Reformat the various grammar fragments. * Move the prose descriptions to the final case (e.g., for and ). * Present alternatives on a single line where possible. * Use centre-level dots consistently to denote elisions of alternatives. * Space alternatives consistently. --- diff --git a/doc/syntax.tex b/doc/syntax.tex index 07b7ce7..fc34e4e 100644 --- a/doc/syntax.tex +++ b/doc/syntax.tex @@ -53,13 +53,13 @@ could be a token. ::= @! - ::= "A" | "B" | \dots\ | "Z" -\alt "a" | "b" | \dots\ | "z" -\alt + ::= "A" | "B" $| \cdots |$ "Z" + | "a" | "b" $| \cdots |$ "z" + | ::= "0" | - ::= "1" | "2" $| \ldots |$ "9" + ::= "1" | "2" $| \cdots |$ "9" \end{grammar} The precise definition of @ is left to the function @@ -80,11 +80,11 @@ level. ::= "'" "'" - ::= any character other than "\\" or "\"" -\alt "\\" + :: "\\" + | any character other than "\\" or "\"" - ::= any character other than "\\" or "'" -\alt "\\" + :: "\\" + | any character other than "\\" or "'" ::= any single character \end{grammar} @@ -101,25 +101,25 @@ discouraged. \begin{grammar} ::= -\alt -\alt -\alt + | + | + | ::= "0" | @^* - ::= "0" @("b"|"B"@) @^+ + ::= "0" @("b" @! "B"@) @^+ ::= "0" | "1" - ::= "0" @["o"|"O"@] @^+ + ::= "0" @["o" @! "O"@] @^+ - ::= "0" | "1" $| \ldots |$ "7" + ::= "0" | "1" $| \cdots |$ "7" - ::= "0" @("x"|"X"@) @^+ + ::= "0" @("x" @! "X"@) @^+ ::= -\alt "A" | "B" | "C" | "D" | "E" | "F" -\alt "a" | "b" | "c" | "d" | "e" | "f" + | "A" | "B" | "C" | "D" | "E" | "F" + | "a" | "b" | "c" | "d" | "e" | "f" \end{grammar} Sod understands only integers, not floating-point numbers; its integer syntax @@ -130,15 +130,15 @@ binary. However, length and signedness indicators are not permitted. \subsection{Punctuation} \label{sec:syntax.lex.punct} \begin{grammar} - ::= any nonalphanumeric character other than "_", "\"" or "'" + ::= "\dots" +\alt any nonalphanumeric character other than "_", "\"", or "'" \end{grammar} \subsection{Comments} \label{sec:syntax.lex.comment} \begin{grammar} - ::= -\alt + ::= | ::= "/*" @@ -367,18 +367,24 @@ keyword arguments. ::= "=" - ::= | "+" | "--" + ::= - ::= | "*" | "/" + ::= + | "+" + | "--" - ::= | "+" | "--" + ::= + | "*" + | "/" + + ::= + | "!" | "~" factor + | "+" | "--" ::= | | | -\alt "<" ">" -\alt "{" "}" -\alt "?" -\alt "(" ")" +\alt "<" ">" | "{" "}" | "?" + | "(" ")" \end{grammar} \emph{Property sets} are a means for associating miscellaneous information