Lines Matching defs:attrs

281 	def __init__(self, attrs, domain, variant, parent, index_type):
282 if "name" in attrs:
283 self.local_name = attrs["name"]
293 if "offsets" in attrs:
294 self.offsets = map(lambda i: "0x%08x" % int(i, 0), attrs["offsets"].split(","))
296 elif "doffsets" in attrs:
297 self.offsets = map(lambda s: "(%s)" % s , attrs["doffsets"].split(","))
300 self.offset = int(attrs["offset"], 0)
301 self.stride = int(attrs["stride"], 0)
303 if "index" in attrs:
307 self.length = int(attrs["length"], 0)
308 if "usage" in attrs:
309 self.usages = attrs["usage"].split(',')
367 def __init__(self, attrs, domain, array, bit_size):
368 self.name = attrs["name"]
371 self.offset = int(attrs["offset"], 0)
377 if "stride" in attrs:
378 self.stride = int(attrs["stride"], 0)
379 self.length = int(attrs["length"], 0)
465 def parse_field(self, name, attrs):
467 if "pos" in attrs:
468 high = low = int(attrs["pos"], 0)
469 elif "high" in attrs and "low" in attrs:
470 high = int(attrs["high"], 0)
471 low = int(attrs["low"], 0)
476 if "type" in attrs:
477 type = attrs["type"]
481 if "shr" in attrs:
482 shr = int(attrs["shr"], 0)
489 b.radix = int(attrs["radix"], 0)
495 def parse_varset(self, attrs):
498 if "varset" in attrs:
499 varset = self.enums[attrs["varset"]]
502 def parse_variants(self, attrs):
503 if not "variants" in attrs:
505 variant = attrs["variants"].split(",")[0]
509 varset = self.parse_varset(attrs)
515 def add_all_variants(self, reg, attrs, parent_variant):
519 variant = self.parse_variants(attrs)
602 def parse_reg(self, attrs, bit_size):
604 if "type" in attrs and attrs["type"] in self.bitsets:
605 bitset = self.bitsets[attrs["type"]]
607 self.current_bitset = Bitset(attrs["name"], bitset)
612 self.current_bitset = Bitset(attrs["name"], None)
614 if "type" in attrs:
615 self.parse_field(None, attrs)
617 variant = self.parse_variants(attrs)
621 self.current_reg = Reg(attrs, self.prefix(variant), self.current_array, bit_size)
628 self.add_all_variants(self.current_reg, attrs, variant)
631 if "usage" in attrs:
632 usages = attrs["usage"].split(',')
638 def start_element(self, name, attrs):
641 filename = attrs["file"]
644 self.current_domain = attrs["name"]
645 if "prefix" in attrs:
646 self.current_prefix = self.parse_variants(attrs)
647 self.current_prefix_type = attrs["prefix"]
651 if "varset" in attrs:
652 self.current_varset = self.enums[attrs["varset"]]
654 self.current_stripe = self.parse_variants(attrs)
657 self.current_enum = Enum(attrs["name"])
658 self.enums[attrs["name"]] = self.current_enum
662 if "value" in attrs:
663 value = int(attrs["value"], 0)
666 self.current_enum.values.append((attrs["name"], value))
668 self.parse_reg(attrs, 32)
670 self.parse_reg(attrs, 64)
673 variant = self.parse_variants(attrs)
674 index_type = self.enums[attrs["index"]] if "index" in attrs else None
675 self.current_array = Array(attrs, self.prefix(variant), variant, self.current_array, index_type)
679 self.current_bitset = Bitset(attrs["name"], None)
680 if "inline" in attrs and attrs["inline"] == "yes":
686 self.parse_field(attrs["name"], attrs)
688 self.do_validate(attrs["xsi:schemaLocation"])
690 self.copyright_year = attrs["year"]
692 self.authors.append(attrs["name"] + " <" + attrs["email"] + "> " + attrs["name"])