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 340-394)

340  !  This routine is no longer used here, but provided to help existing games
341  !  which use it as a general parsing routine:
342   
343  [ ConTopic w; consult_from = wn;
344    do w=NextWordStopped();
345    until (w==-1 || (w=='to' && action_to_be==##Answer));
346    wn--;
347    consult_words = wn-consult_from;
348    if (consult_words==0) return -1;
349    if (action_to_be==##Ask or ##Answer or ##Tell)
350    {   w=wn; wn=consult_from; parsed_number=NextWord();
351        if (parsed_number=='the' && consult_words>1) parsed_number=NextWord();
352        wn=w; return 1;
353    }
354    return 0;
355  ];
356  ! ----------------------------------------------------------------------------
357  !  Final task: provide trivial routines if the user hasn't already:
358  ! ----------------------------------------------------------------------------
359  #Stub TimePasses      0;
360  #Stub Amusing         0;
361  #Stub DeathMessage    0;
362  #Stub DarkToDark      0;
363  #Stub NewRoom         0;
364  #Stub LookRoutine     0;
365  #Stub AfterLife       0;
366  #Stub GamePreRoutine  0;
367  #Stub GamePostRoutine 0;
368  #Stub AfterPrompt     0;
369  #Stub BeforeParsing   0;
370  #Stub PrintTaskName   1;
371  #Stub InScope         1;
372  #Stub UnknownVerb     1;
373  #Stub PrintVerb       1;
374  #Stub ParserError     1;
375  #Stub ParseNumber     2;
376  #Stub ChooseObjects   2;
377  #IFNDEF PrintRank;
378  Constant Make__PR;
379  #ENDIF;
380  #IFDEF Make__PR;
381  [ PrintRank; "."; ];
382  #ENDIF;
383  #IFNDEF ParseNoun;
384  Constant Make__PN;
385  #ENDIF;
386  #IFDEF Make__PN;
387  [ ParseNoun obj; obj=obj; return -1; ];
388  #ENDIF;
389  #Default Story 0;
390  #Default Headline 0;
391  #IFDEF INFIX;
392  #Include "infix";
393  #ENDIF;
394  ! ----------------------------------------------------------------------------


Last updated 27 February 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.