Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-07 - 43,50443/analzr.cor
There are 2 other files named analzr.cor in the archive. Click here to see a list.
-!ANALZR.XPL_ANALZR.OLD
-154,154
   RETURN (SHL(B1,24) + SHL(B2,16) + SHL(B3,8) + B4) & "FFFFFFFF";
-445,445
            I = SHR(J, 24);
-451,451
            J = SHL(J, 8) & "FFFFFFFF";
-470,470
         IF BYTE(CARDIMAGE,CP) \= BLANK & BYTE(CARDIMAGE,CP)
            \= 9 THEN      /* NOT A SPACE OR A TAB */
-515,515
         ELSE IF LENGTH(CARDIMAGE) \= 0 & CARDIMAGE \= EMPTY THEN
                  RETURN TRUE;
-516:      END;                                                                      
-519,564
   SORT_V:
      PROCEDURE;  /* SORT THE SYMBOL TABLE  */
      DO I = 1 TO NSY;
          /* SORT ON 1.  TERMINAL VS. NON-TERMINAL
                        2.  LENGTH OF SYMBOL
                           3.  ORIGINAL ORDER OF OCCURRENCE  */
         SORT#(I) = SHL(ON_LEFT(I), 16) ^ SHL(LENGTH(V(I)), 8) ^ I;
         SORT#(I) = SORT#(I) & "FFFFFFFF";
      END;
      /* BUBBLE SORT  */
      K, L = NSY;
      DO WHILE K <= L;
         L = 0;
         DO I = 2 TO K;
            L = I - 1;
            IF SORT#(L) > SORT#(I) THEN
               DO;
                  J = SORT#(L);  SORT#(L) = SORT#(I);  SORT#(I) = J;
                  T = V(L);  V(L) = V(I);  V(I) = T;
                  K = L;
               END;
         END;
      END;
      DO I = 1 TO NSY; /* BUILD TABLE TO LOCATE SORTED SYMBOLS OF V */
         INDEX(SORT#(I)&"FF") = I;
      END;
      NT = NSY;  /* PREPARE TO COUNT NON-TERMINAL SYMBOLS */
      DO WHILE SORT#(NT) > "10000";  NT = NT - 1;  END;
      /* SUBSTITUTE NEW INDEX NUMBERS IN PRODUCTIONS  */
      DO I = 1 TO NPR;
         LEFT_PART(I) = INDEX(LEFT_PART(I));
         J = INDEX(RIGHT_HEAD(I));
         ON_RIGHT(J) = TRUE;
         RIGHT_HEAD(I) = J;
         L = PRODUCTION(I);
         DO K = 0 TO 3;
            J = INDEX(SHR(L,24)&"FF"); /* INSURANCE FOR 36 BITS */
            ON_RIGHT(J) = TRUE;
            L = SHL(L,8) + J;
         END;
         L = L & "FFFFFFFF";
         PRODUCTION(I) = L;
      END;
      TERMINATOR = INDEX(1);  /* ADD _^_ TO VOCABULARY */
      ON_RIGHT(TERMINATOR) = TRUE;
   END SORT_V;                                                         

   PRINT_DATE:
-613,615
            P = (SHL(P, 8) + I) & "FFFFFFFF";  /* PACK 4 TO A WORD  */
      END;                                                                      
      IF LENGTH(SUBSTR(CARDIMAGE,CP)) \=0 THEN
-646,664
   CALL PRINT_TIME;
   CALL SORT_V;

   EJECT_PAGE;
   OUTPUT  = '   T E R M I N A L   S Y M B O L S                                
   N O N T E R M I N A L S';
   DOUBLE_SPACE;
   IF NSY - NT > NT THEN L = NSY - NT;  ELSE L = NT; /* L = NUMBER OF LINES */  
   DO I = 1 TO L;  /* PRINT V */
      IF I > NT THEN CARDIMAGE = HALF_LINE;
      ELSE
         DO;  /* TERMINAL SYMBOLS */
            T = I;
            J = 5 - LENGTH(T);
            CARDIMAGE = SUBSTR(SUBSTR(EMPTY, 0, J) ^^ T ^^ '   ' ^^ V(I)
               ^^ HALF_LINE, 0, 66);
         END;
      K = I + NT;
      IF K <= NSY THEN
         DO;  /* NON-TERMINAL SYMBOLS */
-716,716
               M = (SHL(M, 8) + S2) & "FFFFFFFF";
-733,733
                           IF INTERNAL THEN M = M & "FFFF00FF"
                                          ^ (SHL(NSY, 8) & "FFFFFFFF");
-734:                           ELSE RIGHT_HEAD(P) = NSY;                            
-773,773
            DO WHILE K \= 0;  J = SHR(K, 24);  K = SHL(K, 8)
                             & "FFFFFFFF";  END;
-871,871
            K = SHR(J,24);  J = SHL(J,8) & "FFFFFFFF";
-967,967
   F11(NF11+1) = SHL(NSY+1, 16) & "FFFFFFFF"; /* BOUNDARY CONDITION  */
-982,982
            YP = SHL(Y+1, 16) & "FFFFFFFF"; /*TO COMPARE WITH TRIPLE */
-1004,1007
         K = SHR(M, 24);  M = SHL(M, 8) & "FFFFFFFF";
         IF K \= 0 THEN                                                         
            DO;                                                                 
               J = (SHL(J, 8) + K) & "FFFFFFFF";
-1008:               L = L - 1;                                                       
-1015
      SORT#(I) = SORT#(I) & "FFFFFFFF";
-1123,1123
                     L = SHL(M+1, 24) & "FFFFFFFF";
-1495

   OUTPUT(-2) = 'GRAMMAR FILE: ';
   FILENAME(0) = INPUT(-1);
   OUTPUT(-2) = ' OUTPUT FILE: ';
   FILENAME(1) = INPUT(-1);