DataMuseum.dkPresents historical artifacts from the history of: CR80 Hard and Floppy Disks |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CR80 Hard and Floppy Disks Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 20254 (0x4f1e) Types: TextFile Names: »PARSER.P«
└─⟦b8af24a88⟧ Bits:30005796 CR80 Disc Pack ( MINICAMPS ) └─ ⟦this⟧ »GENS.D!D_PARSE.D!PARSER.P«
======== COMPILATION STARTED AT: 81:09:01 12:53 ======== PARSER.S 00.00001 "----------------------------------------------------------------------- 00.00002 " 00.00003 " 00.00004 " MODULE NAME: BOTTOM UP PARSER 00.00005 " MODULE ID NMB: CSS/210 00.00006 " MODULE VERSION: 1 00.00007 " MODULE TYPE: LINK (SUB)MODULE 00.00008 " MERGE FILES: @**GENS.D*PARSE.D*CHARCLASSTABLE.I 00.00009 " 00.00010 " SPECIFICATIONS: - 00.00011 " AUTHOR/DATE: LKN/810102 00.00012 " 00.00013 " DELIVERABLE: YES 00.00014 " SOURCE LANGUAGE: SWELL 00.00015 " COMPILE COMPUTER: CR80 00.00016 " TARGET COMPUTER: CR80 00.00017 " OPER. SYSTEM: AMOS 00.00018 " 00.00019 "----------------------------------------------------------------------- 00.00020 " 00.00021 " CHANGE RECORD 00.00022 " 00.00023 " VERSION AUTHOR/DATE DESCRIPTION OF CHANGE 00.00024 " ------- ----------- --------------------- 00.00025 " 00.00026 "----------------------------------------------------------------------- 00.00027 "PAGE«ff»00.00028 00.00028 SUBMODULE BOTTOM_UP_PARSER; 00.00029 00.00030 00.00031 "**********************************************************************" 00.00032 " " 00.00033 " THIS MODULE IS A GENERAL TOOL FOR TABLE DRIVEN BOTTOM UP PARSING. " 00.00034 " " 00.00035 " THE TABLES MAY BE GENERATED BY AN AUTOMATIC PARSE TABLE GENERATOR, " 00.00036 " USING SLR1 OR OTHER TECHNIQUES, REQUIRING A SINGLE LOOKAHEAD SYM- " 00.00037 " BOL, AND USING THE ACTIONS: REDUCE, SHIFT/STACK, FAULT AND JUMP. " 00.00038 " " 00.00039 "**********************************************************************" 00.00040 00.00041 00.00042 %SOURCE ======== CHARCLASSTABLE.I ======== PARSER.S 00.00042 00.00043 00.00044 CONST 00.00045 MAXSYMBOLLENGTH = 132; 00.00046 SP = 32; 00.00047 00.00048 00.00049 TYPE 00.00050 PARSE_ERRORS = 00.00051 ( UNKNOWN_SYMBOL, 00.00052 CONST_OVERFLOW, 00.00053 UNEXPECTED_SYMBOL, 00.00054 STRING_SYNTAX, 00.00055 STRING_SIZE, 00.00056 PARSESTACKFULL, 00.00057 UNRECOVERABLE ); 00.00058 SYMBOLTYPE = 00.00059 ( EMPTY, 00.00060 NAME, 00.00061 CONSTANT, 00.00062 STRING, 00.00063 ERRORSYM ); 00.00064 ACTIONTYPE = 00.00065 ( REDUCE, 00.00066 SHIFT, 00.00067 FAULT, 00.00068 JUMP ); 00.00069 STRINGSTATES = 00.00070 ( INSTRING, 00.00071 AFTERLEFTPAR, 00.00072 INCHARVALUE, 00.00073 BEFORERIGHTPAR ); 00.00074 00.00075 TABLEHEAD = 00.00076 RECORD 00.00077 SAVEREGS: ARRAY [0..6] OF INTEGER; 00.00078 TABLELINK, ITEMSIZE, STACKLIMIT, RECOVERING, WINDOW1, WINDOW2, 00.00079 PRODUCTIONS, ACTIONS, SCANENTRIES, RECOVERSYMBOLS: INTEGER; 00.00080 END; 00.00081 STACKENTRY = 00.00082 RECORD 00.00083 ACTION: INTEGER; 00.00084 END; 00.00085 SCANENTRY = 00.00086 RECORD 00.00087 CH, SYMBOL, ALTERNATIVE, NEXT: INTEGER; 00.00088 END; 00.00089 ACTIONENTRY = 00.00090 RECORD 00.00091 SYMBACTION, OBJECT: INTEGER; 00.00092 END; 00.00093 PRODUCTIONENTRY = 00.00094 RECORD 00.00095 SYMBLENGTH: INTEGER; 00.00096 END; 00.00097 00.00098 00.00099 VAR 00.00100 TABLEPTR, "POINTER TO PARSE TABLE HEADER (TABLEHEAD) 00.00101 CURRCHAR, "LAST SCANNED CHARACTER 00.00102 CURRCLASS: "CLASS OF LAST SCANNED CHARACTER 00.00103 INTEGER; 00.00104 00.00105 EXPORT VAR 00.00106 SYMBOLBUF: ARRAY [0..MAXSYMBOLLENGTH+6] OF CHAR; 00.00107 00.00108 INIT 00.00109 CURRCLASS = IGNORE; 00.00110 00.00111 00.00112 00.00113 IMPORT PROCEDURE IN_BYTE 00.00114 "=====================" 00.00115 (R3; "CHARACTER VALUE (RETURN) 00.00116 R6); "LINK 00.00117 00.00118 00.00119 00.00120 PROCEDURE GETCHAR 00.00121 "===============" 00.00122 (R0; "CHARACTER VALUE (RETURN) 00.00123 R7; "CHARACTER CLASS (RETURN) 00.00124 R6); "LINK 00.00125 VAR 00.00126 SAVER3, SAVER4, SAVER6: INTEGER; 00.00127 BEGIN 00.00128 R3=>SAVER3; 00.00129 R4=>SAVER4; 00.00130 R6=>SAVER6; 00.00131 REPEAT 00.00132 IN_BYTE(R3, R6); 00.00133 R3 EXTRACT 7; 00.00134 CHARCLASSTABLE[R3=>R7]=>R0=>R7; 00.00135 UNTIL R7 <> SKIP; 00.00136 R7=>CURRCLASS; 00.00137 R3=>R0=>CURRCHAR; 00.00138 SAVER3=>R3; 00.00139 SAVER4=>R4; 00.00140 EXIT(SAVER6); 00.00141 END; 00.00142 00.00143 00.00144 00.00145 PROCEDURE SEMANTICS 00.00146 "=================" 00.00147 (R1; "SEMANTIC ACTION NO 00.00148 R2; "ATTRIBUTE 00.00149 R5; "PARSE STACK POINTER 00.00150 R6); "LINK 00.00151 "R4 IS DESTROYED AT RETURN 00.00152 BEGIN 00.00153 TABLEPTR=>R4; 00.00154 EXIT(R4@TABLEHEAD.SAVEREGS[4]); 00.00155 END; 00.00156 00.00157 00.00158 00.00159 PROCEDURE NEXTSYMBOL 00.00160 "==================" 00.00161 (R1; "SYMBOL NUMBER (RETURN) 00.00162 R2; "ATTRIBUTE (RETURN) 00.00163 R6); "LINK 00.00164 LABEL NEWSYMBOL; 00.00165 VAR 00.00166 ATTRIBUTE: LONG; 00.00167 SAVER0, SAVER3, SAVER4, SAVER5, SAVER6, SAVER7: INTEGER; 00.00168 STRINGSTATE, STRINGPOS: INTEGER; 00.00169 BEGIN 00.00170 R0=>SAVER0; 00.00171 R3=>SAVER3; 00.00172 R4=>SAVER4; 00.00173 R5=>SAVER5; 00.00174 R6=>SAVER6; 00.00175 R7=>SAVER7; 00.00176 CURRCHAR=>R0; 00.00177 CURRCLASS=>R7; 00.00178 NEWSYMBOL: 00.00179 WHILE R7 = IGNORE DO GETCHAR(R0, R7, R6); 00.00180 00.00181 CASE R7:CHARCLASS OF 00.00182 00.00183 ALFA: 00.00184 BEGIN 00.00185 TABLEPTR=>R4; 00.00186 R4+R4@TABLEHEAD.SCANENTRIES+SIZE(SCANENTRY); 00.00187 IF R0 >= 'a' LOGAND R0 < ('z'+1) THEN 00.00188 R0 - ('a' - 'A'); 00.00189 WHILE R4@SCANENTRY.CH <> R0 LOGAND R4@SCANENTRY.CH <> 0 DO 00.00190 R4+R4@SCANENTRY.ALTERNATIVE; 00.00191 R0=>SYMBOLBUF[0=>R5]; 00.00192 GETCHAR(R0, R7, R6); 00.00193 WHILE R7 < DELIMITER DO 00.00194 BEGIN 00.00195 R4+R4@SCANENTRY.NEXT; 00.00196 IF R0 >= 'a' LOGAND R0 < ('z'+1) THEN 00.00197 R0 - ('a' - 'A'); 00.00198 IF R5 < MAXSYMBOLLENGTH THEN R0=>SYMBOLBUF[R5+1]; 00.00199 WHILE R4@SCANENTRY.CH <> R0 LOGAND R4@SCANENTRY.CH <> 0 DO 00.00200 R4+R4@SCANENTRY.ALTERNATIVE; 00.00201 GETCHAR(R0, R7, R6); 00.00202 END; 00.00203 R4@SCANENTRY.SYMBOL=>R1; 00.00204 IF R1 = 0 LOGOR R1 = ERRORSYM THEN 00.00205 BEGIN 00.00206 NAME=>R1; 00.00207 0=>R2; 00.00208 R2=>SYMBOLBUF[R5+1]; 00.00209 R2=>SYMBOLBUF[R5+1]; 00.00210 END; 00.00211 END; 00.00212 00.00213 NUMERIC: 00.00214 BEGIN 00.00215 ADDRESS(ATTRIBUTE)=>R5; 00.00216 0=>R5@INTEGER; 00.00217 10=>R1; 00.00218 REPEAT 00.00219 IF R5@INTEGER >= 6554 LOGOR 00.00220 R5@INTEGER >= 6553 LOGAND R0 >= '6' 00.00221 THEN SEMANTICS(ERRORSYM=>R1, CONST_OVERFLOW=>R2, R5, R6) ELSE 00.00222 BEGIN 00.00223 R5@LONG*R1; 00.00224 R5@INTEGER+(R0-'0'); 00.00225 END; 00.00226 GETCHAR(R0, R7, R6); 00.00227 UNTIL R7 <> NUMERIC; 00.00228 CONSTANT=>R1; 00.00229 R5@INTEGER=>R2; 00.00230 END; 00.00231 00.00232 DELIMITER: 00.00233 BEGIN 00.00234 TABLEPTR=>R4; 00.00235 R4+R4@TABLEHEAD.SCANENTRIES+SIZE(SCANENTRY); 00.00236 WHILE R4@SCANENTRY.CH <> R0 LOGAND R4@SCANENTRY.CH <> 0 DO 00.00237 R4+R4@SCANENTRY.ALTERNATIVE; 00.00238 R4=>R5; 00.00239 IF R4@SCANENTRY.NEXT=>R6 < 0 THEN IGNORE=>R7=>CURRCLASS ELSE 00.00240 GETCHAR(R0, R7, R6); 00.00241 WHILE R7 = DELIMITER LOGAND R4@SCANENTRY.CH <> 0 DO 00.00242 BEGIN 00.00243 R4=>R5; 00.00244 R4+R4@SCANENTRY.NEXT; 00.00245 WHILE R4@SCANENTRY.CH <> R0 LOGAND R4@SCANENTRY.CH <> 0 DO 00.00246 R4+R4@SCANENTRY.ALTERNATIVE; 00.00247 IF R4@SCANENTRY.CH <> 0 THEN 00.00248 BEGIN 00.00249 R4=>R5; 00.00250 IF R4@SCANENTRY.NEXT=>R6 < 0 THEN IGNORE=>R7=>CURRCLASS ELSE 00.00251 GETCHAR(R0, R7, R6); 00.00252 END; 00.00253 END; 00.00254 R5@SCANENTRY.SYMBOL=>R1; 00.00255 IF R1 = 0 THEN 00.00256 BEGIN 00.00257 ERRORSYM=>R1; 00.00258 SEMANTICS(R1, UNKNOWN_SYMBOL=>R2, R5, R6); 00.00259 END; 00.00260 END; 00.00261 00.00262 COMMENTCHAR: 00.00263 BEGIN 00.00264 REPEAT 00.00265 GETCHAR(R0, R7, R6); 00.00266 UNTIL R7 = COMMENTCHAR LOGOR R0 < SP; 00.00267 IGNORE=>R7; 00.00268 GOTO NEWSYMBOL; 00.00269 END; 00.00270 00.00271 STRINGCHAR: 00.00272 BEGIN 00.00273 -1=>R5; 00.00274 INSTRING=>R6=>STRINGSTATE; 00.00275 REPEAT 00.00276 GETCHAR(R0, R7, R6); 00.00277 WHILE R7 <> STRINGCHAR LOGAND R0 >= SP DO 00.00278 BEGIN 00.00279 R0=>SYMBOLBUF[R5+1]; 00.00280 IF R5 >= MAXSYMBOLLENGTH THEN 00.00281 BEGIN 00.00282 SEMANTICS(ERRORSYM=>R1, STRING_SIZE=>R2, R5, R6); 00.00283 -1=>R5; 00.00284 END; 00.00285 CASE STRINGSTATE=>R6 OF 00.00286 INSTRING: 00.00287 IF R0 = '(' THEN 00.00288 BEGIN 00.00289 R5=>STRINGPOS; 00.00290 AFTERLEFTPAR=>R6=>STRINGSTATE; 00.00291 END; 00.00292 AFTERLEFTPAR: 00.00293 IF R0 = ':' THEN 00.00294 BEGIN 00.00295 ADDRESS(ATTRIBUTE)=>R2; 00.00296 0=>R2@INTEGER; 00.00297 10=>R1; 00.00298 INCHARVALUE=>R6=>STRINGSTATE; 00.00299 END ELSE 00.00300 IF R0 <> '(' THEN INSTRING=>R6=>STRINGSTATE; 00.00301 INCHARVALUE: 00.00302 BEGIN 00.00303 IF R7 = NUMERIC THEN 00.00304 BEGIN 00.00305 R2@LONG*R1; 00.00306 R2@INTEGER+(R0-'0'); 00.00307 IF R2@INTEGER >= 128 THEN INSTRING=>R6; 00.00308 END ELSE 00.00309 IF R0 = ':' THEN BEFORERIGHTPAR=>R6; 00.00310 R6=>STRINGSTATE; 00.00311 END; 00.00312 BEFORERIGHTPAR: 00.00313 BEGIN 00.00314 IF R0 = ')' THEN R2@INTEGER=>R2=>SYMBOLBUF[STRINGPOS=>R5]; 00.00315 INSTRING=>R6=>STRINGSTATE; 00.00316 END; 00.00317 END; 00.00318 GETCHAR(R0, R7, R6); 00.00319 END; 00.00320 IF R7 <> STRINGCHAR 00.00321 THEN SEMANTICS(ERRORSYM=>R1, STRING_SYNTAX=>R2, R5, R6) ELSE 00.00322 BEGIN 00.00323 GETCHAR(R0, R7, R6); 00.00324 IF R5 >= MAXSYMBOLLENGTH THEN 00.00325 BEGIN 00.00326 SEMANTICS(ERRORSYM=>R1, STRING_SIZE=>R2, R5, R6); 00.00327 -1=>R5; 00.00328 END ELSE 00.00329 IF R7 = STRINGCHAR THEN R0=>SYMBOLBUF[R5+1] ELSE 00.00330 BEGIN 00.00331 WHILE R7 = IGNORE DO GETCHAR(R0, R7, R6); 00.00332 IF R0 = '&' THEN 00.00333 BEGIN 00.00334 REPEAT GETCHAR(R0, R7, R6) UNTIL R7 <> IGNORE; 00.00335 IF R7 <> STRINGCHAR 00.00336 THEN SEMANTICS(ERRORSYM=>R1, STRING_SYNTAX=>R2, R5, R6); 00.00337 END; 00.00338 END; 00.00339 END; 00.00340 UNTIL R7 <> STRINGCHAR; 00.00341 STRING=>R1; 00.00342 0=>R0=>SYMBOLBUF[R5+1]; 00.00343 R5=>R2; 00.00344 R0=>SYMBOLBUF[R5+1]; 00.00345 END; 00.00346 00.00347 HEXCHAR: 00.00348 BEGIN 00.00349 GETCHAR(R0, R7, R6); 00.00350 0=>R2; 00.00351 WHILE R7 < DELIMITER LOGAND R0 < 'G' DO 00.00352 BEGIN 00.00353 IF R7 = NUMERIC THEN R0-'0' ELSE R0-('A'-10); 00.00354 IF R2 >= #1000 THEN SEMANTICS(ERRORSYM=>R1, CONST_OVERFLOW=>R2, R5, R6) 00.00355 ELSE R2 SHIFTLL 4 + R0; 00.00356 GETCHAR(R0, R7, R6); 00.00357 END; 00.00358 CONSTANT=>R1; 00.00359 END; 00.00360 00.00361 ESCAPE: 00.00362 BEGIN 00.00363 EMPTY=>R1; 00.00364 IGNORE=>R7=>CURRCLASS; 00.00365 END; 00.00366 00.00367 00.00368 END; "CASE" 00.00369 00.00370 SAVER0=>R0; 00.00371 SAVER3=>R3; 00.00372 SAVER4=>R4; 00.00373 SAVER5=>R5; 00.00374 SAVER6=>R6; 00.00375 SAVER7=>R7; 00.00376 SAVER6=>R6; 00.00377 EXIT(R6); 00.00378 END; "NEXTSYMBOL" 00.00379 00.00380 00.00381 00.00382 PROCEDURE TESTACCEPT 00.00383 "==================" 00.00384 (R1; "SYMBOL NO (CALL) 00.00385 "LEGAL FOLLOWERSYMBOL (RETURN) 00.00386 R0; "FOLLOWERCOUNT (RETURN) 00.00387 R3; "FOUND (RETURN), 0 = FALSE 00.00388 R4; "PARSE STATE 00.00389 R6); "LINK 00.00390 VAR 00.00391 SAVER4, SAVER5, SAVER6, SAVER7: INTEGER; 00.00392 BEGIN 00.00393 R4=>SAVER4; 00.00394 R5=>SAVER5; 00.00395 R6=>SAVER6; 00.00396 R7=>SAVER7; 00.00397 0=>R3; "SYMBOL NOT FOUND" 00.00398 0=>R7; "NO FOLLOWER SYMBOL" 00.00399 0=>R0; "LEGAL FOLLOWER COUNT" 00.00400 REPEAT 00.00401 R4@ACTIONENTRY.SYMBACTION=>R6 SHIFTRL 4; "SYMBOL NO" 00.00402 R4@ACTIONENTRY.SYMBACTION=>R5 EXTRACT 4; "ACTION" 00.00403 IF R6 = 0 THEN 00.00404 BEGIN 00.00405 IF R5 = JUMP THEN R4+R4@ACTIONENTRY.OBJECT ELSE 0=>R4; 00.00406 END ELSE 00.00407 BEGIN 00.00408 IF R6 = R1 THEN R1=>R3; "SYMBOL FOUND" 00.00409 R6=>R7; 00.00410 R0+1; 00.00411 R4+SIZE(ACTIONENTRY); 00.00412 END; 00.00413 UNTIL R4 = 0; 00.00414 R7=>R1; "FOLLOWER SYMBOL" 00.00415 SAVER4=>R4; 00.00416 SAVER5=>R5; 00.00417 SAVER6=>R6; 00.00418 SAVER7=>R7; 00.00419 EXIT(R6); 00.00420 END; 00.00421 00.00422 00.00423 00.00424 PROCEDURE RECOVER 00.00425 "===============" 00.00426 (R4; "PARSE STATE 00.00427 R5; "PARSE STACK POINTER 00.00428 R6); "LINK 00.00429 VAR 00.00430 SAVER0, SAVER1, SAVER2, SAVER3, SAVER5, SAVER6, SAVER7: INTEGER; 00.00431 BEGIN 00.00432 R0=>SAVER0; 00.00433 R1=>SAVER1; 00.00434 R2=>SAVER2; 00.00435 R3=>SAVER3; 00.00436 R5=>SAVER5; 00.00437 R6=>SAVER6; 00.00438 R7=>SAVER7; 00.00439 TABLEPTR=>R7; 00.00440 SEMANTICS(ERRORSYM=>R1, UNEXPECTED_SYMBOL=>R2, R5, R6); 00.00441 IF R7@TABLEHEAD.WINDOW2=>R1 = 0 00.00442 LOGOR R1 = R7@TABLEHEAD.WINDOW1 THEN 00.00443 BEGIN 00.00444 NEXTSYMBOL(R1, R2, R6); 00.00445 R1=>R7@TABLEHEAD.WINDOW2; 00.00446 END; 00.00447 ERRORSYM=>R0=>R7@TABLEHEAD.WINDOW1; 00.00448 R7=>R6+R7@TABLEHEAD.RECOVERSYMBOLS=>R4; 00.00449 WHILE R6@INTEGER <> R1 LOGAND R6@INTEGER <> 0 DO R6+1; 00.00450 IF R6 <> R4 LOGOR R6@INTEGER <> 0 " RECOVER SYMBOLS PRESENT " THEN 00.00451 WHILE R6@INTEGER <> R1 DO 00.00452 BEGIN 00.00453 NEXTSYMBOL(R1, R2, R6); 00.00454 R7=>R6+R7@TABLEHEAD.RECOVERSYMBOLS; 00.00455 WHILE R6@INTEGER <> R1 LOGAND R6@INTEGER <> 0 DO R6+1; 00.00456 END; 00.00457 R1=>R7@TABLEHEAD.WINDOW2; 00.00458 R5+R7@TABLEHEAD.ITEMSIZE; 00.00459 REPEAT 00.00460 R5-(R7@TABLEHEAD.ITEMSIZE=>R4)=>SAVER5; 00.00461 IF R5 >= R7@TABLEHEAD.SAVEREGS[5] THEN 00.00462 BEGIN 00.00463 R5@STACKENTRY.ACTION=>R4; 00.00464 TESTACCEPT(ERRORSYM=>R1, R0, R3, R4, R6); 00.00465 END ELSE 00.00466 BEGIN 00.00467 SEMANTICS(ERRORSYM=>R1, UNRECOVERABLE=>R2, R5, R6); 00.00468 0=>R5=>SAVER5; "TERMINATE 00.00469 END; 00.00470 UNTIL R3 <> 0 LOGOR R5 = 0; 00.00471 SAVER0=>R0; 00.00472 SAVER1=>R1; 00.00473 SAVER2=>R2; 00.00474 SAVER3=>R3; 00.00475 R5@STACKENTRY.ACTION=>R4; 00.00476 SAVER5=>R5; 00.00477 SAVER6=>R6; 00.00478 SAVER7=>R7; 00.00479 EXIT(R6); 00.00480 END; 00.00481 00.00482 00.00483 00.00484 EXPORT PROCEDURE PARSE 00.00485 "====================" 00.00486 (STACKITEMSIZE, MAXSTACKITEMS: INTEGER; 00.00487 R4; "ENTRY POINT OF SEMANTICS PROCEDURE 00.00488 R5; "PARSE STACK BASE 00.00489 R7; "PARSE TABLE PTR 00.00490 R6); "LINK 00.00491 BEGIN 00.00492 STC(6, R7+7); 00.00493 TABLEPTR=>R0=>R7@TABLEHEAD.TABLELINK; 00.00494 R7=>TABLEPTR; 00.00495 R6@PARSE.STACKITEMSIZE=>R0=>R7@TABLEHEAD.ITEMSIZE; 00.00496 R6@PARSE.MAXSTACKITEMS=>R1; 00.00497 R5=>R3; 00.00498 WHILE R1-1 >= 0 DO R3+R0; 00.00499 R3=>R7@TABLEHEAD.STACKLIMIT; 00.00500 R7=>R4+R7@TABLEHEAD.ACTIONS+SIZE(ACTIONENTRY); 00.00501 R4=>R5@STACKENTRY.ACTION; 00.00502 0=>R1=>R7@TABLEHEAD.WINDOW1; 00.00503 R1=>R7@TABLEHEAD.WINDOW2; 00.00504 R1=>R7@TABLEHEAD.RECOVERING; 00.00505 REPEAT 00.00506 R7@TABLEHEAD.WINDOW1=>R1; 00.00507 R4@ACTIONENTRY.SYMBACTION=>R3 SHIFTRL 4; 00.00508 WHILE R3 <> 0 LOGAND R1 = 0 DO 00.00509 BEGIN 00.00510 NEXTSYMBOL(R1, R2, R6); 00.00511 IF R1 = EMPTY THEN "ESCAPE" 00.00512 BEGIN 00.00513 R4=>R2; "SAVE R4 00.00514 SEMANTICS(R1, R2, R5+R7@TABLEHEAD.ITEMSIZE, R6); 00.00515 R2=>R4; "REESTABLISH R4; 00.00516 (TABLEPTR=>R7)@TABLEHEAD.ITEMSIZE=>R0; 00.00517 R5-R0; 00.00518 END; 00.00519 R1=>R7@TABLEHEAD.WINDOW1; 00.00520 R1=>R7@TABLEHEAD.WINDOW2; 00.00521 END; 00.00522 WHILE R3 <> R1 LOGAND R3 <> 0 DO 00.00523 BEGIN 00.00524 R4+SIZE(ACTIONENTRY); 00.00525 R4@ACTIONENTRY.SYMBACTION=>R3 SHIFTRL 4; 00.00526 END; 00.00527 00.00528 TABLEPTR=>R7; 00.00529 R4@ACTIONENTRY.SYMBACTION=>R6 EXTRACT 4; 00.00530 CASE R6:ACTIONTYPE OF 00.00531 00.00532 REDUCE: 00.00533 BEGIN 00.00534 R4@ACTIONENTRY.OBJECT=>R6; "TAKE PRODUCTION NUMBER" 00.00535 R6+R7+R7@TABLEHEAD.PRODUCTIONS; "TAKE PRODUCTION TABLE ENTRY" 00.00536 R6@PRODUCTIONENTRY.SYMBLENGTH=>R0 EXTRACT 4; 00.00537 R7@TABLEHEAD.ITEMSIZE=>R1; 00.00538 WHILE R0-1 <> 0 DO R5-R1; "UPDATE PARSE STACK POINTER 00.00539 R6@PRODUCTIONENTRY.SYMBLENGTH=>R0 SHIFTRL 4; 00.00540 R0=>R7@TABLEHEAD.WINDOW1; 00.00541 R4@ACTIONENTRY.OBJECT=>R1; "PRODUCTION NO" 00.00542 R1+4; "SEMANTIC ACTION NO" 00.00543 SEMANTICS(R1, R2, R5, R6); 00.00544 TABLEPTR=>R7; 00.00545 IF R1 = 5 " FINAL REDUCTION " THEN 0=>R5 00.00546 ELSE R5-(R7@TABLEHEAD.ITEMSIZE=>R0); 00.00547 R5@STACKENTRY.ACTION=>R4; 00.00548 END; 00.00549 00.00550 SHIFT: 00.00551 BEGIN 00.00552 IF R5+R7@TABLEHEAD.ITEMSIZE >= R7@TABLEHEAD.STACKLIMIT THEN 00.00553 BEGIN 00.00554 SEMANTICS(ERRORSYM=>R1, PARSESTACKFULL=>R2, R5, R6); 00.00555 0=>R5; "TERMINATE 00.00556 END ELSE 00.00557 BEGIN 00.00558 R4+R4@ACTIONENTRY.OBJECT; "NEXT ACTION" 00.00559 R4=>R5@STACKENTRY.ACTION; 00.00560 IF R1 < ERRORSYM THEN SEMANTICS(R1, R2, R5, R6); 00.00561 R5@STACKENTRY.ACTION=>R4; 00.00562 IF R7@TABLEHEAD.WINDOW2=>R0 = R7@TABLEHEAD.WINDOW1=>R1 00.00563 THEN 0=>R0=>R7@TABLEHEAD.WINDOW2; 00.00564 IF R1 = ERRORSYM THEN 1=>R0 ELSE 0=>R0; 00.00565 R0=>R7@TABLEHEAD.RECOVERING; "SET RECOVERING (TRUE OR FALSE = 1/0)" 00.00566 R7@TABLEHEAD.WINDOW2=>R0=>R7@TABLEHEAD.WINDOW1; 00.00567 END; 00.00568 END; 00.00569 00.00570 JUMP: 00.00571 BEGIN 00.00572 R4+R4@ACTIONENTRY.OBJECT; 00.00573 END; 00.00574 00.00575 FAULT: 00.00576 BEGIN 00.00577 RECOVER(R4, R5, R6); 00.00578 END; 00.00579 00.00580 END; "CASE" 00.00581 UNTIL R5 = 0; 00.00582 TABLEPTR=>R7; 00.00583 R7@TABLEHEAD.TABLELINK=>R0=>TABLEPTR; 00.00584 UNS(6, R7); 00.00585 R7-7; 00.00586 EXIT(R6, SIZE(PARSE)); 00.00587 END; "PARSE" 00.00588 00.00589 00.00590 ENDMODULE LINES: 637 CODESIZE VARSIZE CONSTSIZE TEMPSIZE -------- ------- --------- -------- #0294 #0060 #0000 #0000