1 //===--- ParseAST.h - Define the ParseAST method ----------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file defines the clang::ParseAST method. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_CLANG_PARSE_PARSEAST_H 15 #define LLVM_CLANG_PARSE_PARSEAST_H 16 17 #include "clang/Basic/LangOptions.h" 18 19 namespace clang { 20 class Preprocessor; 21 class ASTConsumer; 22 class ASTContext; 23 class CodeCompleteConsumer; 24 class Sema; 25 26 /// \brief Parse the entire file specified, notifying the ASTConsumer as 27 /// the file is parsed. 28 /// 29 /// This operation inserts the parsed decls into the translation 30 /// unit held by Ctx. 31 /// 32 /// \param TUKind The kind of translation unit being parsed. 33 /// 34 /// \param CompletionConsumer If given, an object to consume code completion 35 /// results. 36 void ParseAST(Preprocessor &pp, ASTConsumer *C, 37 ASTContext &Ctx, bool PrintStats = false, 38 TranslationUnitKind TUKind = TU_Complete, 39 CodeCompleteConsumer *CompletionConsumer = nullptr, 40 bool SkipFunctionBodies = false); 41 42 /// \brief Parse the main file known to the preprocessor, producing an 43 /// abstract syntax tree. 44 void ParseAST(Sema &S, bool PrintStats = false, 45 bool SkipFunctionBodies = false); 46 47 } // end namespace clang 48 49 #endif 50