souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Protected Attributes
souffle::ram::Call Class Reference

Call a subroutine. More...

#include <Call.h>

Inheritance diagram for souffle::ram::Call:
Inheritance graph
Collaboration diagram for souffle::ram::Call:
Collaboration graph

Public Member Functions

 Call (std::string name)
 
Callclone () const override
 Create a clone (i.e. More...
 
const std::string & getName () const
 Get call name. More...
 
- Public Member Functions inherited from souffle::ram::Node
virtual void apply (const NodeMapper &)
 Apply the mapper to all child nodes. More...
 
virtual std::vector< const Node * > getChildNodes () const
 Obtain list of all embedded child nodes. More...
 
bool operator!= (const Node &other) const
 Inequality check for two RAM nodes. More...
 
bool operator== (const Node &other) const
 Equivalence check for two RAM nodes. More...
 
virtual void rewrite (const Node *oldNode, Own< Node > newNode)
 Rewrite a child node. More...
 
virtual ~Node ()=default
 

Protected Member Functions

bool equal (const Node &node) const override
 Equality check for two RAM nodes. More...
 
void print (std::ostream &os, int tabpos) const override
 Pretty print with indentation. More...
 
- Protected Member Functions inherited from souffle::ram::Statement
void print (std::ostream &os) const override
 Print RAM node. More...
 

Protected Attributes

const std::string name
 Name of subroutine. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from souffle::ram::Statement
static void print (const Statement *statement, std::ostream &os, int tabpos)
 Pretty print jump-bed. More...
 

Detailed Description

Call a subroutine.

Calls a subroutine

The following example shows how subroutine A is invoked

CALL A

Definition at line 42 of file Call.h.

Constructor & Destructor Documentation

◆ Call()

souffle::ram::Call::Call ( std::string  name)
inline

Definition at line 44 of file Call.h.

47 {

Referenced by getName().

Member Function Documentation

◆ clone()

Call* souffle::ram::Call::clone ( ) const
inlineoverridevirtual

Create a clone (i.e.

deep copy) of this node

Implements souffle::ram::Statement.

Definition at line 51 of file Call.h.

51  :
52  void print(std::ostream& os, int tabpos) const override {
53  os << times(" ", tabpos) << "CALL " << name << std::endl;

References name, and souffle::times().

Here is the call graph for this function:

◆ equal()

bool souffle::ram::Call::equal ( const Node ) const
inlineoverrideprotectedvirtual

Equality check for two RAM nodes.

Default action is that nothing needs to be checked.

Reimplemented from souffle::ram::Node.

Definition at line 60 of file Call.h.

◆ getName()

const std::string& souffle::ram::Call::getName ( ) const
inline

Get call name.

Definition at line 47 of file Call.h.

47  {
48  return new Call(name);
49  }

References Call(), and name.

Here is the call graph for this function:

◆ print()

void souffle::ram::Call::print ( std::ostream &  os,
int  tabpos 
) const
inlineoverrideprotectedvirtual

Pretty print with indentation.

Implements souffle::ram::Statement.

Definition at line 56 of file Call.h.

56  {
57  const auto& other = static_cast<const Call&>(node);
58  return name == other.name;

References name.

Field Documentation

◆ name

const std::string souffle::ram::Call::name
protected

Name of subroutine.

Definition at line 66 of file Call.h.

Referenced by clone(), getName(), and print().


The documentation for this class was generated from the following file:
souffle::ram::Call::print
void print(std::ostream &os, int tabpos) const override
Pretty print with indentation.
Definition: Call.h:56
souffle::times
detail::multiplying_printer< T > times(const T &value, unsigned num)
A utility printing a given value multiple times.
Definition: StreamUtil.h:322
souffle::ram::Call::name
const std::string name
Name of subroutine.
Definition: Call.h:66
souffle::ram::Call::Call
Call(std::string name)
Definition: Call.h:44