LLDB mainline
|
#include <CPlusPlusNameParser.h>
Classes | |
class | Bookmark |
struct | ParsedFunction |
struct | ParsedName |
struct | ParsedNameRanges |
struct | Range |
Public Member Functions | |
CPlusPlusNameParser (llvm::StringRef text) | |
std::optional< ParsedFunction > | ParseAsFunctionDefinition () |
std::optional< ParsedName > | ParseAsFullName () |
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< ParsedFunction > | ParseFunctionImpl (bool expect_return_type) |
std::optional< ParsedFunction > | ParseFuncPtr (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:' ... ']'. | |
std::optional< ParsedNameRanges > | ParseFullNameImpl () |
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 |
Definition at line 23 of file CPlusPlusNameParser.h.
|
inline |
Definition at line 25 of file CPlusPlusNameParser.h.
References ExtractTokens().
|
private |
Definition at line 67 of file CPlusPlusNameParser.cpp.
References m_next_token_index.
Referenced by ConsumeAbiTag(), ConsumeAnonymousNamespace(), ConsumeBrackets(), ConsumeBuiltinType(), ConsumeOperator(), ConsumeTemplateArgs(), ConsumeToken(), and ParseFullNameImpl().
|
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 Advance(), ConsumeToken(), HasMoreTokens(), Peek(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), and SetBookmark().
Referenced by ConsumeTemplateArgs(), and ParseFullNameImpl().
|
private |
Definition at line 328 of file CPlusPlusNameParser.cpp.
References Advance(), ConsumeToken(), HasMoreTokens(), Peek(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), and SetBookmark().
Referenced by ParseFullNameImpl().
|
private |
Definition at line 219 of file CPlusPlusNameParser.cpp.
References ConsumeBrackets().
Referenced by ConsumeDecltype(), ConsumeTemplateArgs(), ParseFullNameImpl(), ParseFuncPtr(), and ParseFunctionImpl().
|
private |
Definition at line 374 of file CPlusPlusNameParser.cpp.
References Advance(), HasMoreTokens(), Peek(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), and SetBookmark().
Referenced by ConsumeArguments(), ConsumeLambda(), ConsumeOperator(), and ConsumeTemplateArgs().
|
private |
Definition at line 495 of file CPlusPlusNameParser.cpp.
References Advance(), HasMoreTokens(), and Peek().
Referenced by ConsumeTypename().
|
private |
Definition at line 547 of file CPlusPlusNameParser.cpp.
References ConsumeArguments(), ConsumeToken(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), and SetBookmark().
Referenced by ConsumeTypename().
|
private |
Definition at line 352 of file CPlusPlusNameParser.cpp.
References ConsumeBrackets(), ConsumeToken(), HasMoreTokens(), Peek(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), SetBookmark(), and TakeBack().
Referenced by ParseFullNameImpl().
|
private |
Definition at line 399 of file CPlusPlusNameParser.cpp.
References Advance(), ConsumeBrackets(), ConsumeToken(), ConsumeTypename(), HasMoreTokens(), m_next_token_index, m_tokens, Peek(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), and SetBookmark().
Referenced by ConsumeTemplateArgs(), and ParseFullNameImpl().
|
private |
Definition at line 536 of file CPlusPlusNameParser.cpp.
References ConsumeToken(), and SkipTypeQualifiers().
Referenced by ParseFuncPtr(), and SkipPtrsAndRefs().
|
private |
Definition at line 223 of file CPlusPlusNameParser.cpp.
References Advance(), ConsumeAbiTag(), ConsumeArguments(), ConsumeBrackets(), ConsumeOperator(), HasMoreTokens(), Peek(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), and SetBookmark().
Referenced by ParseFullNameImpl().
|
private |
|
private |
Definition at line 82 of file CPlusPlusNameParser.cpp.
References Advance(), HasMoreTokens(), and Peek().
|
private |
Definition at line 559 of file CPlusPlusNameParser.cpp.
References ConsumeBuiltinType(), ConsumeDecltype(), ParseFullNameImpl(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), SetBookmark(), SkipPtrsAndRefs(), and SkipTypeQualifiers().
Referenced by ConsumeOperator(), ParseFuncPtr(), and ParseFunctionImpl().
|
private |
Definition at line 767 of file CPlusPlusNameParser.cpp.
References GetKeywordsMap(), GetLangOptions(), m_text, and m_tokens.
Referenced by CPlusPlusNameParser().
|
private |
Definition at line 97 of file CPlusPlusNameParser.cpp.
References m_next_token_index.
Referenced by ParseFullNameImpl(), and ParseFunctionImpl().
|
private |
Definition at line 727 of file CPlusPlusNameParser.cpp.
References lldb_private::CPlusPlusNameParser::Range::begin_index, lldb_private::CPlusPlusNameParser::Range::empty(), lldb_private::CPlusPlusNameParser::Range::end_index, m_text, and m_tokens.
Referenced by ParseAsFullName(), and ParseFunctionImpl().
|
private |
Definition at line 63 of file CPlusPlusNameParser.cpp.
References m_next_token_index, and m_tokens.
Referenced by ConsumeAbiTag(), ConsumeAnonymousNamespace(), ConsumeBrackets(), ConsumeBuiltinType(), ConsumeLambda(), ConsumeOperator(), ConsumeTemplateArgs(), ConsumeToken(), ParseAsFullName(), ParseAsFunctionDefinition(), ParseFullNameImpl(), and Peek().
std::optional< ParsedName > CPlusPlusNameParser::ParseAsFullName | ( | ) |
Definition at line 50 of file CPlusPlusNameParser.cpp.
References lldb_private::CPlusPlusNameParser::ParsedName::basename, lldb_private::CPlusPlusNameParser::ParsedName::context, GetTextForRange(), HasMoreTokens(), m_next_token_index, and ParseFullNameImpl().
Referenced by lldb_private::CPlusPlusLanguage::ExtractContextAndIdentifier().
std::optional< ParsedFunction > CPlusPlusNameParser::ParseAsFunctionDefinition | ( | ) |
Definition at line 23 of file CPlusPlusNameParser.cpp.
References HasMoreTokens(), m_next_token_index, ParseFuncPtr(), ParseFunctionImpl(), and SetBookmark().
Referenced by lldb_private::CPlusPlusLanguage::MethodName::Parse().
|
private |
Definition at line 572 of file CPlusPlusNameParser.cpp.
References Advance(), lldb_private::CPlusPlusNameParser::ParsedNameRanges::basename_range, ConsumeAbiTag(), ConsumeAnonymousNamespace(), ConsumeArguments(), ConsumeLambda(), ConsumeOperator(), ConsumeTemplateArgs(), ConsumeToken(), lldb_private::CPlusPlusNameParser::ParsedNameRanges::context_range, GetCurrentPosition(), lldb_private::CPlusPlusNameParser::Bookmark::GetSavedPosition(), HasMoreTokens(), Peek(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), SetBookmark(), SkipFunctionQualifiers(), lldb_private::State, and TakeBack().
Referenced by ConsumeTypename(), ParseAsFullName(), and ParseFunctionImpl().
|
private |
Definition at line 142 of file CPlusPlusNameParser.cpp.
References ConsumeArguments(), ConsumePtrsAndRefs(), ConsumeToken(), ConsumeTypename(), ParseFuncPtr(), ParseFunctionImpl(), lldb_private::CPlusPlusNameParser::Bookmark::Remove(), SetBookmark(), and SkipFunctionQualifiers().
Referenced by ParseAsFunctionDefinition(), and ParseFuncPtr().
|
private |
Definition at line 105 of file CPlusPlusNameParser.cpp.
References lldb_private::CPlusPlusNameParser::ParsedFunction::arguments, lldb_private::CPlusPlusNameParser::ParsedName::basename, ConsumeArguments(), ConsumeToken(), ConsumeTypename(), lldb_private::CPlusPlusNameParser::ParsedName::context, GetCurrentPosition(), GetTextForRange(), lldb_private::CPlusPlusNameParser::ParsedFunction::name, ParseFullNameImpl(), lldb_private::CPlusPlusNameParser::ParsedFunction::qualifiers, lldb_private::CPlusPlusNameParser::Bookmark::Remove(), lldb_private::CPlusPlusNameParser::ParsedFunction::return_type, SetBookmark(), and SkipFunctionQualifiers().
Referenced by ParseAsFunctionDefinition(), and ParseFuncPtr().
|
private |
Definition at line 99 of file CPlusPlusNameParser.cpp.
References HasMoreTokens(), m_next_token_index, and m_tokens.
Referenced by ConsumeAbiTag(), ConsumeAnonymousNamespace(), ConsumeBrackets(), ConsumeBuiltinType(), ConsumeLambda(), ConsumeOperator(), ConsumeTemplateArgs(), ConsumeToken(), and ParseFullNameImpl().
|
private |
Definition at line 93 of file CPlusPlusNameParser.cpp.
References m_next_token_index.
Referenced by ConsumeAbiTag(), ConsumeAnonymousNamespace(), ConsumeBrackets(), ConsumeDecltype(), ConsumeLambda(), ConsumeOperator(), ConsumeTemplateArgs(), ConsumeTypename(), ParseAsFunctionDefinition(), ParseFullNameImpl(), ParseFuncPtr(), and ParseFunctionImpl().
|
private |
Definition at line 490 of file CPlusPlusNameParser.cpp.
References ConsumeToken().
Referenced by ParseFullNameImpl(), ParseFuncPtr(), and ParseFunctionImpl().
|
private |
Definition at line 531 of file CPlusPlusNameParser.cpp.
References ConsumePtrsAndRefs().
Referenced by ConsumeTypename().
|
private |
Definition at line 485 of file CPlusPlusNameParser.cpp.
References ConsumeToken().
Referenced by ConsumePtrsAndRefs(), and ConsumeTypename().
|
private |
Definition at line 69 of file CPlusPlusNameParser.cpp.
References m_next_token_index.
Referenced by ConsumeLambda(), and ParseFullNameImpl().
|
private |
Definition at line 66 of file CPlusPlusNameParser.h.
Referenced by Advance(), ConsumeOperator(), GetCurrentPosition(), HasMoreTokens(), ParseAsFullName(), ParseAsFunctionDefinition(), Peek(), SetBookmark(), and TakeBack().
|
private |
Definition at line 62 of file CPlusPlusNameParser.h.
Referenced by ExtractTokens(), and GetTextForRange().
|
private |
Definition at line 64 of file CPlusPlusNameParser.h.
Referenced by ConsumeOperator(), ExtractTokens(), GetTextForRange(), HasMoreTokens(), and Peek().