//===--- 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 // //===----------------------------------------------------------------------===// // // Simple matcher expression parser. // // This file contains the Parser class, which is responsible for parsing // expressions in a specific format: matcherName(Arg0, Arg1, ..., ArgN). The // parser can also interpret simple types, like strings. // // The actual processing of the matchers is handled by a Sema object that is // provided to the parser. // // The grammar for the supported expressions is as follows: // <Expression> := <StringLiteral> | <MatcherExpression> // <StringLiteral> := "quoted string" // <MatcherExpression> := <MatcherName>(<ArgumentList>) // <MatcherName> := [a-zA-Z]+ // <ArgumentList> := <Expression> | <Expression>,<ArgumentList> // //===----------------------------------------------------------------------===// #ifndef MLIR_TOOLS_MLIRQUERY_MATCHER_PARSER_H #define MLIR_TOOLS_MLIRQUERY_MATCHER_PARSER_H #include "Diagnostics.h" #include "RegistryManager.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include <memory> #include <vector> namespace mlir::query::matcher::internal { // Matcher expression parser. class Parser { … }; } // namespace mlir::query::matcher::internal #endif // MLIR_TOOLS_MLIRQUERY_MATCHER_PARSER_H