"PARSER for BALLYHOO (c) Copyright 1986 Infocom, Inc. All Rights Reserved" ;"Parser global variable convention: All parser globals will begin with 'P-'. Local variables are not restricted in any way." > > > > > > ;"pointers used by CLAUSE-COPY (source/destination beginning/end pointers)" > > > > > ;"INBUF - Input buffer for READ" > ; "FIX #36" > <> <> <>>> > ;"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." ) ;(DONT <>) OMERGED OWINNER OLEN LEN (DIR <>) (NW 0) (LW 0) (CNT -1)) > ,P-ITBLLEN> ) (T >)> )>> > > ;> > > > > > > > > ,VEHBIT>> >)> >)> ;"rfix no. 36" <==? ,PLAYER ,WINNER>> )> > >) (,P-CONT <==? ,PLAYER ,WINNER>> )> >) (T > ,VEHBIT>> >)> > )> "> >)> > ) ( ,W?OOPS> > ;"rfix 36" ,W?PERIOD ,W?COMMA> > >)> > ) ( )> >> ;"Fixes OOPS w/char" 6>> 7>> <+ <* ,P-LEXELEN> 3>> >;"Will this help?" > ) (T > )>) (T >)> ,W?AGAIN ,W?G> ;"added JO" > ) ;( ) ( ) (> >>
) ( > ,W?PERIOD ,W?COMMA ,W?THEN> > ,W?AND>> >> 2>>) (T )>) (T > 1>>)> 0> ) (T >)> ;> ) (T >)>>) (T > ;"rfix no. 36" >>>> > >>> > ;> > 0> > ) ;"NEXT two clauses added by JO via PROF" (>> ) (>> ) (> >> ;"next clause added 8/20/84 by JW to enable TELL MY NAME TO BEAST" > ,PS?VERB ,P1?VERB>> ) ( > ) ( > > )> > > ) (,QUOTE-FLAG >) (T )>)> >> ) (> ,ACT?WALK ,ACT?GO> > >> ,W?THEN ,W?PERIOD ,W?QUOTE> >> > >>> ,W?THEN>)> > > )>) (> > 2>>>> >>) (> > >> > ,W?OF> <0? .VAL> > >> )>) (> > ,W?THEN ,W?PERIOD>>> )>) ( ) (T > ;"This COND added 8/7/84 for IN FRONT OF" > ,W?FRONT>> ) (> ,W?FRONT ,W?HEAD> > ,W?FRONT ,W?HEAD> > ,W?FRONT ,W?HEAD>> ) ( > ,W?IN> > ,W?FRONT>> )> > > > )>)>) ;( > ) () ( ;"Next expr added to fix FORD, TELL ME WHY" ;"NOT taken out of said expr to fix fix" > ) (T )>) (T )> >>)> > > ; )> > > >> ) (,P-OFLAG )> > T)>> ; > ) "AUX" X Y Z) >>> > >> >> >> )> > ;> > > > ;"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 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 >>)> > ;"DR added JO" ) ( ) ( > >)>) ( ;"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> >) ( >> T) ( > >>) ( > >> 2>>> ) (T >)>) ;"next clause replaced by following on from games with characters" ;( 0>>> >>) ( >) ( T) (T )>) (T )> > >>> ;)) > 2>> > 3>> > 0> ) (T > ) ( ) ( > <- .CHR 48>>>) (T )> >)>> ;"this 3000 used to be 1000" ) (.TIM >) ( )> >>)> ,W?INTNUM> ) (DOLLAR <>) (EXC <>) CCTR TMP NW) > 2>> > 3>> > 0> ) (T > )> ) ( ) ( > <- .CHR 48>>>) (> ) (T )> >)>> >> > >>> )> .TMP>> > ) (T > >>> 2> > 2> 2>>> 3> > 2> 3>>>)>> > 2>>)>) (.DOLLAR >) ( >) ( )> ) (.EXC ) (.TIM ) ;( T) ;( ) ;( T) ;(T >)> >>) (T )> > ; ,W?MONEY) (T ; ,W?NUMBER)>> > 2>> > 3>> > 0> ) (T > > ) ( > <- .CHR 48>>>) (T )> >)>> ) ( >) (T )>> > > ) WRD) > 0>> ,PS?VERB ,P1?VERB> > > ) ( > > > )> >>> >>> ) (<==? ,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> > > > 0>> > > > > 0>> > > > ;"Print undefined word in input. PTR points to the unknown word in P-LEXV" ) (ELSE > >)>>> >> 2> 3>> > >> >> 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
)> ;> ; ) (<0? > >) (T > )> )> ) (T )>> ) (T > )> )>> > ;"? ,P-OTBL?" ) (<0? > >) (T > )>> > )> > > > ) (T >)>> )> > )> > ) (.D2 > )>> .THE?>> ) 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> > > > >> )> > ) (T )>)> .OBJ)>) (T )>> > 0>> > ,P-PRSO> > > >>)> > 0>> > ,P-PRSI> > >> 1> >) (T >)>)>)> > > ) (> ,P-BUTS>) (T .OBJ> >)> >> .NTBL> > > > > > > > > > > > ;> ;> ) LEN WV WRD NW (WAS-ALL <>)) > )> ; ; > >> )> ) (T > >)>) ( ;"This clause at PARSER too" ) ( ) ( > > ) ( >)>) (T > > >)>) ( >> > > T) () () (<==? .WRD ,W?OF> )>) (> >> ;"RFIX NO. 40" ) ( )>)> > > )>>> ) ( ;"stopped in clean-talk?" > ) (T )> ) ;( > ; ; ; ; ;) ;( >> ) (T )> ) ;( > ) ;( ) (T )> ) (T )>> > ; > > ) ( ) (T )> ) ( CR>) ( > > ) (T )>) ( > ) (T CR>)>) (T )>> > ) (T )>> > ) (T )>> ; ) ( ) (T )>> ;"this ADJ-CHECK will grab the first adjective rather than the last, unless it comes across INNER or OUTER" ) ;( )>> ) (OLEN 0) OBJ) > )> ,P-ADJ> >) (> )>)> ;"Added by JW 4-17-85" > <0? ,P-GWIMBIT>> > ;"added JO" )> )> > <0? ,P-SLOCBITS>> )> ) (T )> )> .TLEN>> ;>>) ( >> ;"WAS semied JO - 8/31/85" > >> > )> ) ( >>> .LEN>> ) (T )> >> >>> )> > > ) (>> > > ) ( ,P-NC1) (T ,P-NC2)>> <>> ) (.VRB ;"added JO" ;> )> > > )>)> .GCHECK> > ;"Changed 6/10/83 - MARC" > > > ) (T )>)> > > ) (<0? .LEN> )> > > >> ;"ZILCH should stick the # of the last object here" ;)> % ;>> ;"ZIP case" '> > >> >)> )>>>) (T ;"ZIL case" ' > ) (T >)>> >)> > 1> >)> > ; > ) (T >)>> > 1> >)> > > > .LEN> > > > > > ) ( >) (T >)> > > > )> > )> ) ( )> > 1> )>>> > > 1>> >> )> )>>)> > 4> 1>> >> 1>>> 5>> > > ) ( )>>)> .LEN> ;> > )>)>> > ) (T ) ( ) (T )>)>> > > > )> > > >> ,P-MOBY-FLAG> ,P-SRCALL) ( ,P-SRCALL) (T ,P-SRCTOP)>>>)>)> >) (T )>>)>> > .OBJ> >> > >>> ;"the original for circus - with money added below to return true" > >> > 0> ) (T >> > ) (T )>)> ;"added JO" >> T) (T ) (> >) ( > T>> >) (T )> > > ) ( > ) (T "that">)> )> ) (T
)>
) ( <==? ,WINNER ,PROTAGONIST>>
)>)>)>>) (T)>> ;"From JW Western - with money stuff -- ABORTED" ;> >> > 0> ) (T >> > ) (T )>) ;(<==? .OBJ ,HIM-HER> )> > ) (> >) ( <==? > T>> >) (T )> > ,P-DOLLAR-FLAG> >> ) (T ) (T
)>)> ) ( <==? ,WINNER ,PROTAGONIST>> 0> 1>> ) (T )> )>)>)>>) (T)>> ) TMP) 1> ,SMANY>>> ) ( 1> ,SMANY>>> )> )> > ) ( >) (T >)> ) (T)>> )> > ) (ELSE >)> > ) ( )>>> > ) ( )>>> )) > ) (T > > )>)> 0> )>)> .LIT> > 0> ,W?IT>> ) (T <>>)>> > 0> ,W?IT>> ) (T <>>)>> ;"former CRUFTY.ZIL routine" ) (> <- 2> 1>>>> ) (>> 1>>>>> ) (> >> )> >