9#ifndef LLDB_VALUEOBJECT_DILLEXER_H
10#define LLDB_VALUEOBJECT_DILLEXER_H
13#include "llvm/ADT/StringRef.h"
14#include "llvm/Support/Error.h"
15#include "llvm/Support/FormatVariadic.h"
48 Token(
Kind kind, std::string spelling, uint32_t start)
59 bool IsOneOf(llvm::ArrayRef<Kind> kinds)
const {
60 return llvm::is_contained(kinds,
m_kind);
78 static llvm::Expected<DILLexer>
117 DILLexer(llvm::StringRef dil_expr, std::vector<Token> lexed_tokens)
121 static llvm::Expected<Token>
Lex(llvm::StringRef expr,
122 llvm::StringRef &remainder);
141 llvm::StringRef Options) {
148 llvm::StringRef Options) {
const Token & LookAhead(uint32_t N)
Return the lexed token N positions ahead of the 'current' token being handled by the DIL parser.
static llvm::Expected< DILLexer > Create(llvm::StringRef expr, lldb::DILMode mode=lldb::eDILModeFull)
Lexes all the tokens in expr and calls the private constructor with the lexed tokens.
void Advance(uint32_t N=1)
Advance the current token position by N.
DILLexer(llvm::StringRef dil_expr, std::vector< Token > lexed_tokens)
uint32_t GetCurrentTokenIdx()
Return the index for the 'current' token being handled by the DIL parser.
const Token & GetCurrentToken()
Return the current token to be handled by the DIL parser.
uint32_t NumLexedTokens()
void ResetTokenIdx(uint32_t new_value)
Set the index for the 'current' token (to be handled by the parser) to a particular position.
static llvm::Expected< Token > Lex(llvm::StringRef expr, llvm::StringRef &remainder)
std::vector< Token > m_lexed_tokens
Class defining the tokens generated by the DIL lexer and used by the DIL parser.
bool IsNot(Kind kind) const
static llvm::StringRef GetTokenName(Kind kind)
Token(Kind kind, std::string spelling, uint32_t start)
uint32_t GetLocation() const
std::string GetSpelling() const
bool IsOneOf(llvm::ArrayRef< Kind > kinds) const
A class that represents a running process on the host machine.
DILMode
Data Inspection Language (DIL) evaluation modes.
@ eDILModeFull
Allowed: everything supported by DIL.