LLDB mainline
lldb_private::dil::DILLexer Class Reference

Class for doing the simple lexing required by DIL. More...

#include <DILLexer.h>

Public Member Functions

const TokenGetCurrentToken ()
 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 TokenLookAhead (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< DILLexerCreate (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< TokenLex (llvm::StringRef expr, llvm::StringRef &remainder)

Private Attributes

llvm::StringRef m_expr
std::vector< Tokenm_lexed_tokens
uint32_t m_tokens_idx

Detailed Description

Class for doing the simple lexing required by DIL.

Definition at line 72 of file DILLexer.h.

Constructor & Destructor Documentation

◆ DILLexer()

lldb_private::dil::DILLexer::DILLexer ( llvm::StringRef dil_expr,
std::vector< Token > lexed_tokens )
inlineprivate

Definition at line 114 of file DILLexer.h.

References m_expr, m_lexed_tokens, and m_tokens_idx.

Referenced by Create().

Member Function Documentation

◆ Advance()

void lldb_private::dil::DILLexer::Advance ( uint32_t N = 1)
inline

Advance the current token position by N.

Definition at line 82 of file DILLexer.h.

References m_lexed_tokens, and m_tokens_idx.

◆ Create()

llvm::Expected< DILLexer > lldb_private::dil::DILLexer::Create ( llvm::StringRef expr)
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().

◆ GetCurrentToken()

const Token & lldb_private::dil::DILLexer::GetCurrentToken ( )
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.

◆ GetCurrentTokenIdx()

uint32_t lldb_private::dil::DILLexer::GetCurrentTokenIdx ( )
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.

◆ Lex()

◆ LookAhead()

const Token & lldb_private::dil::DILLexer::LookAhead ( uint32_t N)
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.

◆ NumLexedTokens()

uint32_t lldb_private::dil::DILLexer::NumLexedTokens ( )
inline

Definition at line 111 of file DILLexer.h.

References m_lexed_tokens.

◆ ResetTokenIdx()

void lldb_private::dil::DILLexer::ResetTokenIdx ( uint32_t new_value)
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.

Member Data Documentation

◆ m_expr

llvm::StringRef lldb_private::dil::DILLexer::m_expr
private

Definition at line 122 of file DILLexer.h.

Referenced by DILLexer().

◆ m_lexed_tokens

std::vector<Token> lldb_private::dil::DILLexer::m_lexed_tokens
private

Definition at line 125 of file DILLexer.h.

Referenced by Advance(), DILLexer(), GetCurrentToken(), LookAhead(), NumLexedTokens(), and ResetTokenIdx().

◆ m_tokens_idx

uint32_t lldb_private::dil::DILLexer::m_tokens_idx
private

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