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:     OFFSZ   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: #ifndef LINT
 128: extern  char ititle[];
 129: #endif
 130: extern  struct symtab stab[];
 131: extern  int curftn;
 132: extern  int curclass;
 133: extern  int curdim;
 134: extern  OFFSZ dimtab[];
 135: extern  OFFSZ paramstk[];
 136: extern  int paramno;
 137: extern  OFFSZ autooff, argoff, strucoff;
 138: extern  int regvar;
 139: extern  int minrvar;
 140: extern  int brkflag;
 141: typedef union {
 142:     int intval;
 143:     NODE * nodep;
 144:     } YYSTYPE;
 145: extern  YYSTYPE yylval;
 146: extern  char yytext[];
 147: 
 148: extern  int strflg;
 149: 
 150: extern  OFFSZ inoff;
 151: 
 152: extern  int reached;
 153: 
 154: /* tunnel to buildtree for name id's */
 155: extern  int idname;
 156: 
 157: extern  NODE node[];
 158: extern  NODE *lastfree;
 159: 
 160: extern  int cflag, hflag, pflag;
 161: 
 162: /* various labels */
 163: extern  int brklab;
 164: extern  int contlab;
 165: extern  int flostat;
 166: extern  int retlab;
 167: extern  int retstat;
 168: extern  int asavbc[], *psavbc;
 169: 
 170: /* declarations of various functions */
 171: extern  NODE
 172:     *buildtree(),
 173:     *bdty(),
 174:     *mkty(),
 175:     *rstruct(),
 176:     *dclstruct(),
 177:     *getstr(),
 178:     *tymerge(),
 179:     *stref(),
 180:     *offcon(),
 181:     *bcon(),
 182:     *bpsize(),
 183:     *convert(),
 184:     *pconvert(),
 185:     *oconvert(),
 186:     *ptmatch(),
 187:     *tymatch(),
 188:     *makety(),
 189:     *block(),
 190:     *doszof(),
 191:     *talloc(),
 192:     *optim(),
 193:     *fixargs(),
 194:     *clocal();
 195: OFFSZ   tsize(),
 196:     psize();
 197: TWORD   types();
 198: double  atof();
 199: char    *exname(), *exdcon();
 200: 
 201: #define checkst(x)
 202: 
 203: #ifndef CHARCAST
 204: /* to make character constants into character connstants */
 205: /* this is a macro to defend against cross-compilers, etc. */
 206: #define CHARCAST(x) (char)(x)
 207: #endif
 208: #endif
 209: 
 210: /*
 211:  * Flags used in structures/unions
 212:  */
 213: #define SEENAME     01
 214: #define INSTRUCT    02
 215: #define INUNION     04
 216: #define FUNNYNAME   010
 217: #define TAGNAME     020
 218: 
 219: /*
 220:  * Flags used in the (elementary) flow analysis ...
 221:  */
 222: #define FBRK        02
 223: #define FCONT       04
 224: #define FDEF        010
 225: #define FLOOP       020
 226: 
 227: /*
 228:  * Flags used for return status
 229:  */
 230: #define RETVAL      1
 231: #define NRETVAL     2
 232: 
 233: #define NONAME      040000      /* marks constant w/o name field */
 234: #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 206; 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 222; used 4 times
FCONT defined in line 223; used 4 times
FDEF defined in line 224; 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 225; used 5 times
FORTRAN defined in line 50; used 7 times
FUNNYNAME defined in line 216; used 3 times
INSTRUCT defined in line 214; used 17 times
INUNION defined in line 215; 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 233; used 13 times
NOOFFSET defined in line 234; used 2 times
NRETVAL defined in line 231; used 2 times
PARAM defined in line 45; used 8 times
REGISTER defined in line 40; used 5 times
RETVAL defined in line 230; used 1 times
SEENAME defined in line 213; 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 217; 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 201; used 4 times

Usage of this include

Last modified: 1991-07-28
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3754
Valid CSS Valid XHTML 1.0 Strict