1#ifndef ROSE_BinaryAnalysis_Unparser_EdgeArrows_H
2#define ROSE_BinaryAnalysis_Unparser_EdgeArrows_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
7#include <Sawyer/Graph.h>
8#include <Sawyer/Interval.h>
9#include <Sawyer/IntervalMap.h>
10#include <Sawyer/Map.h>
11#include <Rose/StringUtility.h>
16namespace BinaryAnalysis {
86 OutputLocation location;
92 Arrow(
const OutputLocation &location,
bool isForward)
93 : location(location), isForward(isForward) {}
95 bool operator==(
const Arrow &other) {
96 return location == other.location && isForward == other.isForward;
104 typedef std::vector<Column> Columns;
107 OutputLocation outputHull_;
108 VertexLocations vertexLocations_;
110 ArrowStyle arrowStyle_;
238 static bool ascendingLength(
const Arrow &a,
const Arrow &b);
Analysis to generate arrows from one basic block to another.
std::string render(VertexId, OutputPart) const
Render arrow columsn for a vertex.
void computeLayout(const Graph &, const std::vector< VertexId > &order=std::vector< VertexId >())
Analyze connectivity in order to assign arrow locations.
ArrowSide
On which side of the listing do the errors appear.
@ RIGHT
Arrows appear right of the listing and point to the left.
@ LEFT
Arrows appear left of the listing and point to the right.
Sawyer::Container::Graph< VertexId, Sawyer::Nothing, VertexId > Graph
Graph relating vertices by their edges with vertex index.
static ArrowStyle asciiL4()
Arrow rendering styles.
void computeCfgEdgeLayout(const Partitioner2::PartitionerConstPtr &, const Partitioner2::FunctionPtr &)
Compute arrow layout for a control flow graph for a function.
const ArrowStyle & arrowStyle() const
Property: Information about how to render an arrow.
static ArrowStyle asciiR3()
Arrow rendering styles.
void arrowStyle(ArrowStylePreset, ArrowSide)
Set the arrow style to a preset value.
static ArrowStyle unicodeL2()
Arrow rendering styles.
rose_addr_t VertexId
Vertex identification numbers.
size_t nSources(VertexId) const
Number of arrows that emanate from the given vertex.
static VertexId cfgEdgeTargetEndpoint(size_t edgeId)
Endpoint ID for CFG edge arrows.
static VertexId cfgEdgeSourceEndpoint(size_t edgeId)
Endpoint ID for CFG edge arrows.
static ArrowStyle unicodeL1()
Arrow rendering styles.
size_t nTargets(VertexId) const
Number of arrows that point to the given vertex.
ArrowStylePreset
Arrow style presets.
@ ASCII_1
Single-character ASCII-art arrows.
@ ASCII_3
Threee-character ASCII-art arrows.
@ UNICODE_1
Single-character Unicode arrows.
@ ASCII_2
Two-character ASCII-art arrows.
@ UNICODE_2
Two-character Unicode arrows.
static ArrowStyle asciiR4()
Arrow rendering styles.
OutputPart
Parts of the output.
@ MIDDLE_LINE
Lines in the middle of a printed vertex.
@ FIRST_LINE
First line of a vertex when printed.
@ LAST_LINE
Last line of a vertex when printed.
@ INTER_LINE
Lines output between vertices.
void debug(std::ostream &) const
Print implementation-defined debugging information.
static ArrowStyle unicodeR1()
Arrow rendering styles.
void computeCfgBlockLayout(const Partitioner2::PartitionerConstPtr &, const Partitioner2::FunctionPtr &)
Compute arrow layout for a control flow graph for a function.
static ArrowStyle asciiL3()
Arrow rendering styles.
void arrowStyle(const ArrowStyle &t)
Property: Information about how to render an arrow.
void reset()
Reset the analysis.
static ArrowStyle asciiR1()
Arrow rendering styles.
static ArrowStyle asciiR2()
Arrow rendering styles.
size_t nArrowColumns() const
Number of arrow columns.
static ArrowStyle unicodeR2()
Arrow rendering styles.
static ArrowStyle asciiL2()
Arrow rendering styles.
std::string renderBlank() const
Render a field of blank characters for all the columns.
static ArrowStyle asciiL1()
Arrow rendering styles.
Graph containing user-defined vertices and edges.
An associative container whose keys are non-overlapping intervals.
Range of values delimited by endpoints.
Container associating values with keys.
std::string sourceHorizontal
Text for the horizontal source of an arrow.
std::string upToTarget
Text for an arrow comming from below into a vertex.
std::string targetHorizontal
Text for the horizontal target of an arrow.
std::string sourceThenDown
Text for an arrow leaving a vertex and turning downward.
size_t charactersPerColumn
Number of characters per arrow column.
std::string downToTarget
Text for an arrow comming from above into a vertex.
std::string verticalLine
Text for the vertical line part of an arrow.
std::string blank
Text when there's lack of any arrow.
std::string sourceThenUp
Text for an arrow leaving a vertex and turning upward.
bool pointsRight
Arrows point right? Otherwise left.