def dump(self): print("%s(%s)::" % (self.name, self.operand)) for (v, p) in self.value_string_pairs: if genutil.is_stringish(p): print("%s '%s'" % (hex(v), p)) else: print("%s error" % (hex(v)))
def non_binary_fixed_number(self): "Returns True if this operand is a decimal number" if type(self.bits) == list: if (len(self.bits) == 1 and operand_info_t.decimal_number_pattern.match(self.bits[0])): return True elif genutil.is_stringish(self.bits): if operand_info_t.decimal_number_pattern.match(self.bits): return True return False
def emit_init(self): lines = [] self.string_table_name = 'xed_convert_table_%s' % (self.name) lines.append('static const char* %s[] = {' % (self.string_table_name)) for (v, p) in self.value_string_pairs: if genutil.is_stringish(p): lines.append('/*%s*/ "%s",' % (hex(v), p)) else: lines.append('/*%s*/ 0, /* error */' % (hex(v))) lines.append('};') return lines