35 #ifndef LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H 36 #define LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H 41 #include "llvm/ADT/ArrayRef.h" 42 #include "llvm/ADT/Optional.h" 43 #include "llvm/ADT/StringMap.h" 44 #include "llvm/ADT/StringRef.h" 123 virtual std::vector<MatcherCompletion>
143 llvm::ArrayRef<std::pair<MatcherCtor, unsigned>> Context)
override;
145 std::vector<MatcherCompletion>
213 static std::vector<MatcherCompletion>
216 static std::vector<MatcherCompletion>
220 static std::vector<MatcherCompletion>
234 bool parseBindID(std::string &BindID);
236 bool parseMatcherExpressionImpl(
const TokenInfo &NameToken,
240 void addCompletion(
const TokenInfo &CompToken,
242 void addExpressionCompletions();
244 std::vector<MatcherCompletion>
252 using ContextStackTy = std::vector<std::pair<MatcherCtor, unsigned>>;
254 ContextStackTy ContextStack;
255 std::vector<MatcherCompletion> Completions;
262 #endif // LLVM_CLANG_AST_MATCHERS_DYNAMIC_PARSER_H
Registry of all known matchers.
static llvm::Optional< DynTypedMatcher > parseMatcherExpression(StringRef &MatcherCode, Sema *S, const NamedValueMap *NamedValues, Diagnostics *Error)
Parse a matcher expression.
llvm::StringMap< VariantValue > NamedValueMap
virtual llvm::Optional< MatcherCtor > lookupMatcherCtor(StringRef MatcherName)=0
Look up a matcher by name.
Matcher descriptor interface.
Simple tokenizer for the parser.
static llvm::Optional< DynTypedMatcher > parseMatcherExpression(StringRef &MatcherCode, Diagnostics *Error)
static bool parseExpression(StringRef &Code, Sema *S, const NamedValueMap *NamedValues, VariantValue *Value, Diagnostics *Error)
Parse an expression.
Matcher expression parser.
Sema implementation that uses the matcher registry to process the tokens.
virtual VariantMatcher actOnMatcherExpression(MatcherCtor Ctor, SourceRange NameRange, StringRef BindID, ArrayRef< ParserValue > Args, Diagnostics *Error)=0
Process a matcher expression.
Helper class to manage error messages.
Dataflow Directional Tag Classes.
Interface to connect the parser with the registry and more.
Simple structure to hold information for one token from the parser.
static std::vector< MatcherCompletion > completeExpression(StringRef &Code, unsigned CompletionOffset, Sema *S, const NamedValueMap *NamedValues)
Complete an expression at the given offset.
virtual std::vector< ArgKind > getAcceptedCompletionTypes(llvm::ArrayRef< std::pair< MatcherCtor, unsigned >> Context)
Compute the list of completion types for Context.
static std::vector< MatcherCompletion > completeExpression(StringRef &Code, unsigned CompletionOffset, Sema *S)
A variant matcher object.
virtual std::vector< MatcherCompletion > getMatcherCompletions(llvm::ArrayRef< ArgKind > AcceptedTypes)
Compute the list of completions that match any of AcceptedTypes.
static bool parseExpression(StringRef &Code, VariantValue *Value, Diagnostics *Error)
static std::vector< MatcherCompletion > completeExpression(StringRef &Code, unsigned CompletionOffset)
static bool parseExpression(StringRef &Code, Sema *S, VariantValue *Value, Diagnostics *Error)
static llvm::Optional< DynTypedMatcher > parseMatcherExpression(StringRef &MatcherCode, Sema *S, Diagnostics *Error)