The compiler has serial numbers in the form N.M, where N is the main compiler version (presently Inform 6) and M is the minor version number (presently release 30). Note that the source code comes along with the Technical Manual (see the side links), which documents its main ideas in quite some detail, and is the first place to look for anyone intending to port Inform to a new platform. The source is organised as a set of segments, each in a separate C file, plus a single header included by all of them. Each segment has a common structure, makes standardised use of central memory management routines and so on. The compiler is written in the orthodox front end - lexical analysis - syntax analysis - code generation way, but is unusual in that the Z-machine's code format is packed with complicated tables (so the code generator is large and compiles more than just code), and in that the compiler runs through source in a single pass for speed.
Open Source
Compiler 6.30 Source Code
A Map (6.30)
Link
Extracted from the Technical Manual, this map shows the main flow of data through the compiler.
An Inventory (6.30)
Link
Extracted from the Technical Manual, this inventory shows how the main routines in different segments of the source normally call each other.
arrays.c (6.30)
Download
Syntax analyser for array and global variable declarations
asm.c (6.30)
Download
Parsing and assembling Z-machine assembly language, including optimisation of the resulting Z-code
bpatch.c (6.30)
Download
Backpatches the object code to make cross-references correct within it. (Inform compiles in a rapid single pass through source code, so that cross-references are mostly wrong as it works through, and need to be corrected later: this is called backpatching.)
chars.c (6.30)
Download
Performs character set translations between ASCII, Unicode, ISO and ZSCII (the Z-machine's own character set)
directs.c (6.30)
Download
Syntax analyser for directives
errors.c (6.30)
Download
Issues fatal errors, errors and warnings
expressc.c (6.30)
Download
Expression code generator
expressp.c (6.30)
Download
Expression parser
files.c (6.30)
Download
Reads source code files into buffers for the lexer; performs miscellaneous file I/O
inform.c (6.30)
Download
Top level, including the ICL parser: switches, filename translation, path variables
lexer.c (6.30)
Download
The lexical analyser (or "lexer"), which converts source text to a stream of tokens; this is where keywords significant in the Inform language are all defined
linker.c (6.30)
Download
Links independently compiled modules together to form a single story file. (Linking is now not much done, as it's tricky and imposes certain restrictions, but was a useful speed economy in the mid-1990s when PCs were far less powerful.)
memory.c (6.30)
Download
ICL memory command parser; sets memory settings; allocates and frees memory on behalf of the rest of the compiler
objects.c (6.30)
Download
Syntax analyser for object and class declarations
states.c (6.30)
Download
Syntax analyser for statements
symbols.c (6.30)
Download
Keeps table of symbol names found in the source; recognises from and adds to this table
syntax.c (6.30)
Download
Top level of syntax analyser
tables.c (6.30)
Download
Glues together all the code, dictionary, object tree, etc. into a story file
text.c (6.30)
Download
Translates source text to Z-encoded text; manages the story file's dictionary; optimises abbreviations
veneer.c (6.30)
Download
Applies a veneer of intermediate-level code to each story file compiled, providing services such as message-sending which are not implemented directly by the Z-machine "hardware". The veneer is itself written in a kind of Inform, but which uses additional operators not permitted elsewhere.
verbs.c (6.30)
Download
Syntax analyser for grammar lines and fake actions.
header.h (6.30)
Download
This main header file is included by every other C source file, and declares the names of every important routine, constant and so on.
Last updated 27 February 2004.
This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation.
Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.