Annotation of 41BSD/cmd/apl/tab.c, revision 1.1.1.1

1.1       root        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:        "csh",          comnull,        CSH,
                    143:        "debug",        comnull,        DEBUG,
                    144:        "digits",       comexpr,        DIGITS,
                    145:        "drop",         comnam,         DROPC,
                    146:        "edit",         comnam,         ED_IT,
                    147:        "ex",           comnam,         EX_IT,
                    148:        "erase",        comnam,         ERASE,
                    149:        "fns",          comnull,        FNS,
                    150:        "fuzz",         comexpr,        FUZZ,
                    151:        "lib",          comnull,        LIB,
                    152:        "load",         comnam,         LOAD,
                    153:        "off",          comnull,        OFF,
                    154:        "origin",       comexpr,        ORIGIN,
                    155:        "read",         comnam,         READ,
                    156:        "save",         comnam,         SAVE,
                    157:        "vars",         comnull,        VARS,
                    158:        "vi",           comnam,         EX_VI,
                    159:        "width",        comexpr,        WIDTH,
                    160: #ifdef SOMED
                    161:        "symbols",      comnull,        SYMBOLS,
                    162: #endif
                    163:        0,              unk
                    164: };
                    165:        struct charbox  chartab[] =
                    166: {
                    167:        '/','_',
                    168:        '?','_',
                    169:        'K','L',
                    170:        'L','O',
                    171:        'C','J',
                    172:        ')','T',
                    173:        '(','T',
                    174:        'O','P',
                    175:        '.','K',
                    176:        'O','_',
                    177:        '?','O',
                    178:        'B','N',
                    179:        '+','L',
                    180:        'H','M',
                    181:        'G','M',
                    182:        'M','O',
                    183:        'F','a',
                    184:        'F','b',
                    185:        'F','c',
                    186:        'F','d',
                    187:        'F','e',
                    188:        'F','f',
                    189:        'F','g',
                    190:        'F','h',
                    191:        'F','i',
                    192:        'F','j',
                    193:        'F','k',
                    194:        'F','l',
                    195:        'F','m',
                    196:        'F','n',
                    197:        'F','o',
                    198:        'F','p',
                    199:        'F','q',
                    200:        'F','r',
                    201:        'F','s',
                    202:        'F','t',
                    203:        'F','u',
                    204:        'F','v',
                    205:        'F','w',
                    206:        'F','x',
                    207:        'F','y',
                    208:        'F','z'
                    209: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.