1: #include <stdio.h>
   2: #include "config.h"
   3: char code[256];
   4: #define FIRST 3
   5: #define FOLLOW 2
   6: #define ZERO 6
   7: #define next() (((c = getc(si))==EOF)? exit(0):0)
   8: #define copy() putc(c,so)
   9: #define type() code[(unsigned char)c]
  10: #if os_unix_ts
  11: #define index strchr
  12: #endif
  13: 
  14: init() {
  15:     doit(FIRST,"ABCDEFGHIJKLMNOPQRSTUVWXYZ_");
  16:     doit(FIRST,"0abcdefghijklmnopqrstuvwxyz_");
  17:     doit(FOLLOW,"123456789");
  18: }
  19: doit(act,list)
  20: register unsigned char *list;
  21: {
  22:     while(*list) {code[*list++]=act;}
  23: }
  24: main( )
  25: {
  26:     register FILE *si = stdin, *so = stdout;
  27:     register c, count;
  28: 
  29:     init();
  30: copying:
  31:     do { next(); copy();} while(type()!=FIRST);
  32: hexnum:
  33:     if(c=='0') {
  34:         next();
  35:         if(c=='X'||c=='x') {
  36:             do { copy(); next();}
  37:             while (index("0123456789abcdefABCDEF",c&0x7f)>0);
  38:         }
  39:         ungetc(c,si); goto copying;
  40:     }
  41: counting:
  42:     for(count = 0; count < 7; count++) {
  43:         next();
  44:         copy();
  45:         if(!(type()&FOLLOW)) goto copying;
  46:     }
  47: squelch:
  48:     do { next(); } while (type()&FOLLOW);
  49:     copy();
  50:     goto copying;
  51: }

Defined functions

doit defined in line 19; used 3 times
init defined in line 14; used 1 times
  • in line 29
main defined in line 24; never used

Defined variables

code defined in line 3; used 2 times
  • in line 9, 22

Defined macros

FIRST defined in line 4; used 3 times
FOLLOW defined in line 5; used 3 times
ZERO defined in line 6; never used
copy defined in line 8; used 4 times
index defined in line 11; used 1 times
  • in line 37
next defined in line 7; used 5 times
type defined in line 9; used 3 times
Last modified: 1985-08-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 548
Valid CSS Valid XHTML 1.0 Strict