27#include "antares/expressions/visitors/NodeVisitor.h"
29namespace Antares::Expressions::Visitors
93 void NewTreeGraph(std::ostream& os,
const std::string& tree_name =
"ExpressionTree");
109 std::string
name()
const override;
123 void visit(
const Nodes::SumNode* node, std::ostream& os)
override;
139 void computeNumberNodesPerType();
140 void makeLegend(std::ostream& os);
163 void emitNode(
unsigned int id,
164 const std::string& label,
180 const std::string& label,
189 std::map<const Nodes::Node*, unsigned int> nodeIds_;
196 std::map<std::string, unsigned int> nbNodesPerType_;
203 unsigned int nodeCount_ = 0;
Definition BinaryNode.h:28
Represents a component parameter node in a syntax tree.
Definition ComponentNode.h:80
Represents a component variable node in a syntax tree.
Definition ComponentNode.h:66
Represents a division node in a syntax tree.
Definition DivisionNode.h:31
Represents an equality comparison node in a syntax tree.
Definition EqualNode.h:31
Represents a greater than or equal comparison node in a syntax tree.
Definition GreaterThanOrEqualNode.h:31
Represents a less than or equal comparison node in a syntax tree.
Definition LessThanOrEqualNode.h:31
Represents a literal node in a syntax tree, storing a double value.
Definition LiteralNode.h:11
Represents a multiplication node in a syntax tree.
Definition MultiplicationNode.h:31
Represents a negation node in a syntax tree.
Definition NegationNode.h:31
Base class for nodes in a syntax tree.
Definition Node.h:30
Represents a parameter node in a syntax tree, storing a string value.
Definition ParameterNode.h:19
Represents a port field node in a syntax tree.
Definition PortFieldNode.h:33
Represents a port field node where the expression is a sum.
Definition PortFieldSumNode.h:33
Represents a subtraction node in a syntax tree.
Definition SubtractionNode.h:31
Represents a variable node in a syntax tree, storing a string value.
Definition VariableNode.h:20
A visitor class for generating DOT style output for ASTs (Abstract Syntax Trees).
Definition AstDOTStyleVisitor.h:78
AstDOTStyleVisitor()=default
Default constructor.
void EndTreeGraph(std::ostream &os)
Ends the current tree graph.
Definition AstDOTStyleVisitor.cpp:244
void NewTreeGraph(std::ostream &os, const std::string &tree_name="ExpressionTree")
Begins a new tree graph.
Definition AstDOTStyleVisitor.cpp:238
std::string name() const override
Returns the name of this visitor.
Definition AstDOTStyleVisitor.cpp:185
void operator()(std::ostream &os, const Nodes::Node *root)
Outputs the DOT representation of a node to a stream.
Definition AstDOTStyleVisitor.cpp:261
Definition NodeVisitor.h:87
Represents the style attributes for a box in a graph.
Definition AstDOTStyleVisitor.h:39
std::string_view style
The style of the box.
Definition AstDOTStyleVisitor.h:62
std::string_view shape
The shape of the box.
Definition AstDOTStyleVisitor.h:54
std::string_view color
The color of the box.
Definition AstDOTStyleVisitor.h:46