title k20par - Kermit-20 Parsing and Semantic Action Routines ; All parsing was removed from k20mit and moved to this module as part ; of Edit 194 to address the issue of a very large single source file ; that unexpectedly began generating MCRNEC errors. Most user level ; parsing happens here accept what has been moved into other modules, ; viz: ; ; k20mac - Kermit macro support, extensive rewrite to catch bugs ; and enhancements. ; ; k20ioc - Kermit INPUT/OUTPUT/TRANSMIT support, extensive rewrite ; to better support a batch job, fixes bugs, efficiency. ; Also has parity parsing, (table driven) generation and ; checking. ; ; k20srv - Kermit LOCAL/REMOTE/SERVER support. ; ; Also has many semantic action routines to keep k20sub from swelling. ; Most semantic action routines are a handful of lines to simply set ; the variables that were confirmed by the user during parsing. Others ; are longer, it not always being clear cut where something should go, ; k20net or k20sub or ... ; ; As a general rule, the majority of the code to handle the protocol ; itself remains in K20MIT. ; ; During this time, some code was rewritten to decrease symbol table ; usage, to (hopefully) clean up control flow and provide for ; additional checking and better recovery. Speed ups were not avoided ; where possible, typically space being traded for time. However, ; this was not done at the expense of clarity, maintainability being ; of paramount concern. At least it's supposed to be more clear... subttl Preliminaries search monsym,macsym,cmd,k20unv ;[194] cmdacs ; Clean up p1-p4 definitions cmdunv ;[248] ; CMDSTG externals and definitions sall ; Tidy listing .directive flblst ; We don't need to see all the ASCIZ bytes... remark common parsing external data extern pars1 ; Data from first parse. extern pars2 ; Data from second parse. extern pars3 ; Data from third parse. extern pars4 ; Data from fourth parse. extern pars5 ;[41] ... extern pars6 ;[218] extern pars7 ;[236] extern pars8 ;[245] If debugging MOVSTU extern pars9 ;[247] If debugging IACIAC extern parsx ;[203] For zeroing the above between parses extern setcsb ; Set up command state block extern buffer ; Used for foreign file names extern vtermf ; Set if remote line is a virtual terminal remark Linkages to commands parsed and executed in k20srv extern .bye, $bye ;[220] Cause remote to Logout/Logoff extern .finis, $finis ;[220] Force remote to exit server mode extern .ycdup,$ycdup ;[254] LOCAL Change to Upper (Superior) Directory extern .ycwd,$ycwd ;[220] LOCAL Change Working Directory (I.E., Connect) extern .ydele,$ydele ;[220] LOCAL file delete (remove files) extern .ydire,$ydire ;[220] LOCAL directory (list files) extern .ydisk,$ydisk ;[220] LOCAL Space command (show used and quota) extern .ypwd,$ypwd ;[220] LOCAL Print Working Directory (see CWD) extern .yrun,$yrun ;[220] LOCAL Run a program (in a subfork) extern .stat,$stat ;[220] Parsing is in k20srv, semantic is in k20dsp extern .ytype,$ytype ;[220] LOCAL type file remark tables we fill or use for parsing extern jobtab ; Our job information extern filjfn ; A file JFN extern rufork ; run fork handle extern takjfn ; Current JFN in take file extern takep ; Take file stack pointer extern iniflg ; If we're doing an INI file remark Some JFN handling extern clsjfn ;[194] In k20net extern tlgjfn ;[264] Transaction log JFN in k20mit extern sesjfn ;[264] Session log JFN in k20mit extern sesflg ;[264] Active session logging in k20mit extern qlog ;[264] Quiet session logging in k20mit extern rlog ;[264] Resume session loggin in k20mit remark support routines and hard data extern putc ;[217] Print a control character extern isnulj ; Is this JFN pointing to NUL:? extern movstu ; Move string, chewing leading whitespace extern parity ;[223] Holds a parity ROUTINE address extern crlf ; Carriage return line feed extern crlflf ; Carriage return line feed line feed extern ifcrlf ; Maybe type a carriage return line feed extern nul4 ; Pointer to NUL: constant and length extern %%jser ; JSYS error handler extern %wtlog ; Logging support extern %%smsg ;[216] smsg support extern errptr ; Error pointer extern capas ;[217] Enabled capabilities .psect code/ronly ;[190] Don't allow stores subttl Top-Level commands available to remote KERMIT ;N.B., When parsing for .cmtxt and .cmcfm, .cmcfm must come first!!!! %table(cmdtab,G) ;[194] Declare for main parser %keyf4 , .bye, $bye, cm%inv ;[11] %keyf3 , %conn, %key3 , .captu##, $captu## ;[268] in k20ioc %keyf4 , .ycwd, $ycwd, cm%inv ;[145] ;[194] %key3 , .ycdup, $ycdup ;[254] %keyf4 , .clear, $clear, cm%inv ;[209] %key3 , .clear, $clear ;[162] ;[194] %key3 , .close, $close ;[194] %keyf4 , .clear, $clear, cm%inv ;[209] %keyf4 , .clear, $clear, cm%inv ;[209] %conn: %key3 , .conne, $conne## ;[186] ;[194] %key3 , .ycwd, $ycwd ;[145] ;[194] %key3 , .defin##, $defin## ;[77] ;[194] ;[203] %key3 , .ydele, $ydele ;[145] ;[194] %key3 , .ydire, $ydire ;[145] ;[194] %keyf3 , %exit, %key3 , .echo, $echo ;[194] %exit: %key3 , .exit, $exit %keyf4 , .finis, $finis, cm%inv ;[28] ;[194] %keyf4 , .get, $get##, cm%inv ;[11] ;[194] %key3 , .help, $help ;[194] %keyf4 , .input##, $input##, cm%inv ;[159] ;[194] %key3 , .local, $local ;[56] ;[194] %key3 , .log, $log ;[125] ;[194] %keyf4 , .outpu##, $outpu##, cm%inv ;[159] ;[194] %keyf4 , .pause, $pause, cm%inv ;[159] ;[194] %keyf4 , .promp, $promp, cm%inv ;[194] %keyf3 , %push, %push: %key3 , .push, $push## ;[152] ;[194] %keyf4 , .send, $send## ,cm%inv ; Sleepy Tom keeps typing this... %key3 , .ypwd, $ypwd ;[188] ;[194] %key3 , .exit, $exit %keyf3 , %recv, ;[56] %recv: %key3 , .recv, $recv## ;[194] %keyf4 , .remot, $remot, cm%inv ;[56] ;[194] %key3 , .retur, $retur ;[237] %key3 , .yrun, $yrun ;[145] ;[194] %keyf3 , %send, %send: %key3 , .send, $send## ;[194] %key3 , .serve, $serve ;[194] %key3 , .set, $set %key3 , .show, $show ;[194] %key3 , .ydisk, $ydisk ;[145] ;[194] %key3 , .stat, $stat ;[194] %key3 , .take, $take ;[78] ;[194] %keyf4