LLDB mainline
|
#include <RegularExpression.h>
Public Member Functions | |
RegularExpression ()=default | |
The default constructor that initializes the object state such that it contains no compiled regular expression. | |
RegularExpression (llvm::StringRef string, llvm::Regex::RegexFlags flags=llvm::Regex::NoFlags) | |
Constructor for a regular expression. | |
~RegularExpression ()=default | |
RegularExpression (const RegularExpression &rhs) | |
RegularExpression (RegularExpression &&rhs)=default | |
RegularExpression & | operator= (RegularExpression &&rhs)=default |
RegularExpression & | operator= (const RegularExpression &rhs)=default |
bool | Execute (llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const |
Execute a regular expression match using the compiled regular expression that is already in this object against the given string. | |
llvm::StringRef | GetText () const |
Access the regular expression text. | |
bool | IsValid () const |
Test if this object contains a valid regular expression. | |
llvm::Error | GetError () const |
Return an error if the regular expression failed to compile. | |
bool | operator== (const RegularExpression &rhs) const |
Private Attributes | |
std::string | m_regex_text |
A copy of the original regular expression text. | |
llvm::Regex | m_regex |
The compiled regular expression. | |
Definition at line 18 of file RegularExpression.h.
|
default |
The default constructor that initializes the object state such that it contains no compiled regular expression.
|
explicit |
Constructor for a regular expression.
Compile a regular expression using the supplied regular expression text. The compiled regular expression lives in this object so that it can be readily used for regular expression matches. Execute() can be called after the regular expression is compiled.
[in] | string | An llvm::StringRef that represents the regular expression to compile. |
[in] | flags | An llvm::Regex::RegexFlags that modifies the matching behavior. The default is NoFlags. |
Definition at line 15 of file RegularExpression.cpp.
|
default |
RegularExpression::RegularExpression | ( | const RegularExpression & | rhs | ) |
Definition at line 21 of file RegularExpression.cpp.
|
default |
bool RegularExpression::Execute | ( | llvm::StringRef | string, |
llvm::SmallVectorImpl< llvm::StringRef > * | matches = nullptr |
||
) | const |
Execute a regular expression match using the compiled regular expression that is already in this object against the given string.
If any parens are used for regular expression matches.
[in] | string | The string to match against the compile regular expression. |
[out] | matches | A pointer to a SmallVector to hold the matches. |
Definition at line 24 of file RegularExpression.cpp.
References IsValid(), and m_regex.
Referenced by lldb_private::Symtab::AppendSymbolIndexesMatchingRegExAndType(), InstructionLLVMC::CalculateMnemonicOperandsAndComment(), lldb_private::OptionArgParser::DoToAddress(), lldb_private::Disassembler::ElideMixedSourceAndDisassemblyLine(), lldb_private::plugin::dwarf::NameToDIE::Find(), lldb_private::SymbolFileCTF::FindFunctions(), lldb_private::SymbolFileCTF::FindGlobalVariables(), SymbolFilePDB::FindGlobalVariables(), lldb_private::SourceManager::File::FindLinesMatchingRegex(), lldb_private::SymbolFileCTF::FindTypesByRegex(), SymbolFilePDB::FindTypesByRegex(), lldb_private::ThreadPlanStepInRange::FrameMatchesAvoidCriteria(), lldb_private::plugin::dwarf::DebugNamesDWARFIndex::GetFunctions(), lldb_private::UniqueCStringMap< T >::GetValues(), lldb_private::Variable::GetValuesForVariableExpressionPath(), lldb_private::FileSpec::IsSourceImplementationFile(), lldb_private::TypeMatcher::Matches(), lldb_private::InstrumentationRuntime::ModulesDidLoad(), lldb_private::Mangled::NameMatches(), lldb_private::Variable::NameMatches(), lldb_private::NameMatches(), lldb_private::plugin::dwarf::DWARFUnit::ParseProducerInfo(), lldb_private::ClangREPL::PrintOneVariable(), lldb_private::Instruction::ReadArray(), lldb_private::Instruction::ReadDictionary(), LibCXXFrameRecognizer::RecognizeFrame(), CommandObjectTypeFormatterList< FormatterType >::ShouldListItem(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::WaitForPacketNoLock().
llvm::Error RegularExpression::GetError | ( | ) | const |
Return an error if the regular expression failed to compile.
Definition at line 36 of file RegularExpression.cpp.
References error(), and m_regex.
Referenced by CommandObjectBreakpointSet::DoExecute(), CommandObjectFrameVariable::DoExecute(), and lldb_private::OptionValueRegex::SetValueFromString().
llvm::StringRef RegularExpression::GetText | ( | ) | const |
Access the regular expression text.
Definition at line 34 of file RegularExpression.cpp.
References m_regex_text.
Referenced by lldb_private::OptionValueRegex::DumpValue(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::FindFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindGlobalVariables(), lldb_private::Module::FindSymbolsMatchingRegExAndType(), lldb_private::ThreadPlanStepInRange::FrameMatchesAvoidCriteria(), lldb_private::BreakpointResolverFileRegex::GetDescription(), lldb_private::BreakpointResolverName::GetDescription(), lldb_private::plugin::dwarf::ManualDWARFIndex::GetFunctions(), lldb_private::plugin::dwarf::AppleDWARFIndex::GetGlobalVariables(), lldb_private::plugin::dwarf::ManualDWARFIndex::GetGlobalVariables(), lldb_private::TypeMatcher::GetMatchString(), operator==(), lldb_private::BreakpointResolverFileRegex::SearchCallback(), lldb_private::BreakpointResolverFileRegex::SerializeToStructuredData(), lldb_private::BreakpointResolverName::SerializeToStructuredData(), CommandObjectTypeFormatterList< FormatterType >::ShouldListItem(), and lldb_private::OptionValueRegex::ToJSON().
bool RegularExpression::IsValid | ( | ) | const |
Test if this object contains a valid regular expression.
Definition at line 32 of file RegularExpression.cpp.
References m_regex.
Referenced by CommandObjectTargetVariable::DoExecute(), CommandObjectFrameVariable::DoExecute(), CommandObjectTypeFilterAdd::DoExecute(), lldb_private::OptionValueRegex::DumpValue(), Execute(), SymbolFilePDB::FindFunctions(), SymbolFilePDB::FindGlobalVariables(), lldb_private::OptionValueRegex::GetCurrentValue(), lldb_private::OptionValueRegex::IsValid(), lldb_private::BreakpointResolverName::SerializeToStructuredData(), and lldb_private::OptionValueRegex::SetValueFromString().
|
default |
|
default |
|
inline |
Definition at line 87 of file RegularExpression.h.
References GetText().
|
mutableprivate |
The compiled regular expression.
Definition at line 95 of file RegularExpression.h.
Referenced by Execute(), GetError(), and IsValid().
|
private |
A copy of the original regular expression text.
Definition at line 93 of file RegularExpression.h.
Referenced by GetText().