🏡 Back Home
Passes through Major Nodes
Contents
- The first thing Inform does when compiling source text is to make three passes through its top-level definitions: a "pre-pass", in which names of things like tables and equations are discovered, and assertion sentences are diagrammed; "pass 1", when instance, kinds, properties and so on are created; and "pass 2", when property values and relationships are found.
- We clear the lingering Anaphoric References state before starting a pass.
- Pass 1 goes through the source. Pass 2 adds in the “extra” stuff. Pass 3 seems to be a version of Pass 2 that works where the kind is not explicit.
- So Pass 1 deals with everything that is written.
- Pass 2 deals with everything that is written and also anything that was generated by Pass 1.
- Pass 3 then does things generated by Pass 2.
- The example given is
Every room contains a vehicle and if we don’t know something is a room until Pass 2, we can’t add a vehicle to it until Pass 3.
- Mostly this is straight forward traversal; if we know it’s a special node (imperative, extension doohickeys, equations, tables, etc) then we act as expected.
SENTENCE_NT is the big one.
- We classify it via Classifying Sentences. If it’s a textual string, then it’s an initial appearance definition and we can simply assert it Assertions (assertions).
- Assuming we can identify the verb, we further distinguish special meanings (SMF whatever that is) and regular meanings.
- Special meanings are setup by Booting Verbs. They are things like new definitions or rules or whatever, compared to assertions.
- Regular sentences are refined Refine Parse Tree in Pass 2 to identify the noun phrases.
- Note that a defective noun is not a broken noun, but a linguistic property of not being inflectable.
- I guess “there” is a defective noun?
- We couple the nouns if necessary and make an existential.
TRACE_NT is the debug statement which does a bunch of calls to Telemetry.