souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
41 virtual ~Node() =
default;
47 return this == &other || (
typeid(*this) ==
typeid(other) &&
equal(other));
54 return !(*
this == other);
71 assert(oldNode !=
nullptr &&
"old node is a null-pointer");
72 assert(newNode !=
nullptr &&
"new node is a null-pointer");
74 if (oldNode == node.get()) {
75 return std::move(newNode);
94 friend std::ostream&
operator<<(std::ostream& out,
const Node& node) {
103 virtual void print(std::ostream& out = std::cout)
const = 0;
friend std::ostream & operator<<(std::ostream &out, const Node &node)
Print RAM on a stream.
virtual Node * clone() const =0
Create a clone (i.e.
virtual void apply(const NodeMapper &)
Apply the mapper to all child nodes.
virtual std::vector< const Node * > getChildNodes() const
Obtain list of all embedded child nodes.
bool operator!=(const Node &other) const
Inequality check for two RAM nodes.
Node is a superclass for all RAM IR classes.
An abstract class for manipulating RAM Nodes by substitution.
virtual bool equal(const Node &) const
Equality check for two RAM nodes.
virtual void print(std::ostream &out=std::cout) const =0
Print RAM node.
virtual void rewrite(const Node *oldNode, Own< Node > newNode)
Rewrite a child node.
bool operator==(const Node &other) const
Equivalence check for two RAM nodes.
LambdaNodeMapper< Lambda > makeLambdaRamMapper(const Lambda &lambda)
Creates a node mapper based on a corresponding lambda expression.