clang API Documentation

Classes | Namespaces
ASTMatchers/Dynamic/Parser.h File Reference

Simple matcher expression parser. More...

#include "clang/ASTMatchers/Dynamic/Diagnostics.h"
#include "clang/ASTMatchers/Dynamic/Registry.h"
#include "clang/ASTMatchers/Dynamic/VariantValue.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
Include dependency graph for ASTMatchers/Dynamic/Parser.h:
This graph shows which files directly or indirectly include this file:

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
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> | <Unsigned>
 <StringLiteral>     := "quoted string"
 <Unsigned>          := [0-9]+
 <NamedValue>        := <Identifier>
 <MatcherExpression> := <Identifier>(<ArgumentList>) |
                        <Identifier>(<ArgumentList>).bind(<StringLiteral>)
 <Identifier>        := [a-zA-Z]+
 <ArgumentList>      := <Expression> | <Expression>,<ArgumentList>

Definition in file ASTMatchers/Dynamic/Parser.h.