#define SKIMPAI #include #include int main(int argc, char **argv) { char a[500]; int c, line = 1, ap, continuation = (0!=0), inchar = (0!=0), solinstring = (0!=0), instring = (0!=0); #ifdef SKIMPA fprintf(stdout, " Source file: SKIMPA.IMP Compiled on 25-OCT-1979 at 09:38:57\n\n"); #endif #ifdef SKIMPB fprintf(stdout, " Source file: SKIMPB.IMP Compiled on 25-OCT-1979 at 09:39:49\n\n"); #endif #ifdef SKIMPC fprintf(stdout, " Source file: SKIMPC.IMP Compiled on 25-OCT-1979 at 09:51:22\n\n"); #endif #ifdef SKIMPD fprintf(stdout, " Source file: SKIMPD.IMP Compiled on 25-OCT-1979 at 09:40:47\n\n"); #endif #ifdef SKIMPE fprintf(stdout, " Source file: SKIMPD.IMP Compiled on 25-OCT-1979 at 09:40:47\n\n"); #endif #ifdef SKIMPAI fprintf(stdout, " Source file: SKIMPAI.IMP Compiled on 30-OCT-1979 at 10:38:02\n\n"); #endif fprintf(stdout, " Computer Science IMP77 Compiler. Version 6.01\n\n"); for (;;) { ap = 0; for (;;) { c = fgetc(stdin); if (c == EOF) break; if (c == '\'') inchar = !inchar; else if ((!inchar) && (c == '"')) instring = !instring; a[ap++] = c; if (c == '\n') break; } if (c == EOF) break; a[--ap] = '\0'; fprintf(stdout, "%10d%c %s\n", line++, continuation ? '+' : (solinstring ? '+' : ' '), a); #ifdef SKIMPAI if (line == 307) fprintf(stdout, " ?V unused\n"); #endif solinstring = instring; continuation = ((ap > 1) && ( (a[ap-1] == ',') || ( (a[ap-2] == '%') && (tolower(a[ap-1]) == 'c') ) ) ); } #ifdef SKIMPA fprintf(stdout, " Code 9996 bytes Glap 10136 bytes Diags 2355 bytes Total size 22487 bytes\n"); fprintf(stdout, " 464 statements compiled\n\n"); #endif #ifdef SKIMPB fprintf(stdout, " Code 7292 bytes Glap 1256 bytes Diags 1276 bytes Total size 9824 bytes\n"); fprintf(stdout, " 253 statements compiled\n\n"); #endif #ifdef SKIMPC fprintf(stdout, " Code 2492 bytes Glap 432 bytes Diags 613 bytes Total size 3537 bytes\n"); fprintf(stdout, " 99 statements compiled\n\n"); #endif #ifdef SKIMPD fprintf(stdout, " Code 10012 bytes Glap 1832 bytes Diags 2391 bytes Total size 14235 bytes\n"); fprintf(stdout, " 345 statements compiled\n\n"); #endif #ifdef SKIMPE fprintf(stdout, " ?STRINT unused\n"); fprintf(stdout, " Code 5164 bytes Glap 680 bytes Diags 1023 bytes Total size 6867 bytes\n"); fprintf(stdout, " 187 statements compiled\n\n"); #endif #ifdef SKIMPAI fprintf(stdout, " Code 9580 bytes Glap 1456 bytes Diags 1428 bytes Total size 12464 bytes\n"); fprintf(stdout, " 299 statements compiled\n\n"); #endif exit(0); return(0); }