clang  15.0.0git
Public Member Functions | List of all members
clang::ast_matchers::dynamic::Parser::RegistrySema Class Reference

Sema implementation that uses the matcher registry to process the tokens. More...

#include "clang/ASTMatchers/Dynamic/Parser.h"

Inheritance diagram for clang::ast_matchers::dynamic::Parser::RegistrySema:
Inheritance graph
[legend]
Collaboration diagram for clang::ast_matchers::dynamic::Parser::RegistrySema:
Collaboration graph
[legend]

Public Member Functions

 ~RegistrySema () override
 
llvm::Optional< MatcherCtorlookupMatcherCtor (StringRef MatcherName) override
 Look up a matcher by name. More...
 
VariantMatcher actOnMatcherExpression (MatcherCtor Ctor, SourceRange NameRange, StringRef BindID, ArrayRef< ParserValue > Args, Diagnostics *Error) override
 Process a matcher expression. More...
 
std::vector< ArgKindgetAcceptedCompletionTypes (llvm::ArrayRef< std::pair< MatcherCtor, unsigned >> Context) override
 Compute the list of completion types for Context. More...
 
bool isBuilderMatcher (MatcherCtor Ctor) const override
 
ASTNodeKind nodeMatcherType (MatcherCtor) const override
 
internal::MatcherDescriptorPtr buildMatcherCtor (MatcherCtor, SourceRange NameRange, ArrayRef< ParserValue > Args, Diagnostics *Error) const override
 
std::vector< MatcherCompletiongetMatcherCompletions (llvm::ArrayRef< ArgKind > AcceptedTypes) override
 Compute the list of completions that match any of AcceptedTypes. More...
 
- Public Member Functions inherited from clang::ast_matchers::dynamic::Parser::Sema
virtual ~Sema ()
 

Detailed Description

Sema implementation that uses the matcher registry to process the tokens.

Definition at line 137 of file Parser.h.

Constructor & Destructor Documentation

◆ ~RegistrySema()

clang::ast_matchers::dynamic::Parser::RegistrySema::~RegistrySema ( )
overridedefault

Member Function Documentation

◆ actOnMatcherExpression()

VariantMatcher clang::ast_matchers::dynamic::Parser::RegistrySema::actOnMatcherExpression ( MatcherCtor  Ctor,
SourceRange  NameRange,
StringRef  BindID,
ArrayRef< ParserValue Args,
Diagnostics Error 
)
overridevirtual

Process a matcher expression.

All the arguments passed here have already been processed.

Parameters
CtorA matcher constructor looked up by lookupMatcherCtor.
NameRangeThe location of the name in the matcher source. Useful for error reporting.
BindIDThe ID to use to bind the matcher, or a null StringRef if no ID is specified.
ArgsThe argument list for the matcher.
Returns
The matcher objects constructed by the processor, or a null matcher if an error occurred. In that case, Error will contain a description of the error.

Implements clang::ast_matchers::dynamic::Parser::Sema.

Definition at line 836 of file Parser.cpp.

◆ buildMatcherCtor()

internal::MatcherDescriptorPtr clang::ast_matchers::dynamic::Parser::RegistrySema::buildMatcherCtor ( MatcherCtor  Ctor,
SourceRange  NameRange,
ArrayRef< ParserValue Args,
Diagnostics Error 
) const
overridevirtual

Implements clang::ast_matchers::dynamic::Parser::Sema.

Definition at line 866 of file Parser.cpp.

◆ getAcceptedCompletionTypes()

std::vector< ArgKind > clang::ast_matchers::dynamic::Parser::RegistrySema::getAcceptedCompletionTypes ( llvm::ArrayRef< std::pair< MatcherCtor, unsigned >>  Context)
overridevirtual

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.

Reimplemented from clang::ast_matchers::dynamic::Parser::Sema.

Definition at line 847 of file Parser.cpp.

◆ getMatcherCompletions()

std::vector< MatcherCompletion > clang::ast_matchers::dynamic::Parser::RegistrySema::getMatcherCompletions ( llvm::ArrayRef< ArgKind AcceptedTypes)
overridevirtual

Compute the list of completions that match any of AcceptedTypes.

Parameters
AcceptedTypesAll types accepted for this completion.
Returns
All completions for the specified types. Completions should be valid when used in lookupMatcherCtor(). The matcher constructed from the return of lookupMatcherCtor() should be convertible to some type in AcceptedTypes.

Reimplemented from clang::ast_matchers::dynamic::Parser::Sema.

Definition at line 852 of file Parser.cpp.

◆ isBuilderMatcher()

bool clang::ast_matchers::dynamic::Parser::RegistrySema::isBuilderMatcher ( MatcherCtor  Ctor) const
overridevirtual

Implements clang::ast_matchers::dynamic::Parser::Sema.

Definition at line 857 of file Parser.cpp.

◆ lookupMatcherCtor()

llvm::Optional< MatcherCtor > clang::ast_matchers::dynamic::Parser::RegistrySema::lookupMatcherCtor ( StringRef  MatcherName)
overridevirtual

Look up a matcher by name.

Parameters
MatcherNameThe matcher name found by the parser.
Returns
The matcher constructor, or Optional<MatcherCtor>() if not found.

Implements clang::ast_matchers::dynamic::Parser::Sema.

Definition at line 832 of file Parser.cpp.

◆ nodeMatcherType()

ASTNodeKind clang::ast_matchers::dynamic::Parser::RegistrySema::nodeMatcherType ( MatcherCtor  Ctor) const
overridevirtual

Implements clang::ast_matchers::dynamic::Parser::Sema.

Definition at line 861 of file Parser.cpp.


The documentation for this class was generated from the following files: