Clang::Cursor(3pm)

πŸ’… Clang::Cursor

okay so bestie, welcome to the Clang::Cursor page β€” it's part of the User Contributed Perl Documentation and it lives in section 3 of the manual (that's the 3pm bit, iykyk).


✨ NAME ✨

Clang::Cursor β€” it's the Clang cursor class, periodt.

πŸŽ€ VERSION πŸŽ€

version 0.09 β€” yes she's giving vintage, we stan anyway πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. a Clang::Cursor represents an element in the abstract syntax tree of a translation unit. that's it, that's the vibe. every little node in your AST gets to be a Cursor and honestly? main character energy. 🌟


πŸ‘‘ METHODS πŸ‘‘

kind( )

grab the Clang::CursorKind of the cursor you're holding. that's her whole deal. ✨

type( )

gets you the Clang::Type of the entity this cursor is pointing at. πŸ’«

spelling( )

returns the name of the entity referenced by the given cursor. so like, the actual written-out identifier. πŸ“›

num_arguments( )

how many arguments does this cursor reference? this one tells you. no cap. πŸ”’

displayname( )

gives you back the display name for the entity the cursor references. yeah it's different from spelling( ), don't ask me why, that's just how it is bestie. πŸ’…

children( )

retrieves a list of the children of the given cursor. and plot twist β€” the children are Clang::Cursor objects too. it's a whole family tree, generational, iconic. 🌳🫢

is_pure_virtual( )

figures out whether the given cursor kind represents a pure virtual method. yes/no, that's it. πŸ‘‘

is_virtual( )

same energy, different question: does this cursor kind represent a virtual method? 🌸

location( )

gets you the location of the given cursor. and omg she's generous, she returns FIVE values, in this exact order:

  1. a string with the source file name
  2. an integer with the initial line number
  3. an integer with the initial column number
  4. an integer with the final line number
  5. another integer with the final column number

five values. hold onto all of them, don't drop any. 😭

access_specifier( )

retrieves the access of the given cursor. she can return one of these:

  • invalid
  • public
  • protected
  • private
⚠️ heads up bestie: this only works for C++ code. if you throw a C function at it, it's gonna hand you back invalid and walk away. so don't be surprised, it's not being rude, it's just built like that. πŸ’€

πŸ’– AUTHOR πŸ’–

Alessandro Ghedini <alexbio@cpan.org> β€” we love a legend. 🫢

Copyright 2012 Alessandro Ghedini. πŸŽ€

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information. no gatekeeping here. 🌈


and that's the whole page babes ✨ this was perl v5.42.3, dated 2026-09-03, and it's the Clang::Cursor(3pm) manpage signing off πŸ’…πŸ’– mwah, go write some slay code πŸ¦‹

πŸ“¦ where this page comes from