Annotation of researchv8dc/cmd/qed/address.c, revision 1.1

1.1     ! root        1: /*% cc -c -O %
        !             2:  */
        !             3: #include "vars.h"
        !             4: int *
        !             5: address()
        !             6: {
        !             7:        register int sign, *a;
        !             8:        int opcnt, nextopand, *b;
        !             9:        register c;
        !            10: 
        !            11:        nextopand = -1;
        !            12:        sign = 1;
        !            13:        opcnt = 0;
        !            14:        a = dot;
        !            15:        do {
        !            16:                do c = getchar(); while (c==' ' || c=='\t');
        !            17:                if ('0'<=c && c<='9') {
        !            18:                        peekc = c;
        !            19:                        if (!opcnt)
        !            20:                                a = zero;
        !            21:                        a += sign*getnum();
        !            22:                } else switch (c) {
        !            23:                case '$':
        !            24:                        a = dol;
        !            25:                        /* fall through */
        !            26:                case '.':
        !            27:                        if (opcnt)
        !            28:                                error('a');
        !            29:                        break;
        !            30:                case '\'':
        !            31:                        c = getchar();
        !            32:                        if (opcnt)
        !            33:                                error('a');
        !            34:                        if(posn(c, bname)<0)
        !            35:                                error('k');
        !            36:                        a = zero;
        !            37:                        c = posn(c, bname);     /* outside loop for efficiency */
        !            38:                        do a++; while (a<=dol && names[c]!=(*a|01));
        !            39:                        break;
        !            40:                case '?':
        !            41:                        sign = -sign;
        !            42:                        /* fall through */
        !            43:                case '/':
        !            44:                        compile(c);
        !            45:                        b = a;
        !            46:                        for (;;) {
        !            47:                                a += sign;
        !            48:                                if (a<zero)
        !            49:                                        a = dol;
        !            50:                                if (a>dol)
        !            51:                                        a = zero;
        !            52:                                if (execute(a))
        !            53:                                        break;
        !            54:                                if (a==b)
        !            55:                                        error('/');
        !            56:                        }
        !            57:                        break;
        !            58:                default:
        !            59:                        if (nextopand == opcnt) {
        !            60:                                a += sign;
        !            61:                                if (a<zero || dol<a)
        !            62:                                        continue;       /* error('$'); */
        !            63:                        }
        !            64:                        if (c!='+' && c!='-' && c!='^') {
        !            65:                                peekc = c;
        !            66:                                if (opcnt==0)
        !            67:                                        a = 0;
        !            68:                                return (a);
        !            69:                        }
        !            70:                        sign = 1;
        !            71:                        if (c!='+')
        !            72:                                sign = -sign;
        !            73:                        nextopand = ++opcnt;
        !            74:                        continue;
        !            75:                }
        !            76:                sign = 1;
        !            77:                opcnt++;
        !            78:        } while (zero<=a && a<=dol);
        !            79:        error('$');
        !            80:        /*NOTREACHED*/
        !            81: }

unix.superglobalmegacorp.com

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