kdevplatform/language/duchain
#include <abstracttypebuilder.h>

Public Member Functions | |
const QList< AbstractType::Ptr > & | topTypes () const |
Protected Member Functions | |
virtual void | classTypeOpened (const KDevelop::AbstractType::Ptr &) |
void | clearLastType () |
void | closeType () |
AbstractType::Ptr | currentAbstractType () |
template<class T2 > | |
TypePtr< T2 > | currentType () |
bool | hasCurrentType () |
void | injectType (const AbstractType::Ptr &type) |
template<class T2 > | |
void | injectType (const TypePtr< T2 > &type) |
AbstractType::Ptr | lastType () const |
void | openAbstractType (const AbstractType::Ptr &type) |
template<class T2 > | |
void | openType (const TypePtr< T2 > &type) |
bool | openTypeFromName (const QualifiedIdentifier &id, T *typeNode, bool needClass) |
bool | openTypeFromName (NameT *name, bool needClass) |
virtual DUContext * | searchContext () const |
void | setLastType (const AbstractType::Ptr &ptr) |
void | supportBuild (T *node, DUContext *context=nullptr) override |
Detailed Description
template<typename T, typename NameT, typename LangugageSpecificTypeBuilderBase>
class KDevelop::AbstractTypeBuilder< T, NameT, LangugageSpecificTypeBuilderBase >
Abstract definition-use chain type builder class.
The AbstractTypeBuilder is a convenience class template for creating customized definition-use chain type builders from an AST. It simplifies:
- creating and re-using types
- creating complex types in a stack
- referencing named types
Definition at line 40 of file abstracttypebuilder.h.
Member Function Documentation
◆ classTypeOpened()
|
inlineprotectedvirtual |
Notify that a class type was opened.
This should be called at the beginning of processing a class-specifier, right after the type for the class was created. The type can be retrieved through currentAbstractType().
Definition at line 74 of file abstracttypebuilder.h.
◆ clearLastType()
|
inlineprotected |
Clear the last encountered type.
Definition at line 109 of file abstracttypebuilder.h.
◆ closeType()
|
inlineprotected |
Close the current type.
Definition at line 150 of file abstracttypebuilder.h.
◆ currentAbstractType()
|
inlineprotected |
Retrieve the current type being parsed.
- Warning
- You must not use this in creating another type definition, as it may not be a registered type.
- Returns
- the current abstract type being parsed.
Definition at line 173 of file abstracttypebuilder.h.
◆ currentType()
|
inlineprotected |
Retrieve the current type being parsed.
- Warning
- You must not use this in creating another type definition, as it may not be a registered type.
- Returns
- the current type being parsed.
Definition at line 190 of file abstracttypebuilder.h.
◆ hasCurrentType()
|
inlineprotected |
Determine if the type builder is currently parsing a type.
- Returns
- true if there is a current type, else returns false.
Definition at line 164 of file abstracttypebuilder.h.
◆ injectType() [1/2]
|
inlineprotected |
Simulates that the given type was created.
After calling, this type will be the last type.
Definition at line 118 of file abstracttypebuilder.h.
◆ injectType() [2/2]
|
inlineprotected |
Simulates that the given type was created.
After calling, this type will be the last type.
Definition at line 129 of file abstracttypebuilder.h.
◆ lastType()
|
inlineprotected |
Retrieve the last type that was encountered.
- Returns
- the last encountered type.
Definition at line 93 of file abstracttypebuilder.h.
◆ openAbstractType()
|
inlineprotected |
Opens the given type, and sets it to be the current type.
Definition at line 142 of file abstracttypebuilder.h.
◆ openType()
|
inlineprotected |
Opens the given type, and sets it to be the current type.
Definition at line 136 of file abstracttypebuilder.h.
◆ openTypeFromName() [1/2]
|
inlineprotected |
Search for a type with the identifier given by name.
- Parameters
-
id the identifier of the type for which to search. typeNode the AST node representing the type to open. needClass if true, only class types will be searched, if false all named types will be searched.
- Returns
- whether a type was found (and thus opened).
- Todo:
- only functions may have multiple declarations here
- Todo:
- What about position?
Definition at line 214 of file abstracttypebuilder.h.
◆ openTypeFromName() [2/2]
|
inlineprotected |
Search for a type with the identifier given by name.
- Parameters
-
name the AST node representing the name of the type to open. needClass if true, only class types will be searched, if false all named types will be searched.
- Returns
- whether a type was found (and thus opened).
Definition at line 200 of file abstracttypebuilder.h.
◆ searchContext()
|
inlineprotectedvirtual |
Determine the context to search in when named types are requested.
You may reimplement this to return a different context if required.
- Returns
- the context in which to search for named types.
Definition at line 63 of file abstracttypebuilder.h.
◆ setLastType()
|
inlineprotected |
Set the last encountered type.
- Parameters
-
ptr pointer to the last encountered type.
Definition at line 103 of file abstracttypebuilder.h.
◆ supportBuild()
|
inlineoverrideprotected |
Perform initialisation at the start of a build, and check that all types that were registered were also used.
Definition at line 80 of file abstracttypebuilder.h.
◆ topTypes()
|
inline |
Returns the list of types that were created in the parsing run, excluding subtypes (ie.
returns complete types, not the simple types and intermediate types which went into creating any complex type)
Used for unit tests only.
Definition at line 51 of file abstracttypebuilder.h.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 23:31:18 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.