Version 0.8 of ZILF is here! Highlights include compiler/assembler support for V6 games, a more complete MDL interpreter (i.e. macros can be a lot more useful), better error reporting and optimization, and lots of bug fixes.
Release Notes
Download ZILF 0.8
Sunday, March 19, 2017
Sunday, February 5, 2017
Parsing in ZILF, part 3: From noun phrase to object
This is the third in a series of posts describing ZILF's parser. Read part 2 here.
In the second post, we covered noun phrases -- phrases like "all cubes except red" and "lamp, food, and bottle" that the player can type to refer to objects.
We also covered how the parser recognizes them and how it represents them in memory: the
But how does the parser identify which objects the player is referring to?
After
There are a few possibilities, depending on what the player typed. It can:
In the second post, we covered noun phrases -- phrases like "all cubes except red" and "lamp, food, and bottle" that the player can type to refer to objects.
We also covered how the parser recognizes them and how it represents them in memory: the
PARSE-NOUN-PHRASE
routine scans the player's command and fills in a NOUN-PHRASE
structure, which holds a list of adjective/noun pairs called OBJSPEC
s.But how does the parser identify which objects the player is referring to?
After
MATCH-SYNTAX
finds a syntax line that matches the player's command, the FIND-OBJECTS
routine combines the noun phrases with the find flag and search options from the syntax line, and decides what needs to be done for each object required by the syntax line.There are a few possibilities, depending on what the player typed. It can:
- match a noun phrase,
- expand a pronoun,
- supply a missing object,
- ask the player to clarify,
- or fail, printing an error message.
Subscribe to:
Posts (Atom)