• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/duchain

  • KDevelop
  • AbstractDeclarationBuilder
Protected Types | Protected Member Functions | List of all members
KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase > Class Template Reference

#include <abstractdeclarationbuilder.h>

Inheritance diagram for KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >:
Inheritance graph
[legend]

Protected Types

enum  DeclarationFlags { NoFlags = 0x0, DeclarationIsDefinition = 0x1 }
 

Protected Member Functions

void abortDeclaration ()
 
void clearComment ()
 
virtual void closeDeclaration ()
 
const QByteArray & comment () const
 
Declaration * currentDeclaration () const
 
template<class DeclarationType >
DeclarationType * currentDeclaration () const
 
void eventuallyAssignInternalContext ()
 
bool hasCurrentDeclaration () const
 
template<class DeclarationT >
DeclarationT * openDeclaration (const Identifier &localId, const RangeInRevision &newRange, DeclarationFlags flags=NoFlags)
 
template<class DeclarationT >
DeclarationT * openDeclaration (const QualifiedIdentifier &id, const RangeInRevision &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 RangeInRevision &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 36 of file abstractdeclarationbuilder.h.

Member Enumeration Documentation

◆ DeclarationFlags

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
enum KDevelop::AbstractDeclarationBuilder::DeclarationFlags
protected
Enumerator
NoFlags 
DeclarationIsDefinition 

Definition at line 61 of file abstractdeclarationbuilder.h.

Member Function Documentation

◆ abortDeclaration()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::abortDeclaration ( )
inlineprotected

Abort a declaration, deleting it.

Definition at line 232 of file abstractdeclarationbuilder.h.

◆ clearComment()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::clearComment ( )
inlineprotected

Clears the current comment.

Definition at line 59 of file abstractdeclarationbuilder.h.

◆ closeDeclaration()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
virtual void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::closeDeclaration ( )
inlineprotectedvirtual

Close a declaration. Virtual to allow subclasses to perform customisations to declarations.

Definition at line 226 of file abstractdeclarationbuilder.h.

◆ comment()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
const QByteArray& KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::comment ( ) const
inlineprotected

Access the current comment.

Returns
the current comment, or an empty string if none exists.

Definition at line 55 of file abstractdeclarationbuilder.h.

◆ currentDeclaration() [1/2]

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
Declaration* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::currentDeclaration ( ) const
inlineprotected

Access the current declaration.

Returns
the current declaration, or null if there is no current declaration.

Definition at line 43 of file abstractdeclarationbuilder.h.

◆ currentDeclaration() [2/2]

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
template<class DeclarationType >
DeclarationType* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::currentDeclaration ( ) const
inlineprotected

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 49 of file abstractdeclarationbuilder.h.

◆ eventuallyAssignInternalContext()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::eventuallyAssignInternalContext ( )
inlineprotected

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 195 of file abstractdeclarationbuilder.h.

◆ hasCurrentDeclaration()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
bool KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::hasCurrentDeclaration ( ) const
inlineprotected

Determine if there is currently a declaration open.

Returns
true if a declaration is open, otherwise false.

Definition at line 41 of file abstractdeclarationbuilder.h.

◆ openDeclaration() [1/3]

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
template<class DeclarationT >
DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDeclaration ( const Identifier &  localId,
const RangeInRevision &  newRange,
DeclarationFlags  flags = NoFlags 
)
inlineprotected

Parameters
localIdthe identifier of the new declaration.
newRangethe range which the identifier for the new declaration occupies.
flagsequal to DeclarationIsDefinition whether the new declaration is also a definition
Returns
the new declaration created

Definition at line 118 of file abstractdeclarationbuilder.h.

◆ openDeclaration() [2/3]

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
template<class DeclarationT >
DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDeclaration ( const QualifiedIdentifier &  id,
const RangeInRevision &  newRange,
DeclarationFlags  flags = NoFlags 
)
inlineprotected

Parameters
idthe identifier of the new declaration.
newRangethe range which the identifier for the new declaration occupies.
flagsequal to DeclarationIsDefinition whether the new declaration is also a definition
Returns
the new declaration created

Definition at line 95 of file abstractdeclarationbuilder.h.

◆ openDeclaration() [3/3]

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
template<class DeclarationT >
DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDeclaration ( NameT *  name,
T *  range,
DeclarationFlags  flags = NoFlags 
)
inlineprotected

Register a new declaration with the definition-use chain.

Parameters
nameWhen this is zero, the identifier given through customName is used
rangeprovide a valid AST node here if name is null
flagsequal to DeclarationIsDefinition whether the new declaration is also a definition
Returns
the new declaration created

Definition at line 74 of file abstractdeclarationbuilder.h.

◆ openDeclarationInternal()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDeclarationInternal ( Declaration *  declaration)
inlineprotected

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 182 of file abstractdeclarationbuilder.h.

◆ openDefinition() [1/2]

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
template<class DeclarationT >
DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDefinition ( const QualifiedIdentifier &  id,
const RangeInRevision &  newRange 
)
inlineprotected

Convenience function. Same as openDeclaration(), but creates the declaration as a definition.

Definition at line 175 of file abstractdeclarationbuilder.h.

◆ openDefinition() [2/2]

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
template<class DeclarationT >
DeclarationT* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openDefinition ( NameT *  name,
T *  range 
)
inlineprotected

Convenience function. Same as openDeclaration(), but creates the declaration as a definition.

Definition at line 168 of file abstractdeclarationbuilder.h.

◆ openForwardDeclaration()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
ForwardDeclaration* KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::openForwardDeclaration ( NameT *  name,
T *  range 
)
inlineprotected

Convenience function. Same as openDeclaration(), but creates a forward declaration.

Definition at line 188 of file abstractdeclarationbuilder.h.

◆ setComment()

template<typename T , typename NameT , typename LanguageSpecificDeclarationBuilderBase >
void KDevelop::AbstractDeclarationBuilder< T, NameT, LanguageSpecificDeclarationBuilderBase >::setComment ( const QByteArray &  comment)
inlineprotected

Set the current comment.

Parameters
commentthe new comment.

Definition at line 57 of file abstractdeclarationbuilder.h.


The documentation for this class was generated from the following file:
  • abstractdeclarationbuilder.h
This file is part of the KDE documentation.
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.

kdevplatform/language/duchain

Skip menu "kdevplatform/language/duchain"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal