"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" > > > > > "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" ,PLUS-MODE> 6) (T 4)>> "Offset to first part of speech" ,PLUS-MODE> 7) (T 5)>> "First part of speech bit mask in PSOFF byte" > > > > "" > > > " >" >>> > > >)> ; > > > > > )> ,IT> )>> )> ,IT> )>>)> )> .OCNT) ( >) (T >)> .OCNT) ( > > .ICNT) (T 1)>> <1? .ICNT>> >)> >) (<0? .NUM> ,P-SONUMS>> > >) ( > > ) (T > > > ) ( >) (T >>)> >)>) ;( > >) (T ;"> )>" > )> > )> > ) (T )> ) ( )> ) (T >) (T >)> 0> ,W?ALL>> > ) ( >> ) (> ) (<==? .OBJ1 ,PLAYER> ) ;( ) (T ) (T )> )>)> >> > > > )>)>>)> ; T) ( T) (,P-OFLAG T) (T )> >)>) (T >)> >> >)>)> > > >> > ) ( ;> ) (T )>) ( ) (> ) (T )>) ( > >> )> > > ) (T )>) ( )> ) ( > ) (T )>) (> > ) (T )>) (T )>> )) )> ) ( ) ( ) ( ) ( ) ( ) ( ) ( )>> ) (N 0)) <==? .PRSO ,PLAYER>>> ;"? more?" > ) ( > >> > )> >> > )> <==? ,WINNER ,PLAYER>> ;"? more?" ; )>)>> > > <==? ,HERE ,QCONTEXT-ROOM> <==? ,HERE >> )>> >> ,NOT-HERE-OBJECT ,PLAYER> ) ( ) ( <==? .OBJ ,PRSO>> )> > ;"to cause pronoun 'it' in output" ) ( ) ( ) (T )> > ) ( ) ( ) ( )>> > > ) (<0? > >) (T > )> ;> > ) ( ) ( )> ) (T )>)>> > > )> > >>> ) (T )>)> >) (T )> > )> )>> > ) (I <>) "AUX" V OA OO OI) % ') (T ' 1>>>)> ) (T )>)> )> )> > ) (> >> ) (T )> )> > )> )> )>) (T ) (T )> )>)> > )> )> )>) (T ) (T )> )>)> > )> )> )>) (T ) (T )> )>)> ;)>)> ;)>)>)> > > ,TRAIN-MOVING >> > >>> )> > > > > )>)> > ;"extra output for next (...)" )> ,M-WINNER>>)> ,P?ACTION> ,M-BEG>>)> >>)> .I > > ,P?CONTFCN>> >)>)> .I> >>)> > .O > > ,P?CONTFCN>> >)>)> .O >> >>)> >>)> ; ; > >> ,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 )> )>> > )>> > > > > )>> > ) (OF-FLAG <>) LEN (DIR <>) (NW 0) (LW 0) (CNT -1) OMERGED OWINNER TMP) > ,P-ITBLLEN> ) (T >)> )>> > > > > > ;> > ; ,VEHBIT>> ; >)> >)> <==? ,PLAYER ,WINNER>> )> > >) (> > > ; <==? ,PLAYER ,WINNER>> )> ;> )>) (T ; > ,VEHBIT>> ; >)> > ;"to prevent pronouns w/o referents" > ; )> > ) ( ) (T )> )> % ,PLUS-MODE> ' ">>) (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." >)> ) ( ,W?OOPS> > ) (> >> ;"Fixes OOPS w/chars" 6>> > <+ <* .VAL ,P-LEXELEN> 3>> >;"Will this help?" > ) (T > )>) (T >)> ,W?AGAIN ,W?G> ) ( > ,W?PERIOD ,W?COMMA ,W?THEN> > ,W?AND>> >> 2>>) (T )>) (T > 1>>)> 0> ) (T >)> ;> ) (T >)>>) (T > > > ;"3/25/83: Next statement added." > 0> > ) (>> ) (> ;>> > ; ) ( > )> > ) ( >) (T )>)> >> ) (> ,ACT?WALK ,ACT?HEAD> > >> ,W?THEN ,W?PERIOD ,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 )> >>)> > ) (T )> > )> > > )> 0> )> > T)>> > "For AGAIN purposes, put contents of one LEXV table into another:" > > > 2>> > 3>> > > )>>> "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." > .BIT> ) (T > > >)> )>)>> > "Scan through a noun phrase, leaving a pointer to its starting location:" ) (FIRST?? T) NW (LW 0)) 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 >)>) ;"Next clause replaced by following one to allow ATTRACTIVE MAN, VERB - JW 2/15/85" ;( 0>>> >>) ( >) ( 0>> > ,W?THEN> >) ( T) (T )>) (T )> > >>> > > >>> ) (DOLLAR <>) CCTR TMP NW PTT) >> > > ;> > 0> ) (T > > ) ( ) ( ) (> >> ) (T <- .CHR %>>>)> >)>> >> > >>> )> ; .TMP>> > > ;"two tokens" > ) (T > > 2> 2>>> 3> 3>>>)>> > 2>>) (T >)>)> ) (.TIM )> >>)> ; > ,W?MONEY) (T > ,W?NUMBER)>> >> > > > 0> ) (T > ) (> >> ) (T <- .CHR %>>>)> >)>> ) ( >) (T )>> > > > ) WRD) > 0>> ,PS?ADJECTIVE> ) ( > > > )> >>> >>> ) (<==? ,P-NCN 2> ) (<==? 1> > > <0? .TEMP>> > > ;"? DELETE?" >)> ;"? DELETE?" )> ;>) (T > ;>)> >) (T )>) (<==? 1> > > <0? .TEMP>> > > ;"? DELETE?" >)> ;>)> > > ) (T )>) (,P-ACLAUSE > > > ) (T > > >)> > > ) (T > )>) ( ,PS?ADJECTIVE> ;"same as WT?" >> ) (<==? .WRD ,W?ONE> ) ( ,PS?OBJECT> ) (T )> )> > > )>>)>)> > > > ; 0>> > > ,P-ITBLLEN> ) (T >)>> T> > > % ,PLUS-MODE> ') (T ' >)> 0>> > > > ,PLUS-MODE> '>) (T ' > >)> 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 ) (T )> ) ( ,PERSONBIT>> ,PERSONBIT>>> ) (T )> ) (T )> )> > ) (T )>> ) (T > )> )>> > > ;"? ,P-OTBL?" ) (<0? > >) (T > )>> >) )> > > > ) (T >)>> % ,PLUS-MODE> ') (T ' >)>)> > % ,PLUS-MODE> ') (T ' >)>)> > ) (.D2 > )>> .THE?>> ) WRD (FIRST?? T) (PN <>)) ) (T >) (T )> > >> >> >>> )> ) ( > > >> ) ( ) ( ) (T .CP> )> ) ( > ) ( ;"VISIBLE check above" ;> ) ( ;> ) ( ;> ) (T >)> >)>)> >>> >> >) (T > 32>> 1> <+ 1>>)>> > > )> > ) ;(<==? .WRD ,W?THROUGH> ) (T )> 0>,W?SIT ,W?LIE> <==? ,W?DOWN .WRD>> )> 0>> <==? ,W?OUT .WRD>> )> )>> % ,PLUS-MODE> ') "AUX" BEG END) > > ,P-LEXELEN> 2>>> ,P-LEXELEN>>>> ) (T >> )> >)> >>> )(T "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> > > > > % ,PLUS-MODE>) (T '(> >))> > > > > > "> >" > ) LEN WV WRD NW (WAS-ALL <>) ONEOBJ) ;"Next SETG 6/21/84 for WHICH retrofix" > )> ;" " > >> )> ) (T > >)>) ( > > ) ( ) ( >)>) (T > > >)>) ( >> ;"Next SETG 6/21/84 for WHICH retrofix" > > T) () () (<==? .WRD ,W?OF> )>) % ,PLUS-MODE> '( > )) (T '(> > ))> ( )>)> > > )>>> ) (OLEN 0) OBJ ADJ) ;#DECL ((TBL) TABLE (XBITS BTS TLEN LEN) FIX (GWIM) (VRB GCHECK) ) > ;)> )> ,PLUS-MODE> ',P-ADJ) (T ',P-ADJN)>> ,P-ADJ> ,PLUS-MODE> ',P-ADJ) (T ',P-ADJN)> ,PS?OBJECT> ,PLUS-MODE> ',P-ADJ) (T ',P-ADJN)>> >) ( ,PLUS-MODE> ',P-ADJ) (T ',P-ADJN)> ,PS?DIRECTION ,P1?DIRECTION>> > )>)> > <0? ,P-GWIMBIT>> )> )> > <0? ,P-SLOCBITS>> )> ; )> )> ) (T )> )> .TLEN>> ;)> ) ( >> > >> "?)" CR>)> ) ( >>> .LEN>> ) (T )> >> .TBL>>> )> > % ,PLUS-MODE> '>) (T '> >>)> ) (>> ) ( ,P-NC1) (T ,P-NC2)>> <>> ) (.VRB )> > > )>) ( .GCHECK> > > % ,PLUS-MODE> ' >>) (T ' > >>)> ) (T )>)> > > ) (<0? .LEN> ;)> )> > > ".)" CR>)> > > >> )) )> ) ( ) ( ) ( ) ( )>> > ) (T )>> > >> ;"ZIP case" > >> >)> )>> > >)> .LEN) (T ;"ZIL case" ; ; > ) (T >)>> > 0> )> > 0> ;)> > 1> >)> ;> > > .LEN)>> > ) (<==? .TBL ,P-PRSO> >) (T >)> > > > )> ) ( )> > 1> )>>> (RMGL CNT) FIX (OBJ) OBJECT) > > > ;)> > )> )> )>>)> ;> 4> 1>> ;)> >> 1>>> 5>> > > ) ( )>>)> .LEN> ; > )>)>)>> ) "AUX" BTS) > ) (T ) ( ) (T )>)>> ;> ) (T ) ( ) (T )>)>> )) ;#DECL ((OBJ NOBJ) (TBL) TABLE (LVL) FIX) ; ) (T >)> > )> > > )> > > > ; .MOBY-FLAG >>> ;>> ,P-SRCALL) ( ,P-SRCALL) (T ,P-SRCTOP)> .MOBY-FLAG>)> >) (T )>>)>> ) (>> 2> 1>>>>> ) (>> ,PLUS-MODE> '>) (T '>)>>>> ) (> >> )> > > .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 )>) ( )>>> > )) > )> > ) (T ; > > )>)> 0> )>)> .LIT> ;> ) (<0? > >) (T >)>> > )> > ) (T )> > > > ;>