1: /* $Header: arg.h,v 1.0.1.1 88/01/28 10:22:40 root Exp $
   2:  *
   3:  * $Log:	arg.h,v $
   4:  * Revision 1.0.1.1  88/01/28  10:22:40  root
   5:  * patch8: added eval operator.
   6:  *
   7:  * Revision 1.0  87/12/18  13:04:39  root
   8:  * Initial revision
   9:  *
  10:  */
  11: 
  12: #define O_NULL 0
  13: #define O_ITEM 1
  14: #define O_ITEM2 2
  15: #define O_ITEM3 3
  16: #define O_CONCAT 4
  17: #define O_MATCH 5
  18: #define O_NMATCH 6
  19: #define O_SUBST 7
  20: #define O_NSUBST 8
  21: #define O_ASSIGN 9
  22: #define O_MULTIPLY 10
  23: #define O_DIVIDE 11
  24: #define O_MODULO 12
  25: #define O_ADD 13
  26: #define O_SUBTRACT 14
  27: #define O_LEFT_SHIFT 15
  28: #define O_RIGHT_SHIFT 16
  29: #define O_LT 17
  30: #define O_GT 18
  31: #define O_LE 19
  32: #define O_GE 20
  33: #define O_EQ 21
  34: #define O_NE 22
  35: #define O_BIT_AND 23
  36: #define O_XOR 24
  37: #define O_BIT_OR 25
  38: #define O_AND 26
  39: #define O_OR 27
  40: #define O_COND_EXPR 28
  41: #define O_COMMA 29
  42: #define O_NEGATE 30
  43: #define O_NOT 31
  44: #define O_COMPLEMENT 32
  45: #define O_WRITE 33
  46: #define O_OPEN 34
  47: #define O_TRANS 35
  48: #define O_NTRANS 36
  49: #define O_CLOSE 37
  50: #define O_ARRAY 38
  51: #define O_HASH 39
  52: #define O_LARRAY 40
  53: #define O_LHASH 41
  54: #define O_PUSH 42
  55: #define O_POP 43
  56: #define O_SHIFT 44
  57: #define O_SPLIT 45
  58: #define O_LENGTH 46
  59: #define O_SPRINTF 47
  60: #define O_SUBSTR 48
  61: #define O_JOIN 49
  62: #define O_SLT 50
  63: #define O_SGT 51
  64: #define O_SLE 52
  65: #define O_SGE 53
  66: #define O_SEQ 54
  67: #define O_SNE 55
  68: #define O_SUBR 56
  69: #define O_PRINT 57
  70: #define O_CHDIR 58
  71: #define O_DIE 59
  72: #define O_EXIT 60
  73: #define O_RESET 61
  74: #define O_LIST 62
  75: #define O_SELECT 63
  76: #define O_EOF 64
  77: #define O_TELL 65
  78: #define O_SEEK 66
  79: #define O_LAST 67
  80: #define O_NEXT 68
  81: #define O_REDO 69
  82: #define O_GOTO 70
  83: #define O_INDEX 71
  84: #define O_TIME 72
  85: #define O_TMS 73
  86: #define O_LOCALTIME 74
  87: #define O_GMTIME 75
  88: #define O_STAT 76
  89: #define O_CRYPT 77
  90: #define O_EXP 78
  91: #define O_LOG 79
  92: #define O_SQRT 80
  93: #define O_INT 81
  94: #define O_PRTF 82
  95: #define O_ORD 83
  96: #define O_SLEEP 84
  97: #define O_FLIP 85
  98: #define O_FLOP 86
  99: #define O_KEYS 87
 100: #define O_VALUES 88
 101: #define O_EACH 89
 102: #define O_CHOP 90
 103: #define O_FORK 91
 104: #define O_EXEC 92
 105: #define O_SYSTEM 93
 106: #define O_OCT 94
 107: #define O_HEX 95
 108: #define O_CHMOD 96
 109: #define O_CHOWN 97
 110: #define O_KILL 98
 111: #define O_RENAME 99
 112: #define O_UNLINK 100
 113: #define O_UMASK 101
 114: #define O_UNSHIFT 102
 115: #define O_LINK 103
 116: #define O_REPEAT 104
 117: #define O_EVAL 105
 118: #define MAXO 106
 119: 
 120: #ifndef DOINIT
 121: extern char *opname[];
 122: #else
 123: char *opname[] = {
 124:     "NULL",
 125:     "ITEM",
 126:     "ITEM2",
 127:     "ITEM3",
 128:     "CONCAT",
 129:     "MATCH",
 130:     "NMATCH",
 131:     "SUBST",
 132:     "NSUBST",
 133:     "ASSIGN",
 134:     "MULTIPLY",
 135:     "DIVIDE",
 136:     "MODULO",
 137:     "ADD",
 138:     "SUBTRACT",
 139:     "LEFT_SHIFT",
 140:     "RIGHT_SHIFT",
 141:     "LT",
 142:     "GT",
 143:     "LE",
 144:     "GE",
 145:     "EQ",
 146:     "NE",
 147:     "BIT_AND",
 148:     "XOR",
 149:     "BIT_OR",
 150:     "AND",
 151:     "OR",
 152:     "COND_EXPR",
 153:     "COMMA",
 154:     "NEGATE",
 155:     "NOT",
 156:     "COMPLEMENT",
 157:     "WRITE",
 158:     "OPEN",
 159:     "TRANS",
 160:     "NTRANS",
 161:     "CLOSE",
 162:     "ARRAY",
 163:     "HASH",
 164:     "LARRAY",
 165:     "LHASH",
 166:     "PUSH",
 167:     "POP",
 168:     "SHIFT",
 169:     "SPLIT",
 170:     "LENGTH",
 171:     "SPRINTF",
 172:     "SUBSTR",
 173:     "JOIN",
 174:     "SLT",
 175:     "SGT",
 176:     "SLE",
 177:     "SGE",
 178:     "SEQ",
 179:     "SNE",
 180:     "SUBR",
 181:     "PRINT",
 182:     "CHDIR",
 183:     "DIE",
 184:     "EXIT",
 185:     "RESET",
 186:     "LIST",
 187:     "SELECT",
 188:     "EOF",
 189:     "TELL",
 190:     "SEEK",
 191:     "LAST",
 192:     "NEXT",
 193:     "REDO",
 194:     "GOTO",/* shudder */
 195:     "INDEX",
 196:     "TIME",
 197:     "TIMES",
 198:     "LOCALTIME",
 199:     "GMTIME",
 200:     "STAT",
 201:     "CRYPT",
 202:     "EXP",
 203:     "LOG",
 204:     "SQRT",
 205:     "INT",
 206:     "PRINTF",
 207:     "ORD",
 208:     "SLEEP",
 209:     "FLIP",
 210:     "FLOP",
 211:     "KEYS",
 212:     "VALUES",
 213:     "EACH",
 214:     "CHOP",
 215:     "FORK",
 216:     "EXEC",
 217:     "SYSTEM",
 218:     "OCT",
 219:     "HEX",
 220:     "CHMOD",
 221:     "CHOWN",
 222:     "KILL",
 223:     "RENAME",
 224:     "UNLINK",
 225:     "UMASK",
 226:     "UNSHIFT",
 227:     "LINK",
 228:     "REPEAT",
 229:     "EVAL",
 230:     "106"
 231: };
 232: #endif
 233: 
 234: #define A_NULL 0
 235: #define A_EXPR 1
 236: #define A_CMD 2
 237: #define A_STAB 3
 238: #define A_LVAL 4
 239: #define A_SINGLE 5
 240: #define A_DOUBLE 6
 241: #define A_BACKTICK 7
 242: #define A_READ 8
 243: #define A_SPAT 9
 244: #define A_LEXPR 10
 245: #define A_ARYLEN 11
 246: #define A_NUMBER 12
 247: 
 248: #ifndef DOINIT
 249: extern char *argname[];
 250: #else
 251: char *argname[] = {
 252:     "A_NULL",
 253:     "EXPR",
 254:     "CMD",
 255:     "STAB",
 256:     "LVAL",
 257:     "SINGLE",
 258:     "DOUBLE",
 259:     "BACKTICK",
 260:     "READ",
 261:     "SPAT",
 262:     "LEXPR",
 263:     "ARYLEN",
 264:     "NUMBER",
 265:     "13"
 266: };
 267: #endif
 268: 
 269: #ifndef DOINIT
 270: extern bool hoistable[];
 271: #else
 272: bool hoistable[] = {0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0};
 273: #endif
 274: 
 275: struct arg {
 276:     union argptr {
 277:     ARG *arg_arg;
 278:     char    *arg_cval;
 279:     STAB    *arg_stab;
 280:     SPAT    *arg_spat;
 281:     CMD *arg_cmd;
 282:     STR *arg_str;
 283:     double  arg_nval;
 284:     } arg_ptr;
 285:     short   arg_len;
 286:     char    arg_type;
 287:     char    arg_flags;
 288: };
 289: 
 290: #define AF_SPECIAL 1        /* op wants to evaluate this arg itself */
 291: #define AF_POST 2       /* post *crement this item */
 292: #define AF_PRE 4        /* pre *crement this item */
 293: #define AF_UP 8         /* increment rather than decrement */
 294: #define AF_COMMON 16        /* left and right have symbols in common */
 295: #define AF_NUMERIC 32       /* return as numeric rather than string */
 296: #define AF_LISTISH 64       /* turn into list if important */
 297: 
 298: /*
 299:  * Most of the ARG pointers are used as pointers to arrays of ARG.  When
 300:  * so used, the 0th element is special, and represents the operator to
 301:  * use on the list of arguments following.  The arg_len in the 0th element
 302:  * gives the maximum argument number, and the arg_str is used to store
 303:  * the return value in a more-or-less static location.  Sorry it's not
 304:  * re-entrant, but it sure makes it efficient.  The arg_type of the
 305:  * 0th element is an operator (O_*) rather than an argument type (A_*).
 306:  */
 307: 
 308: #define Nullarg Null(ARG*)
 309: 
 310: EXT char opargs[MAXO];
 311: 
 312: int do_trans();
 313: int do_split();
 314: bool do_eof();
 315: long do_tell();
 316: bool do_seek();
 317: int do_tms();
 318: int do_time();
 319: int do_stat();

Defined variables

argname declared in line 249; defined in line 251; used 1 times
opargs defined in line 310; used 104 times
opname declared in line 121; defined in line 123; used 6 times

Defined struct's

arg defined in line 275; used 2 times

Defined union's

argptr defined in line 276; never used

Defined macros

AF_LISTISH defined in line 296; never used
AF_NUMERIC defined in line 295; used 1 times
A_ARYLEN defined in line 245; used 1 times
A_BACKTICK defined in line 241; never used
A_CMD defined in line 236; never used
A_DOUBLE defined in line 240; never used
A_EXPR defined in line 235; used 1 times
A_LEXPR defined in line 244; never used
A_LVAL defined in line 238; used 3 times
A_NULL defined in line 234; used 2 times
A_NUMBER defined in line 246; never used
A_READ defined in line 242; never used
A_SINGLE defined in line 239; used 1 times
A_SPAT defined in line 243; never used
A_STAB defined in line 237; used 41 times
MAXO defined in line 118; used 1 times
Nullarg defined in line 308; used 161 times
O_CHDIR defined in line 70; used 1 times
O_CHMOD defined in line 108; used 1 times
O_CHOWN defined in line 109; used 1 times
O_CRYPT defined in line 89; used 1 times
O_DIE defined in line 71; used 1 times
O_EACH defined in line 101; used 1 times
O_EVAL defined in line 117; used 1 times
O_EXEC defined in line 104; used 1 times
O_EXIT defined in line 72; used 1 times
O_EXP defined in line 90; used 1 times
O_FORK defined in line 103; used 1 times
O_GMTIME defined in line 87; used 1 times
O_GOTO defined in line 82; used 1 times
O_HEX defined in line 107; used 1 times
O_INDEX defined in line 83; used 1 times
O_INT defined in line 93; used 1 times
O_ITEM2 defined in line 14; used 4 times
O_ITEM3 defined in line 15; used 2 times
O_KEYS defined in line 99; used 2 times
O_KILL defined in line 110; used 1 times
O_LARRAY defined in line 52; used 1 times
O_LAST defined in line 79; used 1 times
O_LENGTH defined in line 58; used 1 times
O_LHASH defined in line 53; used 1 times
O_LINK defined in line 115; used 1 times
O_LOCALTIME defined in line 86; used 1 times
O_LOG defined in line 91; used 1 times
O_NEXT defined in line 80; used 1 times
O_NSUBST defined in line 20; used 1 times
O_NTRANS defined in line 48; used 1 times
O_NULL defined in line 12; never used
O_OCT defined in line 106; used 1 times
O_ORD defined in line 95; used 1 times
O_PRINT defined in line 69; used 2 times
O_PRTF defined in line 94; used 2 times
O_PUSH defined in line 54; used 1 times
O_REDO defined in line 81; used 1 times
O_RENAME defined in line 111; used 1 times
O_RESET defined in line 73; used 1 times
O_SELECT defined in line 75; used 2 times
O_SLEEP defined in line 96; used 1 times
O_SPLIT defined in line 57; used 1 times
O_SQRT defined in line 92; used 1 times
O_SUBST defined in line 19; used 1 times
O_SUBSTR defined in line 60; used 1 times
O_SYSTEM defined in line 105; used 1 times
O_TIME defined in line 84; used 1 times
O_TMS defined in line 85; used 1 times
O_TRANS defined in line 47; used 1 times
O_UMASK defined in line 113; used 1 times
O_UNLINK defined in line 112; used 1 times
O_UNSHIFT defined in line 114; used 1 times
O_VALUES defined in line 100; used 1 times

Usage of this include

Last modified: 2002-12-19
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 5009
Valid CSS Valid XHTML 1.0 Strict