LLVM 20.0.0git
|
Parses a log containing symbolizer markup into a sequence of nodes. More...
#include "llvm/DebugInfo/Symbolize/Markup.h"
Public Member Functions | |
MarkupParser (StringSet<> MultilineTags={}) | |
void | parseLine (StringRef Line) |
Parses an individual Line of input. | |
void | flush () |
Inform the parser of that the input stream has ended. | |
std::optional< MarkupNode > | nextNode () |
Returns the next node in the input sequence. | |
bool | isSGR (const MarkupNode &Node) const |
Parses a log containing symbolizer markup into a sequence of nodes.
llvm::symbolize::MarkupParser::MarkupParser | ( | StringSet<> | MultilineTags = {} | ) |
Definition at line 28 of file Markup.cpp.
void llvm::symbolize::MarkupParser::flush | ( | ) |
Inform the parser of that the input stream has ended.
This allows the parser to finish any deferred processing (e.g., an in-progress multi-line element) and may cause nextNode() to return additional nodes.
Definition at line 102 of file Markup.cpp.
|
inline |
Definition at line 84 of file Markup.h.
References llvm::Regex::match().
std::optional< MarkupNode > llvm::symbolize::MarkupParser::nextNode | ( | ) |
Returns the next node in the input sequence.
Calling nextNode() may invalidate the contents of the node returned by the previous call.
Definition at line 45 of file Markup.cpp.
References llvm::symbolize::advanceTo(), llvm::append_range(), assert(), llvm::StringRef::begin(), llvm::StringRef::drop_front(), llvm::StringRef::empty(), llvm::StringRef::end(), nextNode(), llvm::StringRef::size(), and llvm::symbolize::takeTo().
Referenced by nextNode().
void llvm::symbolize::MarkupParser::parseLine | ( | StringRef | Line | ) |
Parses an individual Line
of input.
Nodes from the previous parseLine() call that haven't yet been extracted by nextNode() are discarded. The nodes returned by nextNode() may reference the input string, so it must be retained by the caller until the last use.
Note that some elements may span multiple lines. If a line ends with the start of one of these elements, then no nodes will be produced until the either the end or something that cannot be part of an element is encountered. This may only occur after multiple calls to parseLine(), corresponding to the lines of the multi-line element.
Definition at line 38 of file Markup.cpp.