clang  20.0.0git
Classes | Namespaces | Functions
HTMLRewrite.cpp File Reference
#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>

Go to the source code of this file.

Classes

struct  clang::html::RelexRewriteCache
 
struct  clang::html::RelexRewriteCache::Highlight
 
struct  clang::html::RelexRewriteCache::RawHighlight
 

Namespaces

 clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
 clang::html
 

Functions

static void AddLineNumber (RewriteBuffer &RB, unsigned LineNo, unsigned B, unsigned E)
 
static void SyntaxHighlightImpl (Rewriter &R, FileID FID, const Preprocessor &PP, llvm::function_ref< void(RewriteBuffer &, unsigned, unsigned, const char *, const char *, const char *)> HighlightRangeCallback)
 SyntaxHighlight - Relex the specified FileID and annotate the HTML with information about keywords, macro expansions etc. More...
 
static void HighlightMacrosImpl (Rewriter &R, FileID FID, const Preprocessor &PP, llvm::function_ref< void(Rewriter &, SourceLocation, SourceLocation, const char *, const char *, bool)> HighlightRangeCallback)
 

Function Documentation

◆ AddLineNumber()

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

Definition at line 238 of file HTMLRewrite.cpp.

References E.

Referenced by clang::html::AddLineNumbers().

◆ HighlightMacrosImpl()

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

Definition at line 455 of file HTMLRewrite.cpp.

◆ SyntaxHighlightImpl()

static void SyntaxHighlightImpl ( Rewriter R,
FileID  FID,
const Preprocessor PP,
llvm::function_ref< void(RewriteBuffer &, unsigned, unsigned, const char *, const char *, const char *)>  HighlightRangeCallback 
)
static

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.

Definition at line 334 of file HTMLRewrite.cpp.