LLDB  mainline
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::CPlusPlusNameParser Class Reference

#include <CPlusPlusNameParser.h>

Collaboration diagram for lldb_private::CPlusPlusNameParser:
Collaboration graph
[legend]

Classes

class  Bookmark
 
struct  ParsedFunction
 
struct  ParsedName
 
struct  ParsedNameRanges
 
struct  Range
 

Public Member Functions

 CPlusPlusNameParser (llvm::StringRef text)
 
std::optional< ParsedFunctionParseAsFunctionDefinition ()
 
std::optional< ParsedNameParseAsFullName ()
 

Private Member Functions

bool HasMoreTokens ()
 
void Advance ()
 
void TakeBack ()
 
bool ConsumeToken (clang::tok::TokenKind kind)
 
template<typename... Ts>
bool ConsumeToken (Ts... kinds)
 
Bookmark SetBookmark ()
 
size_t GetCurrentPosition ()
 
clang::Token & Peek ()
 
bool ConsumeBrackets (clang::tok::TokenKind left, clang::tok::TokenKind right)
 
std::optional< ParsedFunctionParseFunctionImpl (bool expect_return_type)
 
std::optional< ParsedFunctionParseFuncPtr (bool expect_return_type)
 
bool ConsumeArguments ()
 
bool ConsumeTemplateArgs ()
 
bool ConsumeAnonymousNamespace ()
 
bool ConsumeLambda ()
 
bool ConsumeOperator ()
 
void SkipTypeQualifiers ()
 
void SkipFunctionQualifiers ()
 
bool ConsumeBuiltinType ()
 
bool ConsumeDecltype ()
 
void SkipPtrsAndRefs ()
 
bool ConsumePtrsAndRefs ()
 
bool ConsumeTypename ()
 
bool ConsumeAbiTag ()
 Consumes ABI tags enclosed within '[abi:' ... More...
 
std::optional< ParsedNameRangesParseFullNameImpl ()
 
llvm::StringRef GetTextForRange (const Range &range)
 
void ExtractTokens ()
 

Private Attributes

llvm::StringRef m_text
 
llvm::SmallVector< clang::Token, 30 > m_tokens
 
size_t m_next_token_index = 0
 

Detailed Description

Definition at line 23 of file CPlusPlusNameParser.h.

Constructor & Destructor Documentation

◆ CPlusPlusNameParser()

lldb_private::CPlusPlusNameParser::CPlusPlusNameParser ( llvm::StringRef  text)
inline

Definition at line 25 of file CPlusPlusNameParser.h.

References ExtractTokens().

Member Function Documentation

◆ Advance()

void CPlusPlusNameParser::Advance ( )
private

Definition at line 67 of file CPlusPlusNameParser.cpp.

◆ ConsumeAbiTag()

bool CPlusPlusNameParser::ConsumeAbiTag ( )
private

Consumes ABI tags enclosed within '[abi:' ...

']'

Since there is no restriction on what the ABI tag string may contain, this API supports parsing a small set of special characters.

The following regex describes the set of supported characters: [A-Za-z,.\s\d]+

Definition at line 302 of file CPlusPlusNameParser.cpp.

References lldb_private::CPlusPlusNameParser::Bookmark::Remove().

◆ ConsumeAnonymousNamespace()

bool CPlusPlusNameParser::ConsumeAnonymousNamespace ( )
private

◆ ConsumeArguments()

bool CPlusPlusNameParser::ConsumeArguments ( )
private

Definition at line 219 of file CPlusPlusNameParser.cpp.

◆ ConsumeBrackets()

bool CPlusPlusNameParser::ConsumeBrackets ( clang::tok::TokenKind  left,
clang::tok::TokenKind  right 
)
private

◆ ConsumeBuiltinType()

bool CPlusPlusNameParser::ConsumeBuiltinType ( )
private

Definition at line 495 of file CPlusPlusNameParser.cpp.

◆ ConsumeDecltype()

bool CPlusPlusNameParser::ConsumeDecltype ( )
private

◆ ConsumeLambda()

bool CPlusPlusNameParser::ConsumeLambda ( )
private

◆ ConsumeOperator()

bool CPlusPlusNameParser::ConsumeOperator ( )
private

◆ ConsumePtrsAndRefs()

bool CPlusPlusNameParser::ConsumePtrsAndRefs ( )
private

Definition at line 536 of file CPlusPlusNameParser.cpp.

◆ ConsumeTemplateArgs()

bool CPlusPlusNameParser::ConsumeTemplateArgs ( )
private

◆ ConsumeToken() [1/2]

bool lldb_private::CPlusPlusNameParser::ConsumeToken ( clang::tok::TokenKind  kind)
private

◆ ConsumeToken() [2/2]

template<typename... Ts>
bool CPlusPlusNameParser::ConsumeToken ( Ts...  kinds)
private

Definition at line 82 of file CPlusPlusNameParser.cpp.

◆ ConsumeTypename()

bool CPlusPlusNameParser::ConsumeTypename ( )
private

◆ ExtractTokens()

void CPlusPlusNameParser::ExtractTokens ( )
private

Definition at line 766 of file CPlusPlusNameParser.cpp.

References GetKeywordsMap(), and GetLangOptions().

Referenced by CPlusPlusNameParser().

◆ GetCurrentPosition()

size_t CPlusPlusNameParser::GetCurrentPosition ( )
private

Definition at line 97 of file CPlusPlusNameParser.cpp.

◆ GetTextForRange()

llvm::StringRef CPlusPlusNameParser::GetTextForRange ( const Range range)
private

◆ HasMoreTokens()

bool CPlusPlusNameParser::HasMoreTokens ( )
private

Definition at line 63 of file CPlusPlusNameParser.cpp.

◆ ParseAsFullName()

std::optional< ParsedName > CPlusPlusNameParser::ParseAsFullName ( )

◆ ParseAsFunctionDefinition()

std::optional< ParsedFunction > CPlusPlusNameParser::ParseAsFunctionDefinition ( )

◆ ParseFullNameImpl()

std::optional< CPlusPlusNameParser::ParsedNameRanges > CPlusPlusNameParser::ParseFullNameImpl ( )
private

◆ ParseFuncPtr()

std::optional< ParsedFunction > CPlusPlusNameParser::ParseFuncPtr ( bool  expect_return_type)
private

◆ ParseFunctionImpl()

std::optional< ParsedFunction > CPlusPlusNameParser::ParseFunctionImpl ( bool  expect_return_type)
private

◆ Peek()

clang::Token & CPlusPlusNameParser::Peek ( )
private

Definition at line 99 of file CPlusPlusNameParser.cpp.

◆ SetBookmark()

CPlusPlusNameParser::Bookmark CPlusPlusNameParser::SetBookmark ( )
private

Definition at line 93 of file CPlusPlusNameParser.cpp.

◆ SkipFunctionQualifiers()

void CPlusPlusNameParser::SkipFunctionQualifiers ( )
private

Definition at line 490 of file CPlusPlusNameParser.cpp.

◆ SkipPtrsAndRefs()

void CPlusPlusNameParser::SkipPtrsAndRefs ( )
private

Definition at line 531 of file CPlusPlusNameParser.cpp.

◆ SkipTypeQualifiers()

void CPlusPlusNameParser::SkipTypeQualifiers ( )
private

Definition at line 485 of file CPlusPlusNameParser.cpp.

◆ TakeBack()

void CPlusPlusNameParser::TakeBack ( )
private

Definition at line 69 of file CPlusPlusNameParser.cpp.

Member Data Documentation

◆ m_next_token_index

size_t lldb_private::CPlusPlusNameParser::m_next_token_index = 0
private

Definition at line 66 of file CPlusPlusNameParser.h.

◆ m_text

llvm::StringRef lldb_private::CPlusPlusNameParser::m_text
private

Definition at line 62 of file CPlusPlusNameParser.h.

◆ m_tokens

llvm::SmallVector<clang::Token, 30> lldb_private::CPlusPlusNameParser::m_tokens
private

Definition at line 64 of file CPlusPlusNameParser.h.


The documentation for this class was generated from the following files: