language/duchain
KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase > Class Template Reference
A class which iterates the AST to extract definitions of types. More...
#include <abstractdeclarationbuilder.h>
Inherits LanguageSpecificDeclarationBuilderBase.
Protected Types | |
| enum | DeclarationFlags { NoFlags = 0x0, DeclarationIsDefinition = 0x1 } |
Protected Member Functions | |
| void | abortDeclaration () |
| void | clearComment () |
| virtual void | closeDeclaration () |
| const QByteArray & | comment () const |
| template<class DeclarationType > | |
| DeclarationType * | currentDeclaration () const |
| Declaration * | currentDeclaration () const |
| void | eventuallyAssignInternalContext () |
| bool | hasCurrentDeclaration () const |
| template<class DeclarationT > | |
| DeclarationT * | openDeclaration (const QualifiedIdentifier &id, const SimpleRange &newRange, DeclarationFlags flags=NoFlags) |
| template<class DeclarationT > | |
| DeclarationT * | openDeclaration (NameT *name, T *range, DeclarationFlags flags=NoFlags) |
| void | openDeclarationInternal (Declaration *declaration) |
| template<class DeclarationT > | |
| DeclarationT * | openDefinition (const QualifiedIdentifier &id, const SimpleRange &newRange) |
| template<class DeclarationT > | |
| DeclarationT * | openDefinition (NameT *name, T *range) |
| ForwardDeclaration * | openForwardDeclaration (NameT *name, T *range) |
| void | setComment (const QByteArray &comment) |
Detailed Description
template<typename T, typename NameT, typename LanguageSpecificDeclarationBuilderBase>
class KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >
A class which iterates the AST to extract definitions of types.
Definition at line 38 of file abstractdeclarationbuilder.h.
Member Function Documentation
| void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::abortDeclaration | ( | ) | [inline, protected] |
Abort a declaration, deleting it.
Definition at line 217 of file abstractdeclarationbuilder.h.
| void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::clearComment | ( | ) | [inline, protected] |
Clears the current comment.
Definition at line 54 of file abstractdeclarationbuilder.h.
| virtual void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::closeDeclaration | ( | ) | [inline, protected, virtual] |
Close a declaration. Virtual to allow subclasses to perform customisations to declarations.
Definition at line 211 of file abstractdeclarationbuilder.h.
| const QByteArray& KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::comment | ( | ) | const [inline, protected] |
Access the current comment.
- Returns:
- the current comment, or an empty string if none exists.
Definition at line 50 of file abstractdeclarationbuilder.h.
| DeclarationType* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::currentDeclaration | ( | ) | const [inline, protected] |
Access the current declaration, casted to type DeclarationType.
- Returns:
- the current declaration if one exists and is an instance of the given DeclarationType.
Definition at line 47 of file abstractdeclarationbuilder.h.
| Declaration* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::currentDeclaration | ( | ) | const [inline, protected] |
Access the current declaration.
- Returns:
- the current declaration, or null if there is no current declaration.
Definition at line 44 of file abstractdeclarationbuilder.h.
| void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::eventuallyAssignInternalContext | ( | ) | [inline, protected] |
Set the internal context of a declaration; for example, a class declaration's internal context is the context inside the brackets: class ClassName { .
.. }
Definition at line 184 of file abstractdeclarationbuilder.h.
| bool KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::hasCurrentDeclaration | ( | ) | const [inline, protected] |
Determine if there is currently a declaration open.
- Returns:
- true if a declaration is open, otherwise false.
Definition at line 42 of file abstractdeclarationbuilder.h.
| DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDeclaration | ( | const QualifiedIdentifier & | id, | |
| const SimpleRange & | newRange, | |||
| DeclarationFlags | flags = NoFlags | |||
| ) | [inline, protected] |
- Parameters:
-
id the identifier of the new declaration. newRange the range which the identifier for the new declaration occupies. isFunction whether the new declaration is a function. isForward whether the new declaration is a forward declaration. isDefinition whether the new declaration is also a definition.
Definition at line 95 of file abstractdeclarationbuilder.h.
| DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDeclaration | ( | NameT * | name, | |
| T * | range, | |||
| DeclarationFlags | flags = NoFlags | |||
| ) | [inline, protected] |
Register a new declaration with the definition-use chain.
Returns the new declaration created.
- Parameters:
-
name When this is zero, the identifier given through customName is used. range provide a valid AST node here if name is null. isFunction whether the new declaration is a function. isForward whether the new declaration is a forward declaration. isDefinition whether the new declaration is also a definition.
Definition at line 71 of file abstractdeclarationbuilder.h.
| void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDeclarationInternal | ( | Declaration * | declaration | ) | [inline, protected] |
Internal function to open the given declaration by pushing it onto the declaration stack.
Provided for subclasses who don't want to use the generic openDeclaration() functions.
Definition at line 171 of file abstractdeclarationbuilder.h.
| DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDefinition | ( | const QualifiedIdentifier & | id, | |
| const SimpleRange & | newRange | |||
| ) | [inline, protected] |
Convenience function. Same as openDeclaration(), but creates the declaration as a definition.
Definition at line 164 of file abstractdeclarationbuilder.h.
| DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDefinition | ( | NameT * | name, | |
| T * | range | |||
| ) | [inline, protected] |
Convenience function. Same as openDeclaration(), but creates the declaration as a definition.
Definition at line 157 of file abstractdeclarationbuilder.h.
| ForwardDeclaration* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openForwardDeclaration | ( | NameT * | name, | |
| T * | range | |||
| ) | [inline, protected] |
Convenience function. Same as openDeclaration(), but creates a forward declaration.
Definition at line 177 of file abstractdeclarationbuilder.h.
| void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::setComment | ( | const QByteArray & | comment | ) | [inline, protected] |
Set the current comment.
- Parameters:
-
comment the new comment.
Definition at line 52 of file abstractdeclarationbuilder.h.
The documentation for this class was generated from the following file:
KDE 4.4 API Reference