void generateAddrModeClasses() throws IOException {

        setPrinter(newInterfacePrinter("addr", hashMapImport, null,
                tr("The <code>$addr</code> class represents an addressing mode for this architecture. An " +
                "addressing mode fixes the number and type of operands, the syntax, and the encoding format " +
                "of the instruction.")));

        println("public void accept($instr i, $addrvisitor v);");

        for ( AddrModeSetDecl as : arch.addrSets ) {
            startblock("public interface $1 extends $addr", as.name);
            for ( AddrModeDecl.Operand o : as.unionOperands )
                println("public $operand get_$1();", o.name);
            endblock();
        }

        List<AddrModeDecl> list = new LinkedList<AddrModeDecl>();
        for ( AddrModeDecl am : arch.addrModes ) list.add(am);
        for ( InstrDecl id : arch.instructions ) {
            // for each addressing mode declared locally
            if ( id.addrMode.localDecl != null && DGUtil.addrModeClassExists(id) )
                list.add(id.addrMode.localDecl);
        }
        for ( AddrModeDecl am : list ) emitAddrMode(am);
        endblock();
        close();

        emitAddrModeVisitor(list);
    }