Lines Matching refs:field

415         field types. See AddDependency() for more details.
630 """Adds a field for this struct.
633 field_type: The type of the field.
634 field_name: The name of the field.
642 field types, which are implicit dependencies. For example, a field like
660 """Creates a set which holds all current field types.
663 A set of field types.
665 return set([field[0] for field in self.fields])
710 for field in self.fields:
711 out_file.write(self._STRUCTURE_FIELD % {'type': field[0],
712 'name': field[1]})
745 for field in self.fields:
746 if self._ARRAY_FIELD_RE.search(field[1]):
747 self._OutputArrayField(out_file, field, self._SERIALIZE_FIELD_ARRAY)
748 elif self._UNION_TYPE_RE.search(field[0]):
749 self._OutputUnionField(out_file, field,
752 out_file.write(self._SERIALIZE_FIELD % {'type': field[0],
753 'name': field[1]})
756 for field in self.fields:
757 if self._ARRAY_FIELD_RE.search(field[1]):
758 self._OutputArrayField(out_file, field, self._PARSE_FIELD_ARRAY)
759 elif self._UNION_TYPE_RE.search(field[0]):
760 self._OutputUnionField(out_file, field, self._PARSE_FIELD_WITH_SELECTOR)
762 out_file.write(self._PARSE_FIELD % {'type': field[0],
763 'name': field[1]})
781 This is more complex than the struct case because only one field of the
784 of looking for a field which specifies the count.
841 def _OutputUnionField(self, out_file, field, code_format):
842 """Writes serialize / parse code for a union field.
844 In this case |self| may not necessarily represent a union but |field| does.
845 This requires that a field of an acceptable selector type appear somewhere
846 in the struct. The value of this field is used as the selector value when
851 field: The union field to be processed as a (type, name) tuple.
854 selector_types = union_selectors.GetUnionSelectorTypes(field[0])
860 assert selector_name, 'Missing selector for %s in %s!' % (field[1],
862 out_file.write(code_format % {'type': field[0],
864 'name': field[1]})
866 def _OutputArrayField(self, out_file, field, code_format):
867 """Writes serialize / parse code for an array field.
869 The allocated size of the array is ignored and a field which holds the
871 represented by the value of that count field are serialized / parsed.
875 field: The array field to be processed as a (type, name) tuple.
878 field_name = self._ARRAY_FIELD_RE.search(field[1]).group(1)
880 assert count_field != field, ('Missing count field for %s in %s!' %
881 (field[1], self.name))
884 'type': field[0],
1149 print('Invalid field type: %s' % self._line)
1156 print('Invalid field name: %s' % self._line)
1159 # If the field name includes 'sizeof(SOME_TYPE)', record the dependency