1: /*	pass1.h	4.2	85/08/22	*/
   2: 
   3: #ifndef _PASS1_
   4: #define _PASS1_
   5: 
   6: #include "macdefs.h"
   7: #include "manifest.h"
   8: 
   9: /*
  10:  * Symbol table definition.
  11:  *
  12:  * Colliding entries are moved down with a standard
  13:  * probe (no quadratic rehash here) and moved back when
  14:  * entries are cleared.
  15:  */
  16: struct  symtab {
  17: #ifndef FLEXNAMES
  18:     char    sname[NCHNAM];
  19: #else
  20:     char    *sname;
  21: #endif
  22:     struct  symtab *snext;  /* link to other symbols in the same scope */
  23:     TWORD   stype;      /* type word */
  24:     char    sclass;     /* storage class */
  25:     char    slevel;     /* scope level */
  26:     char    sflags;     /* flags, see below */
  27:     int offset;     /* offset or value */
  28:     short   dimoff;     /* offset into the dimension table */
  29:     short   sizoff;     /* offset into the size table */
  30:     int suse;       /* line number of last use of the variable */
  31: };
  32: 
  33: /*
  34:  * Storage classes
  35:  */
  36: #define SNULL       0       /* initial value */
  37: #define AUTO        1       /* automatic (on stack) */
  38: #define EXTERN      2       /* external reference */
  39: #define STATIC      3       /* static scope */
  40: #define REGISTER    4       /* register requested */
  41: #define EXTDEF      5       /* external definition */
  42: #define LABEL       6       /* label definition */
  43: #define ULABEL      7       /* undefined label reference */
  44: #define MOS     8       /* member of structure */
  45: #define PARAM       9       /* parameter */
  46: #define STNAME      10      /* structure name */
  47: #define MOU     11      /* member of union */
  48: #define UNAME       12      /* union name */
  49: #define TYPEDEF     13      /* typedef name */
  50: #define FORTRAN     14      /* fortran function */
  51: #define ENAME       15      /* enumeration name */
  52: #define MOE     16      /* member of enumeration */
  53: #define UFORTRAN    17      /* undefined fortran reference */
  54: #define USTATIC     18      /* undefined static reference */
  55: 
  56: /* field size is ORed in */
  57: #define FIELD       0100
  58: #define FLDSIZ      077
  59: #ifndef BUG1
  60: extern  char *scnames();
  61: #endif
  62: 
  63: /*
  64:  * Symbol table flags
  65:  */
  66: #define SMOS        01      /* member of structure */
  67: #define SHIDDEN     02      /* hidden in current scope */
  68: #define SHIDES      04      /* hides symbol in outer scope */
  69: #define SSET        010     /* symbol assigned to */
  70: #define SREF        020     /* symbol referenced */
  71: #define SNONUNIQ    040     /* non-unique structure member */
  72: #define STAG        0100        /* structure tag name */
  73: 
  74: /*
  75:  * Location counters
  76:  */
  77: #define PROG        0       /* program segment */
  78: #define DATA        1       /* data segment */
  79: #define ADATA       2       /* array data segment */
  80: #define STRNG       3       /* string data segment */
  81: #define ISTRNG      4       /* initialized string segment */
  82: #define STAB        5       /* symbol table segment */
  83: 
  84: 
  85: #ifndef ONEPASS
  86: #include "ndu.h"
  87: #endif
  88: 
  89: 
  90: #ifndef FIXDEF
  91: #define FIXDEF(p)
  92: #endif
  93: #ifndef FIXARG
  94: #define FIXARG(p)
  95: #endif
  96: #ifndef FIXSTRUCT
  97: #define FIXSTRUCT(a,b)
  98: #endif
  99: 
 100:     /* alignment of initialized quantities */
 101: #ifndef AL_INIT
 102: #define AL_INIT ALINT
 103: #endif
 104: 
 105: /*
 106:  * External definitions
 107:  */
 108: struct sw {     /* switch table */
 109:     CONSZ   sval;   /* case value */
 110:     int slab;   /* associated label */
 111: };
 112: extern  struct sw swtab[];
 113: extern  struct sw *swp;
 114: extern  int swx;
 115: 
 116: extern  int ftnno;
 117: extern  int blevel;
 118: extern  int instruct, stwart;
 119: 
 120: extern  int lineno, nerrors;
 121: 
 122: extern  CONSZ lastcon;
 123: extern  float fcon;
 124: extern  double dcon;
 125: 
 126: extern  char ftitle[];
 127: extern  char ititle[];
 128: extern  struct symtab stab[];
 129: extern  int curftn;
 130: extern  int curclass;
 131: extern  int curdim;
 132: extern  int dimtab[];
 133: extern  int paramstk[];
 134: extern  int paramno;
 135: extern  int autooff, argoff, strucoff;
 136: extern  int regvar;
 137: extern  int minrvar;
 138: extern  int brkflag;
 139: typedef union {
 140:     int intval;
 141:     NODE * nodep;
 142:     } YYSTYPE;
 143: extern  YYSTYPE yylval;
 144: extern  char yytext[];
 145: 
 146: extern  int strflg;
 147: 
 148: extern  OFFSZ inoff;
 149: 
 150: extern  int reached;
 151: 
 152: /* tunnel to buildtree for name id's */
 153: extern  int idname;
 154: 
 155: extern  NODE node[];
 156: extern  NODE *lastfree;
 157: 
 158: extern  int cflag, hflag, pflag;
 159: 
 160: /* various labels */
 161: extern  int brklab;
 162: extern  int contlab;
 163: extern  int flostat;
 164: extern  int retlab;
 165: extern  int retstat;
 166: extern  int asavbc[], *psavbc;
 167: 
 168: /* declarations of various functions */
 169: extern  NODE
 170:     *buildtree(),
 171:     *bdty(),
 172:     *mkty(),
 173:     *rstruct(),
 174:     *dclstruct(),
 175:     *getstr(),
 176:     *tymerge(),
 177:     *stref(),
 178:     *offcon(),
 179:     *bcon(),
 180:     *bpsize(),
 181:     *convert(),
 182:     *pconvert(),
 183:     *oconvert(),
 184:     *ptmatch(),
 185:     *tymatch(),
 186:     *makety(),
 187:     *block(),
 188:     *doszof(),
 189:     *talloc(),
 190:     *optim(),
 191:     *fixargs(),
 192:     *clocal();
 193: OFFSZ   tsize(),
 194:     psize();
 195: TWORD   types();
 196: double  atof();
 197: char    *exname(), *exdcon();
 198: 
 199: #define checkst(x)
 200: 
 201: #ifndef CHARCAST
 202: /* to make character constants into character connstants */
 203: /* this is a macro to defend against cross-compilers, etc. */
 204: #define CHARCAST(x) (char)(x)
 205: #endif
 206: #endif
 207: 
 208: /*
 209:  * Flags used in structures/unions
 210:  */
 211: #define SEENAME     01
 212: #define INSTRUCT    02
 213: #define INUNION     04
 214: #define FUNNYNAME   010
 215: #define TAGNAME     020
 216: 
 217: /*
 218:  * Flags used in the (elementary) flow analysis ...
 219:  */
 220: #define FBRK        02
 221: #define FCONT       04
 222: #define FDEF        010
 223: #define FLOOP       020
 224: 
 225: /*
 226:  * Flags used for return status
 227:  */
 228: #define RETVAL      1
 229: #define NRETVAL     2
 230: 
 231: #define NONAME      040000      /* marks constant w/o name field */
 232: #define NOOFFSET    (-10201)    /* mark an offset which is undefined */

Defined struct's

sw defined in line 108; used 10 times
symtab defined in line 16; used 68 times

Defined macros

ADATA defined in line 79; used 1 times
AL_INIT defined in line 102; used 2 times
AUTO defined in line 37; used 7 times
CHARCAST defined in line 204; used 2 times
DATA defined in line 78; used 3 times
ENAME defined in line 51; used 4 times
EXTDEF defined in line 41; used 7 times
EXTERN defined in line 38; used 12 times
FBRK defined in line 220; used 4 times
FCONT defined in line 221; used 4 times
FDEF defined in line 222; used 2 times
FIELD defined in line 57; used 16 times
FIXARG defined in line 94; used 2 times
FIXDEF defined in line 91; used 4 times
FIXSTRUCT defined in line 97; used 2 times
FLDSIZ defined in line 58; used 6 times
FLOOP defined in line 223; used 5 times
FORTRAN defined in line 50; used 7 times
FUNNYNAME defined in line 214; used 3 times
INSTRUCT defined in line 212; used 17 times
INUNION defined in line 213; used 13 times
ISTRNG defined in line 81; used 1 times
LABEL defined in line 42; used 6 times
MOE defined in line 52; used 2 times
MOS defined in line 44; used 5 times
MOU defined in line 47; used 7 times
NONAME defined in line 231; used 13 times
NOOFFSET defined in line 232; used 2 times
NRETVAL defined in line 229; used 2 times
PARAM defined in line 45; used 8 times
REGISTER defined in line 40; used 5 times
RETVAL defined in line 228; used 1 times
SEENAME defined in line 211; used 9 times
SHIDDEN defined in line 67; used 4 times
SHIDES defined in line 68; used 2 times
SMOS defined in line 66; used 10 times
SNONUNIQ defined in line 71; used 6 times
SNULL defined in line 36; used 20 times
SREF defined in line 70; never used
SSET defined in line 69; used 1 times
STAB defined in line 82; never used
STAG defined in line 72; used 7 times
STATIC defined in line 39; used 10 times
STNAME defined in line 46; used 5 times
STRNG defined in line 80; used 1 times
TAGNAME defined in line 215; used 4 times
TYPEDEF defined in line 49; used 2 times
UFORTRAN defined in line 53; used 5 times
ULABEL defined in line 43; used 4 times
UNAME defined in line 48; used 6 times
USTATIC defined in line 54; used 3 times
_PASS1_ defined in line 4; used 1 times
  • in line 3
checkst defined in line 199; used 4 times

Usage of this include

Last modified: 1985-08-25
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1743
Valid CSS Valid XHTML 1.0 Strict