Lines Matching refs:self
16 def __init__(self, *args, **kwargs): argument
25 def __init__(self, argument
40 self.generator = generator
41 self.conventions = generator.genOpts.conventions
42 self.filename = filename
43 self.name = name
44 self.number = number
45 self.ext_type = ext_type
46 self.requires = requires
47 self.requiresCore = requiresCore
48 self.contact = contact
49 self.promotedTo = promotedTo
50 self.deprecatedBy = deprecatedBy
51 self.obsoletedBy = obsoletedBy
52 self.provisional = provisional
53 self.revision = revision
54 self.specialuse = specialuse
56 self.deprecationType = None
57 self.supercedingAPIVersion = None
58 self.supercedingExtension = None
60 … if self.promotedTo is not None and self.deprecatedBy is not None and self.obsoletedBy is not None:
61 …self.generator.logMsg('warn', 'All \'promotedto\', \'deprecatedby\' and \'obsoletedby\' attributes…
62 elif self.promotedTo is not None and self.deprecatedBy is not None:
63 …self.generator.logMsg('warn', 'Both \'promotedto\' and \'deprecatedby\' attributes used on extensi…
64 elif self.promotedTo is not None and self.obsoletedBy is not None:
65 …self.generator.logMsg('warn', 'Both \'promotedto\' and \'obsoletedby\' attributes used on extensio…
66 elif self.deprecatedBy is not None and self.obsoletedBy is not None:
67 …self.generator.logMsg('warn', 'Both \'deprecatedby\' and \'obsoletedby\' attributes used on extens…
70 if self.promotedTo is not None:
71 self.deprecationType = 'promotion'
73 elif self.deprecatedBy is not None:
74 self.deprecationType = 'deprecation'
76 elif self.obsoletedBy is not None:
77 self.deprecationType = 'obsoletion'
81 if supercededBy == '' and not self.deprecationType == 'promotion':
83 elif supercededBy.startswith(self.conventions.api_version_prefix):
84 self.supercedingAPIVersion = supercededBy
85 elif supercededBy.startswith(self.conventions.api_prefix):
86 self.supercedingExtension = supercededBy
88 …self.generator.logMsg('error', 'Unrecognized ' + self.deprecationType + ' attribute value \'' + su…
90 match = EXT_NAME_DECOMPOSE_RE.match(self.name)
91 self.vendor = match.group('tag')
92 self.bare_name = match.group('name')
94 def __str__(self): argument
95 return self.name
96 def __eq__(self, other): argument
97 return self.name == other.name
98 def __ne__(self, other): argument
99 return self.name != other.name
101 def __lt__(self, other): argument
102 self_is_KHR = self.name.startswith(self.conventions.KHR_prefix)
103 self_is_EXT = self.name.startswith(self.conventions.EXT_prefix)
104 other_is_KHR = other.name.startswith(self.conventions.KHR_prefix)
105 other_is_EXT = other.name.startswith(self.conventions.EXT_prefix)
117 return self.name < other.name
119 def typeToStr(self): argument
120 if self.ext_type == 'instance':
122 if self.ext_type == 'device':
125 if self.ext_type is not None:
126 …self.generator.logMsg('warn', 'The type attribute of ' + self.name + ' extension is neither \'inst…
128 self.generator.logMsg('error', 'Logic error in typeToStr(): Missing type attribute!')
131 def specLink(self, xrefName, xrefText, isRefpage = False): argument
142 specURL = self.conventions.specURL('api')
147 def conditionalLinkCoreAPI(self, apiVersion, linkSuffix, isRefpage): argument
148 versionMatch = re.match(self.conventions.api_version_prefix + r'(\d+)_(\d+)', apiVersion)
155 xrefText = self.conventions.api_name() + ' ' + dottedVersion
158 doc += ' ' + self.specLink(xrefName, xrefText, isRefpage) + '\n'
161 doc += ' ' + self.conventions.api_name() + ' ' + dottedVersion + '\n'
166 def conditionalLinkExt(self, extName, indent = ' '): argument
168 doc += indent + self.conventions.formatExtension(extName) + '\n'
176 def resolveDeprecationChain(self, extensionsList, succeededBy, isRefpage, file): argument
203 …self.generator.logMsg('error', 'Logic error in resolveDeprecationChain(): deprecationType is neith…
206 def writeTag(self, tag, value, isRefpage, fp): argument
230 def makeMetafile(self, extensionsList, isRefpage = False): argument
239 filename = self.filename.replace('meta/', 'meta/refpage.')
241 filename = self.filename
243 fp = self.generator.newFile(filename)
246 write('[[' + self.name + ']]', file=fp)
247 write('=== ' + self.name, file=fp)
250 self.writeTag('Name String', '`' + self.name + '`', isRefpage, fp)
251 self.writeTag('Extension Type', self.typeToStr(), isRefpage, fp)
253 self.writeTag('Registered Extension Number', self.number, isRefpage, fp)
254 self.writeTag('Revision', self.revision, isRefpage, fp)
257 self.writeTag('Extension and Version Dependencies', None, isRefpage, fp)
259 write(' * Requires ' + self.conventions.api_name() + ' ' + self.requiresCore, file=fp)
260 if self.requires:
261 for dep in self.requires.split(','):
262 write(' * Requires', self.conventions.formatExtension(dep),
264 if self.provisional == 'true':
267 self.specLink(xrefName = 'boilerplate-provisional-header',
273 if self.deprecationType:
274 self.writeTag('Deprecation state', None, isRefpage, fp)
276 if self.deprecationType == 'promotion':
277 if self.supercedingAPIVersion:
278 …write(' * _Promoted_ to\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-promotions…
280 …write(' * _Promoted_ to\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extension'…
281 … self.resolveDeprecationChain(extensionsList, self.supercedingExtension, isRefpage, fp)
282 elif self.deprecationType == 'deprecation':
283 if self.supercedingAPIVersion:
284 …write(' * _Deprecated_ by\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-new-feat…
285 elif self.supercedingExtension:
286 …write(' * _Deprecated_ by\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extensio…
287 … self.resolveDeprecationChain(extensionsList, self.supercedingExtension, isRefpage, fp)
290 elif self.deprecationType == 'obsoletion':
291 if self.supercedingAPIVersion:
292 …write(' * _Obsoleted_ by\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-new-featu…
293 elif self.supercedingExtension:
294 …write(' * _Obsoleted_ by\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extension…
295 … self.resolveDeprecationChain(extensionsList, self.supercedingExtension, isRefpage, fp)
301 …self.generator.logMsg('error', 'Logic error in makeMetafile(): deprecationType is neither \'promot…
303 if self.specialuse is not None:
304 specialuses = self.specialuse.split(',')
309 self.writeTag(header, None, isRefpage, fp)
316 self.specLink(
317 xrefName = self.conventions.special_use_section_anchor,
321 if self.conventions.write_contacts and not isRefpage:
323 contacts = self.contact.split(',')
331 … 'link:++https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=' + self.name + ':%20&body='…
359 def __init__(self, *args, **kwargs): argument
361 self.extensions = []
363 self.vendor_tags = []
364 self.file_suffix = ''
366 def newFile(self, filename): argument
367 self.logMsg('diag', '# Generating include file:', filename)
369 write(self.genOpts.conventions.warning_comment, file=fp)
372 def beginFile(self, genOpts): argument
373 OutputGenerator.beginFile(self, genOpts)
375 self.directory = self.genOpts.directory
376 self.file_suffix = self.genOpts.conventions.file_suffix
380 root = self.registry.tree.getroot()
382 self.vendor_tags.append(tag.get('name'))
385 self.makeDir(self.directory)
387 def conditionalExt(self, extName, content, ifdef = None, condition = None): argument
416 def makeExtensionInclude(self, ext): argument
417 return self.conventions.extension_include_string(ext)
419 def endFile(self): argument
420 self.extensions.sort()
423 for ext in self.extensions:
424 ext.makeMetafile(self.extensions, isRefpage = False)
425 if self.conventions.write_refpage_include:
426 ext.makeMetafile(self.extensions, isRefpage = True)
430 for ext in self.extensions:
435 …promoted_extensions_fp = self.newFile(self.directory + '/promoted_extensions_' + coreVersion + sel…
448 prefixes = self.conventions.extension_index_prefixes
454 self.extensions.sort(key=makeSortKey)
458 …with self.newFile(self.directory + '/current_extensions_appendix' + self.file_suffix) as current_e…
459 …self.newFile(self.directory + '/deprecated_extensions_appendix' + self.file_suffix) as deprecated_…
460 …self.newFile(self.directory + '/current_extension_appendices' + self.file_suffix) as current_exten…
461 …self.newFile(self.directory + '/current_extension_appendices_toc' + self.file_suffix) as current_e…
462 …self.newFile(self.directory + '/deprecated_extension_appendices' + self.file_suffix) as deprecated…
463 …self.newFile(self.directory + '/deprecated_extension_appendices_toc' + self.file_suffix) as deprec…
464 …self.newFile(self.directory + '/deprecated_extensions_guard_macro' + self.file_suffix) as deprecat…
465 …self.newFile(self.directory + '/provisional_extensions_appendix' + self.file_suffix) as provisiona…
466 …self.newFile(self.directory + '/provisional_extension_appendices' + self.file_suffix) as provision…
467 …self.newFile(self.directory + '/provisional_extension_appendices_toc' + self.file_suffix) as provi…
468 …self.newFile(self.directory + '/provisional_extensions_guard_macro' + self.file_suffix) as provisi…
470 …write('include::deprecated_extensions_guard_macro' + self.file_suffix + '[]', file=current_extensi…
481 …write('include::current_extension_appendices_toc' + self.file_suffix + '[]', file=current_extensio…
483 …write('include::current_extension_appendices' + self.file_suffix + '[]', file=current_extensions_a…
485 …write('include::deprecated_extensions_guard_macro' + self.file_suffix + '[]', file=deprecated_exte…
490 …write('include::deprecated_extension_appendices_toc' + self.file_suffix + '[]', file=deprecated_ex…
492 …write('include::deprecated_extension_appendices' + self.file_suffix + '[]', file=deprecated_extens…
501 …write('include::provisional_extensions_guard_macro' + self.file_suffix + '[]', file=provisional_ex…
506 …write('include::provisional_extension_appendices_toc' + self.file_suffix + '[]', file=provisional_…
508 …write('include::provisional_extension_appendices' + self.file_suffix + '[]', file=provisional_exte…
511 for ext in self.extensions:
512 include = self.makeExtensionInclude(ext)
513 link = ' * ' + self.conventions.formatExtension(ext.name)
515 … write(self.conditionalExt(ext.name, include), file=provisional_extension_appendices_fp)
516 … write(self.conditionalExt(ext.name, link), file=provisional_extension_appendices_toc_fp)
517 …write(self.conditionalExt(ext.name, ':HAS_PROVISIONAL_EXTENSIONS:'), file=provisional_extensions_g…
519 … write(self.conditionalExt(ext.name, include), file=current_extension_appendices_fp)
520 … write(self.conditionalExt(ext.name, link), file=current_extension_appendices_toc_fp)
524 …write(self.conditionalExt(ext.name, include, 'ifndef', condition), file=current_extension_appendic…
525 …write(self.conditionalExt(ext.name, link, 'ifndef', condition), file=current_extension_appendices_…
527 …write(self.conditionalExt(ext.name, include, 'ifdef', condition), file=deprecated_extension_append…
528 …write(self.conditionalExt(ext.name, link, 'ifdef', condition), file=deprecated_extension_appendice…
530 …write(self.conditionalExt(ext.name, ':HAS_DEPRECATED_EXTENSIONS:', 'ifdef', condition), file=depre…
534 OutputGenerator.endFile(self)
536 def beginFeature(self, interface, emit): argument
538 OutputGenerator.beginFeature(self, interface, emit)
541 self.logMsg('diag', 'beginFeature: ignoring non-extension feature', self.featureName)
545 name = self.featureName
546 number = self.getAttrib(interface, 'number')
547 ext_type = self.getAttrib(interface, 'type')
548 revision = self.getSpecVersion(interface, name)
552 requires = self.getAttrib(interface, 'requires', OPTIONAL)
553 …requiresCore = self.getAttrib(interface, 'requiresCore', OPTIONAL, '1.0') # TODO update this line …
554 contact = self.getAttrib(interface, 'contact', OPTIONAL)
555 promotedTo = self.getAttrib(interface, 'promotedto', OPTIONAL)
556 deprecatedBy = self.getAttrib(interface, 'deprecatedby', OPTIONAL)
557 obsoletedBy = self.getAttrib(interface, 'obsoletedby', OPTIONAL)
558 provisional = self.getAttrib(interface, 'provisional', OPTIONAL, 'false')
559 specialuse = self.getAttrib(interface, 'specialuse', OPTIONAL)
561 filename = self.directory + '/' + name + self.file_suffix
564 generator = self,
578 self.extensions.append(extdata)
581 def endFeature(self): argument
583 OutputGenerator.endFeature(self)
585 def getAttrib(self, elem, attribute, required=True, default=None): argument
595 …self.logMsg('error', 'While processing \'' + self.featureName + ', <' + elem.tag + '> \'' + name +…
598 def numbersToWords(self, name): argument
613 def getSpecVersion(self, elem, extname, default=None): argument
621 versioningEnumName = self.numbersToWords(extname.upper()) + '_SPEC_VERSION'
624 enumName = self.getAttrib(enum, 'name')
626 return self.getAttrib(enum, 'value')
630 enumName = self.getAttrib(enum, 'name')
632 …self.logMsg('diag', 'Missing ' + versioningEnumName + '! Potential misnamed candidate ' + enumName…
633 return self.getAttrib(enum, 'value')
635 self.logMsg('error', 'Missing ' + versioningEnumName + '!')