MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / HandleCursor

Function HandleCursor

Scripts/DefinitionExtract.py:444–486  ·  view source on GitHub ↗
(Arch, Cursor)

Source from the content-addressed store, hash-verified

442 logging.critical ("Unhandled TypedefDecl {0}-{1}-{2}".format(Child.kind, Child.type.spelling, Child.spelling))
443
444def HandleCursor(Arch, Cursor):
445 if (Cursor.kind.is_invalid()):
446 Diags = TU.diagnostics
447 for Diag in Diags:
448 logging.warning (Diag.format())
449
450 Arch.Parsed = False
451 return
452
453 for Child in Cursor.get_children():
454 if (Child.kind == CursorKind.TRANSLATION_UNIT):
455 Arch = HandleCursor(Arch, Child)
456 elif (Child.kind == CursorKind.FIELD_DECL):
457 pass
458 elif (Child.kind == CursorKind.UNION_DECL):
459 Arch = HandleUnionDeclCursor(Arch, Child)
460 elif (Child.kind == CursorKind.STRUCT_DECL):
461 Arch = HandleStructDeclCursor(Arch, Child)
462 elif (Child.kind == CursorKind.TYPEDEF_DECL):
463 Arch = HandleTypeDefDeclCursor(Arch, Child)
464 elif (Child.kind == CursorKind.VAR_DECL):
465 Arch = HandleVarDeclCursor(Arch, Child)
466 elif (Child.kind == CursorKind.NAMESPACE):
467 # Append namespace
468 Arch.NamespaceScope.append(Child.spelling)
469 SetNamespace(Arch)
470
471 # Handle children
472 Arch = HandleCursor(Arch, Child)
473
474 # Pop namespace off
475 Arch.NamespaceScope.pop()
476 SetNamespace(Arch)
477 elif (Child.kind == CursorKind.TYPE_REF):
478 # Safe to pass on
479 pass
480 elif (Child.kind == CursorKind.FUNCTION_DECL):
481 # For function printing
482 Arch = HandleFunctionDeclCursor(Arch, Child)
483 else:
484 Arch = HandleCursor(Arch, Child)
485
486 return Arch
487
488def GetDB(Arch, filename, args):
489 Index = clang.cindex.Index.create()

Callers 3

HandleTypeDefDeclCursorFunction · 0.70
HandleStructElementsFunction · 0.70
GetDBFunction · 0.70

Calls 9

HandleFunctionDeclCursorFunction · 0.85
appendMethod · 0.80
popMethod · 0.80
HandleUnionDeclCursorFunction · 0.70
HandleStructDeclCursorFunction · 0.70
HandleTypeDefDeclCursorFunction · 0.70
HandleVarDeclCursorFunction · 0.70
SetNamespaceFunction · 0.70
formatMethod · 0.45

Tested by

no test coverage detected