libTriton version 1.0 build 1588
Loading...
Searching...
No Matches
liftingToDot.hpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#ifndef TRITON_LIFTINGTODOT_HPP
9#define TRITON_LIFTINGTODOT_HPP
10
11#include <map>
12#include <ostream>
13#include <set>
14#include <unordered_map>
15#include <utility>
16
17#include <triton/astContext.hpp>
18#include <triton/dllexport.hpp>
21
22
23
25namespace triton {
32 namespace engines {
40 namespace lifters {
48
50 private:
53
56
58 triton::usize uniqueid;
59
61 std::map<triton::ast::AbstractNode*, triton::engines::symbolic::SymbolicExpression*> information;
62
64 std::unordered_map<triton::usize, triton::engines::symbolic::SharedSymbolicExpression> expressions;
65
67 std::set<std::pair<triton::usize, triton::usize>> edges;
68
70 std::set<std::pair<triton::usize, std::string>> nodes;
71
73 void spreadInformation(std::ostream& stream);
74
76 void defineLegend(std::ostream& stream);
77
79 void iterateNodes(const triton::ast::SharedAbstractNode& root);
80
82 void handleVariable(const triton::ast::SharedAbstractNode& parent, const triton::ast::SharedAbstractNode& var);
83
84 public:
87
89 TRITON_EXPORT std::ostream& liftToDot(std::ostream& stream, const triton::ast::SharedAbstractNode& node);
90
92 TRITON_EXPORT std::ostream& liftToDot(std::ostream& stream, const triton::engines::symbolic::SharedSymbolicExpression& expr);
93 };
94
96 };
98 };
100};
101
102#endif /* TRITON_LIFTINGTODOT_HPP */
TRITON_EXPORT std::ostream & liftToDot(std::ostream &stream, const triton::ast::SharedAbstractNode &node)
Lifts an AST and all its references to Dot format.
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition: ast.hpp:59
std::shared_ptr< triton::ast::AstContext > SharedAstContext
Shared AST context.
Definition: ast.hpp:65
std::shared_ptr< triton::engines::symbolic::SymbolicExpression > SharedSymbolicExpression
Shared Symbolic Expression.
Definition: ast.hpp:40
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
The Triton namespace.