Compilation Flow
- A vague overview of the flow because it’s too many links back and forth.
Build setup
- Main is the entry point.
- Maybe there’s some stuff with foundation.
- This then goes to Inbuild Control for the setup of the project.
- Which creates objects from Project File Manager and Project Bundle Manager.
- And all the various build skill/step modules.
- The Inform7 Skill is the final part of supervisor we use for now, which goes to core via
Task::carry_outin What To Compile and then How To Compile which has the actual passes.
Reading and Lexing
- In Project Services there is
Projects::read_source_text_forwhich does the lexing and sentence breaking.- The lexing is through Source Text → Text From Files → Lexer.
- After this, we have:
- A
source_filewith a bunch of individual words (with location metadata) and some file-level metadata. - A “vocabulary map” of some kind, though at this point we haven’t done any meaning analysis (other than checking if it’s an
ING_MCand some basic numeric parsing).
- A
- After this, we have:
- The sentence breaking is just Sentences directly. This has some rudimentary parsing.
- The docs call this now a syntax tree, even though it’s just a tree of
SENTENCE_NTnodes arranged under their respective Headings. - Syntax Trees has the actual tree structure (it seems to be different to the norm with the “budding” and amending other trees to each other).
- The docs call this now a syntax tree, even though it’s just a tree of
- The lexing is through Source Text → Text From Files → Lexer.
- Technically this is all before the Inform7 Skill.
Passes
- At this point we have sentences, but with a few minor exceptions they are all unparsed. There’s 3 major passes, all of which are in Passes through Major Nodes in assertions.
-
- It’s a lot of Classifying Sentences under the hood.
- Things which are SMF - special meaning functions - are all hooked in in assertions → Booting Verbs.
-
- After the second pass there is
traverse_to_stockin Tables (assertions) and some Dialogue stuff. - I think at this point the parsing is primarily done and we have a list of assertions about the world.
Model World Building
- Base kinds are made; apparently this is in Kind Declarations in runtime which seems awfully late? Maybe by building it means building it in inter?
- We go back to assertions for the “late namings” in Translation Requests. I have no idea what this is yet.
- This seems to just be checking if we have an
INTER_NAMING_SMFTto pay attention to (Special Meanings) for nouns defined in I6.
- This seems to just be checking if we have an
OrderingInstances::objects_in_definition_sequenceis in knowledge → Ordering Instances.- For some reason there simply isn’t a
Stage Iof the world building in this part, andStage II and IIIare put together. Oh, andStage Vis later on. - Stages II, III, and IV are in (whoever could guess this) knowledge → The Model World.
- I need to work out what these actually are.
Tables and Grammar
Measurements::validate_definitionsis in knowledge → Measurements.BinaryPredicateFamilies::second_stockis in calculus → Binary Predicate Families.Tables::check_tables_for_kind_clashesis in assertions → Tables (assertions).
We then have a couple more model world checks which need to come after the tables for…whatever reason? I guess because we need some predicates before we can do the last stage?
World::stage_Vis in knowledge → The Model World.MappingHints::traverse_for_map_parametersis in if → Mapping Hint Requests.
Phrases and Rules
LiteralPatterns::define_named_phrasesis in values → Literal Patterns (values).ImperativeDefinitions::assess_allis in assertions → Imperative Definitions.Equations::traverse_to_stockis in assertions → Equations (assertions).- Another call to
Tables::traverse_to_stockbecause I guess we have more information than the second pass? Tables (assertions). RTRulebooks::RulebookOutcomePrintingRuleis in runtime → Rulebooks (runtime).
This is the end of the actual compiler, I think. At this point we have a fully stocked AST and other various symbol tables and the like.
Inter
Why does part 4 do literally nothing?
Part 1
RTUseOptions::compileis in runtime → Use Options (runtime).RTCommandGrammars::compile_non_generic_constantsis in runtime → Command Grammars.Interventions::make_allis in runtime → Interventions.RTKindConstructors::compileis in runtime → Kind Constructors.RTLiteralPatterns::compileis in runtime → Literal Patterns (runtime).
Part 2
CompletionModule::compileis in runtime → Completion Module.RTProperties::compileis in runtime → Properties (runtime)RTKindConstructors::compile_permissionsis in runtime → Kind Constructors.InferenceSubjects::emit_allis in knowledge → Inference Subjects.Tables::completeis in assertions → Tables (assertions).RTTables::compileis in runtime → Tables (runtime).RTTableColumns::compileis in runtime → Table Columns (runtime).RTEquations::compileis in runtime → Equations (runtime).ImperativeDefinitions::compile_first_blockis in assertions → Imperative Definitions.RTDialogueBeats::compile- Dialogue.- RTDialogueLines::compile - Dialogue.
- RTDialogueChoices::compile - Dialogue.
RTRules::compileis in runtime → Rules (runtime).RTRulebooks::compileis in runtime → Rulebooks (runtime).RTRulebooks::compile_nrosis also in runtime → Rulebooks (runtime).RTActivities::compileis in runtime → Activities (runtime).RTVerbs::compile_conjugationsis in runtime → Conjugations.RTVerbs::compile_formsis in runtime → Conjugations too.CompilationUnits::complete_metadata- Inform TODO list.
Parts 3 and 5
PhraseRequests::invoke_to_beginis in imperative → Phrase Requests.Closures::compile_closuresis in imperative → Closures.RTRelations::compileis in runtime → Relations (runtime).RTAdjectives::compile_mdef_test_functionsis in runtime → Adjectives (linguistics).RTPhrasebook::compile_entriesis in runtime → Phrasebook Index.RTMappingHints::compileis in runtime → Mapping Hints.RTKindIDs::compile_structuresis in runtime → Kind IDs.TheHeap::compile_configurationis in runtime → The Heap.Rules::check_response_usagesis in assertions → Rules (assertions).LocalParking::compile_arrayis in imperative → Local Parking.RTBibliographicData::IFID_textis in runtime → Bibliographic Data.
I’ve dropped the many calls to Sequence::undertake_queued_tasks.
Index
We’re finally done. Inform TODO list