"PARSER for WITNESS Copyright (C) 1983 Infocom, Inc. All rights reserved." ;" 4/27/83 - SYNTAX-CHECK doesn't catch too-many-noun-clauses (MARC) 3/28/83 - GWIM prints XDESC, if any, for PERSON not yet touched. (SWG) 3/25/83 - Two additions to fix 'ACTOR, ' doing the wrong thing. Example: 'PHONG, WHY WERE YOU ...' (MARC) 3/16/83 - LINDER, HELP bug in which HELP was both noun and verb. (MARC) " "Parser global variable convention: All parser globals will begin with 'P-'. Local variables are not restricted in any way. " ">" ">" > ;"INBUF - Input buffer for READ" > ;"Parse-cont variable" > > > > > >> ;"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." > > )> )> > )>> > ) (OF-FLAG <>) LEN (DIR <>) (NW 0) (LW 0) NUM SCNT (CNT -1)) > ,P-ITBLLEN> ) (T )>> > > > > > ,VEHBIT>> >)>)> > > )>) (T > ,VEHBIT>> >)> > 0> ) (T )>> > )> )> "> )> > ) (> ,W?WHY ,W?HOW ,W?WHEN> > )> > ;"3/25/83: Next statement added." > 0> > ) (> >> > ) ( > )> > ) ( > >) (T )>)> >> ) (> <==? .VERB ,ACT?WALK>> >> ,W?THEN ,W?QUOTE> > > > >>> ,W?THEN>)> > > )>) (> >> 2>>>> >>) (> > ;>> <==? > ,W?OF> > <0? .VAL> >> ) (> > ,W?THEN ,W?PERIOD>>> )>) (<==? ,P-NCN 2> ) (T > > > > )>)>) (<==? .WRD ,W?CLOSELY> ) ( > ) ( > ,W?PERIOD ,W?THEN>> ) (T >)>) () (T )>) (T )> >> )> )> 0> )> > T)>> ;"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." > .BIT> ) (T > > >)> )>)>> ;" Scan through a noun clause, leave a pointer to its starting location" ) (FIRST?? T) NW (LW 0)) #DECL ((PTR VAL OFF NUM) FIX (WRD NW) (ANDFLG FIRST??) ) 2>> > > .VAL> .WRD> >) (T >)> > )> > >> ,W?THE ,W?A ,W?AN> 4>>)> > 0> >> )> > >> ) (T >>)> ,ACT?ACCUSE ,ACT?MAKE>> )> > ) ( ) ( > >)>) ( >> > >> >) ;"3/16/83: This clause used to be later." ( 0> >> > ,W?THEN> >) ( > >) ( > >> 2>>> ) (T >)>) ( >) ( T) (T )>) (T )> > >>> )) > 2>> > 3>> > 0> ) (T > ) ( ) ( > <- .CHR 48>>>) (T )> >)>> ) (.TIM ) ( T) ( ) ( T) (T >)> >>)> ,W?INTNUM> ) WRD) #DECL ((CNT TEMP VERB) FIX (BEG END) (WRD) TABLE) > >>> >>> ) (<==? ,P-NCN 2> ) (<==? 1> > > <0? .TEMP>> > >) (T > >)>) (T )>) (<==? 1> > > <0? .TEMP>> > > ) (T )>) (,P-ACLAUSE > > ) (T > > ) (T > )>) ( > ,P-PSOFF> ,PS?ADJECTIVE>> ) ( ,PS?OBJECT> <==? .WRD ,W?ONE>> > ) (T )>)> >>)>)> > ,P-ITBLLEN> ) (T >)>> T> .ADJ> 0>> > > > ;"Print undefined word in input. PTR points to the unknown word in P-LEXV" ) (ELSE > >)>>> >> > > >> 2> 3>> CR> > >> >> 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) #DECL ((DRIVE1 DRIVE2) > (SYN) (LEN NUM VERB PREP) FIX (OBJ) ) >> )> >> > > ,P-SONUMS>> T) ;"Added 4/27/83" (> <0? ,P-NCN> >> <==? .PREP >>> ) (<==? > <==? ,P-NCN 1>> ) (<==? > )>)> ) (T )>) (T >)>> >>> ) ( >>> ) ( ) (T ) (T )> )> ) (T )>> ) (T > )> )>> > ) (<0? > >) (T > )>> >) ) (T >)>> )> > )> > ) (.D2 > )>> .THE?>> ) WRD (FIRST?? T) (PN <>)) #DECL ((BEG END) (CP) ) ) (T >) (T )> > ,W?PERIOD> ) (<==? .WRD ,W?MRS> ) ;(<==? .WRD ,W?MS> ) (<==? .WRD ,W?MR> ) ( > ) (T .CP> )> ) ( <==? ,P-IT-LOC ,HERE>> ) ( <==? ,P-HIM-HER-LOC ,HERE>> ) (T >)> >)>)> >>> > 32>> 1> <+ 1>>> > > ) (T )> 0>> <==? ,W?DOWN .WRD>> ;"Will it ever work? --SWG" )>)>> ) "AUX" BEG END) #DECL ((BPTR EPTR) FIX (BEG END) (INSERT) ) > > ,P-LEXELEN> 2>>> ,P-LEXELEN> 2>>> ) (T >> )> >)> >>> 2>> .WRD> > 2>> ) (<==? .PREP> >>)>>> ) >> )> > 1> > > > ;> ) (T )>)> > ; > ")" CR>) (T )> .OBJ)>) (T )>> >) > 0>> > ,P-PRSO> > > >>)> > 0>> > ,P-PRSI> > >> 1> >) (T >)>)>)> > > ) (> ,P-BUTS>) (T .OBJ> >)> >> .NTBL> > > > > > > > > > > > > > ) (BUT <>) LEN WV WRD NW) #DECL ((TBL) TABLE (PTR EPTR) (AND) (BUT) (WV) ) > >>) (T > >)>) ( > > ) ( >)>) (T > > >)>) ( >> > > T) () () (<==? .WRD ,W?OF> )>) (> > ) ( )>)> > > )>>> ) (OLEN 0) OBJ) #DECL ((TBL) TABLE (XBITS BITS TLEN LEN) FIX (GWIM) (VRB GCHECK) ) > )> ,P-ADJ > >)> > <0? ,P-GWIMBIT>> )> )> > <0? ,P-SLOCBITS>> )> ) (T )> )> .TLEN>> ) ( >> > >> > )> ) ( >>> .LEN>> ) (T )> >> .OBJ>>> )> > > ) ( ,P-NC1) (T ,P-NC2)>> <>> ) (.VRB )> > > )>) ( .GCHECK> ; ; > > > ) (T )>)> > > ) (<0? .LEN> )> > >> )> > > >> > ) (T >)>> > 0> )> > 0> )> > 1> >)> .LEN> > ) (<==? .TBL ,P-PRSO> >) (T >)> > > ;> )> > )> ) ( )> > 1> )>>> (RMGL CNT) FIX (OBJ) OBJECT) > > 1>> > .TBL> )> )>>)> > 4> 1>> >> 1>>> 5>> > > ) ( )>>)> .LEN> > )>)>)>> > ) (T ) ( ) (T )>)>> (TBL) TABLE (LVL) FIX (FLS) ANY) > > > )> > > ;> > ; >> ,P-SRCALL) ( ,P-SRCALL) (T ,P-SRCTOP)>>>)> >) (T )>>)>> ) (> <- 2> 1>>>> ) (>> 1>>>>> ) (> >> )> > > .OBJ> >> > >>> ) > >> > 0> ) (T >> ) (<==? .OBJ ,HIM-HER> )> > ) (> >) ( <==? > T>> >) (T )> > ) (T )> ) ( <==? ,WINNER ,PLAYER>> )>)>)>>) (T)>> ) TMP) #DECL ((LOSS) ) 1> ,SMANY>>> ) ( 1> ,SMANY>>> )> )> > ) (,P-OFLAG >) (T >)> ) (T)>> )> > ) (ELSE >)> > ) ( )>>> > ) ( )>>> ;> ;)) #DECL ((RM OHERE) OBJECT (LIT) ) ,ALWAYS-LIT> ) (T )> 0> )>)> .LIT> ;> ) (<0? > >) (T >)>> 0> ,P-MERGED <==? > 0> ,W?IT> ;>> ) (T <>>)>> > 0> ,P-MERGED <==? > 0> ,W?IT> ;>> ) (T <>>)>> >