#include "clang/ASTMatchers/Dynamic/Parser.h"
#include "clang/ASTMatchers/ASTMatchersInternal.h"
#include "clang/ASTMatchers/Dynamic/Diagnostics.h"
#include "clang/ASTMatchers/Dynamic/Registry.h"
#include "clang/Basic/CharInfo.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include <algorithm>
#include <cassert>
#include <cerrno>
#include <cstddef>
#include <cstdlib>
#include <optional>
#include <string>
#include <utility>
#include <vector>
namespace clang {
namespace ast_matchers {
namespace dynamic {
struct Parser::TokenInfo { … };
const char* const Parser::TokenInfo::ID_Bind = …;
const char *const Parser::TokenInfo::ID_With = …;
class Parser::CodeTokenizer { … };
Parser::Sema::~Sema() = default;
std::vector<ArgKind> Parser::Sema::getAcceptedCompletionTypes(
llvm::ArrayRef<std::pair<MatcherCtor, unsigned>> Context) { … }
std::vector<MatcherCompletion>
Parser::Sema::getMatcherCompletions(llvm::ArrayRef<ArgKind> AcceptedTypes) { … }
struct Parser::ScopedContextEntry { … };
bool Parser::parseIdentifierPrefixImpl(VariantValue *Value) { … }
bool Parser::parseBindID(std::string &BindID) { … }
bool Parser::parseMatcherBuilder(MatcherCtor Ctor, const TokenInfo &NameToken,
const TokenInfo &OpenToken,
VariantValue *Value) { … }
bool Parser::parseMatcherExpressionImpl(const TokenInfo &NameToken,
const TokenInfo &OpenToken,
std::optional<MatcherCtor> Ctor,
VariantValue *Value) { … }
void Parser::addCompletion(const TokenInfo &CompToken,
const MatcherCompletion& Completion) { … }
std::vector<MatcherCompletion> Parser::getNamedValueCompletions(
ArrayRef<ArgKind> AcceptedTypes) { … }
void Parser::addExpressionCompletions() { … }
bool Parser::parseExpressionImpl(VariantValue *Value) { … }
static llvm::ManagedStatic<Parser::RegistrySema> DefaultRegistrySema;
Parser::Parser(CodeTokenizer *Tokenizer, Sema *S,
const NamedValueMap *NamedValues, Diagnostics *Error)
: … { … }
Parser::RegistrySema::~RegistrySema() = default;
std::optional<MatcherCtor>
Parser::RegistrySema::lookupMatcherCtor(StringRef MatcherName) { … }
VariantMatcher Parser::RegistrySema::actOnMatcherExpression(
MatcherCtor Ctor, SourceRange NameRange, StringRef BindID,
ArrayRef<ParserValue> Args, Diagnostics *Error) { … }
std::vector<ArgKind> Parser::RegistrySema::getAcceptedCompletionTypes(
ArrayRef<std::pair<MatcherCtor, unsigned>> Context) { … }
std::vector<MatcherCompletion> Parser::RegistrySema::getMatcherCompletions(
ArrayRef<ArgKind> AcceptedTypes) { … }
bool Parser::RegistrySema::isBuilderMatcher(MatcherCtor Ctor) const { … }
ASTNodeKind Parser::RegistrySema::nodeMatcherType(MatcherCtor Ctor) const { … }
internal::MatcherDescriptorPtr
Parser::RegistrySema::buildMatcherCtor(MatcherCtor Ctor, SourceRange NameRange,
ArrayRef<ParserValue> Args,
Diagnostics *Error) const { … }
bool Parser::parseExpression(StringRef &Code, Sema *S,
const NamedValueMap *NamedValues,
VariantValue *Value, Diagnostics *Error) { … }
std::vector<MatcherCompletion>
Parser::completeExpression(StringRef &Code, unsigned CompletionOffset, Sema *S,
const NamedValueMap *NamedValues) { … }
std::optional<DynTypedMatcher>
Parser::parseMatcherExpression(StringRef &Code, Sema *S,
const NamedValueMap *NamedValues,
Diagnostics *Error) { … }
}
}
}