"PARSER for CHECKPOINT Copyright (C) 1985 Infocom, Inc. All rights reserved." "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" > > > > "" > > ">" > " >" > > > > (OBJ) (OBJ1) OBJECT (TBL) TABLE (PTBL) ) > > >)> > > > > > > .ICNT> ) (T ,IT> )>)>> > .OCNT> ) (T ,IT> )>)>>)> )> .OCNT) ( >) (T >)> .OCNT) ( > > .ICNT) (T 1)>> <1? .ICNT>> >)> >) (<0? .NUM> ,P-SONUMS>> > >) ( > > ) (T > > > ) ( >) (T >>)> >)>) ;( > >) (T ;"> )>" > .NUM> > )> > )> > ) (T )> ) ( )> ) (T >) (T >)> 0> ,W?ALL>> > ) ( ,WINNER ,HERE>> ,SURFACEBIT>>> >>>> ) ( > >> ) (> ) (<==? .OBJ1 ,PLAYER> ) ;( ) (T ) (T )> )>)> >> > > > )>)>>)> T) ( T) (,P-OFLAG T) (T )> >)>) (T >)> > > T) ( > > T) (T >)>)>>> )) )> ) ( ) ( ) ( ) ( ) ( ) ( ) ( )>> ) (N 0)) <==? .PRSO ,PLAYER>>> ;"? more?" > ) ( > >> > )> >> > )> <==? ,WINNER ,PLAYER>> ;"? more?" )>)>> > > <==? ,HERE ,QCONTEXT-ROOM> <==? ,HERE >> )>> >> ,NOT-HERE-OBJECT> )> <==? .OBJ ,PRSO>> )> > > )>) ( ) ( ) ( ) (T )> > > > ) (<0? > >) (T > )> > > > ) ( ) ( )> ) (T )>)>> > > )> > >> .P>>)> >) (T )> > )> )>> ) (I <>) "AUX" V OA OO OI) ;#DECL((A) FIX (O) (I) (V)ANY) % ') (T ' 1>>>)> ) (T )>)> )> )> > >> ) (T )> )> > )> )> )>) (T ) (T )> )>)> > )> )> )>) (T ) (T )> )>)> > )> )> )>) (T ) (T )> )>)> )>) ;"(<==? .O ,THEM>) (<==? .O ,HER> ) (<==? .O ,HIM> )"> )>) ;"(<==? .I ,THEM>) (<==? .I ,HER> ) (<==? .I ,HIM> )">)> > >> > .V) (> > >> T) ;"[in case last clause changed PRSx]" (> ;"extra output for next (...)" >> T) ( ,M-WINNER>> .V) ( ,P?ACTION> ,M-BEG>> .V) (>> .V) ( >>> .V) (>> .O > ,P?CONTFCN>> > ; ,P?CONTFCN>>>> .V) (> >>> .V) ( >> .V)> > >> ,P?ACTION> ,M-END>>)>)> .V> ;> )> > ) "AUX" RES) <>) (T ) (T > )>)> )> ) (T )>> ) ( ) (T )>)> .RES)>> " 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." > > )> > )>> ) ( ) ( ) ( > ) ;( )>> ) ( > ) ( > ) (T )> )>> > )>> > > > > )>> > ) LEN (DIR <>) (NW 0) (LW 0) NUM SCNT (CNT -1) OWINNER) > ,P-ITBLLEN> ) (T )>> > > > > ;> > ,VEHBIT>> >)> >)> > > <==? ,PLAYER ,WINNER>> )> ;> )>) (T > ,VEHBIT>> >)> > )> ; ;> 0> ) (T )>> > ) (T )> )> "> )> > > > ;"Is quote first input token?" > ;"If so, ignore it." >)> > ;"Is THEN first input word?" > ;"If so, ignore it." >)> <==? ,W?GO > ;"Is GO first input word?" >> ;" followed by verb?"> > ;"If so, ignore it." >)> )> > ;"3/25/83: Next statement added." > 0> > ) (>> ) (> ;>> > ) ( ;"Last NOT added 7/3"> )> > ) ( > >) (T )>)> >> ) (> ,ACT?WALK ,ACT?FACE> > >> ,W?THEN ,W?PERIOD ,W?QUOTE> > ; > > >>> ,W?THEN>)> > > )>) (> ;>> ; )> 2>>>> >>) (> > >> <==? > ,W?OF> > <0? .VAL> > >>) (> > ,W?THEN ,W?PERIOD>>> )>) (<==? ,P-NCN 2> ) (T > > > > )>)>) (<==? .WRD ,W?CLOSELY> ) ( > ) () ( > ) (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 phrase, leaving 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?MAKE ,ACT?TAKE>> )> > ) ( ) ( > >)>) ( >> > >> >) ;"3/16/83: This clause used to be later." ( 0> ;"10/26/84: next stmt changed" >> > ,W?THEN> >) ( >> T) ( > >) ( > >> 2>>> ) (T >)>) ( 0>>> >>) ( 0>> > ,W?THEN> >) ( T) (T )>) (T )> > >>> > > >>> ) (DOLLAR <>)) > 2>> > 3>> ;> > 0> ) (T > > ) ( ) ( ) (> >> ) (T <- .CHR %>>>)> >)>> ) (.TIM >)" ( ) ;"( T) ( ) ( T) (T >)"> >>)> > ,W?MONEY ; ;) (T > ,W?NUMBER ; ;)>> > > "New ORPHAN-MERGE for TRAP Retrofix 6/21/84" ) WRD) > 0>> ,PS?ADJECTIVE ,P1?ADJECTIVE> ) ;"Following clause is retrofix #30, which handles case where one-word response is both noun and verb. -JW 8/20/84" ( > > > )> >>> >>> ) (<==? ,P-NCN 2> ) (> ) (<==? 1> > > <0? .TEMP>> >) (T >)> 0> >)> >) (T )>) (<==? 1> > > <0? .TEMP>> >)> > 0> >)> > ) (T )>) (,P-ACLAUSE > > > ) (T > > >)> > > ) (T > )>) ( ,PS?ADJECTIVE> >> ) (<==? .WRD ,W?ONE> ) ( ,PS?OBJECT> ) (T )> )> > > )>>)>)> > > > 0>> ) (T )> > ,P-ITBLLEN> ) (T >)>> T> "New ACLAUSE-WIN for TRAP retrofix 6/21/84" > > > 0>> > > > > 0>> > > > "Print undefined word in input. PTR points to the unknown word in P-LEXV" )> ) (ELSE > >)>>> >> > >) ;(T )> >> 2> 3>> > > CR>) ;(T )>> > > >> 2> 3>> ) ;(T )>> " 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 "ere") (T "at")> " do you want to ">) (T "ere") (T "at")> " you want" THE ,WINNER " to ">)> )> ) (T )>> ) (T > )> )>> > > ;"? ,P-OTBL?" ) (<0? > >) (T > )>> >) )> > > > ) (T >)>> )> > )> > ) (.D2 > )>> .THE?>> ) WRD (FIRST?? T) (PN <>)) ) (T >) (T )> > >> >> >>> )> ) ( ) ( ) (T .CP> )> ) ( > ) ( ;"VISIBLE check above" ;> ) ( ;> ) ( ;> ) (T >)> >)>)> >>> >> > 32>> 1> <+ 1>>> > )> > ) (<==? .WRD ,W?THROUGH> ) (T )> 0>> <==? ,W?DOWN .WRD>> )> 0>> <==? ,W?OUT .WRD>> ;"Will it ever work? --SWG" )> )>> > "pointers used by CLAUSE-COPY (source/destination beginning/end pointers)" ) "AUX" BEG END) >> >> ,P-LEXELEN> 2>>> ,P-LEXELEN> 2>>> ) (T >> )> >)> >>> 2>> .WRD> > 2>> ) (<==? .PREP> >>)>>> ) >> )> > 1> > > )> .OBJ)>) (T )>> >) > 0>> > ,P-PRSO> > > >>)> > 0>> > ,P-PRSI> > >> 1> >) (T >)>)>)> > > ) (> ,P-BUTS>) (T .OBJ> >)> >> .NTBL> > > > > > > > > > > > > > > ) LEN WV WRD NW) ;"Next SETG 6/21/84 for WHICH retrofix" > > >>) (T > >)>) ( > > ) ( ) ( >)>) (T > > >)>) ( >> ;"Next SETG 6/21/84 for WHICH retrofix" > > T) () () (<==? .WRD ,W?OF> )>) (> > ) ( )>)> > > )>>> ) (OLEN 0) OBJ ADJ) ;#DECL ((TBL) TABLE (XBITS BTS TLEN LEN) FIX (GWIM) (VRB GCHECK) ) > ;)> )> ,P-ADJ> >) (> > )>)> > <0? ,P-GWIMBIT>> )> )> > <0? ,P-SLOCBITS>> )> )> )> ) (T )> )> .TLEN>> ;)> ) ( >> > >> "?)" CR>)> ) ( >>> .LEN>> ) (T )> >> .TBL>>> )> > > ;> ) (> ) ( ,P-NC1) (T ,P-NC2)>> <>> ) (.VRB )> > > )>) ( .GCHECK> > > > > ) (T )>)> > > ) (<0? .LEN> ;)> )> > > ".)" CR>)> > > >> )) )> ) ( ) ( ) ( ) ( )>> > ) (T )>> > >> ;"ZIP case" > >> >)> ;"last object" )>> > >)> .LEN) (T ;"ZIL case" > ) (T >)>> > 0> )> > 0> )> > 1> >)> > .LEN)>> > > ) (<==? .TBL ,P-PRSO> >) (T >)> > > > )> ) ( )> > 1> )>>> (RMGL CNT) FIX (OBJ) OBJECT) > > 1>> ;)> > )> )> )>>)> > 4> 1>> ;)> >> 1>>> 5>> > > ) ( )>>)> .LEN> > )>)>)>> > ) (T ) ( ) (T )>)>> (TBL) TABLE (LVL) FIX) ; ) (T >)> > )> > > )> > > ,P-MOBY-FLAG >>> ;>> ,P-SRCALL) ( ,P-SRCALL) (T ,P-SRCTOP)>>)> >) (T )>>)>> ) (>> 2> 1>>>>> ) (>> 1>>>>> ) (> >> )> > > .OBJ> >> > >>> ) > >> > 0> )> >> > ) (T )>) (<==? .OBJ ,HER> > ) (T )>) (<==? .OBJ ,HIM> > ) (T )>) (<==? .OBJ ,THEM> > ) (T )>)> > ;>> ) ;(> >) ( <==? > T>> >) (T )> > > ) ( ) (T )> ) ( ;<==? ,WINNER ,PLAYER>> )> )>)>>) (T)>> ) TMP) ;#DECL ((LOSS) ) 1> ,SMANY>>> ) ( 1> ,SMANY>>> )> > ) (T )> > ) ( >) (T >)> )>) (T)>> )> > ) (ELSE >)> > ) (T )>) ( )>>> )> > ) (<==? .ITM > ) (T )>) (T )>>> > ) (T )>) ( )>>> ;> .ITM> ) ( )>>> > )) > )> > ) (T > > )>)> 0> )>)> .LIT> ;> ) (<0? > >) (T >)>> > )> > > )>> > > >