clang 22.0.0git
ParseAST.h
Go to the documentation of this file.
1//===--- ParseAST.h - Define the ParseAST method ----------------*- 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// This file defines the clang::ParseAST method.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_PARSE_PARSEAST_H
14#define LLVM_CLANG_PARSE_PARSEAST_H
15
17
18namespace clang {
19 class Preprocessor;
20 class ASTConsumer;
21 class ASTContext;
23 class Sema;
24
25 /// Parse the entire file specified, notifying the ASTConsumer as
26 /// the file is parsed.
27 ///
28 /// This operation inserts the parsed decls into the translation
29 /// unit held by Ctx.
30 ///
31 /// \param PrintStats Whether to print LLVM statistics related to parsing.
32 /// \param TUKind The kind of translation unit being parsed.
33 /// \param CompletionConsumer If given, an object to consume code completion
34 /// results.
35 /// \param SkipFunctionBodies Whether to skip parsing of function bodies.
36 /// This option can be used, for example, to speed up searches for
37 /// declarations/definitions when indexing.
39 ASTContext &Ctx, bool PrintStats = false,
41 CodeCompleteConsumer *CompletionConsumer = nullptr,
42 bool SkipFunctionBodies = false);
43
44 /// Parse the main file known to the preprocessor, producing an
45 /// abstract syntax tree.
46 void ParseAST(Sema &S, bool PrintStats = false,
47 bool SkipFunctionBodies = false);
48
49} // end namespace clang
50
51#endif
Defines the clang::LangOptions interface.
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs.
Definition ASTConsumer.h:34
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:188
Abstract interface for a consumer of code-completion information.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Sema - This implements semantic analysis and AST building for C.
Definition Sema.h:854
The JSON file list parser is used to communicate input to InstallAPI.
void ParseAST(Preprocessor &pp, ASTConsumer *C, ASTContext &Ctx, bool PrintStats=false, TranslationUnitKind TUKind=TU_Complete, CodeCompleteConsumer *CompletionConsumer=nullptr, bool SkipFunctionBodies=false)
Parse the entire file specified, notifying the ASTConsumer as the file is parsed.
Definition ParseAST.cpp:99
TranslationUnitKind
Describes the kind of translation unit being processed.
@ TU_Complete
The translation unit is a complete translation unit.