mirror of
https://github.com/ganelson/inform.git
synced 2024-07-05 16:44:21 +03:00
68 lines
2.6 KiB
OpenEdge ABL
68 lines
2.6 KiB
OpenEdge ABL
|
Inform Organisation.
|
||
|
|
||
|
The standard hierarchy of inter code generated by Inform.
|
||
|
|
||
|
@h Status.
|
||
|
The Inter specification allows great flexibility in how packages are used
|
||
|
to structure a program, and requires very little.
|
||
|
|
||
|
The Inform compiler, however, uses this flexibility in a systematic way,
|
||
|
as follows.
|
||
|
|
||
|
@h Global area and main.
|
||
|
Inform opens with a version number, then declares package types (as needed
|
||
|
below), issues pragmas for I6 compiler memory settings, then declares
|
||
|
primitives for the standard Inform set: it always declares the same set
|
||
|
of primitives on every run.
|
||
|
|
||
|
As required, the rest of the program is in the |main| package, and much of
|
||
|
it in a plain module called |/main/resources|.
|
||
|
|
||
|
@h Compilation modules.
|
||
|
Inform divides up its material into compilation modules, as follows. Each
|
||
|
one becomes an inter package of type |_module|, as a subpackage
|
||
|
of |/main/resources|.
|
||
|
|
||
|
(a) The "generic module" contains built-in definitions of kinds, and the like.
|
||
|
No source text directly leads to this, and indeed, it can entirely be defined
|
||
|
without having seen any source text: it will be the same on every run. The
|
||
|
package is |/main/resources/generic|.
|
||
|
|
||
|
(b) Each extension is a compilation module, including of course the Standard
|
||
|
Rules, which is |/main/resources/standard_rules|. Subsequent extensions have
|
||
|
longer names, such as |/main/resources/locksmith_by_emily_short|.
|
||
|
|
||
|
(c) Material in the main source text is a single compilation module, and
|
||
|
goes into |/main/resources/source_text|.
|
||
|
|
||
|
(d) The "synoptic module" contains material which was synthesised from all
|
||
|
of the source material in the other modules, and which can't meaningfully
|
||
|
be localised. For example, a function at run-time which returns the default
|
||
|
value for a kind given its weak kind ID has to be synoptic, because its
|
||
|
definition will include references to every kind defined in the program.
|
||
|
Such a function doesn't belong to any one block of source text. The
|
||
|
package is |/main/resources/synoptic|.
|
||
|
|
||
|
@ Each module package then contains some or all of a standard set of
|
||
|
subpackages (and nothing else). Suppose the module name is |M|. The
|
||
|
range of possible subpackages is:
|
||
|
|
||
|
|/main/resources/M/actions|
|
||
|
|/main/resources/M/activities|
|
||
|
|/main/resources/M/adjectives|
|
||
|
|/main/resources/M/chronology|
|
||
|
|/main/resources/M/conjugations|
|
||
|
|/main/resources/M/equations|
|
||
|
|/main/resources/M/extensions|
|
||
|
|/main/resources/M/grammar|
|
||
|
|/main/resources/M/instances|
|
||
|
|/main/resources/M/kinds|
|
||
|
|/main/resources/M/listing|
|
||
|
|/main/resources/M/phrases|
|
||
|
|/main/resources/M/properties|
|
||
|
|/main/resources/M/relations|
|
||
|
|/main/resources/M/rulebooks|
|
||
|
|/main/resources/M/rules|
|
||
|
|/main/resources/M/tables|
|
||
|
|/main/resources/M/variables|
|