1: /* $Header: a2p.h,v 1.0 87/12/18 13:06:58 root Exp $
   2:  *
   3:  * $Log:	a2p.h,v $
   4:  * Revision 1.0  87/12/18  13:06:58  root
   5:  * Initial revision
   6:  *
   7:  */
   8: 
   9: #include "handy.h"
  10: #define Nullop 0
  11: 
  12: #define OPROG       1
  13: #define OJUNK       2
  14: #define OHUNKS      3
  15: #define ORANGE      4
  16: #define OPAT        5
  17: #define OHUNK       6
  18: #define OPPAREN     7
  19: #define OPANDAND    8
  20: #define OPOROR      9
  21: #define OPNOT       10
  22: #define OCPAREN     11
  23: #define OCANDAND    12
  24: #define OCOROR      13
  25: #define OCNOT       14
  26: #define ORELOP      15
  27: #define ORPAREN     16
  28: #define OMATCHOP    17
  29: #define OMPAREN     18
  30: #define OCONCAT     19
  31: #define OASSIGN     20
  32: #define OADD        21
  33: #define OSUB        22
  34: #define OMULT       23
  35: #define ODIV        24
  36: #define OMOD        25
  37: #define OPOSTINCR   26
  38: #define OPOSTDECR   27
  39: #define OPREINCR    28
  40: #define OPREDECR    29
  41: #define OUMINUS     30
  42: #define OUPLUS      31
  43: #define OPAREN      32
  44: #define OGETLINE    33
  45: #define OSPRINTF    34
  46: #define OSUBSTR     35
  47: #define OSTRING     36
  48: #define OSPLIT      37
  49: #define OSNEWLINE   38
  50: #define OINDEX      39
  51: #define ONUM        40
  52: #define OSTR        41
  53: #define OVAR        42
  54: #define OFLD        43
  55: #define ONEWLINE    44
  56: #define OCOMMENT    45
  57: #define OCOMMA      46
  58: #define OSEMICOLON  47
  59: #define OSCOMMENT   48
  60: #define OSTATES     49
  61: #define OSTATE      50
  62: #define OPRINT      51
  63: #define OPRINTF     52
  64: #define OBREAK      53
  65: #define ONEXT       54
  66: #define OEXIT       55
  67: #define OCONTINUE   56
  68: #define OREDIR      57
  69: #define OIF     58
  70: #define OWHILE      59
  71: #define OFOR        60
  72: #define OFORIN      61
  73: #define OVFLD       62
  74: #define OBLOCK      63
  75: #define OREGEX      64
  76: #define OLENGTH     65
  77: #define OLOG        66
  78: #define OEXP        67
  79: #define OSQRT       68
  80: #define OINT        69
  81: 
  82: #ifdef DOINIT
  83: char *opname[] = {
  84:     "0",
  85:     "PROG",
  86:     "JUNK",
  87:     "HUNKS",
  88:     "RANGE",
  89:     "PAT",
  90:     "HUNK",
  91:     "PPAREN",
  92:     "PANDAND",
  93:     "POROR",
  94:     "PNOT",
  95:     "CPAREN",
  96:     "CANDAND",
  97:     "COROR",
  98:     "CNOT",
  99:     "RELOP",
 100:     "RPAREN",
 101:     "MATCHOP",
 102:     "MPAREN",
 103:     "CONCAT",
 104:     "ASSIGN",
 105:     "ADD",
 106:     "SUB",
 107:     "MULT",
 108:     "DIV",
 109:     "MOD",
 110:     "POSTINCR",
 111:     "POSTDECR",
 112:     "PREINCR",
 113:     "PREDECR",
 114:     "UMINUS",
 115:     "UPLUS",
 116:     "PAREN",
 117:     "GETLINE",
 118:     "SPRINTF",
 119:     "SUBSTR",
 120:     "STRING",
 121:     "SPLIT",
 122:     "SNEWLINE",
 123:     "INDEX",
 124:     "NUM",
 125:     "STR",
 126:     "VAR",
 127:     "FLD",
 128:     "NEWLINE",
 129:     "COMMENT",
 130:     "COMMA",
 131:     "SEMICOLON",
 132:     "SCOMMENT",
 133:     "STATES",
 134:     "STATE",
 135:     "PRINT",
 136:     "PRINTF",
 137:     "BREAK",
 138:     "NEXT",
 139:     "EXIT",
 140:     "CONTINUE",
 141:     "REDIR",
 142:     "IF",
 143:     "WHILE",
 144:     "FOR",
 145:     "FORIN",
 146:     "VFLD",
 147:     "BLOCK",
 148:     "REGEX",
 149:     "LENGTH",
 150:     "LOG",
 151:     "EXP",
 152:     "SQRT",
 153:     "INT",
 154:     "70"
 155: };
 156: #else
 157: extern char *opname[];
 158: #endif
 159: 
 160: union {
 161:     int ival;
 162:     char *cval;
 163: } ops[50000];       /* hope they have 200k to spare */
 164: 
 165: EXT int mop INIT(1);
 166: 
 167: #define DEBUGGING
 168: 
 169: #include <stdio.h>
 170: #include <ctype.h>
 171: #include <setjmp.h>
 172: #include <sys/types.h>
 173: #include <sys/stat.h>
 174: #include <time.h>
 175: #include <sys/times.h>
 176: 
 177: typedef struct string STR;
 178: typedef struct htbl HASH;
 179: 
 180: #include "str.h"
 181: #include "hash.h"
 182: 
 183: /* A string is TRUE if not "" or "0". */
 184: #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
 185: EXT char *Yes INIT("1");
 186: EXT char *No INIT("");
 187: 
 188: #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
 189: 
 190: #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
 191: #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
 192: #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
 193: EXT STR *Str;
 194: 
 195: #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
 196: 
 197: STR *str_new();
 198: 
 199: char *scanpat();
 200: char *scannum();
 201: 
 202: void str_free();
 203: 
 204: EXT int line INIT(0);
 205: 
 206: EXT FILE *rsfp;
 207: EXT char buf[1024];
 208: EXT char *bufptr INIT(buf);
 209: 
 210: EXT STR *linestr INIT(Nullstr);
 211: 
 212: EXT char tokenbuf[256];
 213: EXT int expectterm INIT(TRUE);
 214: 
 215: #ifdef DEBUGGING
 216: EXT int debug INIT(0);
 217: EXT int dlevel INIT(0);
 218: #define YYDEBUG;
 219: extern int yydebug;
 220: #endif
 221: 
 222: EXT STR *freestrroot INIT(Nullstr);
 223: 
 224: EXT STR str_no;
 225: EXT STR str_yes;
 226: 
 227: EXT bool do_split INIT(FALSE);
 228: EXT bool split_to_array INIT(FALSE);
 229: EXT bool set_array_base INIT(FALSE);
 230: EXT bool saw_RS INIT(FALSE);
 231: EXT bool saw_OFS INIT(FALSE);
 232: EXT bool saw_ORS INIT(FALSE);
 233: EXT bool saw_line_op INIT(FALSE);
 234: EXT bool in_begin INIT(TRUE);
 235: EXT bool do_opens INIT(FALSE);
 236: EXT bool do_fancy_opens INIT(FALSE);
 237: EXT bool lval_field INIT(FALSE);
 238: EXT bool do_chop INIT(FALSE);
 239: EXT bool need_entire INIT(FALSE);
 240: EXT bool absmaxfld INIT(FALSE);
 241: 
 242: EXT char const_FS INIT(0);
 243: EXT char *namelist INIT(Nullch);
 244: EXT char fswitch INIT(0);
 245: 
 246: EXT int saw_FS INIT(0);
 247: EXT int maxfld INIT(0);
 248: EXT int arymax INIT(0);
 249: char *nameary[100];
 250: 
 251: EXT STR *opens;
 252: 
 253: EXT HASH *symtab;

Defined variables

No defined in line 186; used 2 times
Str defined in line 193; used 18 times
Yes defined in line 185; never used
arymax defined in line 248; used 11 times
buf defined in line 207; used 7 times
bufptr defined in line 208; never used
const_FS defined in line 242; used 9 times
dlevel defined in line 217; never used
expectterm defined in line 213; never used
freestrroot defined in line 222; used 5 times
fswitch defined in line 244; used 5 times
line defined in line 204; never used
linestr defined in line 210; never used
maxfld defined in line 247; used 14 times
mop defined in line 165; never used
nameary defined in line 249; used 8 times
namelist defined in line 243; used 4 times
opens defined in line 251; used 13 times
opname declared in line 157; defined in line 83; used 1 times
saw_FS defined in line 246; used 5 times
str_no defined in line 224; never used
str_yes defined in line 225; never used
symtab defined in line 253; used 4 times
tokenbuf defined in line 212; used 57 times

Defined typedef's

HASH defined in line 178; used 12 times
STR defined in line 177; used 57 times

Defined macros

GROWSTR defined in line 195; used 11 times
Nullop defined in line 10; used 10 times
OADD defined in line 32; used 1 times
OASSIGN defined in line 31; used 1 times
OBREAK defined in line 64; used 1 times
OCANDAND defined in line 23; used 1 times
OCNOT defined in line 25; used 1 times
OCOMMA defined in line 57; used 2 times
OCOMMENT defined in line 56; used 2 times
OCONCAT defined in line 30; used 1 times
OCONTINUE defined in line 67; used 1 times
OCOROR defined in line 24; used 1 times
OCPAREN defined in line 22; used 1 times
ODIV defined in line 35; used 1 times
OEXIT defined in line 66; used 2 times
OEXP defined in line 78; never used
OFLD defined in line 54; used 2 times
OFOR defined in line 71; used 2 times
OFORIN defined in line 72; used 1 times
OGETLINE defined in line 44; used 1 times
OHUNK defined in line 17; used 3 times
OHUNKS defined in line 14; used 1 times
OINDEX defined in line 50; used 1 times
OINT defined in line 80; never used
OJUNK defined in line 13; used 2 times
OLENGTH defined in line 76; used 2 times
OLOG defined in line 77; never used
OMATCHOP defined in line 28; used 1 times
OMOD defined in line 36; used 1 times
OMPAREN defined in line 29; used 1 times
OMULT defined in line 34; used 1 times
ONEWLINE defined in line 55; used 2 times
ONEXT defined in line 65; used 1 times
ONUM defined in line 51; used 1 times
OPANDAND defined in line 19; used 1 times
OPAT defined in line 16; used 1 times
OPNOT defined in line 21; used 1 times
OPOROR defined in line 20; used 1 times
OPOSTDECR defined in line 38; used 1 times
OPOSTINCR defined in line 37; used 1 times
OPPAREN defined in line 18; used 1 times
OPREDECR defined in line 40; used 1 times
OPREINCR defined in line 39; used 1 times
OPROG defined in line 12; used 1 times
ORANGE defined in line 15; used 1 times
OREDIR defined in line 68; used 3 times
OREGEX defined in line 75; used 1 times
ORELOP defined in line 26; used 1 times
ORPAREN defined in line 27; used 1 times
OSCOMMENT defined in line 59; used 1 times
OSEMICOLON defined in line 58; used 3 times
OSNEWLINE defined in line 49; used 2 times
OSPLIT defined in line 48; used 2 times
OSPRINTF defined in line 45; used 1 times
OSQRT defined in line 79; never used
OSTATE defined in line 61; used 1 times
OSTATES defined in line 60; used 1 times
OSTR defined in line 52; used 3 times
OSTRING defined in line 47; never used
OSUB defined in line 33; used 1 times
OSUBSTR defined in line 46; used 2 times
OUMINUS defined in line 41; used 1 times
OUPLUS defined in line 42; used 1 times
OVFLD defined in line 73; used 2 times
OWHILE defined in line 70; used 1 times
True defined in line 184; used 1 times
YYDEBUG defined in line 218; never used
str_get defined in line 191; never used
str_gnum defined in line 192; never used
str_peek defined in line 190; never used
str_true defined in line 188; never used

Usage of this include

Last modified: 1988-01-31
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 5189
Valid CSS Valid XHTML 1.0 Strict