| 1 | #define B 0100000 |
| 2 | struct tab |
| 3 | { |
| 4 | int input; |
| 5 | int lexval; |
| 6 | int retval; |
| 7 | } tab[] = |
| 8 | { |
| 9 | /* |
| 10 | * one of a kind |
| 11 | */ |
| 12 | |
| 13 | ':', unk,lpar, |
| 14 | '"', unk,rpar, |
| 15 | ';', unk,lbkt, |
| 16 | '\'', unk,rbkt, |
| 17 | '/', COM,com, |
| 18 | 0200 , COM0,com0, |
| 19 | '?', EXD,com, |
| 20 | 0201 , EXD0,com0, |
| 21 | 'K', unk,strng, |
| 22 | 'J', unk,null, |
| 23 | '.', IPROD,dot, |
| 24 | 'L', QUAD,quad, |
| 25 | 0202 , QQUAD,quad, |
| 26 | 0203 , CQUAD,quad, |
| 27 | '<', unk,semi, |
| 28 | '>', unk,cln, |
| 29 | 0204 , COMNT,comnt, |
| 30 | 'C', COMNT,comnt, |
| 31 | ']', BRAN0,tran, |
| 32 | |
| 33 | /* |
| 34 | * dyadic scalars |
| 35 | * op2 op1 v (dyadic op) |
| 36 | */ |
| 37 | |
| 38 | '#', LT,dscal, |
| 39 | '&', GT,dscal, |
| 40 | '$', LE,dscal, |
| 41 | '^', GE,dscal, |
| 42 | '%', EQ,dscal, |
| 43 | '*', NE,dscal, |
| 44 | ')', AND,dscal, |
| 45 | '(', OR,dscal, |
| 46 | 0205 , NAND,dscal, |
| 47 | 0206 , NOR,dscal, |
| 48 | |
| 49 | /* |
| 50 | * monadic or dyadic scalars |
| 51 | * op2 op1 v (dyadic op) |
| 52 | * op1 v+1 (monadic op) |
| 53 | */ |
| 54 | |
| 55 | '-', ADD,mdscal, |
| 56 | '_', SUB,mdscal, |
| 57 | '=', MUL,mdscal, |
| 58 | '+', DIV,mdscal, |
| 59 | 'M', MOD,mdscal, |
| 60 | 'D', MIN,mdscal, |
| 61 | 'S', MAX,mdscal, |
| 62 | 'P', PWR,mdscal, |
| 63 | 0207 , LOG,mdscal, |
| 64 | 'O', CIR,mdscal, |
| 65 | 0210 , COMB,mdscal, |
| 66 | |
| 67 | /* |
| 68 | * monadic |
| 69 | * op1 v (monadic op) |
| 70 | */ |
| 71 | |
| 72 | 'T', NOT,m, |
| 73 | /* |
| 74 | * dyadic |
| 75 | * op2 op1 v (dyadic op) |
| 76 | */ |
| 77 | |
| 78 | 'N', REP,d, |
| 79 | 'Y', TAKE,d, |
| 80 | 'U', DROP,d, |
| 81 | '[', ASGN,asg, |
| 82 | |
| 83 | /* |
| 84 | * monadic or dyadic |
| 85 | * op2 op1 v (dyadic op) |
| 86 | * op1 v+1 (monadic op) |
| 87 | */ |
| 88 | |
| 89 | 'E', EPS,md, |
| 90 | 'B', BASE,md, |
| 91 | 'Q', DEAL,md, |
| 92 | 'R', DRHO,md, |
| 93 | 'I', DIOT,md, |
| 94 | 0211 , ROT0,md, |
| 95 | 0212 , DTRN,md, |
| 96 | 0213 , DIBM,md, |
| 97 | 0214 , DDOM,md, |
| 98 | |
| 99 | |
| 100 | |
| 101 | /* |
| 102 | * monadic with optional subscript |
| 103 | * op1 v (monadic op) |
| 104 | * op1 sub v+1 (subscripted monadic op) |
| 105 | */ |
| 106 | |
| 107 | 0215 , GDU,msub, |
| 108 | 0216 , GDD,msub, |
| 109 | |
| 110 | /* |
| 111 | * dyadic with optional subscript |
| 112 | * op2 op1 v (dyadic op) |
| 113 | * op2 op1 sub v+1 (subscripted dyadic op) |
| 114 | */ |
| 115 | |
| 116 | |
| 117 | /* |
| 118 | * monadic or dyadic with optional subscript |
| 119 | * op2 op1 v (dyadic op) |
| 120 | * op1 v+1 (monadic op) |
| 121 | * op2 op1 sub v+2 (subscripted dyadic op) |
| 122 | * op1 sub v+3 (subscripted monadic op) |
| 123 | */ |
| 124 | |
| 125 | 0217 , ROT,mdsub, |
| 126 | ',', CAT,mdsub, |
| 127 | |
| 128 | /* |
| 129 | * end of list |
| 130 | */ |
| 131 | |
| 132 | 0 |
| 133 | }; |
| 134 | |
| 135 | int comtab[] = |
| 136 | { |
| 137 | "ascii", comnull, ASCII, |
| 138 | "apl", comnull, APL, |
| 139 | "clear", comnull, CLEAR, |
| 140 | "continue", comnull, CONTIN, |
| 141 | "copy", comnam, COPY, |
| 142 | "debug", comnull, DEBUG, |
| 143 | "digits", comexpr, DIGITS, |
| 144 | "drop", comnam, DROPC, |
| 145 | "edit", comnam, ED_IT, |
| 146 | "ex", comnam, EX_IT, |
| 147 | "erase", comnam, ERASE, |
| 148 | "fns", comnull, FNS, |
| 149 | "fuzz", comexpr, FUZZ, |
| 150 | "lib", comnull, LIB, |
| 151 | "load", comnam, LOAD, |
| 152 | "off", comnull, OFF, |
| 153 | "origin", comexpr, ORIGIN, |
| 154 | "read", comnam, READ, |
| 155 | "save", comnam, SAVE, |
| 156 | "vars", comnull, VARS, |
| 157 | "vi", comnam, EX_VI, |
| 158 | "width", comexpr, WIDTH, |
| 159 | #ifdef SOMED |
| 160 | "symbols", comnull, SYMBOLS, |
| 161 | #endif |
| 162 | 0, unk |
| 163 | }; |
| 164 | struct charbox chartab[] = |
| 165 | { |
| 166 | '/','_', |
| 167 | '?','_', |
| 168 | 'K','L', |
| 169 | 'L','O', |
| 170 | 'C','J', |
| 171 | ')','T', |
| 172 | '(','T', |
| 173 | 'O','P', |
| 174 | '.','K', |
| 175 | 'O','_', |
| 176 | '?','O', |
| 177 | 'B','N', |
| 178 | '+','L', |
| 179 | 'H','M', |
| 180 | 'G','M', |
| 181 | 'M','O', |
| 182 | 'F','a', |
| 183 | 'F','b', |
| 184 | 'F','c', |
| 185 | 'F','d', |
| 186 | 'F','e', |
| 187 | 'F','f', |
| 188 | 'F','g', |
| 189 | 'F','h', |
| 190 | 'F','i', |
| 191 | 'F','j', |
| 192 | 'F','k', |
| 193 | 'F','l', |
| 194 | 'F','m', |
| 195 | 'F','n', |
| 196 | 'F','o', |
| 197 | 'F','p', |
| 198 | 'F','q', |
| 199 | 'F','r', |
| 200 | 'F','s', |
| 201 | 'F','t', |
| 202 | 'F','u', |
| 203 | 'F','v', |
| 204 | 'F','w', |
| 205 | 'F','x', |
| 206 | 'F','y', |
| 207 | 'F','z' |
| 208 | }; |