def generate_instructions(self, instructions, outpath):
    try:
        logger.info(('Generating Rust instruction accessors to: ' + str(outpath)))
        for inst in instructions:
            outfile_path = os.path.join(outpath, (inst.name.lower() + '.rs'))
            outfile_path = os.path.abspath(outfile_path)
            with open(outfile_path, 'w') as outfile:
                self._generate_instruction(outfile, inst)
        self.__update_module_files(outpath)
        self.__update_lib_file(outpath)
    except Exception as e:
        msg = '{g} failed to generate output {out}: {exception}'.format(g=str(type(self).__name__), out=outpath, exception=e)
        raise PalGeneratorException(msg)
def generate_instructions(self, instructions, outpath):
    try:
        logger.info(('Generating Rust instruction accessors to: ' + str(outpath)))
        for inst in instructions:
            outfile_path = os.path.join(outpath, (inst.name.lower() + '.rs'))
            outfile_path = os.path.abspath(outfile_path)
            with open(outfile_path, 'w') as outfile:
                self._generate_instruction(outfile, inst)
        self.__update_module_files(outpath)
        self.__update_lib_file(outpath)
    except Exception as e:
        msg = '{g} failed to generate output {out}: {exception}'.format(g=str(type(self).__name__), out=outpath, exception=e)
        raise PalGeneratorException(msg)