Inform 7: The Program

Inform 7

Build 6F95

Graham Nelson

Inform 7 PDF
(510pp, 1121KB)

The core compiler in a natural-language design system for interactive fiction.

Artistic License 2.0

Appendix B: The Template Layer  (510pp, 1121KB1 overfull hbox )  


The template organises the I6 code generated by Inform, fleshes it out with a large amount of standard material (similar to the content of the traditional I6 library, which I7 doesn't use), and also controls the sequence of operations followed during compilation.

Introduction.i6t  (B/introt: 5pp, 82KB)

File (228 lines) 

PDF (5pp, 82KB) 

A short introduction to the template and its organisation.

Main.i6t  (B/maint: 4pp, 65KB)

File (191 lines) 

PDF (4pp, 65KB) 

The top-level logic of NI: the sequence of operations followed by NI up to the point where the output file is opened, resuming after it is closed again.

Load-Core.i6t  (B/lcore: 11pp, 70KB)

File (632 lines) 

PDF (11pp, 70KB) 

To load the core language definition for Inform, which means creating the basis for its hierarchy of kinds.

Load-Times.i6t  (B/ltims: 1pp, 41KB)

File (39 lines) 

PDF (1pp, 41KB) 

To load the Times of Day language definition element.

Load-Actions.i6t  (B/lacts: 2pp, 41KB)

File (66 lines) 

PDF (2pp, 41KB) 

To load the Actions language definition element.

Load-Scenes.i6t  (B/lscen: 1pp, 40KB)

File (36 lines) 

PDF (1pp, 40KB) 

To load the Scenes language definition element.

Load-Figures.i6t  (B/lfigs: 1pp, 39KB)

File (35 lines) 

PDF (1pp, 39KB) 

To load the Figures language definition element.

Load-Sounds.i6t  (B/lsnd: 1pp, 39KB)

File (35 lines) 

PDF (1pp, 39KB) 

To load the Sounds language definition element.

Load-Files.i6t  (B/lfile: 1pp, 39KB)

File (35 lines) 

PDF (1pp, 39KB) 

To load the Files language definition element.

Output.i6t  (B/outt: 13pp, 104KB)

File (764 lines) 

PDF (13pp, 104KB) 

This is the superstructure of the file of I6 code output by NI: from ICL commands at the top down to the signing-off comments at the bottom.

Definitions.i6t  (B/defnt: 14pp, 116KB)

File (781 lines) 

PDF (14pp, 116KB) 

Miscellaneous constant definitions, usually providing symbolic names for otherwise inscrutable numbers, which are used throughout the template layer.

OrderOfPlay.i6t  (B/ordt: 12pp, 112KB)

File (702 lines) 

PDF (12pp, 112KB) 

The sequence of events in play: the Main routine which runs the startup rulebook, the turn sequence rulebook and the shutdown rulebook; and most of the I6 definitions of primitive rules in those rulebooks.

Actions.i6t  (B/actt: 14pp, 96KB)

File (751 lines) 

PDF (14pp, 96KB) 

To try actions by people in the model world, processing the necessary rulebooks.

Activities.i6t  (B/acvt: 4pp, 60KB)

File (172 lines) 

PDF (4pp, 60KB) 

To run the necessary rulebooks to carry out an activity.

Rulebooks.i6t  (B/rbt: 9pp, 87KB)

File (483 lines) 

PDF (9pp, 87KB) 

To work through the rules in a rulebook until a decision is made.

Parser.i6t  (B/parst: 69pp, 212KB)

File (3961 lines) 

PDF (69pp, 212KB) 

The parser for turning the text of the typed command into a proposed action by the player.

ListWriter.i6t  (B/lwt: 15pp, 117KB)

File (875 lines) 

PDF (15pp, 117KB) 

A flexible object-lister taking care of plurals, inventory information, various formats and so on.

OutOfWorld.i6t  (B/oowt: 3pp, 53KB)

File (137 lines) 

PDF (3pp, 53KB) 

To implement some of the out of world actions.

WorldModel.i6t  (B/wmt: 13pp, 96KB)

File (684 lines) 

PDF (13pp, 96KB) 

Testing and changing the fundamental spatial relations.

Light.i6t  (B/light: 7pp, 76KB)

File (351 lines) 

PDF (7pp, 76KB) 

The determination of light, visibility and physical access.

Tests.i6t  (B/testt: 9pp, 73KB)

File (483 lines) 

PDF (9pp, 73KB) 

The command grammar and I6 implementation for testing commands such as TEST, ACTIONS and PURLOIN.

Language.i6t  (B/langt: 19pp, 90KB)

File (989 lines) 

PDF (19pp, 90KB) 

The fundamental definitions needed by the parser and the verb library in order to specify the language of play -- that is, the language used for communications between the story file and the player.

MStack.i6t  (B/stackt: 5pp, 70KB)

File (220 lines) 

PDF (5pp, 70KB) 

To allocate space on the memory stack for frames of variables to be used by rulebooks, activities and actions.

Chronology.i6t  (B/chrt: 5pp, 78KB)

File (302 lines) 

PDF (5pp, 78KB) 

To record information now which will be needed later, when a condition phrased in the perfect tense is tested.

Printing.i6t  (B/print: 13pp, 101KB)

File (758 lines) 

PDF (13pp, 101KB) 

To manage the line skips which space paragraphs out, and to handle the printing of names of objects, pieces of text and numbers.

RTP.i6t  (B/rtpt: 8pp, 80KB)

File (429 lines) 

PDF (8pp, 80KB) 

To issue run-time problem messages, and to perform some run-time type checking which may issue such messages.

Utilities.i6t  (B/utilt: 4pp, 72KB)

File (204 lines) 

PDF (4pp, 72KB) 

Miscellaneous utility routines for some fundamental I6 needs.

Number.i6t  (B/numt: 2pp, 51KB)

File (80 lines) 

PDF (2pp, 51KB) 

Support for parsing integers.

Time.i6t  (B/timet: 5pp, 69KB)

File (251 lines) 

PDF (5pp, 69KB) 

Support for parsing and printing times of day.

Tables.i6t  (B/tabt: 17pp, 108KB)

File (930 lines) 

PDF (17pp, 108KB) 

To read, write, search and allocate rows in the Table data structure.

Sort.i6t  (B/sortt: 4pp, 67KB)

File (234 lines) 

PDF (4pp, 67KB) 

To sort arrays.

Relations.i6t  (B/relt: 22pp, 130KB)

File (1248 lines) 

PDF (22pp, 130KB) 

To manage run-time storage for relations between objects, and to find routes through relations and the map.

Figures.i6t  (B/figst: 1pp, 47KB)

File (41 lines) 

PDF (1pp, 47KB) 

To display figures and play sound effects.

IndexedText.i6t  (B/inxt: 16pp, 96KB)

File (858 lines) 

PDF (16pp, 96KB) 

Code to support the indexed text kind of value.

RegExp.i6t  (B/regxt: 32pp, 126KB)

File (1788 lines) 

PDF (32pp, 126KB) 

Code to match and replace on regular expressions against indexed text strings.

Char.i6t  (B/chart: 3pp, 52KB)

File (141 lines) 

PDF (3pp, 52KB) 

To decide whether letters are upper or lower case, and convert between the two.

UnicodeData.i6t  (B/unict: 3pp, 56KB)

File (160 lines) 

PDF (3pp, 56KB) 

To tabulate casings in the character set.

StoredAction.i6t  (B/stact: 7pp, 75KB)

File (357 lines) 

PDF (7pp, 75KB) 

Code to support the stored action kind of value.

Lists.i6t  (B/listt: 15pp, 98KB)

File (803 lines) 

PDF (15pp, 98KB) 

Code to support the list of... kind of value constructor.

Combinations.i6t  (B/combt: 4pp, 64KB)

File (201 lines) 

PDF (4pp, 64KB) 

Code to support the combination kind of value constructor.

RelationKind.i6t  (B/relkt: 35pp, 139KB)

File (1913 lines) 

PDF (35pp, 139KB) 

Code to support the relation kind.

BlockValues.i6t  (B/blkvt: 7pp, 85KB)

File (393 lines) 

PDF (7pp, 85KB) 

Routines for copying, comparing, creating and destroying block values, and for reading and writing them as if they were arrays.

Flex.i6t  (B/flext: 12pp, 108KB)

File (704 lines) 

PDF (12pp, 108KB) 

To allocate flexible-sized blocks of memory as needed to hold arbitrary-length strings of text, stored actions or other block values.

ZMachine.i6t  (B/zmt: 15pp, 101KB)

File (826 lines) 

PDF (15pp, 101KB) 

To provide routines handling low-level Z-machine facilities.

Glulx.i6t  (B/glut: 38pp, 133KB)

File (2136 lines) 

PDF (38pp, 133KB) 

To start up the Glk interface for the Glulx virtual machine, and provide Glulx-specific printing functions.

FileIO.i6t  (B/iot: 8pp, 75KB)

File (417 lines) 

PDF (8pp, 75KB) 

Reading and writing external files, in the Glulx virtual machine only.

This is a "web", a term invented by Donald Knuth in the early 1980s for a program written according to the heavily annotated literate programming dogma. For more on "inweb", visit the Inform 7 project.