"PARSER for WORDPLAY (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." > > > > ;> ;"see p-ocl1 global defined" ;"pointers used by CLAUSE-COPY (source/destination beginning/end pointers)" ;"different CLAUSE-COPY: zip to ezip" ; ; ; >> >> >> > ;"number of bytes in input buffer" > ;"INBUF - Input buffer for READ" > ; "FIX #36" > <> <> <>>> > ;"Parse-cont variable" > > > > ;"PRSO is a direction" ;"is this necessary?" > ) ( ) ( ) (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 OLEN LEN (DIR <>) (NW 0) (LW 0) (CNT -1)) > ,P-ITBLLEN> ) (T >)> )>> ;> ;> ;> ;> > > > > ,VEHBIT>> >)> >)> ;"rfix no. 36" > > )> > >) (,P-CONT > > )> >) (T > ,VEHBIT>> >)> > > )> 4> ; ;"next 2 do this routine" -5>>)> ; ;"now gets called by the MAIN-LOOP, instead" "> >)> > ) ( ,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> ) ( ) (> >> ) ( > ,W?PERIOD ,W?COMMA ,W?THEN> > ,W?AND>> >> 2>>) (T )>) (T > 1>>)> 0> ) (T >)> ;> ) (T >)>>) (T > ;"fix #36" >>>> > >>> > ;> > 0> > ) (>> ) (> >> > ;"next clause added 8/20/84 by JW to enable TELL MY NAME TO BEAST" > ) ( > ) ;( > > )> > >) (T )>)> >> ) (> ,ACT?WALK ,ACT?GO> > >> > >>> ,W?THEN>)> > > )>) (> > 2>>>> >>) (> > >> >> )> ;"3/3/86 -- fix OPEN BACK DOOR given that back is also a prep for HAND BACK OBJ -pdl" > >>) (> >> )>) ( ) (T > > > > )>)>) ;( > ) () ( ;"Next expr added to fix FORD, TELL ME WHY" > ) (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>> ;"WT? checks 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 > > >)> )>)>> > .BIT> ) ( 1) (T > > >)> )>)>> > >> .NW) (ELSE >)>)>> ;" Scan through a noun clause, leave a pointer to its starting location" ) (FIRST?? T) NW (LW 0)) 2>> > > .VAL> .WRD> >) (T >)> > )> > >> > 0> >> )> > ) (>> > > ;"fix 'knock on back door', break compiler">>> 4>>) ;( > ) ( ) ( > > >)>) ( ;"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) ;( ,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 on from games with characters" ;( 0>>> >>) ( >) ( T) (T )>) (T )> > >>> > 2>> > 3>> ) (> 0> ) (T > > <- .CHR 48>>>) (>> )> >)>> ;"next COND handles inputs like 4,000" > ,W?COMMA> > >> > 2>>> 2>>>> > 2> .CCTR> ;"returning 0 would = false" )> .TMP>> > ) (T > >> > 2> 2>>> 3> 3>>>)>> > 2>>)>)> ;"this 10000 used to be 3000" )> ,W?NUMBER> > 2>> > 3>> > 0> ) (T > > ) ( > <- .CHR 48>>>) (T )> >)>> > ;"only handles 3 digits after the comma" ) ( ;"if it returned 0, the calling predicate becomes <>" ) (T )>> ) WRD) > 0>> ,PS?VERB ,P1?VERB> > > ) ( > > > )> >>> >>> ) ( ) ( 1> > > > > > >)> )>) (T > ;>)> >) (T )>) ( 1> > > > > > >)>)> > > ) (T )>) (,P-ACLAUSE > > > ) (T > > >)> > > ) ;"former CLAUSE-WIN" (T > )>) ( ,PS?ADJECTIVE> ;"same as WT?" >> ) ( ;"zip to ezip" ) ( ,PS?OBJECT> ) (T )> )> > > )>>)>)> > > > ; 0>> > > ,P-ITBLLEN> ) (T >)>> T> > ,P-ACLAUSE <+ ,P-ACLAUSE 1> .ADJ> 0>> > > > > 0>> > > > ;"zip for a- n- clause-win" ;)) >) (ELSE )> > ) (ELSE )> 0>> > > > ;"Print undefined word in input. PTR points to the unknown word in P-LEXV" ) (ELSE > >)>>> >> 2> 3>> > >> ) "AUX" BUF) ) (T )>) (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) >> )> >> > > ,P-SONUMS>> T) (> >> >>> ) ( > > ) ( > )>)> ) (T )>) (T >)>> >>> ) ( >>> ) ;( ) (T ) (T )> ) ( ,ACTORBIT>> ,ACTORBIT>>> ) (T )> ) (T )> > > )> ) (T )>> ) (T > )> )>> > ;"? ,P-OTBL?" ) ( ) (> >) (T > )>> > ; ;"new in lgop -- pdl hacks?" ;)> ;"not supported in amfv shell" > > > ) (T >)>> )> > )> ; ;"classic" ;"new in lgop -- pdl hacks?" )> ;> ;"classic" ;"new in lgop -- pdl hacks?" )> > ) (.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>) ;"zip above to ezip below" (> >>) (T .OBJ> >)> >> .NTBL> > > > > > ;> ;"classic" > > > > ;> ;"new in lgop -- pdl hacks?" ;> ;"not supported in amfv shell" ;"they had replaced p-oclause below" > ;"from good ole amfv" ) LEN WV WRD NW (WAS-ALL <>)) > )> ; ; > >> )> ) (T > ) (T >)> > )> >)>) ( ;"This clause at PARSER too" ) ( > > ) ( >)>) (T > > >)>) ( >> > > T) () () ( )>) ( >> ) ;"next clause classic in place of above" ;(> >> ;"RFIX NO. 40" ) ( )>)> > > )>>> > ) ;( ) ( ) ;( ) ( ) ;( ) ;( ) (T )>> > ;"grabs the first adjective, unless it comes across a special-cased adjective" ) ;( > ) ;( ) ;( ) (T )>> ) (OLEN 0) OBJ) > )> ,P-ADJ> ;"classic to ezip changes below" > ;>) ;(> )>)> ;"Added by JW 4-17-85" > > )> )> > > )> ) (T > ) ( ,VEHBIT> >> .TBL>)> )> .TLEN>> ;>>) ;( > >> "?]" CR> ) (ELSE )>) (> >>>> .LEN>> ) (T )> >> >>> )> > > ) (>> > > ) ( ,P-NC1) (T ,P-NC2)>> <>> ) (.VRB )> > > )>) ( .GCHECK> > ;"Changed 6/10/83 - MARC" ; ;"zip to ezip" > > ;> ;"ditto" ) (T )>)> > > ) ( )> > > >> > )>> ;"ZILCH should stick the # of the last object here" ;)> % ;>> ;"ZIP case" '> > >> >)> )>>>) (T ;"ZIL case" ' > ) (T >)>> >)> > 1> >)> > > > > > ;> ) ( >) (T >)> > > > )> > )> ) ( )> > 1> )>>> > > ; 1>> 2> 1>> >> ;"zip to ezip" )> )>>)> ;> > >>>>) ;(>>>>) (> ,PS?ADJECTIVE ,P1?ADJECTIVE>>>>) ( ; ;) (T >)> ; ;"removed by JO" ;>> ; 5>> >> > > ; )> > > )>>)> .LEN> ;> > )>)>> > ) (T ) ( ) (T )>)>> > > > )> > > >> ,P-MOBY-FLAG> ,P-SRCALL) ( ,P-SRCALL) (T ,P-SRCTOP)>>>)>)> >) (T )>>)>> > .OBJ> >> > >>> > >> > 0> ) (T >> > ) (T )>) ( > ) (T )>) ( > ) (T )>)> ; ,RAFT-HELD> ;"for LET GO OF RAFT" > T) (T ) ( ) (> >) ( > T>> >) (T )> > > ) ( )> ) (T )> ) ( > > )>)>)>>) (T)>> ) TMP) ,SMANY>>> ) ( ,SMANY>>> ) ( 1> ,SMANY>>> ) ( 1> ,SMANY>>> )> )> > ) ( >) (T >)> ) (T)>> ;"replaced by INTBL in ezip" ; )> > ) (ELSE >)> > ) ( )>>> ;> ) ( )>>> )) > ) (T > > )>)> 0> )>)> .LIT> > 0> ,W?IT>> ) (T <>>)>> > 0> ,W?IT>> ) (T <>>)>> ;"former CRUFTY.ZIL routine" ) (> <- 2> 1>>>> ) (>> 2>> ;"classic to ezip" ; 1>>>>> ) (> >> )> >