commit 035a16e6587317770f326eb9d9e8ce584681dd4c parent a486697fb767279df7be1278766969438c0ef06f Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz> Date: Fri, 9 Feb 2024 14:07:23 -0500 Formal syntax: More. Diffstat:
M | doc/r7rs-small/formal-syntax.texinfo | | | 158 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- |
1 file changed, 157 insertions(+), 1 deletion(-)
diff --git a/doc/r7rs-small/formal-syntax.texinfo b/doc/r7rs-small/formal-syntax.texinfo @@ -325,7 +325,163 @@ the syntax keywords defined in this report have been properly imported from their libraries, and that none of them have been redefined or shadowed. -[grammar] +@indentedblock + +@svar{expression} @expansion{} @svar{identifier} + | @svar{literal} + | @svar{procedure call} + | @svar{lambda expression} + | @svar{conditional} + | @svar{assignment} + | @svar{derived expression} + | @svar{macro use} + | @svar{macro block} + | @svar{includer} + +@sp 1 + +@svar{literal} @expansion{} @svar{quotation} | @svar{self-evaluating} + +@svar{self-evaluating} @expansion{} @svar{boolean} | @svar{number} + | @svar{vector} | @svar{character} | @svar{string} | @svar{bytevector} + +@svar{quotation} @expansion{} @code{'}@svar{datum} + | @code{(quote} @svar{datum}@code{)} + +@svar{procedure call} @expansion{} + @code{(}@svar{operator} @arbno{@svar{operand}}@code{)} + +@svar{operator} @expansion{} @svar{expression} + +@svar{operand} @expansion{} @svar{expression} + +@sp 1 + +@svar{lambda expression} @expansion{} + @code{(lambda} @svar{formals} @svar{body}@code{)} + +@svar{formals} @expansion{} @code{(}@arbno{@svar{identifier}}@code{)} + | @svar{identifier} + | @code{(}@atleastone{@svar{identifier}} @code{.} + @svar{identifier}@code{)} + +@svar{body} @expansion{} @arbno{@svar{definition}} @svar{sequence} + +@svar{sequence} @expansion{} @arbno{@svar{command}} @svar{expression} + +@svar{command} @expansion{} @svar{expression} + +@sp 1 + +@svar{conditional} @expansion{} + @code{(if} @svar{test} @svar{consequent} @svar{alternate}@code{)} + +@svar{test} @expansion{} @svar{expression} + +@svar{consequent} @expansion{} @svar{expression} + +@svar{alternate} @expansion{} @svar{expression} | @svar{empty} + +@sp 1 + +@svar{assignment} @expansion{} + @code{(set!} @svar{identifier} @svar{expression}@code{)} + +@sp 1 + +@c This is going to need some serious line-breaking. +@svar{derived expression} @expansion{} + @code{(cond }@atleastone{@svar{cond clause}}@code{)} + | @code{(cond }@arbno{@svar{cond clause}} @code{(else} + @svar{sequence})@code{)} + | @code{(case }@svar{expression} + @atleastone{@svar{case clause}}@code{)} + | @code{(case }@svar{expression} + @arbno{@svar{case clause}} + @code{(else }@svar{sequence})@code{)} + | @code{(case }@svar{expression} + @arbno{@svar{case clause}} + @code{(else =>} @svar{recipient})@code{)} + | @code{(and }@arbno{@svar{test}}@code{)} + | @code{(or }@arbno{@svar{test}}@code{)} + | @code{(when }@svar{test} @svar{sequence}@code{)} + | @code{(unless }@svar{test} @svar{sequence}@code{)} + | @code{(let }(@arbno{@svar{binding spec}}) @svar{body}@code{)} + | @code{(let }@svar{identifier} (@arbno{@svar{binding spec}}) + @svar{body}@code{)} + | @code{(let* }(@arbno{@svar{binding spec}}) @svar{body}@code{)} + | @code{(letrec }(@arbno{@svar{binding spec}}) @svar{body}@code{)} + | @code{(letrec* }(@arbno{@svar{binding spec}}) @svar{body}@code{)} + | @code{(let-values }(@arbno{@svar{mv binding spec}}) + @svar{body}@code{)} + | @code{(let*-values }(@arbno{@svar{mv binding spec}}) + @svar{body}@code{)} + | @code{(begin }@svar{sequence}@code{)} + | @code{(do }(@arbno{@svar{iteration spec}}@code{)} + (@svar{test} @svar{do result}@code{)} + @arbno{@svar{command}}@code{)} + | @code{(delay }@svar{expression}@code{)} + | @code{(delay-force }@svar{expression}@code{)} + | @code{(parameterize }(@arbno{(@svar{expression} @svar{expression})}@code{)} + @svar{body}@code{)} + | @code{(guard }(@svar{identifier} @arbno{@svar{cond clause}}) @svar{body}@code{)} + | @svar{quasiquotation} + | @code{(case-lambda }@arbno{@svar{case-lambda clause}}@code{)} + +@sp 1 + +@svar{cond clause} @expansion{} @code{(}@svar{test} @svar{sequence}@code{)} + | @code{(}@svar{test}@code{)} + | @code{(}@svar{test} @code{=>} @svar{recipient}@code{)} + +@svar{recipient} @expansion{} @svar{expression} + +@svar{case clause} @expansion{} + @code{((}@arbno{@svar{datum}}@code{)} @svar{sequence}@code{)} + | @code{((}@arbno{@svar{datum}}@code{) =>} @svar{recipient}@code{)} + +@svar{binding spec} @expansion{} @code{(}@svar{identifier} + @svar{expression}@code{)} + +@svar{mv binding spec} @expansion{} @code{(}@svar{formals} + @svar{expression}@code{)} + +@svar{iteration spec} @expansion{} @code{(}@svar{identifier} @svar{init} + @svar{step}@code{)} + | @code{(}@svar{identifier} @svar{init}@code{)} + +@svar{case-lambda clause} @expansion{} @code{(}@svar{formals} + @svar{body}@code{)} + +@svar{init} @expansion{} @svar{expression} + +@svar{step} @expansion{} @svar{expression} + +@svar{do result} @expansion{} @svar{sequence} | @svar{empty} + +@sp 1 + +@svar{macro use} @expansion{} @code{(}@svar{keyword} + @arbno{@svar{datum}}@code{)} + +@svar{keyword} @expansion{} @svar{identifier} + +@svar{macro block} @expansion{} + @code{@code{(}let-syntax }@code{(}@arbno{@svar{syntax spec}}@code{)} + @svar{body}@code{)} + | @code{(letrec-syntax }@code{(}@arbno{@svar{syntax spec}}@code{)} + @svar{body}@code{)} + +@svar{syntax spec} @expansion{} @code{(}@svar{keyword} + @svar{transformer spec}@code{)} + +@sp 1 + +@svar{includer} @expansion{} + | @code{(include }@atleastone{@svar{string}}@code{)} + | @code{(include-ci }@atleastone{@svar{string}}@code{)} + +@end indentedblock @node Quasiquotations @subsection Quasiquotations