DeclarationHandler

This class is a CXXHandler which takes care of translating C/C++ declarations into Declaration nodes. It heavily relies on its sibling handler, the DeclaratorHandler.

In the C/C++ language, the meaning of a declaration depends on two major factors: First, a list of so-called declaration specifiers, which specify the type of declaration. Prominent examples include class or enum. Second, a list of declarators, which describe the actual "content" of the declaration, such as its name or parameters (in case of a function).

Since the logic behind a declarator is quite complex, this logic is extracted into its own handler. In fact, in most cases the DeclaratorHandler actually creates the CPG Declaration and the DeclarationHandler modifies the declaration depending on the declaration specifiers.

Constructors

Link copied to clipboard
constructor(lang: CXXLanguageFrontend)

Properties

Link copied to clipboard
open override val ctx: TranslationContext?
Link copied to clipboard
Link copied to clipboard
open override val language: Language<*>?
Link copied to clipboard
Link copied to clipboard
open override val namespace: Name?
Link copied to clipboard
open override val scope: Scope?

Functions

Link copied to clipboard
open override fun codeOf(astNode: IASTNode): String?
Link copied to clipboard
open override fun handle(ctx: IASTNode): Declaration?

We intentionally override the logic of Handler.handle because we do not want the map-based logic, but rather want to make use of the Kotlin-when syntax.

Link copied to clipboard
open override fun handleNode(node: IASTNode): Declaration
Link copied to clipboard
fun handleTranslationUnit(translationUnit: IASTTranslationUnit): TranslationUnitDeclaration
Link copied to clipboard
open override fun locationOf(astNode: IASTNode): PhysicalLocation?