commit b87a6107ac95e9755348964049ad1f72c0bd86df parent 59924c6e1ea7668df2d43d5fbc9b7bfc5b458458 Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz> Date: Fri, 9 Feb 2024 17:06:53 -0500 Formal syntax: Add rest of grammar. Diffstat:
M | doc/r7rs-small/formal-syntax.texinfo | | | 93 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- |
1 file changed, 91 insertions(+), 2 deletions(-)
diff --git a/doc/r7rs-small/formal-syntax.texinfo b/doc/r7rs-small/formal-syntax.texinfo @@ -602,9 +602,98 @@ pattern or an identifier pattern. @node Programs and definitions @subsection Programs and definitions -[grammar] +@indentedblock + +@svar{program} @expansion{} + @atleastone{@svar{import declaration}} + @atleastone{@svar{command or definition}} + +@svar{command or definition} @expansion{} @svar{command} + | @svar{definition} + | @code{(begin }@atleastone{@svar{command or definition}}@code{)} + +@svar{definition} @expansion{} + @code{(define }@svar{identifier} @svar{expression}@code{)} + | @code{(define }(@svar{identifier} @svar{def formals}@code{)} + @svar{body}@code{)} + | @svar{syntax definition} + | @code{(define-values }@svar{formals} @svar{body}@code{)} + | @code{(define-record-type }@svar{identifier} + @svar{constructor} @svar{identifier} + @arbno{@svar{field spec}}@code{)} + | @code{(begin }@arbno{@svar{definition}}@code{)} + +@svar{def formals} @expansion{} @arbno{@svar{identifier}} + | @arbno{@svar{identifier}} @code{.} @svar{identifier} + +@svar{constructor} @expansion{} + @code{(}@svar{identifier} @arbno{@svar{field name}}@code{)} + +@svar{field spec} @expansion{} + @code{(}@svar{field name} @svar{accessor}@code{)} + | @code{(}@svar{field name} @svar{accessor} @svar{mutator}@code{)} + +@svar{field name} @expansion{} @svar{identifier} + +@svar{accessor} @expansion{} @svar{identifier} + +@svar{mutator} @expansion{} @svar{identifier} + +@svar{syntax definition} @expansion{} + @code{(define-syntax }@svar{keyword} @svar{transformer spec}@code{)} + +@end indentedblock @node Libraries formal @subsection Libraries -[grammar] +@indentedblock + +@svar{library} @expansion{} + @code{(define-library }@svar{library name} + @arbno{@svar{library declaration}}@code{)} + +@svar{library name} @expansion{} + @code{(}@atleastone{@svar{library name part}}@code{)} + +@svar{library name part} @expansion{} @svar{identifier} + | @svar{uinteger 10} + +@svar{library declaration} @expansion{} + @code{(export }@arbno{@svar{export spec}}@code{)} + | @svar{import declaration} + | @code{(begin }@arbno{@svar{command or definition}}@code{)} + | @svar{includer} + | @code{(include-library-declarations} + @atleastone{@svar{string}}@code{)} + | @code{(cond-expand} + @atleastone{@svar{cond-expand clause}}@code{)} + | @code{(cond-expand} + @atleastone{@svar{cond-expand clause}} + @code{(else }@arbno{@svar{library declaration}})@code{)} + +@svar{import declaration} @expansion{} + @code{(import }@atleastone{@svar{import set}}@code{)} + +@svar{export spec} @expansion{} @svar{identifier} + | @code{(rename }@svar{identifier} @svar{identifier}@code{)} + +@svar{import set} @expansion{} @svar{library name} + | @code{(only }@svar{import set} + @atleastone{@svar{identifier}}@code{)} + | @code{(except }@svar{import set} + @atleastone{@svar{identifier}}@code{)} + | @code{(prefix }@svar{import set} @svar{identifier}@code{)} + | @code{(rename }@svar{import set} + @atleastone{(@svar{identifier} @svar{identifier})}@code{)} + +@svar{cond-expand clause} @expansion{} + (@svar{feature requirement} @arbno{@svar{library declaration}}@code{)} + +@svar{feature requirement} @expansion{} @svar{identifier} + | @code{(library }@svar{library name}@code{)} + | @code{(and }@arbno{@svar{feature requirement}}@code{)} + | @code{(or }@arbno{@svar{feature requirement}}@code{)} + | @code{(not }@svar{feature requirement}@code{)} + +@end indentedblock