X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/1aedcc8a019d2e9bc1eb1dfab2224a4d4d796225..40f2456eca4c0386a1fd473cfdf61253d13f0048:/doc/syntax.tex diff --git a/doc/syntax.tex b/doc/syntax.tex index 30fcdfb..0b415d2 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,16 @@ 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 +368,53 @@ keyword arguments. ::= "=" - ::= | "+" | "--" + ::= - ::= | "*" | "/" + ::= + | "||" - ::= | "+" | "--" + ::= + | "&&" + + ::= + | "|" + + ::= + | "^" + + ::= + | "&" + + ::= + | "==" + | "!=" + + ::= + | "<" + | "<=" + | ">=" + | ">" + + ::= + | "<<" + | ">>" + + ::= + | "+" + | "--" + + ::= + | "*" + | "/" + + ::= + | "!" | "~" factor + | "+" | "--" ::= | | | -\alt "<" ">" -\alt "{" "}" -\alt "?" -\alt "(" ")" +\alt "<" ">" | "{" "}" | "?" + | "(" ")" \end{grammar} \emph{Property sets} are a means for associating miscellaneous information @@ -462,10 +498,10 @@ above, are as follows. \item The @|boolean| output type denotes a boolean value, which may be either true or false. A value of type @|id| is considered true if it is @|true|, - @|t|, @|yes|, @|on|, or @|verily|; or false if it is @|false|, @|nil|, - @|no|, @|off|, or @|nowise|; it is erroneous to provide any other - identifier where a boolean value is wanted. A value of type @|int| is - considered true if it is nonzero, or false if it is zero. + @|t|, @|yes|, @|on|, @|yup|, or @|verily|; or false if it is @|false|, + @|nil|, @|no|, @|off|, @|nope|, or @|nowise|; it is erroneous to provide + any other identifier where a boolean value is wanted. A value of type + @|int| is considered true if it is nonzero, or false if it is zero. \item The @|symbol| output type denotes a Lisp symbol. @@ -634,9 +670,11 @@ declarations instead. \begin{grammar} ::= - "code" ":" @[@] + "code" ":" @[@] "{" "}" + ::= + ::= "[" $[\mbox{@}]$ "]" ::= @^+