1
0
Fork
You've already forked r7rs-large-schema
1
RELAX NG for R7RS documentation
  • Makefile 100%
Find a file
2026年04月10日 23:02:44 -04:00
schemas add <s:identifier> as a valid markup tag in <computeroutput> 2026年04月10日 23:02:44 -04:00
tests add <s:evalexample> 2026年04月09日 18:28:44 -04:00
Makefile add <s:evalexample> 2026年04月09日 18:28:44 -04:00
README.md ideas for better restricting features 2026年04月02日 21:41:28 -04:00

R7RS-Large RELAX-NG Schema

An extension of DocBook 5 for documenting R7RS-Large code (5.0-extension r7rs-large-doc), and a restriction (5.0-variant r7rs-large-report) that only contains the elements necessary to validate and style the Report.

Summary of New Behavior

Read the schema for more information.

BNF

  • <production> is allowed to have one or more <rhs>es.
  • <nonterminal> does not need a link.
  • <production> does not need an xml:id.
  • <rhs> can now have <rhsopt>, <rhsmany>, <rhsplus>.
  • <rhsopt> denotes zero or one of a EBNF production.
  • <rhsmany> denotes zero or more of a EBNF production.
  • <rhsplus> denotes one or more of a EBNF production.

Blocks

  • <remark> is now allowed to have all inlines.

Inlines

  • <s:identifier> is a Scheme identifier.
  • <s:exprsyntax> see below.
  • <nonterminal> can contain general inlines, and is a programming inline.

Synopses

<s:synopsis> is a general Scheme synopsis block used for the prototypes of proecdures and syntax. The following are allowed in <s:synopsis>.

  • <s:boundidentifier> is used to document an identifier. It takes an attribute s:bindtype which is value, identifiersyntax, auxiliary, syntaxparameter, or identifierproperty.
  • <code> is used for lexical syntax.
  • <s:exprsyntax>: see section.
  • <s:procprototype>: see section.
  • <s:librarysynopsis>: A summary of a Scheme library. The first element is a <package>, and the rest of the elements are <s:identifier> that are the identifiers exported by the library.

Expression Syntax

<s:exprsyntax> is the language of Scheme data as trees. It is similar to, but distinct from, EBNF. It is distinct from EBNF because matching and production is done over trees, not strings.

  • <s:list>: Represents a Scheme list. Can have any exprsyntax element, and as the final element can also have <s:listtail>.
  • <s:listtail>: Represents the final cdr of a list when it is generally not a list. Can have any expression element. Can only appear in a <s:list>.
  • <s:exprmany>: Represents zero or more of an element. Can have any exprsyntax in it. Can appear in <s:list>, <s:vector>, and the root. (This is the ... in expressions.)
  • <s:vector>: Represents a Scheme vector. Can have any exprsyntax element.
  • <nonterminal>: Used to represent either a matched expression syntax from somewhere else, a matched EBNF from somewhere else, or a syntactic variable whose contents are described later.
  • <s:identifier>: Used to represent a literal identifier in the expression.
  • <code>: Used to represent a literal datum in the expression, like a string or a number.
  • <inlineequation>: Used to represent some variable.

Expression Grammars

Equivalent to grammars for expression syntax.

  • <s:exprset> is a contained for expressions bound to names.
  • <s:namedexpr> is an <lhs> (name of the expression) followed by zero or more <s:exprsyntax> (interpreted as a disjunction).

Procedure prototypes

<s:procprototype> describes identifiers bound to procedures.

  • <function>: The first element of any procprototype. Contains the name of the procedure.
  • <parameter>: Allowed after the <function>. Internals is text and inlines that markup the name of an argument.
  • <s:argopt>: Allowed after the <function>. Denotes zero or one of an argument. Allows one or more <s:arg*> inside of it.
  • <s:argmany>: Allowed after the <function>. Denotes zero or more of an argument. Allows one or more <s:arg*> inside of it.
  • <s:argplus>: Allowed after the <function>. Denotes one or more of an argument. Allows one or more <s:arg*> inside of it.

Run Tests

The tests by default run in a Docker container. If you have jing locally installed, run

make JING=/path/to/jing SCHEMA_LOCATION=schemas TESTS_LOCATION=tests test-all

Future ideas

These are probably for r7rs-large-report and are probably too restrictive for r7rs-large-doc.

  1. Sections with role feature only allow subsections of semantics, examples, restrictions, and syntax.
  2. Sections with the role semantics, examples, restrictions, and syntax are simple (not using <simpara> though).

License

DocBook5.0 is under the following license:

Copyright 1992-2008 HaL Computer Systems, Inc., O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software Corporation, Norman Walsh, Sun Microsystems, Inc., and the Organization for the Advancement of Structured Information Standards (OASIS).

Release: $Id: docbook.rnc 7661 2008年02月06日 13:52:59Z nwalsh $

Permission to use, copy, modify and distribute the DocBook schema and its accompanying documentation for any purpose and without fee is hereby granted in perpetuity, provided that the above copyright notice and this paragraph appear in all copies. The copyright holders make no representation about the suitability of the schema for any purpose. It is provided "as is" without expressed or implied warranty.

If you modify the DocBook schema in any way, label your schema as a variant of DocBook. See the reference documentation (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook) for more information.

Please direct all questions, bug reports, or suggestions for changes to the docbook@lists.oasis-open.org mailing list. For more information, see http://www.oasis-open.org/docbook/.

The R7RS-Large schema is released into the public domain under the CC0. If you modify the scheme, you are requested to name it something other than VERSION r7rs-large-doc for any value of VERSION.