Annotation of coherent/b/bin/c/n0/locals.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * C compiler.
        !             3:  * Local variable declarations.
        !             4:  */
        !             5: #ifdef   vax
        !             6: #include "INC$LIB:cc0.h"
        !             7: #else
        !             8: #include "cc0.h"
        !             9: #endif
        !            10: 
        !            11: /*
        !            12:  * Read local variables.
        !            13:  * The correct lexic level is in "llex".
        !            14:  * The first token of the locals is in "s".
        !            15:  */
        !            16: locals()
        !            17: {
        !            18:        register SYM    *sp;
        !            19:        SYM             *nsp;
        !            20:        DIM             *dp, *ndp;
        !            21:        INFO            *ip;
        !            22:        int             seg;
        !            23:        int             rf;
        !            24:        int             c, dc, t;
        !            25: 
        !            26:        for (;;) {
        !            27:                gcandt(&c, &t, &dp, &ip, &rf);
        !            28:                if (c==C_NONE && t==T_NONE && rf==0)
        !            29:                        break;
        !            30:                if (s == SEMI) {
        !            31:                        lex();
        !            32:                        continue;
        !            33:                }
        !            34:                if (c == C_NONE)
        !            35:                        c = C_AUTO;
        !            36:                if (t == T_NONE)
        !            37:                        t = T_INT;
        !            38:                for (;;) {
        !            39:                        if (gdecl(&nsp, &ndp, dp, c, SL_VAR)) {
        !            40:                                sp = nsp;
        !            41:                                sp = declare(sp, c, t, ndp, ip, rf);
        !            42:                                if ((dc=sp->s_class) == C_SIN) {
        !            43:                                        seg = SPURE;
        !            44:                                        if ((rf&S_RONLY) == 0) {
        !            45:                                                if (s == ASSIGN)
        !            46:                                                        seg = SDATA;
        !            47:                                                else
        !            48:                                                        seg = SBSS;
        !            49:                                        }
        !            50:                                        newseg(seg);
        !            51:                                        align(sp);
        !            52:                                        sp->s_value = here();
        !            53:                                        sp->s_seg = seg;
        !            54:                                        if (s == ASSIGN) {
        !            55:                                                lex();
        !            56:                                                putautos();
        !            57:                                                init(sp, sp->s_dp, (sizeof_t)0, 1);
        !            58:                                        } else {
        !            59:                                                bput(BLOCK);
        !            60:                                                zput(ssize(sp));
        !            61:                                        }
        !            62:                                        newseg(SCODE);
        !            63:                                }
        !            64:                                if (dc==C_AUTO || dc==C_REG) {
        !            65:                                        bindlocal(sp);
        !            66:                                        if (s == ASSIGN) {
        !            67:                                                lex();
        !            68:                                                putautos();
        !            69:                                                init(sp, sp->s_dp, (sizeof_t)0, 0);
        !            70:                                        }
        !            71:                                }
        !            72: #ifdef KLUDGE
        !            73:                                if (dc == C_GREF) {
        !            74:                                        bput(SGUESS);
        !            75:                                        nput(sp->s_id);
        !            76:                                        if (isfunc(sp))
        !            77:                                                bput(SCODE);
        !            78:                                        else
        !            79:                                                bput(SDATA);
        !            80:                                }
        !            81: #endif
        !            82:                        }
        !            83:                        dblocal(sp);
        !            84:                        if (s != COMMA)
        !            85:                                break;
        !            86:                        lex();
        !            87:                }
        !            88:                xdropinfo(t, ip);
        !            89:                mustbe(SEMI);
        !            90:        }
        !            91: }

unix.superglobalmegacorp.com

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