|
|
1.1 ! root 1: /* Copyright (c) 1982 Regents of the University of California */ ! 2: ! 3: /* static char sccsid[] = "@(#)opinfo.h 1.3 1/18/82"; */ ! 4: ! 5: /* ! 6: * Tree operator definitions. ! 7: */ ! 8: ! 9: struct opinfo { ! 10: short opflags; ! 11: char *opstring; ! 12: }; ! 13: ! 14: OPINFO opinfo[]; ! 15: ! 16: #define O_NOP 0 /* no op */ ! 17: #define O_NAME 1 /* leaf op for address of a variable */ ! 18: #define O_QNAME 2 /* variable qualified by surrounding block */ ! 19: #define O_LCON 3 /* long constant (i.e. integer) */ ! 20: #define O_FCON 4 /* floating constant (i.e. real) */ ! 21: #define O_SCON 5 /* string constant (type alfa) */ ! 22: #define O_INDEX 6 /* array subscript (does just one index) */ ! 23: #define O_INDIR 7 /* indirection through a pointer */ ! 24: #define O_RVAL 8 /* get value of an operand address */ ! 25: #define O_COMMA 9 /* as in parameter lists */ ! 26: ! 27: /* ! 28: * arithmetic operators ! 29: */ ! 30: ! 31: #define O_ITOF 10 /* convert integer to real */ ! 32: #define O_ADD 11 ! 33: #define O_ADDF 12 ! 34: #define O_SUB 13 ! 35: #define O_SUBF 14 ! 36: #define O_NEG 15 ! 37: #define O_NEGF 16 ! 38: #define O_MUL 17 ! 39: #define O_MULF 18 ! 40: #define O_DIVF 19 /* real divided by real */ ! 41: #define O_DIV 20 /* integer divided by integer, integer result */ ! 42: #define O_MOD 21 ! 43: ! 44: /* ! 45: * logical operators ! 46: */ ! 47: ! 48: #define O_AND 22 ! 49: #define O_OR 23 ! 50: ! 51: /* ! 52: * relational operators ! 53: */ ! 54: ! 55: #define O_LT 24 ! 56: #define O_LTF 25 ! 57: #define O_LE 26 ! 58: #define O_LEF 27 ! 59: #define O_GT 28 ! 60: #define O_GTF 29 ! 61: #define O_GE 30 ! 62: #define O_GEF 31 ! 63: #define O_EQ 32 ! 64: #define O_EQF 33 ! 65: #define O_NE 34 ! 66: #define O_NEF 35 ! 67: ! 68: /* ! 69: * debugger commands ! 70: */ ! 71: ! 72: #define O_ASSIGN 36 ! 73: #define O_CHFILE 37 ! 74: #define O_CONT 38 ! 75: #define O_LIST 39 ! 76: #define O_NEXT 40 ! 77: #define O_PRINT 41 ! 78: #define O_STEP 42 ! 79: #define O_WHATIS 43 ! 80: #define O_WHERE 44 ! 81: #define O_XI 45 ! 82: #define O_XD 46 ! 83: #define O_CALL 47 ! 84: #define O_EDIT 48 ! 85: #define O_DUMP 49 ! 86: #define O_HELP 50 ! 87: #define O_REMAKE 51 ! 88: #define O_RUN 52 ! 89: #define O_SOURCE 53 ! 90: #define O_STATUS 54 ! 91: #define O_TRACE 55 ! 92: #define O_TRACEI 56 ! 93: #define O_STOP 57 ! 94: #define O_STOPI 58 ! 95: #define O_DELETE 59 ! 96: #define O_WHICH 60 ! 97: #define O_QLINE 61 /* filename : linenumber */ ! 98: #define O_ALIAS 62 ! 99: #define O_GRIPE 63 ! 100: ! 101: #define O_LASTOP 63 /* must be number of last operator */ ! 102: ! 103: /* ! 104: * operator flags and predicates ! 105: */ ! 106: ! 107: #define LEAF 01 ! 108: #define UNARY 02 ! 109: #define BINARY 04 ! 110: #define BOOL 010 ! 111: #define REALOP 020 ! 112: #define INTOP 040 ! 113: ! 114: #define isbitset(a, m) ((a&m) == m) ! 115: #define isleaf(o) isbitset(opinfo[o].opflags, LEAF) ! 116: #define isunary(o) isbitset(opinfo[o].opflags, UNARY) ! 117: #define isbinary(o) isbitset(opinfo[o].opflags, BINARY) ! 118: #define isreal(o) isbitset(opinfo[o].opflags, REALOP) ! 119: #define isint(o) isbitset(opinfo[o].opflags, INTOP) ! 120: #define isboolean(o) isbitset(opinfo[o].opflags, BOOL) ! 121: ! 122: #define degree(o) (opinfo[o].opflags&(LEAF|UNARY|BINARY))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.