clang API Documentation
#include <Registry.h>
Static Public Member Functions | |
static llvm::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, const SourceRange &NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error) |
Construct a matcher from the registry. | |
static VariantMatcher | constructBoundMatcher (MatcherCtor Ctor, const SourceRange &NameRange, StringRef BindID, ArrayRef< ParserValue > Args, Diagnostics *Error) |
Construct a matcher from the registry and bind it. |
Definition at line 62 of file Registry.h.
VariantMatcher clang::ast_matchers::dynamic::Registry::constructBoundMatcher | ( | MatcherCtor | Ctor, |
const SourceRange & | NameRange, | ||
StringRef | BindID, | ||
ArrayRef< ParserValue > | Args, | ||
Diagnostics * | Error | ||
) | [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 493 of file Registry.cpp.
References clang::ast_matchers::dynamic::Diagnostics::addError(), clang::ast_matchers::dynamic::Diagnostics::ET_RegistryNotBindable, clang::ast_matchers::dynamic::VariantMatcher::getSingleMatcher(), and clang::ast_matchers::dynamic::VariantMatcher::isNull().
VariantMatcher clang::ast_matchers::dynamic::Registry::constructMatcher | ( | MatcherCtor | Ctor, |
const SourceRange & | NameRange, | ||
ArrayRef< ParserValue > | Args, | ||
Diagnostics * | Error | ||
) | [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 485 of file Registry.cpp.
References clang::ast_matchers::dynamic::internal::MatcherDescriptor::create().
std::vector< ArgKind > clang::ast_matchers::dynamic::Registry::getAcceptedCompletionTypes | ( | llvm::ArrayRef< std::pair< MatcherCtor, unsigned >> | Context | ) | [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 376 of file Registry.cpp.
References Context, clang::ast_matchers::dynamic::internal::MatcherDescriptor::getArgKinds(), clang::ast_matchers::dynamic::internal::MatcherDescriptor::getNumArgs(), clang::ast_matchers::dynamic::internal::MatcherDescriptor::isConvertibleTo(), and clang::ast_matchers::dynamic::internal::MatcherDescriptor::isVariadic().
std::vector< MatcherCompletion > clang::ast_matchers::dynamic::Registry::getMatcherCompletions | ( | ArrayRef< ArgKind > | AcceptedTypes | ) | [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 407 of file Registry.cpp.
llvm::Optional< MatcherCtor > clang::ast_matchers::dynamic::Registry::lookupMatcherCtor | ( | StringRef | MatcherName | ) | [static] |
Look up a matcher in the registry by name,.
Definition at line 348 of file Registry.cpp.