|
Antares Simulator
Power System Simulator
|
A visitor class for generating DOT style output for ASTs (Abstract Syntax Trees). More...
#include <AstDOTStyleVisitor.h>
Public Member Functions | |
| AstDOTStyleVisitor ()=default | |
| Default constructor. | |
| void | EndTreeGraph (std::ostream &os) |
| Ends the current tree graph. More... | |
| std::string | name () const override |
| Returns the name of this visitor. More... | |
| void | operator() (std::ostream &os, const Nodes::Node *root) |
| Outputs the DOT representation of a node to a stream. More... | |
Public Member Functions inherited from Antares::Expressions::Visitors::NodeVisitor< void, std::ostream & > | |
| void | dispatch (const Nodes::Node *node, Args... args) |
| virtual void | visit (const Nodes::SumNode *, Args... args)=0 |
| Visits a SumNode and processes its children. More... | |
| virtual void | visit (const Nodes::SubtractionNode *, Args... args)=0 |
| Visits a SubtractionNode and processes its children. More... | |
| virtual void | visit (const Nodes::MultiplicationNode *, Args... args)=0 |
| Visits a MultiplicationNode and processes its children. More... | |
| virtual void | visit (const Nodes::DivisionNode *, Args... args)=0 |
| Visits a DivisionNode and processes its children. More... | |
| virtual void | visit (const Nodes::EqualNode *, Args... args)=0 |
| Visits an EqualNode and processes its children. More... | |
| virtual void | visit (const Nodes::LessThanOrEqualNode *, Args... args)=0 |
| Visits a LessThanOrEqualNode and processes its children. More... | |
| virtual void | visit (const Nodes::GreaterThanOrEqualNode *, Args... args)=0 |
| Visits a GreaterThanOrEqualNode and processes its children. More... | |
| virtual void | visit (const Nodes::NegationNode *, Args... args)=0 |
| Visits a NegationNode and processes its child. More... | |
| virtual void | visit (const Nodes::LiteralNode *, Args... args)=0 |
| Visits a LiteralNode. More... | |
| virtual void | visit (const Nodes::VariableNode *, Args... args)=0 |
| Visits a VariableNode. More... | |
| virtual void | visit (const Nodes::ParameterNode *, Args... args)=0 |
| Visits a ParameterNode. More... | |
| virtual void | visit (const Nodes::PortFieldNode *, Args... args)=0 |
| Visits a PortFieldNode. More... | |
| virtual void | visit (const Nodes::PortFieldSumNode *, Args... args)=0 |
| Visits a PortFieldSumNode. More... | |
| virtual void | visit (const Nodes::TimeShiftNode *, Args... args)=0 |
| Visits a TimeShiftNode. More... | |
| virtual void | visit (const Nodes::TimeIndexNode *, Args... args)=0 |
| Visits a TimeIndexNode. More... | |
| virtual void | visit (const Nodes::TimeSumNode *, Args... args)=0 |
| Visits a TimeSumNode. More... | |
| virtual void | visit (const Nodes::AllTimeSumNode *, Args... args)=0 |
| Visits a AllTimeSumNode. More... | |
| virtual void | visit (const Nodes::FunctionNode *, Args... args)=0 |
| Visits a FunctionNode. More... | |
Public Member Functions inherited from Antares::Expressions::IName | |
| bool | operator== (const IName &other) const =default |
Static Public Member Functions | |
| static void | NewTreeGraph (std::ostream &os, const std::string &tree_name="ExpressionTree") |
| Begins a new tree graph. More... | |
A visitor class for generating DOT style output for ASTs (Abstract Syntax Trees).
This class extends the NodeVisitor template class to produce a DOT representation of a given AST. The DOT format is commonly used for graph visualization tools, such as Graphviz. The visitor generates the graph structure, including nodes and edges, and outputs it to a stream.
| NodeVisitor | A base class template for visiting nodes. |
| std::ostream& | The type of the output stream where the DOT representation is written. |
| void Antares::Expressions::Visitors::AstDOTStyleVisitor::EndTreeGraph | ( | std::ostream & | os | ) |
Ends the current tree graph.
Finalizes the DOT graph representation.
| os | The output stream to which the DOT representation is written. |
|
overridevirtual |
Returns the name of this visitor.
Implements Antares::Expressions::IName.
|
static |
Begins a new tree graph.
Initializes the DOT graph representation and sets the tree name.
| os | The output stream to which the DOT representation is written. |
| tree_name | The name of the tree graph. Defaults to "ExpressionTree". |
| void Antares::Expressions::Visitors::AstDOTStyleVisitor::operator() | ( | std::ostream & | os, |
| const Nodes::Node * | root | ||
| ) |
Outputs the DOT representation of a node to a stream.
This operator overload facilitates the use of the AstDOTStyleVisitor with a node for direct streaming of the DOT representation.
| os | The output stream to which the DOT representation is written. |
| root | The root of the expression to be output. |