souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
45 class Atom :
public Literal {
47 Atom(QualifiedName
name = {}, VecOwn<Argument> args = {}, SrcLocation loc = {})
81 arg =
map(std::move(arg));
86 std::vector<const Node*> res;
88 res.push_back(cur.get());
94 void print(std::ostream& os)
const override {
98 bool equal(
const Node& node)
const override {
99 const auto& other =
static_cast<const Atom&
>(node);
void print(std::ostream &os) const override
Output to a given output stream.
std::vector< Argument * > getArguments() const
Return arguments.
void addArgument(Own< Argument > arg)
Add argument to the atom.
Atom * clone() const override
Create a clone (i.e.
An abstract class for manipulating AST Nodes by substitution.
auto map(const std::vector< A > &xs, F &&f)
Applies a function to each element of a vector and returns the results.
void setQualifiedName(QualifiedName n)
Set qualified name.
const QualifiedName & getQualifiedName() const
Return qualified name.
auto clone(const std::vector< A * > &xs)
VecOwn< Argument > arguments
Arguments of atom.
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
bool equal_targets(const Container &a, const Container &b, const Comparator &comp)
A function testing whether two containers are equal with the given Comparator.
std::vector< const Node * > getChildNodes() const override
Obtain a list of all embedded AST child nodes.
void apply(const NodeMapper &map) override
Apply the mapper to all child nodes.
bool equal(const Node &node) const override
Abstract equality check for two AST nodes.
Atom(QualifiedName name={}, VecOwn< Argument > args={}, SrcLocation loc={})
size_t getArity() const
Return arity of the atom.
QualifiedName name
Name of atom.
const SrcLocation & getSrcLoc() const
Return source location of the Node.
Qualified Name class defines fully/partially qualified names to identify objects in components.
std::vector< T * > toPtrVector(const std::vector< std::unique_ptr< T >> &v)
A utility function enabling the creation of a vector of pointers.
std::vector< Own< A > > VecOwn