1 //===-- ClangHighlighter.h --------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_ClangHighlighter_h_
10 #define liblldb_ClangHighlighter_h_
12 #include "lldb/Utility/Stream.h"
13 #include "llvm/ADT/StringSet.h"
15 #include "lldb/Core/Highlighter.h"
17 namespace lldb_private {
19 class ClangHighlighter : public Highlighter {
20 llvm::StringSet<> keywords;
24 llvm::StringRef GetName() const override { return "clang"; }
26 void Highlight(const HighlightStyle &options, llvm::StringRef line,
27 llvm::Optional<size_t> cursor_pos,
28 llvm::StringRef previous_lines, Stream &s) const override;
30 /// Returns true if the given string represents a keywords in any Clang
31 /// supported language.
32 bool isKeyword(llvm::StringRef token) const;
35 } // namespace lldb_private
37 #endif // liblldb_ClangHighlighter_h_