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

« back to all changes in this revision

Viewing changes to lib/grammar.h

  • 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
 
! ==============================================================================
2
 
!   GRAMMAR:  Grammar table entries for the standard verbs library.
3
 
!
4
 
!   Supplied for use with Inform 6 -- Release 6/11 -- Serial number 040227
5
 
!
6
 
!   Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
7
 
!
8
 
!   In your game file, Include three library files in this order:
9
 
!       Include "Parser";
10
 
!       Include "VerbLib";
11
 
!       Include "Grammar";
12
 
! ==============================================================================
13
 
 
14
 
System_file;
15
 
 
16
 
! ------------------------------------------------------------------------------
17
 
!  The "meta-verbs", commands to the game rather than in the game, come first:
18
 
! ------------------------------------------------------------------------------
19
 
 
20
 
Verb meta 'brief' 'normal'
21
 
    *                                           -> LMode1;
22
 
Verb meta 'verbose' 'long'
23
 
    *                                           -> LMode2;
24
 
Verb meta 'superbrief' 'short'
25
 
    *                                           -> LMode3;
26
 
Verb meta 'notify'
27
 
    *                                           -> NotifyOn
28
 
    * 'on'                                      -> NotifyOn
29
 
    * 'off'                                     -> NotifyOff;
30
 
Verb meta 'pronouns' 'nouns'
31
 
    *                                           -> Pronouns;
32
 
Verb meta 'quit' 'q//' 'die'
33
 
    *                                           -> Quit;
34
 
Verb meta 'recording'
35
 
    *                                           -> CommandsOn
36
 
    * 'on'                                      -> CommandsOn
37
 
    * 'off'                                     -> CommandsOff;
38
 
Verb meta 'replay'
39
 
    *                                           -> CommandsRead;
40
 
Verb meta 'restart'
41
 
    *                                           -> Restart;
42
 
Verb meta 'restore'
43
 
    *                                           -> Restore;
44
 
Verb meta 'save'
45
 
    *                                           -> Save;
46
 
Verb meta 'score'
47
 
    *                                           -> Score;
48
 
Verb meta 'fullscore' 'full'
49
 
    *                                           -> FullScore
50
 
    * 'score'                                   -> FullScore;
51
 
Verb meta 'script' 'transcript'
52
 
    *                                           -> ScriptOn
53
 
    * 'on'                                      -> ScriptOn
54
 
    * 'off'                                     -> ScriptOff;
55
 
Verb meta 'noscript' 'unscript'
56
 
    *                                           -> ScriptOff;
57
 
Verb meta 'verify'
58
 
    *                                           -> Verify;
59
 
Verb meta 'version'
60
 
    *                                           -> Version;
61
 
 
62
 
#Ifndef NO_PLACES;
63
 
Verb meta 'objects'
64
 
    *                                           -> Objects;
65
 
Verb meta 'places'
66
 
    *                                           -> Places;
67
 
#Endif; ! NO_PLACES
68
 
 
69
 
! ------------------------------------------------------------------------------
70
 
!  Debugging grammar
71
 
! ------------------------------------------------------------------------------
72
 
 
73
 
#Ifdef DEBUG;
74
 
Verb meta 'actions'
75
 
    *                                           -> ActionsOn
76
 
    * 'on'                                      -> ActionsOn
77
 
    * 'off'                                     -> ActionsOff;
78
 
Verb meta 'changes'
79
 
    *                                           -> ChangesOn
80
 
    * 'on'                                      -> ChangesOn
81
 
    * 'off'                                     -> ChangesOff;
82
 
Verb meta 'gonear'
83
 
    * noun                                      -> Gonear;
84
 
Verb meta 'goto'
85
 
    * number                                    -> Goto;
86
 
Verb meta 'random'
87
 
    *                                           -> Predictable;
88
 
Verb meta 'routines' 'messages'
89
 
    *                                           -> RoutinesOn
90
 
    * 'on'                                      -> RoutinesOn
91
 
    * 'off'                                     -> RoutinesOff;
92
 
Verb meta 'scope'
93
 
    *                                           -> Scope
94
 
    * noun                                      -> Scope;
95
 
Verb meta 'showobj'
96
 
    *                                           -> Showobj
97
 
    * number                                    -> Showobj
98
 
    * multi                                     -> Showobj;
99
 
Verb meta 'showverb'
100
 
    * special                                   -> Showverb;
101
 
Verb meta 'timers' 'daemons'
102
 
    *                                           -> TimersOn
103
 
    * 'on'                                      -> TimersOn
104
 
    * 'off'                                     -> TimersOff;
105
 
Verb meta 'trace'
106
 
    *                                           -> TraceOn
107
 
    * number                                    -> TraceLevel
108
 
    * 'on'                                      -> TraceOn
109
 
    * 'off'                                     -> TraceOff;
110
 
Verb meta 'abstract'
111
 
    * noun 'to' noun                            -> XAbstract;
112
 
Verb meta 'purloin'
113
 
    * multi                                     -> XPurloin;
114
 
Verb meta 'tree'
115
 
    *                                           -> XTree
116
 
    * noun                                      -> XTree;
117
 
 
118
 
#Ifdef TARGET_GLULX;
119
 
Verb meta 'glklist'
120
 
    *                                           -> Glklist;
121
 
#Endif; ! TARGET_
122
 
 
123
 
#Endif; ! DEBUG
124
 
 
125
 
! ------------------------------------------------------------------------------
126
 
!  And now the game verbs.
127
 
! ------------------------------------------------------------------------------
128
 
 
129
 
[ ADirection; if (noun in compass) rtrue; rfalse; ];
130
 
 
131
 
Verb 'answer' 'say' 'shout' 'speak'
132
 
    * topic 'to' creature                       -> Answer;
133
 
Verb 'ask'
134
 
    * creature 'about' topic                    -> Ask
135
 
    * creature 'for' noun                       -> AskFor
136
 
    * creature 'to' topic                       -> AskTo
137
 
    * 'that' creature topic                     -> AskTo;
138
 
Verb 'attack' 'break' 'crack' 'destroy'
139
 
     'fight' 'hit' 'kill' 'murder' 'punch'
140
 
     'smash' 'thump' 'torture' 'wreck'
141
 
    * noun                                      -> Attack;
142
 
Verb 'blow'
143
 
    * held                                      -> Blow;
144
 
Verb 'bother' 'curses' 'darn' 'drat'
145
 
    *                                           -> Mild
146
 
    * topic                                     -> Mild;
147
 
Verb 'burn' 'light'
148
 
    * noun                                      -> Burn
149
 
    * noun 'with' held                          -> Burn;
150
 
Verb 'buy' 'purchase'
151
 
    * noun                                      -> Buy;
152
 
Verb 'climb' 'scale'
153
 
    * noun                                      -> Climb
154
 
    * 'up'/'over' noun                          -> Climb;
155
 
Verb 'close' 'cover' 'shut'
156
 
    * noun                                      -> Close
157
 
    * 'up' noun                                 -> Close
158
 
    * 'off' noun                                -> SwitchOff;
159
 
Verb 'consult'
160
 
    * noun 'about' topic                        -> Consult
161
 
    * noun 'on' topic                           -> Consult;
162
 
Verb 'cut' 'chop' 'prune' 'slice'
163
 
    * noun                                      -> Cut;
164
 
Verb 'dig'
165
 
    * noun                                      -> Dig
166
 
    * noun 'with' held                          -> Dig;
167
 
Verb 'drink' 'sip' 'swallow'
168
 
    * noun                                      -> Drink;
169
 
Verb 'drop' 'discard' 'throw'
170
 
    * multiheld                                 -> Drop
171
 
    * multiexcept 'in'/'into'/'down' noun       -> Insert
172
 
    * multiexcept 'on'/'onto' noun              -> PutOn
173
 
    * held 'at'/'against'/'on'/'onto' noun      -> ThrowAt;
174
 
Verb 'eat'
175
 
    * held                                      -> Eat;
176
 
Verb 'empty'
177
 
    * noun                                      -> Empty
178
 
    * 'out' noun                                -> Empty
179
 
    * noun 'out'                                -> Empty
180
 
    * noun 'to'/'into'/'on'/'onto' noun         -> EmptyT;
181
 
Verb 'enter' 'cross'
182
 
    *                                           -> GoIn
183
 
    * noun                                      -> Enter;
184
 
Verb 'examine' 'x//' 'check' 'describe' 'watch'
185
 
    * noun                                      -> Examine;
186
 
Verb 'exit' 'out' 'outside'
187
 
    *                                           -> Exit
188
 
    * noun                                      -> Exit;
189
 
Verb 'fill'
190
 
    * noun                                      -> Fill;
191
 
Verb 'get'
192
 
    * 'out'/'off'/'up'                          -> Exit
193
 
    * multi                                     -> Take
194
 
    * 'in'/'into'/'on'/'onto' noun              -> Enter
195
 
    * 'off' noun                                -> GetOff
196
 
    * multiinside 'from' noun                   -> Remove;
197
 
Verb 'give' 'feed' 'offer' 'pay'
198
 
    * held 'to' creature                        -> Give
199
 
    * creature held                             -> Give reverse
200
 
    * 'over' held 'to' creature                 -> Give;
201
 
Verb 'go' 'run' 'walk'
202
 
    *                                           -> VagueGo
203
 
    * noun=ADirection                           -> Go
204
 
    * noun                                      -> Enter
205
 
    * 'into'/'in'/'inside'/'through' noun       -> Enter;
206
 
Verb 'in' 'inside'
207
 
    *                                           -> GoIn;
208
 
Verb 'insert'
209
 
    * multiexcept 'in'/'into' noun              -> Insert;
210
 
Verb 'inventory' 'inv' 'i//'
211
 
    *                                           -> Inv
212
 
    * 'tall'                                    -> InvTall
213
 
    * 'wide'                                    -> InvWide;
214
 
Verb 'jump' 'hop' 'skip'
215
 
    *                                           -> Jump
216
 
    * 'over' noun                               -> JumpOver;
217
 
Verb 'kiss' 'embrace' 'hug'
218
 
    * creature                                  -> Kiss;
219
 
Verb 'leave'
220
 
    *                                           -> VagueGo
221
 
    * noun=ADirection                           -> Go
222
 
    * noun                                      -> Exit
223
 
    * 'into'/'in'/'inside'/'through' noun       -> Enter;
224
 
Verb 'listen' 'hear'
225
 
    *                                           -> Listen
226
 
    * noun                                      -> Listen
227
 
    * 'to' noun                                 -> Listen;
228
 
Verb 'lock'
229
 
    * noun 'with' held                          -> Lock;
230
 
Verb 'look' 'l//'
231
 
    *                                           -> Look
232
 
    * 'at' noun                                 -> Examine
233
 
    * 'inside'/'in'/'into'/'through'/'on' noun  -> Search
234
 
    * 'under' noun                              -> LookUnder
235
 
    * 'up' topic 'in' noun                      -> Consult
236
 
    * noun=ADirection                           -> Examine
237
 
    * 'to' noun=ADirection                      -> Examine;
238
 
Verb 'no'
239
 
    *                                           -> No;
240
 
Verb 'open' 'uncover' 'undo' 'unwrap'
241
 
    * noun                                      -> Open
242
 
    * noun 'with' held                          -> Unlock;
243
 
Verb 'peel'
244
 
    * noun                                      -> Take
245
 
    * 'off' noun                                -> Take;
246
 
Verb 'pick'
247
 
    * 'up' multi                                -> Take
248
 
    * multi 'up'                                -> Take;
249
 
Verb 'pray'
250
 
    *                                           -> Pray;
251
 
Verb 'pry' 'prise' 'prize' 'lever' 'jemmy' 'force'
252
 
    * noun 'with' held                          -> Unlock
253
 
    * 'apart'/'open' noun 'with' held           -> Unlock
254
 
    * noun 'apart'/'open' 'with' held           -> Unlock;
255
 
Verb 'pull' 'drag'
256
 
    * noun                                      -> Pull;
257
 
Verb 'push' 'clear' 'move' 'press' 'shift'
258
 
    * noun                                      -> Push
259
 
    * noun noun                                 -> PushDir
260
 
    * noun 'to' noun                            -> Transfer;
261
 
Verb 'put'
262
 
    * multiexcept 'in'/'inside'/'into' noun     -> Insert
263
 
    * multiexcept 'on'/'onto' noun              -> PutOn
264
 
    * 'on' held                                 -> Wear
265
 
    * 'down' multiheld                          -> Drop
266
 
    * multiheld 'down'                          -> Drop;
267
 
Verb 'read'
268
 
    * noun                                      -> Examine
269
 
    * 'about' topic 'in' noun                   -> Consult
270
 
    * topic 'in' noun                           -> Consult;
271
 
Verb 'remove'
272
 
    * held                                      -> Disrobe
273
 
    * multi                                     -> Take
274
 
    * multiinside 'from' noun                   -> Remove;
275
 
Verb 'rub' 'clean' 'dust' 'polish' 'scrub'
276
 
     'shine' 'sweep' 'wipe'
277
 
    * noun                                      -> Rub;
278
 
Verb 'search'
279
 
    * noun                                      -> Search;
280
 
Verb 'set' 'adjust'
281
 
    * noun                                      -> Set
282
 
    * noun 'to' special                         -> SetTo;
283
 
Verb 'shed' 'disrobe' 'doff'
284
 
    * held                                      -> Disrobe;
285
 
Verb 'show' 'display' 'present'
286
 
    * creature held                             -> Show reverse
287
 
    * held 'to' creature                        -> Show;
288
 
Verb 'shit' 'damn' 'fuck' 'sod'
289
 
    *                                           -> Strong
290
 
    * topic                                     -> Strong;
291
 
Verb 'sing'
292
 
    *                                           -> Sing;
293
 
Verb 'sit' 'lie'
294
 
    * 'on' 'top' 'of' noun                      -> Enter
295
 
    * 'on'/'in'/'inside' noun                   -> Enter;
296
 
Verb 'sleep' 'nap'
297
 
    *                                           -> Sleep;
298
 
Verb 'smell' 'sniff'
299
 
    *                                           -> Smell
300
 
    * noun                                      -> Smell;
301
 
Verb 'sorry'
302
 
    *                                           -> Sorry;
303
 
Verb 'squeeze' 'squash'
304
 
    * noun                                      -> Squeeze;
305
 
Verb 'stand'
306
 
    *                                           -> Exit
307
 
    * 'up'                                      -> Exit
308
 
    * 'on' noun                                 -> Enter;
309
 
Verb 'swim' 'dive'
310
 
    *                                           -> Swim;
311
 
Verb 'swing'
312
 
    * noun                                      -> Swing
313
 
    * 'on' noun                                 -> Swing;
314
 
Verb 'switch'
315
 
    * noun                                      -> Switchon
316
 
    * noun 'on'                                 -> Switchon
317
 
    * noun 'off'                                -> Switchoff
318
 
    * 'on' noun                                 -> Switchon
319
 
    * 'off' noun                                -> Switchoff;
320
 
Verb 'take' 'carry' 'hold'
321
 
    * multi                                     -> Take
322
 
    * 'off' worn                                -> Disrobe
323
 
    * multiinside 'from' noun                   -> Remove
324
 
    * multiinside 'off' noun                    -> Remove
325
 
    * 'inventory'                               -> Inv;
326
 
Verb 'taste'
327
 
    * noun                                      -> Taste;
328
 
Verb 'tell'
329
 
    * creature 'about' topic                    -> Tell
330
 
    * creature 'to' topic                       -> AskTo;
331
 
Verb 'think'
332
 
    *                                           -> Think;
333
 
Verb 'tie' 'attach' 'fasten' 'fix'
334
 
    * noun                                      -> Tie
335
 
    * noun 'to' noun                            -> Tie;
336
 
Verb 'touch' 'feel' 'fondle' 'grope'
337
 
    * noun                                      -> Touch;
338
 
Verb 'transfer'
339
 
    * noun 'to' noun                            -> Transfer;
340
 
Verb 'turn' 'rotate' 'screw' 'twist' 'unscrew'
341
 
    * noun                                      -> Turn
342
 
    * noun 'on'                                 -> Switchon
343
 
    * noun 'off'                                -> Switchoff
344
 
    * 'on' noun                                 -> Switchon
345
 
    * 'off' noun                                -> Switchoff;
346
 
Verb 'wave'
347
 
    *                                           -> WaveHands
348
 
    * noun                                      -> Wave;
349
 
Verb 'wear' 'don'
350
 
    * held                                      -> Wear;
351
 
Verb 'yes' 'y//'
352
 
    *                                           -> Yes;
353
 
Verb 'unlock'
354
 
    * noun 'with' held                          -> Unlock;
355
 
Verb 'wait' 'z//'
356
 
    *                                           -> Wait;
357
 
Verb 'wake' 'awake' 'awaken'
358
 
    *                                           -> Wake
359
 
    * 'up'                                      -> Wake
360
 
    * creature                                  -> WakeOther
361
 
    * creature 'up'                             -> WakeOther
362
 
    * 'up' creature                             -> WakeOther;
363
 
 
364
 
! ------------------------------------------------------------------------------
365
 
!  This routine is no longer used here, but provided to help existing games
366
 
!  which use it as a general parsing routine:
367
 
 
368
 
[ ConTopic w;
369
 
    consult_from = wn;
370
 
    do w = NextWordStopped();
371
 
    until (w == -1 || (w == 'to' && action_to_be == ##Answer));
372
 
    wn--;
373
 
    consult_words = wn - consult_from;
374
 
    if (consult_words == 0) return -1;
375
 
    if (action_to_be == ##Answer or ##Ask or ##Tell) {
376
 
        w = wn; wn = consult_from; parsed_number = NextWord();
377
 
        if (parsed_number == 'the' && consult_words > 1) parsed_number = NextWord();
378
 
        wn = w;
379
 
        return 1;
380
 
    }
381
 
    return 0;
382
 
];
383
 
 
384
 
! ------------------------------------------------------------------------------
385
 
!  Final task: provide trivial routines if the user hasn't already:
386
 
! ------------------------------------------------------------------------------
387
 
 
388
 
#Stub AfterLife         0;
389
 
#Stub AfterPrompt       0;
390
 
#Stub Amusing           0;
391
 
#Stub BeforeParsing     0;
392
 
#Stub ChooseObjects     2;
393
 
#Stub DarkToDark        0;
394
 
#Stub DeathMessage      0;
395
 
#Stub GamePostRoutine   0;
396
 
#Stub GamePreRoutine    0;
397
 
#Stub InScope           1;
398
 
#Stub LookRoutine       0;
399
 
#Stub NewRoom           0;
400
 
#Stub ParseNumber       2;
401
 
#Stub ParserError       1;
402
 
#Stub PrintTaskName     1;
403
 
#Stub PrintVerb         1;
404
 
#Stub TimePasses        0;
405
 
#Stub UnknownVerb       1;
406
 
 
407
 
#Ifdef TARGET_GLULX;
408
 
#Stub HandleGlkEvent    2;
409
 
#Stub IdentifyGlkObject 4;
410
 
#Stub InitGlkWindow     1;
411
 
#Endif; ! TARGET_GLULX
412
 
 
413
 
#Ifndef PrintRank;
414
 
! Constant Make__PR;
415
 
! #Endif;
416
 
! #Ifdef Make__PR;
417
 
[ PrintRank; "."; ];
418
 
#Endif;
419
 
 
420
 
#Ifndef ParseNoun;
421
 
! Constant Make__PN;
422
 
! #Endif;
423
 
! #Ifdef Make__PN;
424
 
[ ParseNoun obj; obj = obj; return -1; ];
425
 
#Endif;
426
 
 
427
 
#Default Story 0;
428
 
#Default Headline 0;
429
 
 
430
 
#Ifdef INFIX;
431
 
#Include "infix";
432
 
#Endif;
433
 
 
434
 
! ==============================================================================
435
 
 
436
 
Constant LIBRARY_GRAMMAR;       ! for dependency checking
437
 
 
438
 
! ==============================================================================