clang 19.0.0git
Classes | Namespaces
Parser.h File Reference

Simple matcher expression parser. More...

#include "clang/ASTMatchers/ASTMatchersInternal.h"
#include "clang/ASTMatchers/Dynamic/Registry.h"
#include "clang/ASTMatchers/Dynamic/VariantValue.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include <optional>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  clang::ast_matchers::dynamic::Parser
 Matcher expression parser. More...
 
class  clang::ast_matchers::dynamic::Parser::Sema
 Interface to connect the parser with the registry and more. More...
 
class  clang::ast_matchers::dynamic::Parser::RegistrySema
 Sema implementation that uses the matcher registry to process the tokens. More...
 

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::ast_matchers
 
namespace  clang::ast_matchers::dynamic
 

Detailed Description

Simple matcher expression parser.

The parser understands matcher expressions of the form: MatcherName(Arg0, Arg1, ..., ArgN) as well as simple types like strings. The parser does not know how to process the matchers. It delegates this task to a Sema object received as an argument.

Grammar for the expressions supported:
<Expression> := <Literal> | <NamedValue> | <MatcherExpression>
<Literal> := <StringLiteral> | <Boolean> | <Double> | <Unsigned>
<StringLiteral> := "quoted string"
<Boolean> := true | false
<Double> := [0-9]+.[0-9]* | [0-9]+.[0-9]*[eE][-+]?[0-9]+
<Unsigned> := [0-9]+
<NamedValue> := <Identifier>
<MatcherExpression> := <Identifier>(<ArgumentList>) |
<Identifier>(<ArgumentList>).bind(<StringLiteral>)
<Identifier> := [a-zA-Z]+
<ArgumentList> := <Expression> | <Expression>,<ArgumentList>
StringRef Identifier
Definition: Format.cpp:2980

Definition in file Parser.h.