LLDB mainline
|
Class for doing the simple lexing required by DIL. More...
#include <DILLexer.h>
Public Member Functions | |
const Token & | GetCurrentToken () |
Return the current token to be handled by the DIL parser. | |
void | Advance (uint32_t N=1) |
Advance the current token position by N. | |
const Token & | LookAhead (uint32_t N) |
Return the lexed token N positions ahead of the 'current' token being handled by the DIL parser. | |
uint32_t | GetCurrentTokenIdx () |
Return the index for the 'current' token being handled by the DIL parser. | |
void | ResetTokenIdx (uint32_t new_value) |
Set the index for the 'current' token (to be handled by the parser) to a particular position. | |
uint32_t | NumLexedTokens () |
Static Public Member Functions | |
static llvm::Expected< DILLexer > | Create (llvm::StringRef expr) |
Lexes all the tokens in expr and calls the private constructor with the lexed tokens. |
Private Member Functions | |
DILLexer (llvm::StringRef dil_expr, std::vector< Token > lexed_tokens) |
Static Private Member Functions | |
static llvm::Expected< Token > | Lex (llvm::StringRef expr, llvm::StringRef &remainder) |
Private Attributes | |
llvm::StringRef | m_expr |
std::vector< Token > | m_lexed_tokens |
uint32_t | m_tokens_idx |
Class for doing the simple lexing required by DIL.
Definition at line 72 of file DILLexer.h.
|
inlineprivate |
Definition at line 114 of file DILLexer.h.
References m_expr, m_lexed_tokens, and m_tokens_idx.
Referenced by Create().
|
inline |
Advance the current token position by N.
Definition at line 82 of file DILLexer.h.
References m_lexed_tokens, and m_tokens_idx.
|
static |
Lexes all the tokens in expr and calls the private constructor with the lexed tokens.
Definition at line 112 of file DILLexer.cpp.
References DILLexer(), lldb_private::dil::Token::eof, and Lex().
Referenced by lldb_private::StackFrame::DILGetValueForVariableExpressionPath().
|
inline |
Return the current token to be handled by the DIL parser.
Definition at line 79 of file DILLexer.h.
References m_lexed_tokens, and m_tokens_idx.
|
inline |
Return the index for the 'current' token being handled by the DIL parser.
Definition at line 101 of file DILLexer.h.
References m_tokens_idx.
|
staticprivate |
Definition at line 125 of file DILLexer.cpp.
References lldb_private::dil::Token::amp, lldb_private::dil::Token::arrow, lldb_private::dil::Token::coloncolon, lldb_private::dil::Token::eof, lldb_private::dil::Token::float_constant, lldb_private::dil::Token::identifier, lldb_private::dil::Token::integer_constant, lldb_private::dil::IsNumber(), lldb_private::dil::IsWord(), lldb_private::dil::Token::kw_false, lldb_private::dil::Token::kw_true, lldb_private::dil::Token::l_paren, lldb_private::dil::Token::l_square, lldb_private::dil::Token::minus, lldb_private::dil::Token::period, lldb_private::dil::Token::plus, lldb_private::dil::Token::r_paren, lldb_private::dil::Token::r_square, and lldb_private::dil::Token::star.
Referenced by Create().
|
inline |
Return the lexed token N positions ahead of the 'current' token being handled by the DIL parser.
Definition at line 92 of file DILLexer.h.
References m_lexed_tokens, and m_tokens_idx.
|
inline |
Definition at line 111 of file DILLexer.h.
References m_lexed_tokens.
|
inline |
Set the index for the 'current' token (to be handled by the parser) to a particular position.
Used for either committing 'look ahead' parsing or rolling back tentative parsing.
Definition at line 106 of file DILLexer.h.
References m_lexed_tokens, and m_tokens_idx.
|
private |
Definition at line 122 of file DILLexer.h.
Referenced by DILLexer().
|
private |
Definition at line 125 of file DILLexer.h.
Referenced by Advance(), DILLexer(), GetCurrentToken(), LookAhead(), NumLexedTokens(), and ResetTokenIdx().
|
private |
Definition at line 129 of file DILLexer.h.
Referenced by Advance(), DILLexer(), GetCurrentToken(), GetCurrentTokenIdx(), LookAhead(), and ResetTokenIdx().