



PrintCommand (lines 3504-3544)
Back to List
Browsing parserm.h
3504 ! PrintCommand reconstructs the command as it presently reads, from
3505 ! the pattern which has been built up
3506 !
3507 ! If from is 0, it starts with the verb: then it goes through the pattern.
3508 ! The other parameter is "emptyf" - a flag: if 0, it goes up to pcount:
3509 ! if 1, it goes up to pcount-1.
3510 !
3511 ! Note that verbs and prepositions are printed out of the dictionary:
3512 ! and that since the dictionary may only preserve the first six characters
3513 ! of a word (in a V3 game), we have to hand-code the longer words needed.
3514 !
3515 ! (Recall that pattern entries are 0 for "multiple object", 1 for "special
3516 ! word", 2 to REPARSE_CODE-1 are object numbers and REPARSE_CODE+n means the
3517 ! preposition n)
3518 ! ----------------------------------------------------------------------------
3519
3520 [ PrintCommand from i k spacing_flag;
3521 if (from == 0) {
3522 i = verb_word;
3523 if (LanguageVerb(i) == 0)
3524 if (PrintVerb(i) == 0) print (address) i;
3525 from++; spacing_flag = true;
3526 }
3527
3528 for (k=from : k<pcount : k++) {
3529 i = pattern-->k;
3530 if (i == PATTERN_NULL) continue;
3531 if (spacing_flag) print (char) ' ';
3532 if (i ==0 ) { print (string) THOSET__TX; jump TokenPrinted; }
3533 if (i == 1) { print (string) THAT__TX; jump TokenPrinted; }
3534 if (i >= REPARSE_CODE)
3535 print (address) No__Dword(i-REPARSE_CODE);
3536 else
3537 if (i in compass && LanguageVerbLikesAdverb(verb_word))
3538 LanguageDirection (i.door_dir); ! the direction name as adverb
3539 else
3540 print (the) i;
3541 .TokenPrinted;
3542 spacing_flag = true;
3543 }
3544 ];
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.