"PARSER for NORD AND BERT (from amfv) (c) Copyright 1987 Infocom, Inc. All Rights Reserved" ;"Parser global variable convention: All parser globals will begin with 'P-'. Local variables are not restricted in any way." > > ;"was AND the word used, not a comma" > ;"was PICKED used for 'p. p. picked a peck of p. p.'" > > > > > > > > > > > > "INBUF - Input buffer for READ" > > <> <> <>>> "word pointer to unknown token in P-LEXV" "word pointer to sentence start in P-LEXV" "byte length of unparsed tokens in P-LEXV" "byte pointer to first free byte in OOPS-INBUF" > ;"Parse-cont variable" > > > > ;"PRSO is a direction" ;"is this necessary?" > ) ( ) ( ) ;"for animals" (T )>> > ;"Orphan flag" > > > > "Parser variables and temporaries:" "Byte offset to # of entries in LEXV" "Word offset to start of LEXV entries" "Number of words per LEXV entry" "Offset to parts of speech byte" "Offset to first part of speech" "First part of speech bit mask in PSOFF byte" > > > > > > > " Grovel down the input finding the verb, prepositions, and noun clauses. If the input is or , fall out immediately setting PRSA to ,V?WALK and PRSO to . Otherwise, perform all required orphaning, syntax checking, and noun clause lookup." ) (DONT <>) OMERGED OWINNER LEN (DIR <>) (NW 0) (LW 0)(CNT -1)(OF-FLAG <>)) > ) (T >)> )>> > > > > > > > > ;> ;> ;> > ;> ;> > > ; ;> > > > ,VEHBIT>> >)> ;>)> <==? ,PROTAGONIST ,WINNER>> )> > >) (,P-CONT <==? ,PROTAGONIST ,WINNER>> )> >) (T > ,VEHBIT>> >)> ;> )> 4> -5>> )> ;"T added to fix screen clearing" "> ;"STATUS-LINE called at end of main-loop" )> > ) ( ,W?OOPS> > ,W?PERIOD ,W?COMMA> > >)> > ) (> )> >> ;"Fixes OOPS w/chars" 6>> 7>> <+ <* .VAL ,P-LEXELEN> 3>> > > ) (T > )> ; )> > > 2> > 3>>) (T >)> >> )>) (T >)> ,W?AGAIN ,W?G> > ) ( ,P-OFLAG ;"orphaning every turn?" ; ,ACT?NOVERB>> ) ( ) (> >> ) ( > ,W?PERIOD ,W?COMMA ,W?THEN> > ,W?AND ,W?PICKED ,W?CANT ,W?CAN\'T>> > ,W?AND> )> > ,W?PICKED> )> > ,W?CANT ,W?CAN\'T> )> >> 2>>) (T )>) (T > 1>>)> 0> ) (T >)> ;> ; ) (T >)>>) (T > >>>> > >>> > ;> > > ) ;( >>> ;"to print ptr" ) (> >> ) (T >>)> >>> ;"to print ptr" ) ( > ) ( > ) ( > > )> > ) ( >) (T )>)> >> ) (> ,ACT?WALK ,ACT?GO> > >> > >>> )> )> )> ,W?THEN>)> > > )>) (> > ; ,ACT?NOVERB> )> 2>>>> >>) (> > ;"1 IN RETROFIX #34" <0? .VAL> > >> ;"save of-word" ) (> >> )>) ( ) (T > > ) ( >> ,W?FRONT>> )> > > > )>)>) ( ;"RETROFIX #34" > ) (T >)>) ( > ) () ( > ) (T )>) (T )> >>)> > > ;"dont" > ;"else, when input is just a direction, P-PRSA-WORD will remain whatever it was for the previous turn" )> )> ;"this WAS replaced by below dont clause" > ) (T )> ; >> )> ;"dont" > > > T)>> ) "AUX" BUF (NUM 0)) )> >> ) (.TO-PRINT? > ;"got moved to ID room" )> > ;"so previous orphan will be shut off" >> 2> 3>> ) ( ) (T > )>> ;"30" > ) "AUX" X Y Z) >>> > >> >> >> )> > > > "For AGAIN purposes, put contents of one LEXV table into another:" > > ; >)> > 2>> > > > > )>>> ;"Put contents of one INBUF into another" ) (T >)>>> ;> )> >>> ;"Put the word in the positions specified from P-INBUF to the end of OOPS-INBUF, leaving the appropriate pointers in AGAIN-LEXV" > ) (T > >>>)> > >> > )>> .LEN>> ;"Check whether word pointed at by PTR is the correct part of speech. The second argument is the part of speech (,PS?). The 3rd argument (,P1?), if given, causes the value for that part of speech to be returned." ;"allows three parts ot speech" > .BIT> ) ( 1) (T > > >)> )>)>> ;" Scan through a noun clause, leave a pointer to its starting location" ) (FIRST?? T) NW (LW 0)) 2>> > > .VAL> .WRD> >) (T >)> > )> > >> ,W?THE ,W?A ,W?AN> 4>>)> > 0> >> )> > >> ) (T >> ;"added 8/14/86 SWG" >>)>)> > ) ( ) ( ) (T )>) ;"above added and below semied for J3" ( ) ( > >)>) ( ;"ADDED 4/27 FOR TURTLE,UP" >> > >> >) ;"This next clause was 2 clauses further down" ;"This attempts to fix EDDIE, TURN ON COMPUTER" ( 0>> > ,W?THEN> >) ( >> .WRD> ;"previous line had been just T -- from prof's trinity") ( ,ACT?SHOW ,ACT?HAND ,ACT?FEED> > ;"horrific kludge for 'give her sword to...' --pdl") ( > > > ,ACT?SHOW ,ACT?HAND ,ACT?FEED>>>) ( > > >>) ( > >> 2>>> ) (T >)>) ;"next clause replaced by following one from games with characters" ;( 0>>> >>) ( >) ( T) (T )>) (T )> > >>> ;) (EXC <>)) > 2>> > 3>> > 0> ) (T > )> ) (<==? .CHR ;45 % %> )> ) ( ) ( > <- .CHR 48>>>) (T )> >)>> ;"Makes #s work with AGAIN" ) (.TIM ;"from Deadline -- no time before 8 am" >) ( )> >>) (T )> ,W?NUMBER> ;"from suspect" ) (EXC <>)) > 2>> > 3>> > 0> ) (T > )> ) (<==? .CHR 45 %> )> ) ( ) ( > <- .CHR 48>>>) (T )> >)>> ) (.EXC ) (.TIM ) ( T) ( ) ( T) (T >)> >>) (T )> ,W?NUMBER> > ) WRD) > 0>> > > ) ( > > > )> >>> >>> ) (<==? ,P-NCN 2> ) (<==? 1> > > <0? .TEMP>> > > >)> )>) (T > ;>)> >) (T )>) (<==? 1> > > <0? .TEMP>> > > >)>)> > > ) (T )>) (,P-ACLAUSE > > > ) (T > > >)> > > ) (T > )>) ( ,PS?ADJECTIVE> ;"same as WT?" >> ) (<==? .WRD ,W?ONE> ) ( ,PS?OBJECT> ) (T )> )> > > )>>)>)> > > > ; 0>> > > ,P-ITBLLEN> ) (T >)>> T> > ,P-ACLAUSE <+ ,P-ACLAUSE 1> .ADJ> 0>> > > > > 0>> > > > ;"Print undefined word in input. PTR points to the unknown word in P-LEXV" ) (ELSE > >)>>> ) (T )> >> 2> 3>> ) (T )> > ;>> >> 2> 3>> > >> ;"Perform syntax matching operations, using P-ITBL as the source of the verb and adjectives for this input. Returns false if no syntax matches, and does it's own orphaning. If return is true, the syntax is saved in P-SYNTAX." ) (DRIVE2 <>) PREP VERB TMP) >> >)> >> > > ,P-SONUMS>> T) (> <0? ,P-NCN> >> <==? .PREP >>> ) (<==? > <==? ,P-NCN 1>> ) ( > )>)> ) (T )>) (T >)>> >>> ) ( >>> ) ( ) ;( ) (T ) (T )> ) ( ,ACTORBIT>> ,ACTORBIT>>> ) (T )> )> ) (T )> )> > ) (T )>> ) (T > )> > > ;"by Jeff for WP -- since p-namw retained" ;"from last command" )>> ;> ) (>> ) ( ,W?CLOTHES ,W?CLOTHING> ) ( ,W?MY> ,W?CLOTHES ,W?CLOTHING> ) (T )>)>> > ;"? ,P-OTBL?" ) (<0? > >) (T > )>> ; > )> > > > ) (T >)>> )> > )> > ) (.D2 > )>> ; > .THE? T>> ) "AUX" (NOSP <>) WRD (FIRST?? T) (PN <>)) ) (T >) (T )> > ,W?PERIOD> ) ( > ) ;( > > >> ) ( ) ( ) ( ) (T .CP> )> ) ( > ; ) ( > ) ( > ) (T >)> >)>)> >>> ) (T )>> >) (T > 32>> 1> <+ 1>>)>> > ) (T > )>)>> ) "AUX" BEG END) > > ,P-LEXELEN> 2>>> ,P-LEXELEN> 2>>> ) (T >> )> >)> >>> 2>> .WRD> > 2>> ) (<==? .PREP> >>)>>> >> )> > 1> > > > > ; ,ACT?SIT> <==? .PREP ,W?ON> <==? .OBJ ,DINETTE-SET>> ) ( ,ACT?SIT> <==? .PREP ,W?ON> <==? .OBJ ,STADIUM-STANDS>> )> )> > ) (T )>)> .OBJ)>) (T )>> > 0>> > ,P-PRSO> > > >>)> > 0>> > ,P-PRSI> > >> 1> >) (T >)>)>)> > > ) (> >>) (T .OBJ> >)> >> .NTBL> > > > > > ;"the FIRST! noun in a NOUN-OF-NOUN phrase" "Which noun phrase is being parsed?" > > > > > ) LEN TMP WRD NW ONEOBJ (WAS-ALL <>)) ;"Next SETG 6/21/84 for WHICH retrofix" > > > )> > >> )> ) (T > ) (T >)> ; >)>) ( > > ) ( >)>) (T > > >)>) ( >> )> )> )> > > T) () () (<==? .WRD ,W?OF> )>) ( >> ;"SWG put 0 in" ) ( )>)> > > )>>> ;"ADJ-CHECK will grab the first adjective, unless it comes across one of the words in the last clause" ) ;( ) ;() (T )>> ) (T )>> > ) (OLEN 0) OBJ) > )> ,P-ADJ > >) (> )> > <0? ,P-GWIMBIT>> )> )> > <0? ,P-SLOCBITS>> )> ) (T )> .TLEN>> ;>>) ( >> > ,W?STONE> ,STONE ,GRINDSTONE> ) (T >> > )>)> ) ( >>> .LEN>> ) (T )> >> >>> )> > > ) (>> ; ) ( ,P-NC1) (T ,P-NC2)>> <>> ) (.VRB )> > > )>) ( .GCHECK> > > )> > > ) (<0? .LEN> )> > > >> > >) (T )> )>> ;"zilch should stick the # of last object here" ;)> % ;>> ;"ZIP case" '> > >> >)> )>>>) (T ;"ZIL case" ' > ) (T >)>> >)> > 1> >)> > > > > )> )> > ; ) (T )>) (T ) ( >) (T >)> ;> )>)> ;>)> > > > )> > )> ) ( )> > 1> )>> > ) (T )>> > > 2> 1>> >> )> )>>)> .LEN> ;> > )>)>> ) "AUX" BTS) > ) (T ) ( ) (T )>)>> ) "AUX" FLS NOBJ) > > > )> > > >> .MOBY-FLAG> ,P-SRCALL) ( ,P-SRCALL) (T ,P-SRCTOP)> .MOBY-FLAG>>)>)> >) (T )>>)>> >> > > >>> > >> > 0> ) (T >> > ) (T )>) ( > ) (T )>) ( > ) (T )>)> > T) (T ) (> >) ( > T>> >) (T )> > > ) ( )> ) (T )> ,W?CANISTER>> ) (T )> ) ( <==? ,WINNER ,PROTAGONIST>> )>)>)>>) (T)>> ) TMP) 1> ,SMANY>>> ) ( 1> ,SMANY>>> )> ) (.LOSS ; )> ; > ) ( >) (T >)> ) (T)>> ; )> > ) (T >)> > ) ( )>>> ;)) > ) (T > > )>)> 0> )>)> .LIT> ;"in x1 too, protag not found now" ) (>> )> 2>>>> )> >> ) ( 2>>> )>)> > >> )> >