//===- Parser.h - Matcher expression parser ---------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // /// \file /// 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. /// /// \code /// 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> /// \endcode // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H #define LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H #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> namespace clang { namespace ast_matchers { namespace dynamic { class Diagnostics; /// Matcher expression parser. class Parser { … }; } // namespace dynamic } // namespace ast_matchers } // namespace clang #endif // LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H