MLIR  20.0.0git
Parser.h
Go to the documentation of this file.
1 //===- Parser.h - MLIR PDLL Frontend Parser ---------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef MLIR_TOOLS_PDLL_PARSER_PARSER_H_
10 #define MLIR_TOOLS_PDLL_PARSER_PARSER_H_
11 
12 #include <memory>
13 
14 #include "mlir/Support/LLVM.h"
15 
16 namespace llvm {
17 class SourceMgr;
18 } // namespace llvm
19 
20 namespace mlir {
21 namespace pdll {
22 class CodeCompleteContext;
23 
24 namespace ast {
25 class Context;
26 class Module;
27 } // namespace ast
28 
29 /// Parse an AST module from the main file of the given source manager.
30 /// `enableDocumentation` is an optional flag that, when set, indicates that the
31 /// parser should also include documentation when building the AST when
32 /// possible. `codeCompleteContext` is an optional code completion context that
33 /// may be provided to receive code completion suggestions. If a completion is
34 /// hit, this method returns a failure.
35 FailureOr<ast::Module *>
36 parsePDLLAST(ast::Context &ctx, llvm::SourceMgr &sourceMgr,
37  bool enableDocumentation = false,
38  CodeCompleteContext *codeCompleteContext = nullptr);
39 } // namespace pdll
40 } // namespace mlir
41 
42 #endif // MLIR_TOOLS_PDLL_PARSER_PARSER_H_
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Definition: CallGraph.h:229
FailureOr< ast::Module * > parsePDLLAST(ast::Context &ctx, llvm::SourceMgr &sourceMgr, bool enableDocumentation=false, CodeCompleteContext *codeCompleteContext=nullptr)
Parse an AST module from the main file of the given source manager.
Definition: Parser.cpp:3194
Include the generated interface declarations.