LLVM 19.0.0git
Public Member Functions | List of all members
llvm::symbolize::MarkupParser Class Reference

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< MarkupNodenextNode ()
 Returns the next node in the input sequence.
 
bool isSGR (const MarkupNode &Node) const
 

Detailed Description

Parses a log containing symbolizer markup into a sequence of nodes.

Definition at line 51 of file Markup.h.

Constructor & Destructor Documentation

◆ MarkupParser()

llvm::symbolize::MarkupParser::MarkupParser ( StringSet<>  MultilineTags = {})

Definition at line 28 of file Markup.cpp.

Member Function Documentation

◆ flush()

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.

◆ isSGR()

bool llvm::symbolize::MarkupParser::isSGR ( const MarkupNode Node) const
inline

Definition at line 84 of file Markup.h.

References llvm::Regex::match().

◆ nextNode()

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.

Returns
the next markup node or std::nullopt if none remain.

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().

◆ parseLine()

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.


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