class Lexer

Declaration

class Lexer { /* full declaration omitted */ };

Description

Comment lexer.

Declared at: clang/include/clang/AST/CommentLexer.h:220

Member Variables

private llvm::BumpPtrAllocator& Allocator
Allocator for strings that are semantic values of tokens and have to be computed (for example, resolved decimal character references).
private clang::DiagnosticsEngine& Diags
private const clang::comments::CommandTraits& Traits
private const char* const BufferStart
private const char* const BufferEnd
private const char* BufferPtr
private const char* CommentEnd
One past end pointer for the current comment. For BCPL comments points to newline or BufferEnd, for C comments points to star in '*/'.
private clang::SourceLocation FileLoc
private bool ParseCommands
If true, the commands, html tags, etc will be parsed and reported as separate tokens inside the comment body. If false, the comment text will be parsed into text and newline tokens.
private clang::comments::Lexer::LexerCommentState CommentState
Low-level lexer state, track if we are inside or outside of comment.
private clang::comments::Lexer::LexerState State
Current lexing mode.
private SmallString<16> VerbatimBlockEndCommandName
If State is LS_VerbatimBlock, contains the name of verbatim end command, including command marker.

Method Overview

Methods

clang::DiagnosticBuilder Diag(
    clang::SourceLocation Loc,
    unsigned int DiagID)

Declared at: clang/include/clang/AST/CommentLexer.h:316

Parameters

clang::SourceLocation Loc
unsigned int DiagID

Lexer(
    llvm::BumpPtrAllocator& Allocator,
    clang::DiagnosticsEngine& Diags,
    const clang::comments::CommandTraits& Traits,
    clang::SourceLocation FileLoc,
    const char* BufferStart,
    const char* BufferEnd,
    bool ParseCommands = true)

Declared at: clang/include/clang/AST/CommentLexer.h:352

Parameters

llvm::BumpPtrAllocator& Allocator
clang::DiagnosticsEngine& Diags
const clang::comments::CommandTraits& Traits
clang::SourceLocation FileLoc
const char* BufferStart
const char* BufferEnd
bool ParseCommands = true

Lexer(const clang::comments::Lexer&)

Declared at: clang/include/clang/AST/CommentLexer.h:222

Parameters

const clang::comments::Lexer&

void formTextToken(clang::comments::Token& Result,
                   const char* TokEnd)

Declared at: clang/include/clang/AST/CommentLexer.h:302

Parameters

clang::comments::Token& Result
const char* TokEnd

void formTokenWithChars(
    clang::comments::Token& Result,
    const char* TokEnd,
    tok::TokenKind Kind)

Declared at: clang/include/clang/AST/CommentLexer.h:299

Parameters

clang::comments::Token& Result
const char* TokEnd
tok::TokenKind Kind

clang::SourceLocation getSourceLocation(
    const char* Loc) const

Declared at: clang/include/clang/AST/CommentLexer.h:308

Parameters

const char* Loc

llvm::StringRef getSpelling(
    const clang::comments::Token& Tok,
    const clang::SourceManager& SourceMgr) const

Declared at: clang/include/clang/AST/CommentLexer.h:359

Parameters

const clang::comments::Token& Tok
const clang::SourceManager& SourceMgr

void lex(clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:357

Parameters

clang::comments::Token& T

void lexCommentText(clang::comments::Token& T)

Description

Lex comment text, including commands if ParseCommands is set to true.

Declared at: clang/include/clang/AST/CommentLexer.h:327

Parameters

clang::comments::Token& T

void lexHTMLCharacterReference(
    clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:341

Parameters

clang::comments::Token& T

void lexHTMLEndTag(clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:349

Parameters

clang::comments::Token& T

void lexHTMLStartTag(clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:345

Parameters

clang::comments::Token& T

void lexVerbatimBlockBody(
    clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:334

Parameters

clang::comments::Token& T

void lexVerbatimBlockFirstLine(
    clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:332

Parameters

clang::comments::Token& T

void lexVerbatimLineText(
    clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:339

Parameters

clang::comments::Token& T

llvm::StringRef
resolveHTMLDecimalCharacterReference(
    llvm::StringRef Name) const

Description

Given a Unicode codepoint as base-10 integer, return the character.

Declared at: clang/include/clang/AST/CommentLexer.h:294

Parameters

llvm::StringRef Name

llvm::StringRef resolveHTMLHexCharacterReference(
    llvm::StringRef Name) const

Description

Given a Unicode codepoint as base-16 integer, return the character.

Declared at: clang/include/clang/AST/CommentLexer.h:297

Parameters

llvm::StringRef Name

llvm::StringRef
resolveHTMLNamedCharacterReference(
    llvm::StringRef Name) const

Description

Given a character reference name (e.g., "lt"), return the character that it stands for (e.g., "<").

Declared at: clang/include/clang/AST/CommentLexer.h:291

Parameters

llvm::StringRef Name

void setupAndLexHTMLEndTag(
    clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:347

Parameters

clang::comments::Token& T

void setupAndLexHTMLStartTag(
    clang::comments::Token& T)

Declared at: clang/include/clang/AST/CommentLexer.h:343

Parameters

clang::comments::Token& T

void setupAndLexVerbatimBlock(
    clang::comments::Token& T,
    const char* TextBegin,
    char Marker,
    const clang::comments::CommandInfo* Info)

Declared at: clang/include/clang/AST/CommentLexer.h:329

Parameters

clang::comments::Token& T
const char* TextBegin
char Marker
const clang::comments::CommandInfo* Info

void setupAndLexVerbatimLine(
    clang::comments::Token& T,
    const char* TextBegin,
    const clang::comments::CommandInfo* Info)

Declared at: clang/include/clang/AST/CommentLexer.h:336

Parameters

clang::comments::Token& T
const char* TextBegin
const clang::comments::CommandInfo* Info

void skipLineStartingDecorations()

Description

Eat string matching regexp .

Declared at: clang/include/clang/AST/CommentLexer.h:321

const char* skipTextToken()

Description

Skip over pure text.

Declared at: clang/include/clang/AST/CommentLexer.h:324