private void typeCheckAccessMethods() {
        Environment env = arch.globalEnv;
        // first step: resolve all read methods by type
        JIGIRTypeEnv te = arch.typeEnv;
        for ( OperandTypeDecl ot: arch.operandTypes ) {
            for ( OperandTypeDecl.AccessMethod m : ot.readDecls )
                ot.readAccessors.put(resolveAccessMethodType(m, te), m);
            for ( OperandTypeDecl.AccessMethod m : ot.writeDecls )
                ot.writeAccessors.put(resolveAccessMethodType(m, te), m);
        }
        // now typecheck the bodies
        for ( OperandTypeDecl ot: arch.operandTypes ) {
            // add each of the sub operands to the environment
            Environment oenv = new Environment(env);
            oenv.addVariable("this", operandRepresentationType(ot));
            for ( AddrModeDecl.Operand o : ot.subOperands ) {
                o.typeRef.resolve(arch.typeEnv);
                oenv.addDecl(o);
            }

            for ( OperandTypeDecl.AccessMethod m : ot.readDecls ) {
                typeCheck(m.code.getStmts(), resolveAccessMethodType(m, arch.typeEnv), new Environment(oenv));
            }
            for ( OperandTypeDecl.AccessMethod m : ot.writeDecls ) {
                Environment senv = new Environment(oenv);
                senv.addVariable("value", resolveAccessMethodType(m, arch.typeEnv));
                typeCheck(m.code.getStmts(), null, senv);
            }
        }

    }