Lines Matching refs:enum
133 elif child.tag in ['enum', 'feature']:
196 (type/group/enum/command/API/extension).
231 infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' /
234 if infoName == 'enum':
253 # The same enum cannot extend two different types
256 # Non-<enum>s should never be redefined
281 in an <enums> block, generally corresponding to a C "enum" type."""
288 """Registry information about an enum"""
293 """numeric type of the value of the <enum> tag
434 "dictionary of EnumInfo objects keyed by enum name"
511 - elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>`/`<spirvextension>`/`<spirvcapability>`/`<format>`/`<syncstage>`/`<syncaccess>`/`<syncpipeline>` Element
513 - infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' / 'spirvextension' / 'spirvcapability' / 'format' / 'syncstage' / 'syncaccess' / 'syncpipeline'
514 - dictionary - self.{type|group|enum|cmd|api|ext|format|spirvext|spirvcap|sync}dict
535 - fname - name of type / enum / command
536 - dictionary - self.{type|enum|cmd}dict"""
591 # Create dictionary of registry enum groups from <enums> tags.
595 # enum type definition - it is just a container for <enum> tags.
600 # Create dictionary of registry enums from <enum> tags
605 # Required <enum> attributes: 'name', 'value'
606 # For containing <enums> which have type="enum" or type="bitmask",
607 # tag all contained <enum>s are required. This is a stopgap until
612 for enum in enums.findall('enum'):
613 enumInfo = EnumInfo(enum)
615 self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
673 # When seen here, the <enum> element, processed to contain the
674 # numeric enum value, is added to the corresponding <enums>
675 # element, as well as adding to the enum dictionary. It is no
677 # Instead, generateRequiredInterface ignores <enum> elements
680 # For <enum> tags which are actually just constants, if there is
686 for enum in elem.findall('enum'):
688 groupName = enum.get('extends')
690 # self.gen.logMsg('diag', 'Found extension enum',
691 # enum.get('name'))
692 # Add version number attribute to the <enum> element
693 enum.set('version', featureInfo.version)
699 gi.elem.append(copy.deepcopy(enum))
702 groupName, 'for enum', enum.get('name'), 'found.')
704 format_name = enum.get('name')
705 if enum.get('alias'):
706 format_name = enum.get('alias')
709 elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
710 # self.gen.logMsg('diag', 'Adding extension constant "enum"',
711 # enum.get('name'))
714 enumInfo = EnumInfo(enum)
715 self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
733 for enum in elem.findall('enum'):
735 groupName = enum.get('extends')
737 # self.gen.logMsg('diag', 'Found extension enum',
738 # enum.get('name'))
741 # the <enum> element unless specified explicitly, such
742 # as when redefining an enum in another extension.
743 extnumber = enum.get('extnumber')
745 enum.set('extnumber', str(featureInfo.number))
747 enum.set('extname', featureInfo.name)
748 enum.set('supported', noneStr(featureInfo.supported))
754 gi.elem.append(copy.deepcopy(enum))
757 groupName, 'for enum', enum.get('name'), 'found.')
760 format_name = enum.get('name')
761 if enum.get('alias'):
762 format_name = enum.get('alias')
768 stage_flag = enum.get('name')
769 if enum.get('alias'):
770 stage_flag = enum.get('alias')
777 access_flag = enum.get('name')
778 if enum.get('alias'):
779 access_flag = enum.get('alias')
787 elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
788 # self.gen.logMsg('diag', 'Adding extension constant "enum"',
789 # enum.get('name'))
792 enumInfo = EnumInfo(enum)
793 self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
836 Truncates type / enum / command elements to maxlen characters (default 120)"""
912 # <member><name>member</name>[<enum>MEMBER_SIZE</enum>]</member>
913 for subenum in typeinfo.elem.findall('.//enum'):
914 self.gen.logMsg('diag', 'markRequired: type requires dependent <enum>', subenum.text)
933 """Mark an enum as required or not.
935 - enumname - name of enum
938 self.gen.logMsg('diag', 'markEnumRequired: tagging enum:', enumname, '-> required =', required)
939 enum = self.lookupElementInfo(enumname, self.enumdict)
940 if enum is not None:
941 # If the enum is part of a group, and is being removed, then
946 groupName = enum.elem.get('extends')
948 self.gen.logMsg('diag', f'markEnumRequired: Removing extending enum {enum.elem.get("name")}')
953 gienum = gi.elem.find("enum[@name='" + enumname + "']")
955 # Remove copy of this enum from the group
958 self.gen.logMsg('warn', 'markEnumRequired: Cannot remove enum',
962 self.gen.logMsg('warn', 'markEnumRequired: Cannot remove enum',
966 # This enum is not an extending enum.
970 enumName = enum.elem.get('name')
972 self.gen.logMsg('diag', f'markEnumRequired: Removing non-extending enum {enumName}')
976 for thisEnum in enums.findall('enum'):
985 enum.required = required
986 # Tag enum dependencies in 'alias' attribute as required
987 depname = enum.elem.get('alias')
989 self.gen.logMsg('diag', 'markEnumRequired: Generating dependent enum',
990 depname, 'for alias', enumname, 'required =', enum.required)
1008 # actual C language aliases like type and enum aliases. Instead
1048 for enumElem in feature.findall('enum'):
1121 "enum": {},
1170 for enumElem in require.findall('enum'):
1176 if not self.checkForCorrectionAliases(alias, require, 'enum'):
1245 """Generate a single type / enum group / enum / command,
1248 - fname - name of feature (`<type>`/`<enum>`/`<command>`)
1249 - ftype - type of feature, 'type' | 'enum' | 'command'
1250 - dictionary - of *Info objects - self.{type|enum|cmd}dict
1286 # embedded <type> and <enum> tags within the element.
1289 # have a uint64 enum, it should require that type).
1314 # <member><name>member</name>[<enum>MEMBER_SIZE</enum>]</member>
1315 for subtype in f.elem.findall('.//enum'):
1316 self.gen.logMsg('diag', 'Generating required dependent <enum>',
1318 self.generateFeature(subtype.text, 'enum', self.enumdict)
1320 # If the type is an enum group, look up the corresponding
1322 if f.elem.get('category') == 'enum':
1323 self.gen.logMsg('diag', 'Type', fname, 'is an enum group, so generate that instead')
1335 self.gen.logMsg('warn', 'Skipping enum type', fname,
1342 # @ The enum group is not ready for generation. At this
1343 # @ point, it contains all <enum> tags injected by
1347 # @ definitions of an <enum>.
1349 # @ Pass over each enum, marking its enumdict[] entry as
1353 enums = group.elem.findall('enum')
1368 # 'supported' attribute was injected when the <enum> element was
1408 elif ftype == 'enum':
1409 # Generate enum dependencies in 'alias' attribute
1411 self.generateFeature(alias, 'enum', self.enumdict)
1425 self.gen.logMsg('diag', 'Generating required bitvalues <enum>',
1438 for e in features.findall('enum'):
1439 # If this is an enum extending an enumerated type, do not
1444 self.generateFeature(e.get('name'), 'enum', self.enumdict, explicit=True)
1769 """Reset type/enum/command dictionaries before generating another API.
1774 for enum in self.enumdict:
1775 self.enumdict[enum].resetState()