본문 바로가기

Language/python

python clang.cindex.Cursor

class Cursor(_ctypes.Structure)
 |  The Cursor class represents a reference to an element within the AST. It
 |  acts as a kind of iterator.
 |
 |  Method resolution order:
 |      Cursor
 |      _ctypes.Structure
 |      _ctypes._CData
 |      __builtin__.object
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |
 |  __ne__(self, other)
 |
 |  get_arguments(self)
 |      Return an iterator for accessing the arguments of this cursor.
 |
 |  get_bitfield_width(self)
 |      Retrieve the width of a bitfield.
 |
 |  get_children(self)
 |      Return an iterator for accessing the children of this cursor.
 |
 |  get_definition(self)
 |      If the cursor is a reference to a declaration or a declaration of
 |      some entity, return a cursor that points to the definition of that
 |      entity.
 |
 |  get_field_offsetof(self)
 |      Returns the offsetof the FIELD_DECL pointed by this Cursor.
 |
 |  get_num_template_arguments(self)
 |      Returns the number of template args associated with this cursor.
 |
 |  get_template_argument_kind(self, num)
 |      Returns the TemplateArgumentKind for the indicated template
 |      argument.
 |
 |  get_template_argument_type(self, num)
 |      Returns the CXType for the indicated template argument.
 |
 |  get_template_argument_unsigned_value(self, num)
 |      Returns the value of the indicated arg as an unsigned 64b integer.
 |
 |  get_template_argument_value(self, num)
 |      Returns the value of the indicated arg as a signed 64b integer.
 |
 |  get_tokens(self)
 |      Obtain Token instances formulating that compose this Cursor.
 |
 |      This is a generator for Token instances. It returns all tokens which
 |      occupy the extent this cursor occupies.
 |
 |  get_usr(self)
 |      Return the Unified Symbol Resultion (USR) for the entity referenced
 |      by the given cursor (or None).
 |
 |      A Unified Symbol Resolution (USR) is a string that identifies a
 |      particular entity (function, class, variable, etc.) within a
 |      program. USRs can be compared across translation units to determine,
 |      e.g., when references in one translation refer to an entity defined in
 |      another translation unit.
 |
 |  is_anonymous(self)
 |      Check if the record is anonymous.
 |
 |  is_bitfield(self)
 |      Check if the field is a bitfield.
 |
 |  is_const_method(self)
 |      Returns True if the cursor refers to a C++ member function or member
 |      function template that is declared 'const'.
 |
 |  is_definition(self)
 |      Returns true if the declaration pointed at by the cursor is also a
 |      definition of that entity.
 |
 |  is_mutable_field(self)
 |      Returns True if the cursor refers to a C++ field that is declared
 |      'mutable'.
 |
 |  is_pure_virtual_method(self)
 |      Returns True if the cursor refers to a C++ member function or member
 |      function template that is declared pure virtual.
 |
 |  is_static_method(self)
 |      Returns True if the cursor refers to a C++ member function or member
 |      function template that is declared 'static'.
 |
 |  is_virtual_method(self)
 |      Returns True if the cursor refers to a C++ member function or member
 |      function template that is declared 'virtual'.
 |
 |  walk_preorder(self)
 |      Depth-first preorder walk over the cursor and its descendants.
 |
 |      Yields cursors.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  from_cursor_result(res, fn, args)
 |
 |  from_location(tu, location)
 |
 |  from_result(res, fn, args)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables (if defined)
 |
 |  __weakref__
 |      list of weak references to the object (if defined)
 |
 |  access_specifier
 |      Retrieves the access specifier (if any) of the entity pointed at by the
 |      cursor.
 |
 |  brief_comment
 |      Returns the brief comment text associated with that Cursor
 |
 |  canonical
 |      Return the canonical Cursor corresponding to this Cursor.
 |
 |      The canonical cursor is the cursor which is representative for the
 |      underlying entity. For example, if you have multiple forward
 |      declarations for the same class, the canonical cursor for the forward
 |      declarations will be identical.
 |
 |  data
 |      Structure/Union member
 |
 |  displayname
 |      Return the display name for the entity referenced by this cursor.
 |
 |      The display name contains extra information that helps identify the
 |      cursor, such as the parameters of a function or template or the
 |      arguments of a class template specialization.
 |
 |  enum_type
 |      Return the integer type of an enum declaration.
 |
 |      Returns a Type corresponding to an integer. If the cursor is not for an
 |      enum, this raises.
 |
 |  enum_value
 |      Return the value of an enum constant.
 |
 |  extent
 |      Return the source range (the range of text) occupied by the entity
 |      pointed at by the cursor.
 |
 |  hash
 |      Returns a hash of the cursor as an int.
 |
 |  kind
 |      Return the kind of this cursor.
 |
 |  lexical_parent
 |      Return the lexical parent for this cursor.
 |
 |  location
 |      Return the source location (the starting character) of the entity
 |      pointed at by the cursor.
 |
 |  mangled_name
 |      Return the mangled name for the entity referenced by this cursor.
 |
 |  objc_type_encoding
 |      Return the Objective-C type encoding as a str.
 |
 |  raw_comment
 |      Returns the raw comment text associated with that Cursor
 |
 |  referenced
 |      For a cursor that is a reference, returns a cursor
 |      representing the entity that it references.
 |
 |  result_type
 |      Retrieve the Type of the result for this Cursor.
 |
 |  semantic_parent
 |      Return the semantic parent for this cursor.
 |
 |  spelling
 |      Return the spelling of the entity pointed at by the cursor.
 |
 |  storage_class
 |      Retrieves the storage class (if any) of the entity pointed at by the
 |      cursor.
 |
 |  translation_unit
 |      Returns the TranslationUnit to which this Cursor belongs.
 |
 |  type
 |      Retrieve the Type (if any) of the entity pointed at by the cursor.
 |
 |  underlying_typedef_type
 |      Return the underlying type of a typedef declaration.
 |
 |      Returns a Type for the typedef this cursor is a declaration for. If
 |      the current cursor is not a typedef, this raises.
 |
 |  xdata
 |      Structure/Union member
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from _ctypes.Structure:
 |
 |  __init__(...)
 |      x.__init__(...) initializes x; see help(type(x)) for signature
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from _ctypes.Structure:
 |
 |  __new__ = <built-in method __new__ of _ctypes.PyCStructType object>
 |      T.__new__(S, ...) -> a new object with type S, a subtype of T
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from _ctypes._CData:
 |
 |  __ctypes_from_outparam__(...)
 |
 |  __hash__(...)
 |      x.__hash__() <==> hash(x)
 |
 |  __reduce__(...)
 |
 |  __setstate__(...)


https://www.pydoc.io/pypi/prophy-1.0.1/autoapi/parsers/clang/cindex/index.html