Lines Matching refs:attrs

297     def __init__(self, parser, name, attrs):
301 self.explicit_size = int(attrs["size"]) if "size" in attrs else 0
303 self.align = int(attrs["align"]) if "align" in attrs else None
324 def add_section(self, type_name, attrs):
325 assert("name" in attrs)
326 section = self.Section(safe_name(attrs["name"]).lower())
327 section.human_name = attrs["name"]
328 section.offset = int(attrs["offset"])
330 section.type = self.parser.structs[attrs["type"]]
335 def __init__(self, parser, attrs):
337 if "name" in attrs:
338 self.name = safe_name(attrs["name"]).lower()
339 self.human_name = attrs["name"]
341 if ":" in str(attrs["start"]):
342 (word, bit) = attrs["start"].split(":")
345 self.start = int(attrs["start"])
347 self.end = self.start + int(attrs["size"]) - 1
348 self.type = attrs["type"]
353 if "prefix" in attrs:
354 self.prefix = safe_name(attrs["prefix"]).upper()
358 if "exact" in attrs:
359 self.exact = int(attrs["exact"])
363 self.default = attrs.get("default")
369 self.modifier = parse_modifier(attrs.get("modifier"))
676 def __init__(self, attrs):
677 self.name = attrs["name"]
678 self.value = int(attrs["value"], 0)
696 def start_element(self, name, attrs):
699 if "arch" in attrs:
700 arch = int(attrs["arch"])
706 name = attrs["name"]
707 self.no_direct_packing = attrs.get("no-direct-packing", False)
712 if "size" in attrs:
713 self.group.length = int(attrs["size"]) * 4
714 self.group.align = int(attrs["align"]) if "align" in attrs else None
715 self.structs[attrs["name"]] = self.group
717 self.group.fields.append(Field(self, attrs))
721 self.enum = safe_name(attrs["name"])
722 self.enums.add(attrs["name"])
723 if "prefix" in attrs:
724 self.prefix = attrs["prefix"]
728 self.values.append(Value(attrs))
730 aggregate_name = self.gen_prefix(safe_name(attrs["name"].upper()))
731 self.aggregate = Aggregate(self, aggregate_name, attrs)
732 self.aggregates[attrs['name']] = self.aggregate
734 type_name = self.gen_prefix(safe_name(attrs["type"].upper()))
735 self.aggregate.add_section(type_name, attrs)