File: deerror.c

package info (click to toggle)
clisp 1997-12-06-1
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 20,744 kB
  • ctags: 8,390
  • sloc: ansic: 37,808; lisp: 37,255; asm: 6,393; sh: 3,077; objc: 2,481; makefile: 1,174; sed: 96; perl: 14
file content (57 lines) | stat: -rw-r--r-- 1,971 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* C-Programm-Prprozessor-Hilfe:
   Ersetzt die #error-Anweisungen am Beginn jeder Zeile durch ERROR.
   Bruno Haible 4.11.1992
*/

#include <stdio.h>

#ifdef __cplusplus
extern "C" void exit(int);
#endif

#define NL 10

main ()
  { int c;
    zeilenanfang:
      c = getchar(); if (c==EOF) { goto eof; }
      if (c=='#')
        { c = getchar(); if (c==EOF) { putchar('#'); goto eof; }
          if (c=='e')
            { c = getchar(); if (c==EOF) { putchar('#'); putchar('e'); goto eof; }
              if (c=='r')
                { c = getchar(); if (c==EOF) { putchar('#'); putchar('e'); putchar('r'); goto eof; }
                  if (c=='r')
                    { c = getchar(); if (c==EOF) { putchar('#'); putchar('e'); putchar('r'); putchar('r'); goto eof; }
                      if (c=='o')
                        { c = getchar(); if (c==EOF) { putchar('#'); putchar('e'); putchar('r'); putchar('r'); putchar('o'); goto eof; }
                          if (c=='r')
                            { putchar('E'); putchar('R'); putchar('R'); putchar('O'); putchar('R');
                              c = getchar();
                            }
                            else
                            { putchar('#'); putchar('e'); putchar('r'); putchar('r'); putchar('o'); }
                        }
                        else
                        { putchar('#'); putchar('e'); putchar('r'); putchar('r'); }
                    }
                    else
                    { putchar('#'); putchar('e'); putchar('r'); }
                }
                else
                { putchar('#'); putchar('e'); }
            }
            else
            { putchar('#'); }
        }
      /* Rest der Zeile unverndert bernehmen: */
      rest:
        putchar(c);
        if (c==NL) goto zeilenanfang;
        c = getchar(); if (c==EOF) { goto eof; }
        goto rest;
    eof: ;
    if (ferror(stdin) || ferror(stdout)) { exit(1); }
    exit(0);
  }