llvm/clang/lib/Rewrite/HTMLRewrite.cpp

//== HTMLRewrite.cpp - Translate source code into prettified HTML --*- C++ -*-//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//  This file defines the HTMLRewriter class, which is used to translate the
//  text of a source file into prettified HTML.
//
//===----------------------------------------------------------------------===//

#include "clang/Rewrite/Core/HTMLRewrite.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/TokenConcatenation.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "llvm/ADT/RewriteBuffer.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>

usingnamespaceclang;
usingnamespacellvm;
usingnamespacehtml;

/// HighlightRange - Highlight a range in the source code with the specified
/// start/end tags.  B/E must be in the same file.  This ensures that
/// start/end tags are placed at the start/end of each line if the range is
/// multiline.
void html::HighlightRange(Rewriter &R, SourceLocation B, SourceLocation E,
                          const char *StartTag, const char *EndTag,
                          bool IsTokenRange) {}

/// HighlightRange - This is the same as the above method, but takes
/// decomposed file locations.
void html::HighlightRange(RewriteBuffer &RB, unsigned B, unsigned E,
                          const char *BufferStart,
                          const char *StartTag, const char *EndTag) {}

namespace clang::html {
struct RelexRewriteCache {};
} // namespace clang::html

html::RelexRewriteCacheRef html::instantiateRelexRewriteCache() {}

void html::EscapeText(Rewriter &R, FileID FID,
                      bool EscapeSpaces, bool ReplaceTabs) {}

std::string html::EscapeText(StringRef s, bool EscapeSpaces, bool ReplaceTabs) {}

static void AddLineNumber(RewriteBuffer &RB, unsigned LineNo,
                          unsigned B, unsigned E) {}

void html::AddLineNumbers(Rewriter& R, FileID FID) {}

void html::AddHeaderFooterInternalBuiltinCSS(Rewriter &R, FileID FID,
                                             StringRef title) {}

/// SyntaxHighlight - Relex the specified FileID and annotate the HTML with
/// information about keywords, macro expansions etc.  This uses the macro
/// table state from the end of the file, so it won't be perfectly perfect,
/// but it will be reasonably close.
static void SyntaxHighlightImpl(
    Rewriter &R, FileID FID, const Preprocessor &PP,
    llvm::function_ref<void(RewriteBuffer &, unsigned, unsigned, const char *,
                            const char *, const char *)>
        HighlightRangeCallback) {}
void html::SyntaxHighlight(Rewriter &R, FileID FID, const Preprocessor &PP,
                           RelexRewriteCacheRef Cache) {}

static void HighlightMacrosImpl(
    Rewriter &R, FileID FID, const Preprocessor &PP,
    llvm::function_ref<void(Rewriter &, SourceLocation, SourceLocation,
                            const char *, const char *, bool)>
        HighlightRangeCallback) {}

/// HighlightMacros - This uses the macro table state from the end of the
/// file, to re-expand macros and insert (into the HTML) information about the
/// macro expansions.  This won't be perfectly perfect, but it will be
/// reasonably close.
void html::HighlightMacros(Rewriter &R, FileID FID, const Preprocessor &PP,
                           RelexRewriteCacheRef Cache) {}