~ubuntu-branches/ubuntu/vivid/inform/vivid

« back to all changes in this revision

Viewing changes to inform-6.31.1/manual/s30.html

  • Committer: Bazaar Package Importer
  • Author(s): Jan Christoph Nordholz
  • Date: 2008-05-26 22:09:44 UTC
  • mfrom: (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526220944-ba7phz0d1k4vo7wx
Tags: 6.31.1+dfsg-1
* Remove a considerable number of files from the package
  due to unacceptable licensing terms.
* Repair library symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<html>
 
3
<head>
 
4
<title>DM4 &#167;30: How verbs are parsed</title>
 
5
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
6
<link rel="stylesheet" type="text/css" href="dm4.css">
 
7
</head>
 
8
<body>
 
9
<p class="navbar">
 
10
 <a href="index.html">home</a> /
 
11
 <a href="contents.html">contents</a> /
 
12
 <a href="ch4.html" title="Chapter IV: Describing and Parsing">chapter IV</a> /
 
13
 <a href="s29.html" title="&#167;29: Plural names for duplicated objects">prev</a> /
 
14
 <a href="s31.html" title="&#167;31: Tokens of grammar">next</a> /
 
15
 <a href="dm4index.html">index</a>
 
16
</p>
 
17
<div class="page">
 
18
<a id="p225" name="p225"></a>
 
19
<h2>&#167;30 &nbsp; How verbs are parsed</h2>
 
20
 
 
21
<blockquote>&#8220;&#8230;I can see that the grammar gets tucked into 
 
22
the tales and poetry as one gives pills in jelly.&#8221;<br>
 
23
&#8212; Louisa May Alcott (1832&#8211;1888), <i>Little Women</i></blockquote>
 
24
 
 
25
<p class="normal"><span class="atleft"><img src="dm4-225_1.jpg" alt=""></span>
 
26
Here is how the parser reads in a whole command. Given a stream of 
 
27
text like</p>
 
28
 
 
29
<p class="syntax"><tt>saint</tt> / <tt>peter</tt> / <tt>,</tt> / 
 
30
<tt>take</tt> / <tt>the</tt> / <tt>keys</tt> / <tt>from</tt> / 
 
31
<tt>paul</tt></p>
 
32
 
 
33
<p class="normal">it first breaks it into words, as shown, and then 
 
34
calls the entry point routine <code>BeforeParsing</code> (which you 
 
35
can provide, if you want to, in order to meddle with the text stream 
 
36
before parsing gets underway). The parser then works out who is being 
 
37
addressed, if anyone, by looking for a comma, and trying out the text 
 
38
up to there as a noun matching an <code>animate</code> or 
 
39
<code>talkable</code> object: in this case St Peter. This person is 
 
40
called the &#8220;actor&#8221;, since he or she is going to perform 
 
41
the action, and is most often the player (thus, typing &#8220;myself, 
 
42
go north&#8221; is equivalent to typing &#8220;go north&#8221;). 
 
43
The next word, in this case <code>'take'</code>, is the &#8220;verb 
 
44
word&#8221;. An Inform verb usually has several English verb words
 
45
attached, which are called synonyms of each other: for instance, the 
 
46
library is set up with</p>
 
47
 
 
48
<p class="syntax">&#8220;take&#8221; = &#8220;carry&#8221; 
 
49
= &#8220;hold&#8221;</p>
 
50
 
 
51
<p class="normal">all referring to the same Inform verb.</p>
 
52
 
 
53
<p class="aside"><span class="warning">&#9650;</span>
 
54
The parser sets up variables <code>actor</code> and <code>verb_word</code> 
 
55
while working. (In the example above, their values would be the St Peter 
 
56
object and <code>'take'</code>, respectively.)</p>
 
57
 
 
58
<p class="aside"><span class="warning">&#9650;</span>
 
59
This brief discussion is simplified in two ways. Firstly, it leaves 
 
60
out directions, because Inform considers that the name of a direction-object 
 
61
implies &#8220;go&#8221;: thus &#8220;north&#8221; means &#8220;go 
 
62
north&#8221;. Secondly, it misses out the grammar property described 
 
63
in <a href="s18.html">&#167;18</a>, which can cause different actors 
 
64
to recognise different grammars.</p>
 
65
 
 
66
<a id="ex81" name="ex81"></a>
 
67
<p class="aside"><span class="warning"><b>&#8226;</b>&#9650;
 
68
<b><a href="sa6.html#ans81">EXERCISE 81</a></b></span><br>
 
69
Use <code>BeforeParsing</code> to implement a lamp which, when rubbed, 
 
70
produces a genie who casts a spell to make the player confuse the 
 
71
words &#8220;white&#8221; and &#8220;black&#8221;.</p>
 
72
 
 
73
<p class="dotbreak">� � � � �</p>
 
74
 
 
75
<a id="p226" name="p226"></a>
 
76
<p class="normal">This section is about verbs, which are defined 
 
77
with &#8220;grammar&#8221;, meaning usages of the directives <code>Verb</code> 
 
78
and <code>Extend</code>. The library contains a substantial amount
 
79
of grammar as it is, and this forms (most of) the library file 
 
80
<tt>&quot;Grammar.h&quot;</tt>. Grammar defined in your own code can 
 
81
either build on this or selectively knock it down, but either way it 
 
82
should be made after the inclusion of <tt>&quot;Grammar.h&quot;</tt>.</p>
 
83
 
 
84
<p class="indent">For instance, making a new synonym for an existing 
 
85
verb is easy:</p>
 
86
 
 
87
<p class="lynxonly"></p>
 
88
<pre class="code">Verb 'steal' 'acquire' 'grab' = 'take';</pre>
 
89
 
 
90
<p class="normal">Now &#8220;steal&#8221;, &#8220;acquire&#8221; and 
 
91
&#8220;grab&#8221; are synonyms for &#8220;take&#8221;.</p>
 
92
 
 
93
<p class="aside"><span class="warning">&#9650;</span>
 
94
One can also prise synonyms apart, as will appear later.</p>
 
95
 
 
96
<p class="dotbreak">� � � � �</p>
 
97
 
 
98
<p class="normal">To return to the text above, the parser has now 
 
99
recognised the English word &#8220;take&#8221; as one of those which 
 
100
can refer to a particular Inform verb. It has reached word 5 and still 
 
101
has &#8220;the keys from paul&#8221; left to understand.</p>
 
102
 
 
103
<p class="indent">Every Inform verb has a &#8220;grammar&#8221; which 
 
104
consists of a list of one or more &#8220;grammar lines&#8221;, each 
 
105
of them a pattern which the rest of the text might match. The parser 
 
106
tries the first, then the second and so on, and accepts the earliest 
 
107
one that matches, without ever considering later ones.</p>
 
108
 
 
109
<p class="indent">A line is a row of &#8220;tokens&#8221;. Typical 
 
110
tokens might mean &#8216;the name of a nearby object&#8217;, &#8216;the 
 
111
word <code>'from'</code>&#8217; or &#8216;somebody's name&#8217;. To 
 
112
match a line, the parser must match against each token in sequence. 
 
113
Continuing the example, the parser accepts the line of three tokens</p>
 
114
 
 
115
<p class="syntax">&#8249;<span class="token">one or more nouns</span>&#8250;
 
116
&#8249;<span class="token">the word <tt>from</tt></span>&#8250;
 
117
&#8249;<span class="token">a noun</span>&#8250;</p>
 
118
 
 
119
<p class="normal">as matching &#8220;the keys from paul&#8221;.</p>
 
120
 
 
121
<p class="indent">Every grammar line has the name of an action attached, 
 
122
and in this case it is <code>Remove</code>: so the parser has ground 
 
123
up the original text into just four quantities, ending up with</p>
 
124
 
 
125
<p class="syntax"><tt>actor = StPeter</tt> &nbsp;
 
126
<tt>action = Remove</tt> &nbsp; <tt>noun = gold_keys</tt> &nbsp;
 
127
<tt>second = StPaul</tt></p>
 
128
 
 
129
<p class="normal">The parser's job is now complete, and the rest of 
 
130
the Inform library can get on with processing the action or, as in 
 
131
this case, an order being addressed to somebody other than the player.</p>
 
132
 
 
133
<p class="aside"><span class="warning">&#9650;</span>
 
134
The action for the line currently being worked through is stored in 
 
135
the variable <code>action_to_be</code>; or, at earlier stages when 
 
136
the verb hasn't been deciphered yet, it holds the value <code>NULL</code>.</p>
 
137
 
 
138
<a id="p227" name="p227"></a>
 
139
<p class="dotbreak">� � � � �</p>
 
140
 
 
141
<p class="normal">The <code>Verb</code> directive creates Inform 
 
142
verbs, giving them some English verb words and a grammar. The library's 
 
143
<tt>&quot;Grammar.h&quot;</tt> file consists almost exclusively of
 
144
<code>Verb</code> directives: here is an example simplified from one 
 
145
of them.</p>
 
146
 
 
147
<p class="lynxonly"></p>
 
148
<pre class="code">
 
149
Verb 'take' 'get' 'carry' 'hold'
 
150
    * 'out'                   -&gt; Exit
 
151
    * multi                   -&gt; Take
 
152
    * multiinside 'from' noun -&gt; Remove
 
153
    * 'in' noun               -&gt; Enter
 
154
    * multiinside 'off' noun  -&gt; Remove
 
155
    * 'off' held              -&gt; Disrobe
 
156
    * 'inventory'             -&gt; Inv;
 
157
</pre>
 
158
 
 
159
<p class="normal">(You can look at the grammar being used in a game 
 
160
with the debugging verb &#8220;showverb&#8221;: see 
 
161
<a href="s7.html">&#167;7</a>.) Each line of grammar begins with a 
 
162
<code>*</code>, gives a list of tokens as far as <code>-&gt;</code> and 
 
163
then the action which the line produces. The first line can only be 
 
164
matched by something like &#8220;get out&#8221;, the second might 
 
165
be matched by</p>
 
166
 
 
167
<p class="output">&#8220;take the banana&#8221;<br>
 
168
&#8220;get all the fruit except the apple&#8221;</p>
 
169
 
 
170
<p class="normal">and so on. A full list of tokens will be given 
 
171
later: briefly, <span class="grammartoken"><code>'out'</code></span> 
 
172
means the literal word &#8220;out&#8221;, <span class="grammartoken"><code>multi</code></span> 
 
173
means one or more objects nearby, <span class="grammartoken"><code>noun</code></span> 
 
174
means just one and <span class="grammartoken"><code>multiinside</code></span> 
 
175
means one or more objects inside the second noun. In this book, grammar 
 
176
tokens are written in the style <span class="grammartoken"><code>noun</code></span> 
 
177
to prevent confusion (as there is also a variable called <code>noun</code>).</p>
 
178
 
 
179
<p class="aside"><span class="warning">&#9650;</span>
 
180
Some verbs are marked as <code>meta</code> &#8211; these are the verbs 
 
181
leading to Group 1 actions, those which are not really part of the 
 
182
game's world: for example, &#8220;save&#8221;, &#8220;score&#8221; 
 
183
and &#8220;quit&#8221;. For example:</p>
 
184
 
 
185
<p class="lynxonly"></p>
 
186
<pre class="code">Verb meta 'score' * -&gt; Score;</pre>
 
187
 
 
188
<p class="aside">and any debugging verbs you create would probably work 
 
189
better this way, since meta-verbs are protected from interference by 
 
190
the game and take up no game time.</p>
 
191
 
 
192
<p class="dotbreak">� � � � �</p>
 
193
 
 
194
<p class="normal">After the <code>-&gt;</code> in each line is the 
 
195
name of an action. Giving a name in this way is what creates an action, 
 
196
and if you give the name of one which doesn't already 
 
197
<a id="p228" name="p228"></a>
 
198
exist then you 
 
199
must also write a routine to execute the action, even if it's one which 
 
200
doesn't do very much. The name of the routine is always the name of
 
201
the action with <code>Sub</code> appended. For instance:</p>
 
202
 
 
203
<p class="lynxonly"></p>
 
204
<pre class="code">
 
205
[ XyzzySub; &quot;Nothing happens.&quot;; ];
 
206
Verb 'xyzzy' * -&gt; Xyzzy;
 
207
</pre>
 
208
 
 
209
<p class="normal">will make a new magic-word verb &#8220;xyzzy&#8221;, 
 
210
which always says &#8220;Nothing happens&#8221; &#8211; always, that 
 
211
is, unless some before rule gets there first, as it might do in 
 
212
certain magic places. <code>Xyzzy</code> is now an action just as 
 
213
good as all the standard ones: <code>##Xyzzy</code> gives its action 
 
214
number, and you can write <code>before</code> rules for it in 
 
215
<code>Xyzzy:</code> fields just as you would for, say, <code>Take</code>.</p>
 
216
 
 
217
<p class="aside"><span class="warning">&#9650;</span>
 
218
Finally, the line can end with the word <code>reverse</code>. This 
 
219
is only useful if there are objects or numbers in the line which 
 
220
occur in the wrong order. An example from the library's grammar:</p>
 
221
 
 
222
<p class="lynxonly"></p>
 
223
<pre class="code">
 
224
Verb 'show' 'present' 'display'
 
225
    * creature held      -&gt; Show reverse
 
226
    * held 'to' creature -&gt; Show;
 
227
</pre>
 
228
 
 
229
<p class="aside">The point is that the <code>Show</code> action expects 
 
230
the first parameter to be an item, and the second to be a person. 
 
231
When the text &#8220;show him the shield&#8221; is typed in, the 
 
232
parser must reverse the two parameters &#8220;him&#8221; and 
 
233
&#8220;the shield&#8221; before causing a <code>Show</code> action.
 
234
On the other hand, in &#8220;show the shield to him&#8221; the 
 
235
parameters are in the right order already.</p>
 
236
 
 
237
<p class="dotbreak">� � � � �</p>
 
238
 
 
239
<p class="normal">The library defines grammars for the 100 or so English 
 
240
verbs most often used by adventure games. However, in practice you 
 
241
quite often need to alter these, usually to add extra lines of grammar 
 
242
but sometimes to remove existing ones. For instance, suppose you 
 
243
would like &#8220;drop charges&#8221; to be a command in a
 
244
detection game (or a naval warfare game). This means adding a new 
 
245
grammar line to the &#8220;drop&#8221; verb. The <code>Extend</code> 
 
246
directive is provided for exactly this purpose:</p>
 
247
 
 
248
<p class="lynxonly"></p>
 
249
<pre class="code">Extend 'drop' * 'charges' -&gt; DropCharges;</pre>
 
250
 
 
251
<p class="normal">Normally, extra lines of grammar are added at the 
 
252
bottom of those already there, so that this will be the very last grammar 
 
253
line tested by the parser. This may not be what you want. For instance, 
 
254
&#8220;take&#8221; has a grammar line reading</p>
 
255
 
 
256
<p class="lynxonly"></p>
 
257
<pre class="code">* multi -&gt; Take</pre>
 
258
 
 
259
<a id="p229" name="p229"></a>
 
260
<p class="normal">quite early on. So if you want to add a grammar line 
 
261
diverting &#8220;take &#8249;<span class="token">food</span>&#8250;&#8221; to
 
262
a different action, like so:</p>
 
263
 
 
264
<p class="lynxonly"></p>
 
265
<pre class="code">* edible -&gt; Eat</pre>
 
266
 
 
267
<p class="normal">(<span class="grammartoken"><code>edible</code></span> 
 
268
being a token matching anything which has the attribute <code>edible</code>)
 
269
then it's no good adding this at the bottom of the <code>Take</code> 
 
270
grammar, because the earlier line will always be matched first. What you 
 
271
need is for the new line to go in at the top, not the bottom:</p>
 
272
 
 
273
<p class="lynxonly"></p>
 
274
<pre class="code">
 
275
Extend 'take' first
 
276
    * edible -&gt; Eat;
 
277
</pre>
 
278
 
 
279
<p class="normal">You might even want to throw away the old grammar completely, 
 
280
not just add a line or two. For this, use</p>
 
281
 
 
282
<p class="lynxonly"></p>
 
283
<pre class="code">
 
284
Extend 'press' replace
 
285
    * 'charges' -&gt; PressCharges;
 
286
</pre>
 
287
 
 
288
<p class="normal">and now the verb &#8220;press&#8221; has no other 
 
289
sense but this, and can't be used in the sense of pressing down on 
 
290
objects any more, because those grammar lines are gone. To sum 
 
291
up, <code>Extend</code> can optionally take one of three keywords:</p>
 
292
 
 
293
<p class="lynxonly"></p>
 
294
<div class="inset"><table>
 
295
<tr><td><code>replace</code></td><td>&nbsp; replace the old grammar with this one;</td></tr>
 
296
<tr><td><code>first</code></td><td>&nbsp; insert the new grammar at the top;</td></tr>
 
297
<tr><td><code>last</code></td><td>&nbsp; insert the new grammar at the bottom;</td></tr>
 
298
</table></div>
 
299
 
 
300
<p class="normal">with <code>last</code> being the default.</p>
 
301
 
 
302
<p class="aside"><span class="warning">&#9650;</span>
 
303
In library grammar, some verbs have many synonyms: for instance,</p>
 
304
 
 
305
<p class="lynxonly"></p>
 
306
<pre class="code">
 
307
'attack' 'break' 'smash' 'hit' 'fight' 'wreck' 'crack'
 
308
'destroy' 'murder' 'kill' 'torture' 'punch' 'thump'
 
309
</pre>
 
310
 
 
311
<p class="aside">are all treated as identical. But you might want 
 
312
to distinguish between murder and lesser crimes. For this, try</p>
 
313
 
 
314
<p class="lynxonly"></p>
 
315
<pre class="code">
 
316
Extend only 'murder' 'kill' replace
 
317
    * animate -&gt; Murder;
 
318
</pre>
 
319
 
 
320
<p class="aside">The keyword only tells Inform to extract the two 
 
321
verbs &#8220;murder&quot; and &#8220;kill&quot;. These then become 
 
322
a new verb which is initially an identical copy of the old one, but 
 
323
then <code>replace</code> tells Inform to throw that away in favour of 
 
324
an entirely new grammar. Similarly,</p>
 
325
 
 
326
<p class="lynxonly"></p>
 
327
<pre class="code">Extend only 'run' * 'program' -&gt; Compute;</pre>
 
328
 
 
329
<p class="aside">makes &#8220;run&quot; behave exactly like &#8220;go&quot; 
 
330
and &#8220;walk&#8221;, as these three words are ordinarily synonymous 
 
331
to the library, except that it also recognises &#8220;program&quot;, 
 
332
so that &#8220;run program&quot; activates a computer but &#8220;walk 
 
333
program&quot; doesn't. Other good pairs to separate might be &#8220;cross&#8221; 
 
334
and &#8220;enter&#8221;, &#8220;drop&#8221; and &#8220;throw&#8221;, 
 
335
&#8220;give&#8221; and &#8220;feed&#8221;, &#8220;swim&#8221; 
 
336
and &#8220;dive&#8221;, &#8220;kiss&#8221; and &#8220;hug&#8221;, 
 
337
&#8220;cut&#8221; and &#8220;prune&#8221;. Bear in mind that once a
 
338
pair has been split apart like this, any subsequent change to one will 
 
339
not also change the other.</p>
 
340
 
 
341
<a id="p230" name="p230"></a>
 
342
<p class="aside"><span class="warning">&#9650;&#9650;</span>
 
343
Occasionally verb definition commands are not enough. For example, 
 
344
in the original &#8216;Advent&#8217;, the player could type the name 
 
345
of an adjacent place which had previously been visited, and be taken 
 
346
there. (This feature isn't included in the Inform example version 
 
347
of the game in order to keep the source code as simple as possible.)
 
348
There are several laborious ways to code this, but here's a concise 
 
349
way. The library calls the <code>UnknownVerb</code> entry point routine 
 
350
(if you provide one) when the parser can't even get past the first 
 
351
word. This has two options: it can return <code>false</code>, in which 
 
352
case the parser just goes on to complain as it would have done anyway. 
 
353
Otherwise, it can return a verb word which is substituted for what 
 
354
the player actually typed. Here is one way the &#8216;Advent&#8217; 
 
355
room-naming might work. Suppose that every room has been given a 
 
356
property called <code>go_verb</code> listing the words which refer 
 
357
to it, so for instance the well house might be defined along these 
 
358
lines:</p>
 
359
 
 
360
<p class="lynxonly"></p>
 
361
<pre class="code">
 
362
AboveGround Inside_Building &quot;Inside Building&quot;
 
363
  with description
 
364
           &quot;You are inside a building, a well house for a
 
365
           large spring.&quot;,
 
366
       go_verb 'well' 'house' 'inside' 'building',
 
367
...
 
368
</pre>
 
369
 
 
370
<p class="aside">The <code>UnknownVerb</code> routine then looks 
 
371
through the possible compass directions for already-visited 
 
372
rooms, checking against words stored in this new property:</p>
 
373
 
 
374
<p class="lynxonly"></p>
 
375
<pre class="code">
 
376
Global go_verb_direction;
 
377
[ UnknownVerb word room direction adjacent;
 
378
  room = real_location;
 
379
  objectloop (direction in compass) {
 
380
      adjacent = room.(direction.door_dir);
 
381
      if (adjacent ofclass Object &amp;&amp; adjacent has visited
 
382
          &amp;&amp; adjacent provides go_verb
 
383
          &amp;&amp; WordInProperty(word, adjacent, go_verb)) {
 
384
              go_verb_direction = direction;
 
385
              return 'go.verb';
 
386
      }
 
387
  }
 
388
  if (room provides go_verb
 
389
      &amp;&amp; WordInProperty(word, room, go_verb)) {
 
390
      go_verb_direction = &quot;You're already there!&quot;;
 
391
      return 'go.verb';
 
392
  }
 
393
  objectloop (room provides go_verb &amp;&amp; room has visited
 
394
              &amp;&amp; WordInProperty(word, room, go_verb)) {
 
395
      go_verb_direction = &quot;You can't get there from here!&quot;;
 
396
      return 'go.verb';
 
397
  }<a id="p231" name="p231"></a>
 
398
  objectloop (room provides go_verb &amp;&amp; room hasnt visited
 
399
              &amp;&amp; WordInProperty(word, room, go_verb)) {
 
400
      go_verb_direction = &quot;But you don't know the way there!&quot;;
 
401
      return 'go.verb';
 
402
  }
 
403
  rfalse;
 
404
];
 
405
</pre>
 
406
 
 
407
<p class="aside">When successful, this routine stores either a compass 
 
408
direction (an object belonging to the compass) in the variable 
 
409
<code>go_verb_direction</code>, or else a string to print. (Note that
 
410
an <code>UnknownVerb</code> routine shouldn't print anything itself, 
 
411
as this might be inappropriate in view of subsequent parsing, or if 
 
412
the actor isn't the player.) The routine then tells the parser to 
 
413
treat the verb as if it were <code>'go.verb'</code>, and as this doesn't 
 
414
exist yet, we must define it:</p>
 
415
 
 
416
<p class="lynxonly"></p>
 
417
<pre class="code">
 
418
[ Go_VerbSub;
 
419
  if (go_verb_direction ofclass String)
 
420
      print_ret (string) go_verb_direction;
 
421
  &lt;&lt;Go go_verb_direction&gt;&gt;;
 
422
];
 
423
Verb 'go.verb' * -&gt; Go_Verb;
 
424
</pre>
 
425
 
 
426
<a id="ex82" name="ex82"></a>
 
427
<p class="aside"><span class="warning"><b>&#8226;</b>&#9650;&#9650;
 
428
<b><a href="sa6.html#ans82">EXERCISE 82</a></b></span><br>
 
429
A minor deficiency with the above system is that the parser may print 
 
430
out strange responses like &#8220;I only understood you as far as 
 
431
wanting to go.verb.&#8221; if the player types something odd 
 
432
like &#8220;bedquilt the nugget&#8221;. How can we ensure that the 
 
433
parser will always say something like &#8220;I only understood you 
 
434
as far as wanting to go to Bedquilt.&#8221;?</p>
 
435
 
 
436
<p class="aside"><span class="warning"><b>&#8226;</b>
 
437
<b>REFERENCES</b></span><br>
 
438
&#8216;Advent&#8217; makes a string of simple <code>Verb</code> definitions; 
 
439
&#8216;Alice Through the Looking-Glass&#8217; uses <code>Extend</code> a 
 
440
little. &nbsp;
 
441
<span class="warning"><b>&#8226;</b></span>&#8216;Balances&#8217; has a 
 
442
large extra grammar and also uses the <code>UnknownVerb</code> and 
 
443
<code>PrintVerb</code> entry points. &nbsp;
 
444
<span class="warning"><b>&#8226;</b></span>Irene Callaci's <tt>&quot;AskTellOrder.h&quot;</tt>
 
445
library extension file makes an elegant use of <code>BeforeParsing</code> to 
 
446
convert commands in the form &#8220;ask mr darcy to dance&#8221; or 
 
447
&#8220;tell jack to go north&#8221; to Inform's preferred form
 
448
&#8220;mr darcy, dance&#8221; and &#8220;jack, go north&#8221;.</p>
 
449
 
 
450
</div>
 
451
<p class="navbar">
 
452
 <a href="index.html">home</a> /
 
453
 <a href="contents.html">contents</a> /
 
454
 <a href="ch4.html" title="Chapter IV: Describing and Parsing">chapter IV</a> /
 
455
 <a href="s29.html" title="&#167;29: Plural names for duplicated objects">prev</a> /
 
456
 <a href="s31.html" title="&#167;31: Tokens of grammar">next</a> /
 
457
 <a href="dm4index.html">index</a>
 
458
</p>
 
459
</body>
 
460
</html>
 
461