§1. The programs in the Inform toolchain need a variety of services beyond those provided by our standard library foundation. The latter offers basics such as memory allocation, linked lists, string manipulation and so on, but the Inform tools need much more than that.
The services layer of Inform1 is structured as a set of modules. They can be (and are) used by other tools besides the main inform7 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.
To some extent a tool can include just those modules it needs, but there are dependencies between them: for example, linguistics requires syntax, which in turn requires words. Each service has a section of documentation called "How To Include This Module", explaining its needs.
§2. The words 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 wording and word_assemblage, 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.
- ● Contents page of web: words.
- ● Detailed overview: What This Module Does (in words).
- ● Usage instructions: How To Include This Module (in words).
- ● Unit test tool here: words-test.
- ● A manual for writing Preform grammars: About Preform (in words).
§3. The lexicon 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.
- ● Contents page of web: lexicon.
- ● Detailed overview: What This Module Does (in lexicon).
- ● Usage instructions: How To Include This Module (in lexicon).
§4. The calculus 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.
- ● Contents page of web: calculus.
- ● Detailed overview: What This Module Does (in calculus).
- ● Usage instructions: How To Include This Module (in calculus).
- ● Unit test tool here: calculus-test.
§5. syntax 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.
This is really part one of a two-part story, the second being linguistics. Together these define the AST for the Inform 7 language.
- ● Contents page of web: syntax.
- ● Detailed overview: What This Module Does (in syntax).
- ● Usage instructions: How To Include This Module (in syntax).
- ● Unit test tool here: syntax-test.
§6. The linguistics module manages grammatical categories such as verbs, adjectives, determiners and so on, and uses the annotated syntax trees of the syntax module to diagram sentences.
This is really part two of a two-part story, the first being syntax. Together these define the AST for the Inform 7 language.
- ● Contents page of web: linguistics.
- ● Detailed overview: What This Module Does (in linguistics).
- ● Usage instructions: How To Include This Module (in linguistics).
- ● Unit test tool here: linguistics-test.
- ● A description of the result: About Sentence Diagrams (in linguistics).
§7. The inflections 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.2 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".
- ● Contents page of web: inflections.
- ● Detailed overview: What This Module Does (in inflections).
- ● Usage instructions: How To Include This Module (in inflections).
- ● Unit test tool here: inflections-test.
2 A full implementation of Conway's pluralisation algorithm can be found in this module, and is one of Inform's more picturesque corners. ↩
§8. The kinds module provides a basic type system for an Inform-like language.3 Note that this does not contain the Inform typechecker, which can be found in the main compiler (at Dash (in values)); 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.
- ● Contents page of web: kinds.
- ● Detailed overview: What This Module Does (in kinds).
- ● Usage instructions: How To Include This Module (in kinds).
- ● Unit test tool here: kinds-test.
- ● A manual for "Neptune", the mini-language used by kits to create fundamental kinds and kind constructors: A Brief Guide to Neptune (in kinds).
3 Following traditional Inform practice, the term "kind" is used instead of the more conventional computer-science word "type". ↩
§9. The arch 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.
- ● Contents page of web: arch.
- ● Detailed overview: What This Module Does (in arch).
- ● Usage instructions: How To Include This Module (in arch).
- ● Unit test tool here: arch-test.
§10. The problems module is a simple system for producing HTML-page-style error messages, such as the Problems issued by the Inform compiler.4
- ● Contents page of web: problems.
- ● Detailed overview: What This Module Does (in problems).
- ● Usage instructions: How To Include This Module (in problems).
- ● Unit test tool here: problems-test.
4 Arguably it's not really of any wider application and shouldn't have been made a module at all, but never mind. ↩
§11. The html 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.
- ● Contents page of web: html.
- ● Detailed overview: What This Module Does (in html). This section includes a description of the custom Inform-app-only URL schemas inform: and source:.
- ● Usage instructions: How To Include This Module (in html).