Inform - Support - Source

Back to List

Inventory
Complete

Backward
At End

Plain
Coloured
Gaudy

This code
in plain text

Browsing Grammar.h

Tidying up operations for the whole library (lines 365-438)

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  ! ==============================================================================


Last updated 27 February 2004. The librarian in charge of this page is Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight. Please email any comments, suggestions or corrections to cedenqs@inform-fiction.org.