clang 20.0.0git
|
DeclarationFragments is a vector of tagged important parts of a symbol's declaration. More...
#include "clang/ExtractAPI/DeclarationFragments.h"
Classes | |
struct | Fragment |
Fragment holds information of a single fragment. More... | |
Public Types | |
enum class | FragmentKind { None , Keyword , Attribute , NumberLiteral , StringLiteral , Identifier , TypeIdentifier , GenericParameter , ExternalParam , InternalParam , Text } |
The kind of a fragment. More... | |
using | FragmentIterator = std::vector< Fragment >::iterator |
using | ConstFragmentIterator = std::vector< Fragment >::const_iterator |
Static Public Member Functions | |
static StringRef | getFragmentKindString (FragmentKind Kind) |
Get the string description of a FragmentKind Kind . | |
static FragmentKind | parseFragmentKindFromString (StringRef S) |
Get the corresponding FragmentKind from string S . | |
static DeclarationFragments | getExceptionSpecificationString (ExceptionSpecificationType ExceptionSpec) |
static DeclarationFragments | getStructureTypeFragment (const RecordDecl *Decl) |
DeclarationFragments is a vector of tagged important parts of a symbol's declaration.
The fragments sequence can be joined to form spans of declaration text, with attached information useful for purposes like syntax-highlighting etc. For example:
Definition at line 48 of file DeclarationFragments.h.
using clang::extractapi::DeclarationFragments::ConstFragmentIterator = std::vector<Fragment>::const_iterator |
Definition at line 106 of file DeclarationFragments.h.
using clang::extractapi::DeclarationFragments::FragmentIterator = std::vector<Fragment>::iterator |
Definition at line 105 of file DeclarationFragments.h.
|
strong |
The kind of a fragment.
Enumerator | |
---|---|
None | Unknown fragment kind. |
Keyword | |
Attribute | |
NumberLiteral | |
StringLiteral | |
Identifier | |
TypeIdentifier | Identifier that refers to a type in the context. |
GenericParameter | Parameter that's used as generics in the context. For example template parameters. |
ExternalParam | External parameters in Objective-C methods. For example, - (void) setValue:(Value)value forKey(Key)key
Definition: Value.h:93 |
InternalParam | Internal/local parameters in Objective-C methods. For example, - (void) setValue:(Value)value forKey(Key)key
|
Text |
Definition at line 53 of file DeclarationFragments.h.
|
default |
|
inline |
Append another DeclarationFragments to the end.
Definition at line 130 of file DeclarationFragments.h.
References end(), insert(), and clang::Other.
Referenced by getExceptionSpecificationString(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForConcept(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForConversionFunction(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForCXXClass(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForCXXMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForEnum(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForEnumConstant(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForField(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunction(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunctionTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunctionTemplateSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForMacro(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForNamespace(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCCategory(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCInterface(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCProperty(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCProtocol(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForOverloadedOperator(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForRecordDecl(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForRedeclarableTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTemplateArguments(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTemplateParameters(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTypedef(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVar(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplateSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFunctionSignature(), getStructureTypeFragment(), clang::extractapi::DeclarationFragmentsBuilder::getSubHeading(), clang::extractapi::DeclarationFragmentsBuilder::getSubHeadingForMacro(), and clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitTypedefNameDecl().
|
inline |
Append a new Fragment to the end of the Fragments.
Definition at line 138 of file DeclarationFragments.h.
References clang::Declaration, Kind, and Text.
DeclarationFragments & DeclarationFragments::appendSemicolon | ( | ) |
Append a text Fragment of a semicolon character.
Definition at line 89 of file DeclarationFragments.cpp.
Referenced by clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForConcept(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForConversionFunction(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForCXXClass(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForCXXMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForEnum(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForField(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunction(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForNamespace(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCProperty(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForOverloadedOperator(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForRecordDecl(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTypedef(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVar(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplateSpecialization(), and clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitTypedefNameDecl().
DeclarationFragments & DeclarationFragments::appendSpace | ( | ) |
Append a text Fragment of a space character.
Definition at line 85 of file DeclarationFragments.cpp.
Referenced by clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForConcept(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForConversionFunction(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForCXXClass(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForCXXMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForEnum(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForField(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunction(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunctionTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunctionTemplateSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForMacro(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForNamespace(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCCategory(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCInterface(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCProperty(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCProtocol(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForOverloadedOperator(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForRecordDecl(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForRedeclarableTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTemplateArguments(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTemplateParameters(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTypedef(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVar(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplateSpecialization(), and clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitTypedefNameDecl().
|
inline |
Definition at line 110 of file DeclarationFragments.h.
Referenced by clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTemplateArguments(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFunctionSignature(), insert(), and prepend().
|
inline |
Definition at line 114 of file DeclarationFragments.h.
|
inline |
Definition at line 116 of file DeclarationFragments.h.
|
inline |
Definition at line 112 of file DeclarationFragments.h.
|
static |
Definition at line 152 of file DeclarationFragments.cpp.
References append(), clang::EST_BasicNoexcept, clang::EST_DependentNoexcept, clang::EST_Dynamic, clang::EST_DynamicNone, clang::EST_NoexceptFalse, clang::EST_NoexceptTrue, clang::EST_None, Keyword, and Text.
Referenced by clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForCXXMethod(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunction(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForOverloadedOperator(), and clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod().
|
static |
Get the string description of a FragmentKind Kind
.
Definition at line 104 of file DeclarationFragments.cpp.
References Attribute, ExternalParam, GenericParameter, Identifier, InternalParam, Keyword, None, NumberLiteral, StringLiteral, Text, and TypeIdentifier.
|
inline |
Definition at line 108 of file DeclarationFragments.h.
Referenced by clang::extractapi::FunctionSignature::empty().
|
static |
Definition at line 192 of file DeclarationFragments.cpp.
References append(), and Keyword.
Referenced by clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForCXXClass().
|
inline |
Inserts another DeclarationFragments at It
.
Definition at line 156 of file DeclarationFragments.h.
References begin(), end(), Kind, clang::Other, and Text.
|
static |
Get the corresponding FragmentKind from string S
.
Definition at line 135 of file DeclarationFragments.cpp.
References Attribute, ExternalParam, GenericParameter, Identifier, InternalParam, Keyword, None, NumberLiteral, StringLiteral, Text, and TypeIdentifier.
|
inline |
Definition at line 197 of file DeclarationFragments.h.
Referenced by clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplatePartialSpecialization(), and clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplateSpecialization().
|
inline |
Prepend another DeclarationFragments to the beginning.
Definition at line 122 of file DeclarationFragments.h.
References begin(), insert(), and clang::Other.
Referenced by clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitTypedefNameDecl().
DeclarationFragments & DeclarationFragments::removeTrailingSemicolon | ( | ) |
Removes a trailing semicolon character if present.
Definition at line 93 of file DeclarationFragments.cpp.
References clang::Last, and Text.
Referenced by clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitTypedefNameDecl().
|
inline |
Definition at line 202 of file DeclarationFragments.h.