def __str__(self): raise RuntimeError("oh no you di'int") s = uop_to_py(self) if not is_jcc(self.op): s += " # %s" % repr(self) if self.is_output: s += "\n" + uop_to_py_out(self, self.label) return s
def to_py(self): loop_statements = [ "while 1:" ] for i,insn in self.exemplar.body: if insn == self.condition: loop_statements.append( " if %s (%s): break" % ("" if self.taken else "not", uop_to_py(self.condition)) ) else: for line in str(insn).splitlines(): loop_statements.append(" " + line + " # %s" % repr(insn)) return "\n".join(loop_statements)
def to_py(self): loop_statements = ["while 1:"] for i, insn in self.exemplar.body: if insn == self.condition: loop_statements.append( " if %s (%s): break" % ("" if self.taken else "not", uop_to_py(self.condition))) else: for line in str(insn).splitlines(): loop_statements.append(" " + line + " # %s" % repr(insn)) return "\n".join(loop_statements)
def tr(op): s = uop_to_py(op) if not is_jcc(op.op): s += " # %s" % repr(op) if op.is_output: s += "\n" + uop_to_py_out(op, "out") return s