MLIR 22.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
16namespace llvm {
17class SourceMgr;
18} // namespace llvm
19
20namespace mlir {
21namespace pdll {
23
24namespace ast {
25class Context;
26class 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.
35FailureOr<ast::Module *>
36parsePDLLAST(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_
This class provides an abstract interface into the parser for hooking in code completion events.
This class represents the main context of the PDLL AST.
Definition Context.h:25
This class represents a top-level AST module.
Definition Nodes.h:1297
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:3205
Include the generated interface declarations.