Home | History | Annotate | Download | only in Dynamic

Lines Matching defs:Parser

1 //===- Parser.cpp - Matcher expression parser -----------------------------===//
10 /// Recursive parser implementation for the matcher expression grammar.
14 #include "clang/ASTMatchers/Dynamic/Parser.h"
36 /// Simple structure to hold information for one token from the parser.
37 struct Parser::TokenInfo {
65 const char* const Parser::TokenInfo::ID_Bind = "bind";
66 const char *const Parser::TokenInfo::ID_With = "with";
68 /// Simple tokenizer for the parser.
69 class Parser::CodeTokenizer {
323 Parser::Sema::~Sema() = default;
325 std::vector<ArgKind> Parser::Sema::getAcceptedCompletionTypes(
331 Parser::Sema::getMatcherCompletions(llvm::ArrayRef<ArgKind> AcceptedTypes) {
335 struct Parser::ScopedContextEntry {
336 Parser *P;
338 ScopedContextEntry(Parser *P, MatcherCtor C) : P(P) {
356 bool Parser::parseIdentifierPrefixImpl(VariantValue *Value) {
428 // Otherwise, fallback to the matcher parser.
447 bool Parser::parseBindID(std::string &BindID) {
471 bool Parser::parseMatcherBuilder(MatcherCtor Ctor, const TokenInfo &NameToken,
629 bool Parser::parseMatcherExpressionImpl(const TokenInfo &NameToken,
738 void Parser::addCompletion(const TokenInfo &CompToken,
747 std::vector<MatcherCompletion> Parser::getNamedValueCompletions(
762 void Parser::addExpressionCompletions() {
786 bool Parser::parseExpressionImpl(VariantValue *Value) {
822 static llvm::ManagedStatic<Parser::RegistrySema> DefaultRegistrySema;
824 Parser::Parser(CodeTokenizer *Tokenizer, Sema *S,
829 Parser::RegistrySema::~RegistrySema() = default;
832 Parser::RegistrySema::lookupMatcherCtor(StringRef MatcherName) {
836 VariantMatcher Parser::RegistrySema::actOnMatcherExpression(
847 std::vector<ArgKind> Parser::RegistrySema::getAcceptedCompletionTypes(
852 std::vector<MatcherCompletion> Parser::RegistrySema::getMatcherCompletions(
857 bool Parser::RegistrySema::isBuilderMatcher(MatcherCtor Ctor) const {
861 ASTNodeKind Parser::RegistrySema::nodeMatcherType(MatcherCtor Ctor) const {
866 Parser::RegistrySema::buildMatcherCtor(MatcherCtor Ctor, SourceRange NameRange,
872 bool Parser::parseExpression(StringRef &Code, Sema *S,
876 if (!Parser(&Tokenizer, S, NamedValues, Error).parseExpressionImpl(Value))
888 Parser::completeExpression(StringRef &Code, unsigned CompletionOffset, Sema *S,
892 Parser P(&Tokenizer, S, NamedValues, &Error);
908 Parser::parseMatcherExpression(StringRef &Code, Sema *S,