souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Private Attributes
souffle::ast::BranchInit Class Reference

Initialization of ADT instance. More...

#include <BranchInit.h>

Inheritance diagram for souffle::ast::BranchInit:
Inheritance graph
Collaboration diagram for souffle::ast::BranchInit:
Collaboration graph

Public Member Functions

 BranchInit (std::string constructor, VecOwn< Argument > args, SrcLocation loc={})
 
BranchInitclone () const override
 Create clone. More...
 
const std::string & getConstructor () const
 
- Public Member Functions inherited from souffle::ast::Term
void addArgument (Own< Argument > arg)
 Add argument to argument list. More...
 
void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
std::vector< Argument * > getArguments () const
 Get arguments. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain a list of all embedded AST child nodes. More...
 
- Public Member Functions inherited from souffle::ast::Argument
 Node (SrcLocation loc={})
 
- Public Member Functions inherited from souffle::ast::Node
std::string extloc () const
 Return source location of the syntactic element. More...
 
const SrcLocationgetSrcLoc () const
 Return source location of the Node. More...
 
 Node (SrcLocation loc={})
 
bool operator!= (const Node &other) const
 Inequality check for two AST nodes. More...
 
bool operator== (const Node &other) const
 Equivalence check for two AST nodes. More...
 
void setSrcLoc (SrcLocation l)
 Set source location for the Node. More...
 
virtual ~Node ()=default
 

Protected Member Functions

bool equal (const Node &node) const override
 Implements the node comparison for this node type. More...
 
void print (std::ostream &os) const override
 Output to a given output stream. More...
 
- Protected Member Functions inherited from souffle::ast::Term
bool equal (const Node &node) const override
 Abstract equality check for two AST nodes. More...
 
template<typename... Operands>
 Term (Operands &&... operands)
 
template<typename... Operands>
 Term (SrcLocation loc, Operands &&... operands)
 
 Term (VecOwn< Argument > operands, SrcLocation loc={})
 

Private Attributes

std::string constructor
 The adt branch constructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from souffle::ast::Term
VecOwn< Argumentargs
 Arguments. More...
 

Detailed Description

Initialization of ADT instance.

Parameters
constructorAn entity used to create a variant type. Can be though of as a name of the branch.

Initializes one of the branches of ADT. The syntax for branches initialization is $Constructor(args...) In case of the branch with no arguments it is simplified to $Constructor.

Definition at line 49 of file BranchInit.h.

Constructor & Destructor Documentation

◆ BranchInit()

souffle::ast::BranchInit::BranchInit ( std::string  constructor,
VecOwn< Argument args,
SrcLocation  loc = {} 
)
inline

Definition at line 51 of file BranchInit.h.

52  {

References souffle::ast::Term::args, souffle::clone(), constructor, and souffle::ast::Node::getSrcLoc().

Here is the call graph for this function:

Member Function Documentation

◆ clone()

BranchInit* souffle::ast::BranchInit::clone ( ) const
inlineoverridevirtual

Create clone.

Implements souffle::ast::Argument.

Definition at line 58 of file BranchInit.h.

62  {

◆ equal()

bool souffle::ast::BranchInit::equal ( const Node node) const
inlineoverrideprotectedvirtual

Implements the node comparison for this node type.

Reimplemented from souffle::ast::Node.

Definition at line 68 of file BranchInit.h.

◆ getConstructor()

const std::string& souffle::ast::BranchInit::getConstructor ( ) const
inline

Definition at line 54 of file BranchInit.h.

56  :
57  void print(std::ostream& os) const override {

◆ print()

void souffle::ast::BranchInit::print ( std::ostream &  os) const
inlineoverrideprotectedvirtual

Output to a given output stream.

Implements souffle::ast::Node.

Definition at line 63 of file BranchInit.h.

67  :
68  /** The adt branch constructor */

Field Documentation

◆ constructor

std::string souffle::ast::BranchInit::constructor
private

The adt branch constructor.

Definition at line 75 of file BranchInit.h.

Referenced by BranchInit().


The documentation for this class was generated from the following file:
souffle::ast::BranchInit::print
void print(std::ostream &os) const override
Output to a given output stream.
Definition: BranchInit.h:63