mirror of
https://github.com/ganelson/inform.git
synced 2024-07-16 22:14:23 +03:00
214 lines
16 KiB
HTML
214 lines
16 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>Services and their unit tests</title>
|
|
<link href="docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<meta name="viewport" content="width=device-width initial-scale=1">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta http-equiv="Content-Language" content="en-gb">
|
|
|
|
<link href="docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<script src="http://code.jquery.com/jquery-1.12.4.min.js"
|
|
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
|
|
|
|
<script src="docs-assets/Bigfoot.js"></script>
|
|
<link href="docs-assets/Bigfoot.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
|
|
</head>
|
|
<body class="commentary-font">
|
|
<nav role="navigation">
|
|
<h1><a href="index.html">
|
|
<img src="docs-assets/Inform.png" height=72">
|
|
</a></h1>
|
|
<ul><li><a href="index.html"><span class="selectedlink">home</span></a></li>
|
|
</ul><h2>Compiler</h2><ul>
|
|
<li><a href="structure.html">structure</a></li>
|
|
<li><a href="inbuildn.html">inbuild</a></li>
|
|
<li><a href="inform7n.html">inform7</a></li>
|
|
<li><a href="intern.html">inter</a></li>
|
|
<li><span class="unlink">services</span></li>
|
|
<li><a href="secrets.html">secrets</a></li>
|
|
</ul><h2>Other Tools</h2><ul>
|
|
<li><a href="inblorbn.html">inblorb</a></li>
|
|
<li><a href="indocn.html">indoc</a></li>
|
|
<li><a href="inform6.html">inform6</a></li>
|
|
<li><a href="inpolicyn.html">inpolicy</a></li>
|
|
</ul><h2>Resources</h2><ul>
|
|
<li><a href="extensions.html">extensions</a></li>
|
|
<li><a href="kits.html">kits</a></li>
|
|
</ul><h2>Repository</h2><ul>
|
|
<li><a href="https://github.com/ganelson/inform"><img src="docs-assets/github.png" height=18> github</a></li>
|
|
</ul><h2>Related Projects</h2><ul>
|
|
<li><a href="../../inweb/index.html">inweb</a></li>
|
|
<li><a href="../../intest/index.html">intest</a></li>
|
|
|
|
</ul>
|
|
</nav>
|
|
<main role="main">
|
|
<!--Weave of 'Services and their unit tests' generated by Inweb-->
|
|
<div class="breadcrumbs">
|
|
<ul class="crumbs"><li><a href="index.html">Home</a></li><li><b>Services and their unit tests</b></li></ul></div>
|
|
<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>§1. </b>The programs in the Inform toolchain need a variety of services beyond those
|
|
provided by our standard library <a href="../../inweb/foundation-module/index.html" class="internal">foundation</a>. The latter offers basics such
|
|
as memory allocation, linked lists, string manipulation and so on, but the
|
|
Inform tools need much more than that.
|
|
</p>
|
|
|
|
<p class="commentary">The services layer of Inform<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> is structured as a set of modules. They can be
|
|
(and are) used by other tools besides the main <a href="inform7/index.html" class="internal">inform7</a> compiler, and in
|
|
particular most of the services come with unit-testing tools: small stand-alone
|
|
executables which enable the workings of the service in question to be tested
|
|
in isolation from the rest of the Inform toolchain.
|
|
</p>
|
|
|
|
<p class="commentary">To some extent a tool can include just those modules it needs, but there are
|
|
dependencies between them: for example, <a href="linguistics-module/index.html" class="internal">linguistics</a> requires <a href="syntax-module/index.html" class="internal">syntax</a>,
|
|
which in turn requires <a href="words-module/index.html" class="internal">words</a>. Each service has a section of documentation
|
|
called "How To Include This Module", explaining its needs.
|
|
</p>
|
|
|
|
<ul class="footnotetexts"><li class="footnote" id="fn:1"><p class="inwebfootnote"><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> At one time this was going to be called Second Foundation, or perhaps
|
|
Foundation and Empire.
|
|
<a href="#fnref:1" title="return to text"> ↩</a></p></li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>§2. </b>The <a href="words-module/index.html" class="internal">words</a> module provides for natural-language text to be read in,
|
|
and then broken up into words and punctuation marks. Usefully efficient ways
|
|
to refer to fragments of this text, such as <span class="extract"><span class="extract-syntax">wording</span></span> and <span class="extract"><span class="extract-syntax">word_assemblage</span></span>,
|
|
are also provided. Much of this is simple book-keeping, but the words module
|
|
also provides the "Preform" system for parsing text against simple grammars.
|
|
Preform powers the lexical/syntax analysis phases of Inform.
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="words-module/index.html" class="internal">words</a>.
|
|
</li><li>● Detailed overview: <a href="words-module/P-wtmd.html" class="internal">What This Module Does (in words)</a>.
|
|
</li><li>● Usage instructions: <a href="words-module/P-htitm.html" class="internal">How To Include This Module (in words)</a>.
|
|
</li><li>● Unit test tool here: <a href="words-test/index.html" class="internal">words-test</a>.
|
|
</li><li>● A manual for writing Preform grammars: <a href="words-module/4-ap.html" class="internal">About Preform (in words)</a>.
|
|
</li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>§3. </b>The <a href="lexicon-module/index.html" class="internal">lexicon</a> module provides a way to store and look up meanings of
|
|
multi-word phrases such as "brass plaque" or "red silk jacket". This is the
|
|
equivalent, in a natural-language context, of a symbols table in a more
|
|
conventional compiler. Speed is critical and some novel algorithms are used.
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="lexicon-module/index.html" class="internal">lexicon</a>.
|
|
</li><li>● Detailed overview: <a href="lexicon-module/P-wtmd.html" class="internal">What This Module Does (in lexicon)</a>.
|
|
</li><li>● Usage instructions: <a href="lexicon-module/P-htitm.html" class="internal">How To Include This Module (in lexicon)</a>.
|
|
</li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>§4. </b>The <a href="calculus-module/index.html" class="internal">calculus</a> module allows logical propositions to be stored and
|
|
simplified. The word "calculus" is used here in the sense of predicate
|
|
calculus with equality, a standard system for mathematical logic, and is
|
|
nothing to do with derivatives or integrals.
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="calculus-module/index.html" class="internal">calculus</a>.
|
|
</li><li>● Detailed overview: <a href="calculus-module/P-wtmd.html" class="internal">What This Module Does (in calculus)</a>.
|
|
</li><li>● Usage instructions: <a href="calculus-module/P-htitm.html" class="internal">How To Include This Module (in calculus)</a>.
|
|
</li><li>● Unit test tool here: <a href="calculus-test/index.html" class="internal">calculus-test</a>.
|
|
</li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>§5. </b><a href="syntax-module/index.html" class="internal">syntax</a> is a relatively small module, which manages annotated syntax trees.
|
|
It provides only basic facilities for making and annotating ASTs, but also
|
|
contains the sentence-breaking algorithm, turning a stream of words into a
|
|
rudimentary AST.
|
|
</p>
|
|
|
|
<p class="commentary">This is really part one of a two-part story, the second being <a href="linguistics-module/index.html" class="internal">linguistics</a>.
|
|
Together these define the AST for the Inform 7 language.
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="syntax-module/index.html" class="internal">syntax</a>.
|
|
</li><li>● Detailed overview: <a href="syntax-module/P-wtmd.html" class="internal">What This Module Does (in syntax)</a>.
|
|
</li><li>● Usage instructions: <a href="syntax-module/P-htitm.html" class="internal">How To Include This Module (in syntax)</a>.
|
|
</li><li>● Unit test tool here: <a href="syntax-test/index.html" class="internal">syntax-test</a>.
|
|
</li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>§6. </b>The <a href="linguistics-module/index.html" class="internal">linguistics</a> module manages grammatical categories such as verbs,
|
|
adjectives, determiners and so on, and uses the annotated syntax trees of
|
|
the <a href="syntax-module/index.html" class="internal">syntax</a> module to diagram sentences.
|
|
</p>
|
|
|
|
<p class="commentary">This is really part two of a two-part story, the first being <a href="syntax-module/index.html" class="internal">syntax</a>.
|
|
Together these define the AST for the Inform 7 language.
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="linguistics-module/index.html" class="internal">linguistics</a>.
|
|
</li><li>● Detailed overview: <a href="linguistics-module/P-wtmd.html" class="internal">What This Module Does (in linguistics)</a>.
|
|
</li><li>● Usage instructions: <a href="linguistics-module/P-htitm.html" class="internal">How To Include This Module (in linguistics)</a>.
|
|
</li><li>● Unit test tool here: <a href="linguistics-test/index.html" class="internal">linguistics-test</a>.
|
|
</li><li>● A description of the result: <a href="linguistics-module/P-asd.html" class="internal">About Sentence Diagrams (in linguistics)</a>.
|
|
</li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>§7. </b>The <a href="inflections-module/index.html" class="internal">inflections</a> module provides ways to recognise or generate inflected
|
|
forms of words: for example, "fig" becoming "figs", "ox" becoming "oxen",
|
|
"box" becoming "boxes", and "sheep" becoming "sheep" are all inflections to
|
|
make the plural of an English noun.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> And similarly for inflected verb forms
|
|
such as "starting", "starts" and "start"; or adjectival inflections such as
|
|
those used to generate comparatives and superlatives — "large" to "larger"
|
|
or "largest".
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="inflections-module/index.html" class="internal">inflections</a>.
|
|
</li><li>● Detailed overview: <a href="inflections-module/P-wtmd.html" class="internal">What This Module Does (in inflections)</a>.
|
|
</li><li>● Usage instructions: <a href="inflections-module/P-htitm.html" class="internal">How To Include This Module (in inflections)</a>.
|
|
</li><li>● Unit test tool here: <a href="inflections-test/index.html" class="internal">inflections-test</a>.
|
|
</li></ul>
|
|
<ul class="footnotetexts"><li class="footnote" id="fn:2"><p class="inwebfootnote"><sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> A full implementation of Conway's pluralisation algorithm can be found in
|
|
this module, and is one of Inform's more picturesque corners.
|
|
<a href="#fnref:2" title="return to text"> ↩</a></p></li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>§8. </b>The <a href="kinds-module/index.html" class="internal">kinds</a> module provides a basic type system for an Inform-like language.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup>
|
|
Note that this does not contain the Inform typechecker, which can be found in
|
|
the main compiler (at <a href="values-module/5-dsh.html" class="internal">Dash (in values)</a>); but it does contain code to test
|
|
whether or not values of one kind conform to another kind, which is a key part
|
|
of the typechecking process.
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="kinds-module/index.html" class="internal">kinds</a>.
|
|
</li><li>● Detailed overview: <a href="kinds-module/P-wtmd.html" class="internal">What This Module Does (in kinds)</a>.
|
|
</li><li>● Usage instructions: <a href="kinds-module/P-htitm.html" class="internal">How To Include This Module (in kinds)</a>.
|
|
</li><li>● Unit test tool here: <a href="kinds-test/index.html" class="internal">kinds-test</a>.
|
|
</li><li>● A manual for "Neptune", the mini-language used by kits to create fundamental
|
|
kinds and kind constructors: <a href="kinds-module/4-abgtn.html" class="internal">A Brief Guide to Neptune (in kinds)</a>.
|
|
</li></ul>
|
|
<ul class="footnotetexts"><li class="footnote" id="fn:3"><p class="inwebfootnote"><sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> Following traditional Inform practice, the term "kind" is used instead of the
|
|
more conventional computer-science word "type".
|
|
<a href="#fnref:3" title="return to text"> ↩</a></p></li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>§9. </b>The <a href="arch-module/index.html" class="internal">arch</a> module is a way to represent the possible code-generation
|
|
"architectures" supported in the Inform toolchain. For example, "32-bit words
|
|
with debugging enabled" is an architecture.
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="arch-module/index.html" class="internal">arch</a>.
|
|
</li><li>● Detailed overview: <a href="arch-module/P-wtmd.html" class="internal">What This Module Does (in arch)</a>.
|
|
</li><li>● Usage instructions: <a href="arch-module/P-htitm.html" class="internal">How To Include This Module (in arch)</a>.
|
|
</li><li>● Unit test tool here: <a href="arch-test/index.html" class="internal">arch-test</a>.
|
|
</li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>§10. </b>The <a href="problems-module/index.html" class="internal">problems</a> module is a simple system for producing HTML-page-style
|
|
error messages, such as the Problems issued by the Inform compiler.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup>
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="problems-module/index.html" class="internal">problems</a>.
|
|
</li><li>● Detailed overview: <a href="problems-module/P-wtmd.html" class="internal">What This Module Does (in problems)</a>.
|
|
</li><li>● Usage instructions: <a href="problems-module/P-htitm.html" class="internal">How To Include This Module (in problems)</a>.
|
|
</li><li>● Unit test tool here: <a href="problems-test/index.html" class="internal">problems-test</a>.
|
|
</li></ul>
|
|
<ul class="footnotetexts"><li class="footnote" id="fn:4"><p class="inwebfootnote"><sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> Arguably it's not really of any wider application and shouldn't have been
|
|
made a module at all, but never mind.
|
|
<a href="#fnref:4" title="return to text"> ↩</a></p></li></ul>
|
|
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>§11. </b>The <a href="html-module/index.html" class="internal">html</a> module contains tools for generating non-standard features of HTML
|
|
needed by the files made by Inform, such as clickable links to the source text.
|
|
</p>
|
|
|
|
<ul class="items"><li>● Contents page of web: <a href="html-module/index.html" class="internal">html</a>.
|
|
</li><li>● Detailed overview: <a href="html-module/P-wtmd.html" class="internal">What This Module Does (in html)</a>. This section includes a
|
|
description of the custom Inform-app-only URL schemas <span class="extract"><span class="extract-syntax">inform:</span></span> and <span class="extract"><span class="extract-syntax">source:</span></span>.
|
|
</li><li>● Usage instructions: <a href="html-module/P-htitm.html" class="internal">How To Include This Module (in html)</a>.
|
|
</li></ul>
|
|
<!--End of weave-->
|
|
|
|
</main>
|
|
</body>
|
|
</html>
|
|
|