private void forproc(){
        mustbe(TK.FOR);
        gcprint("for(");
        String id = tok.string;
        Entry iv = null; // index variable in symtab
        if( is(TK.ID) ) {
            iv = lvalue_id(tok.string, tok.lineNumber);
            iv.setIsIV(true); // mark Entry as IV
            scan();
        }
        else {
            parse_error("missing id on left-hand-side of assignment in for");
        }
        mustbe(TK.ASSIGN);
        gcprint("=");
        expression();
        gcprint(";");
        boolean up = true;
        if( is(TK.TO) ) {
            up = true;
        }
        else if( is(TK.DOWNTO) ) {
            up = false;
        }
        else
            parse_error("for statement is missing to/downto");
        scan();
        gcprintid(id);
        gcprint(up?"<=":">=");
        expression();
        mustbe(TK.DO);
        gcprint(";");
        gcprintid(id);
        gcprint(up?"++)":"--)");
        block();
        mustbe(TK.END);
        iv.setIsIV(false); // mark Entry as no longer IV
    }