clang 20.0.0git
|
#include "clang/ASTMatchers/Dynamic/Registry.h"
Public Member Functions | |
Registry ()=delete | |
Static Public Member Functions | |
static ASTNodeKind | nodeMatcherType (MatcherCtor) |
static bool | isBuilderMatcher (MatcherCtor Ctor) |
static internal::MatcherDescriptorPtr | buildMatcherCtor (MatcherCtor, SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error) |
static std::optional< MatcherCtor > | lookupMatcherCtor (StringRef MatcherName) |
Look up a matcher in the registry by name,. | |
static std::vector< ArgKind > | getAcceptedCompletionTypes (llvm::ArrayRef< std::pair< MatcherCtor, unsigned > > Context) |
Compute the list of completion types for Context . | |
static std::vector< MatcherCompletion > | getMatcherCompletions (ArrayRef< ArgKind > AcceptedTypes) |
Compute the list of completions that match any of AcceptedTypes . | |
static VariantMatcher | constructMatcher (MatcherCtor Ctor, SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error) |
Construct a matcher from the registry. | |
static VariantMatcher | constructBoundMatcher (MatcherCtor Ctor, SourceRange NameRange, StringRef BindID, ArrayRef< ParserValue > Args, Diagnostics *Error) |
Construct a matcher from the registry and bind it. | |
Definition at line 82 of file Registry.h.
|
delete |
|
static |
Definition at line 634 of file Registry.cpp.
References clang::ast_matchers::dynamic::internal::MatcherDescriptor::buildMatcherCtor().
|
static |
Construct a matcher from the registry and bind it.
Similar the constructMatcher()
above, but it then tries to bind the matcher to the specified BindID
. If the matcher is not bindable, it sets an error in Error
and returns a null matcher.
Definition at line 809 of file Registry.cpp.
References clang::Result, and clang::ast_matchers::dynamic::VariantMatcher::SingleMatcher().
|
static |
Construct a matcher from the registry.
Ctor | The matcher constructor to instantiate. |
NameRange | The location of the name in the matcher source. Useful for error reporting. |
Args | The argument list for the matcher. The number and types of the values must be valid for the matcher requested. Otherwise, the function will return an error. |
Error
will contain the description of the error. Definition at line 802 of file Registry.cpp.
References clang::ast_matchers::dynamic::internal::MatcherDescriptor::create().
|
static |
Compute the list of completion types for Context
.
Each element of Context
represents a matcher invocation, going from outermost to innermost. Elements are pairs consisting of a reference to the matcher constructor and the index of the next element in the argument list of that matcher (or for the last element, the index of the completion point in the argument list). An empty list requests completion for the root matcher.
Definition at line 663 of file Registry.cpp.
References clang::ast_matchers::dynamic::internal::MatcherDescriptor::getArgKinds(), clang::ast_matchers::dynamic::internal::MatcherDescriptor::isConvertibleTo(), clang::ast_matchers::dynamic::internal::MatcherDescriptor::isVariadic(), Kind, and clang::ast_matchers::dynamic::ArgKind::MakeMatcherArg().
|
static |
Compute the list of completions that match any of AcceptedTypes
.
AcceptedTypes | All types accepted for this completion. |
lookupMatcherCtor()
. The matcher constructed from the return of lookupMatcherCtor()
should be convertible to some type in AcceptedTypes
. Definition at line 697 of file Registry.cpp.
References clang::ast_matchers::dynamic::ArgKind::AK_Matcher, clang::ast_matchers::dynamic::ArgKind::AK_String, Kind, and clang::ast_matchers::dynamic::RegistryData.
|
static |
Definition at line 629 of file Registry.cpp.
References clang::ast_matchers::dynamic::internal::MatcherDescriptor::isBuilderMatcher().
|
static |
Look up a matcher in the registry by name,.
Definition at line 641 of file Registry.cpp.
References clang::ast_matchers::dynamic::RegistryData.
|
static |
Definition at line 620 of file Registry.cpp.
References clang::ast_matchers::dynamic::internal::MatcherDescriptor::nodeMatcherType().