1 ! ==============================================================================
2 ! GRAMMAR
: Grammar table entries
for the standard verbs library
.
4 ! Supplied
for use with Inform
6 -- Release
6/12 -- Serial number
151220
6 ! Copyright Graham Nelson
1993-2004 and David Griffith
2012-2015
7 ! This code is licensed under either the traditional Inform license as
8 ! described by the DM4
or the Artistic License version
2.0. See the
9 ! file COPYING in the distribution archive
or at
10 ! https
://github.com/DavidGriffith/inform6lib/
12 ! In your game file
, Include three library files in
this order
:
16 ! ==============================================================================
21 #Iffalse LIBRARY_STAGE >= AFTER_GRAMMAR; ! if not already included
22 #Iftrue LIBRARY_STAGE == AFTER_VERBLIB; ! if okay to include it
24 ! ------------------------------------------------------------------------------
25 ! The
"meta-verbs", commands to the game rather than in the game
, come first
:
26 ! ------------------------------------------------------------------------------
31 Verb meta
'verbose' 'long'
34 Verb meta
'superbrief' 'short'
45 Verb meta
'pronouns' 'nouns'
48 Verb meta
'quit' 'q//' 'die'
54 * 'off' -> CommandsOff
;
71 Verb meta
'fullscore' 'full'
73 * 'score' -> FullScore
;
75 Verb meta
'script' 'transcript'
80 Verb meta
'noscript' 'unscript'
96 ! ------------------------------------------------------------------------------
98 ! ------------------------------------------------------------------------------
104 * 'off' -> ActionsOff
;
109 * 'off' -> ChangesOff
;
112 * anynumber
-> GoNear
122 Verb meta
'routines' 'messages'
125 * 'verbose' -> RoutinesVerbose
126 * 'off' -> RoutinesOff
;
133 Verb meta
'showdict' 'dict'
139 * anynumber
-> Showobj
143 * special
-> Showverb
;
145 Verb meta
'timers' 'daemons'
148 * 'off' -> TimersOff
;
152 * number
-> TraceLevel
157 * anynumber
'to' anynumber
-> XAbstract
158 * noun
'to' noun
-> XAbstract
;
161 * anynumber
-> XPurloin
176 ! ------------------------------------------------------------------------------
177 ! And now the game verbs
.
178 ! ------------------------------------------------------------------------------
180 [ ADirection
; if (noun in compass
) rtrue
; rfalse
; ];
182 Verb
'answer' 'say' 'shout' 'speak'
183 * topic
'to' creature
-> Answer
;
186 * creature
'about' topic
-> Ask
187 * creature
'for' noun
-> AskFor
188 * creature
'to' topic
-> AskTo
189 * 'that' creature topic
-> AskTo
;
191 Verb
'attack' 'break' 'crack' 'destroy'
192 'fight' 'hit' 'kill' 'murder' 'punch'
193 'smash' 'thump' 'torture' 'wreck'
199 Verb
'bother' 'curses' 'darn' 'drat'
205 * noun
'with' held
-> Burn
;
207 Verb
'buy' 'purchase'
212 * 'up'/'over' noun
-> Climb
;
214 Verb
'close' 'cover' 'shut'
217 * 'off' noun
-> SwitchOff
;
220 * noun
'about' topic
-> Consult
221 * noun
'on' topic
-> Consult
;
223 Verb
'cut' 'chop' 'prune' 'slice'
228 * noun
'with' held
-> Dig
230 * 'in' noun
'with' held
-> Dig
;
233 Verb
'disrobe' 'doff' 'shed'
236 Verb
'drink' 'sip' 'swallow'
239 Verb
'drop' 'discard'
241 * multiexcept
'in'/'into'/'down' noun
-> Insert
242 * multiexcept
'on'/'onto' noun
-> PutOn
;
245 * held
'at'/'against'/'on'/'onto' noun
-> ThrowAt
;
252 * 'out' noun
-> Empty
253 * noun
'out' -> Empty
254 * noun
'to'/'into'/'on'/'onto' noun
-> EmptyT
;
260 Verb
'examine' 'x//' 'check' 'describe' 'watch'
263 Verb
'exit' 'out' 'outside'
269 * noun
'from' noun
-> Fill
;
272 * 'out'/'off'/'up' 'of'/'from' noun
-> Exit
274 * 'in'/'into'/'on'/'onto' noun
-> Enter
275 * 'off' noun
-> GetOff
276 * multiinside
'from'/'off' noun
-> Remove
;
278 Verb
'give' 'feed' 'offer' 'pay'
279 * held
'to' creature
-> Give
280 * creature held
-> Give reverse
281 * 'over' held
'to' creature
-> Give
;
283 Verb
'go' 'run' 'walk'
285 * noun
=ADirection
-> Go
287 * 'out'/'outside' -> Exit
288 * 'in'/'inside' -> GoIn
289 * 'into'/'in'/'inside'/'through' noun
-> Enter
;
295 * multiexcept
'in'/'into' noun
-> Insert
;
297 Verb
'inventory' 'inv' 'i//'
302 Verb
'jump' 'hop' 'skip'
304 * 'in' noun
-> JumpIn
305 * 'into' noun
-> JumpIn
306 * 'on' noun
-> JumpOn
307 * 'upon' noun
-> JumpOn
308 * 'over' noun
-> JumpOver
;
310 Verb
'kiss' 'embrace' 'hug'
315 * noun
=ADirection
-> Go
317 * 'into'/'in'/'inside'/'through' noun
-> Enter
;
322 * 'to' noun
-> Listen
;
325 * noun
'with' held
-> Lock
;
329 * 'at' noun
-> Examine
330 * 'inside'/'in'/'into'/'through'/'on' noun
-> Search
331 * 'under' noun
-> LookUnder
332 * 'up' topic
'in' noun
-> Consult
333 * noun
=ADirection
-> Examine
334 * 'to' noun
=ADirection
-> Examine
;
339 Verb
'open' 'uncover' 'undo' 'unwrap'
341 * noun
'with' held
-> Unlock
;
345 * 'off' noun
-> Take
;
349 * multi
'up' -> Take
;
354 Verb
'pry' 'prise' 'prize' 'lever' 'jemmy' 'force'
355 * noun
'with' held
-> Unlock
356 * 'apart'/'open' noun
'with' held
-> Unlock
357 * noun
'apart'/'open' 'with' held
-> Unlock
;
362 Verb
'push' 'clear' 'move' 'press' 'shift'
364 * noun noun
-> PushDir
365 * noun
'to' noun
-> Transfer
;
368 * multiexcept
'in'/'inside'/'into' noun
-> Insert
369 * multiexcept
'on'/'onto' noun
-> PutOn
371 * 'down' multiheld
-> Drop
372 * multiheld
'down' -> Drop
;
376 * 'about' topic
'in' noun
-> Consult
377 * topic
'in' noun
-> Consult
;
382 * multiinside
'from' noun
-> Remove
;
384 Verb
'rub' 'clean' 'dust' 'polish' 'scrub'
385 'shine' 'sweep' 'wipe'
393 * noun
'to' special
-> SetTo
;
395 Verb
'show' 'display' 'present'
396 * creature held
-> Show reverse
397 * held
'to' creature
-> Show
;
399 Verb
'shit' 'damn' 'fuck' 'sod'
407 * 'on' 'top' 'of' noun
-> Enter
408 * 'on'/'in'/'inside' noun
-> Enter
;
420 Verb
'squeeze' 'squash'
426 * 'on' noun
-> Enter
;
433 * 'on' noun
-> Swing
;
437 * noun
'on' -> Switchon
438 * noun
'off' -> Switchoff
439 * 'on' noun
-> Switchon
440 * 'off' noun
-> Switchoff
;
442 Verb
'take' 'carry' 'hold'
444 * 'off' held
-> Disrobe
445 * multiinside
'from'/'off' noun
-> Remove
446 * 'inventory' -> Inv
;
452 * creature
'about' topic
-> Tell
453 * creature
'to' topic
-> AskTo
;
458 Verb
'tie' 'attach' 'connect' 'fasten' 'fix'
460 * noun
'to' noun
-> Tie
;
462 Verb
'touch' 'feel' 'fondle' 'grope'
466 * noun
'to' noun
-> Transfer
;
468 Verb
'turn' 'rotate' 'screw' 'twist' 'unscrew'
470 * noun
'on' -> Switchon
471 * noun
'off' -> Switchoff
472 * 'on' noun
-> Switchon
473 * 'off' noun
-> Switchoff
;
476 * noun
'with' held
-> Unlock
;
481 Verb
'wake' 'awake' 'awaken'
484 * creature
-> WakeOther
485 * creature
'up' -> WakeOther
486 * 'up' creature
-> WakeOther
;
491 * noun
'at' noun
-> Wave
492 * 'at' noun
-> WaveHands
;
500 ! ------------------------------------------------------------------------------
501 ! This routine is no longer used here
, but provided to help existing games
502 ! which use it as a general parsing routine
:
506 do w
= NextWordStopped();
507 until (w
== -1 || (w
== 'to' && action_to_be
== ##Answer));
509 consult_words
= wn
- consult_from
;
510 if (consult_words
== 0) return -1;
511 if (action_to_be
== ##Answer or ##Ask or ##Tell) {
512 w
= wn
; wn
= consult_from
; parsed_number
= NextWord();
513 if (parsed_number
== 'the' && consult_words
> 1) parsed_number
= NextWord();
520 ! ------------------------------------------------------------------------------
521 ! Final task
: provide trivial routines
if the user hasn
't already:
522 ! ------------------------------------------------------------------------------
532 Stub BeforeParsing 0;
533 Stub ChooseObjects 2;
537 Stub GamePostRoutine 0;
538 Stub GamePreRoutine 0;
542 Stub ObjectDoesNotFit 2;
545 Stub PrintTaskName 1;
551 Stub HandleGlkEvent 2;
552 Stub IdentifyGlkObject 4;
553 Stub InitGlkWindow 1;
554 #Endif; ! TARGET_GLULX
561 [ ParseNoun obj; obj = obj; return -1; ];
568 ! ==============================================================================
570 Undef LIBRARY_STAGE; Constant LIBRARY_STAGE = AFTER_GRAMMAR;
572 #Ifnot; ! LIBRARY_STAGE < AFTER_GRAMMAR but ~= AFTER_VERBLIB
573 Message "Error: 'verblib
' needs to be correctly included before including 'grammar
'. This will cause a big number of errors!";
576 #Ifnot; ! LIBRARY_STAGE >= AFTER_GRAMMAR : already included
577 Message "Warning: 'grammar
' included twice; ignoring second inclusion. (Ignore this if this is on purpose.)";
580 #Ifnot; ! LIBRARY_STAGE is not defined
581 Message "Error: 'parser
', then 'verblib
' need to be correctly included before including 'grammar
'. This will cause a big number of errors!";
584 ! ==============================================================================