Path: blob/main/contrib/llvm-project/lldb/source/Plugins/REPL/Clang/ClangREPL.h
39653 views
//===-- ClangREPL.h ---------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H9#define LLDB_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H1011#include "lldb/Expression/REPL.h"1213namespace lldb_private {14/// Implements a Clang-based REPL for C languages on top of LLDB's REPL15/// framework.16class ClangREPL : public llvm::RTTIExtends<ClangREPL, REPL> {17public:18// LLVM RTTI support19static char ID;2021ClangREPL(lldb::LanguageType language, Target &target);2223~ClangREPL() override;2425static void Initialize();2627static void Terminate();2829static lldb::REPLSP CreateInstance(Status &error, lldb::LanguageType language,30Debugger *debugger, Target *target,31const char *repl_options);3233static llvm::StringRef GetPluginNameStatic() { return "ClangREPL"; }3435protected:36Status DoInitialization() override;3738llvm::StringRef GetSourceFileBasename() override;3940const char *GetAutoIndentCharacters() override;4142bool SourceIsComplete(const std::string &source) override;4344lldb::offset_t GetDesiredIndentation(const StringList &lines,45int cursor_position,46int tab_size) override;4748lldb::LanguageType GetLanguage() override;4950bool PrintOneVariable(Debugger &debugger, lldb::StreamFileSP &output_sp,51lldb::ValueObjectSP &valobj_sp,52ExpressionVariable *var = nullptr) override;5354void CompleteCode(const std::string ¤t_code,55CompletionRequest &request) override;5657private:58/// The specific C language of this REPL.59lldb::LanguageType m_language;60/// A regex matching the implicitly created LLDB result variables.61lldb_private::RegularExpression m_implicit_expr_result_regex;62};63} // namespace lldb_private6465#endif // LLDB_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H666768