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

Intrinsic Functor class for functors are in-built. More...

#include <IntrinsicFunctor.h>

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

Public Member Functions

IntrinsicFunctorclone () const override
 Create clone. More...
 
const std::string & getBaseFunctionOp () const
 Get (base type) function. More...
 
std::optional< FunctorOpgetFinalOpType () const
 
std::optional< TypeAttributegetFinalReturnType () const
 
template<typename... Operands>
 IntrinsicFunctor (SrcLocation loc, std::string op, Operands &&... operands)
 
template<typename... Operands>
 IntrinsicFunctor (std::string op, Operands &&... operands)
 
 IntrinsicFunctor (std::string op, VecOwn< Argument > args, SrcLocation loc={})
 
void setFinalOpType (FunctorOp newType)
 
void setFinalReturnType (TypeAttribute newType)
 
void setFunction (std::string functor)
 Set function. More...
 
- 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
 Abstract equality check for two AST nodes. More...
 
void print (std::ostream &os) const override
 Output to a given output stream. More...
 
- Protected Member Functions inherited from souffle::ast::Functor
template<typename... Operands>
 Term (Operands &&... operands)
 
template<typename... Operands>
 Term (SrcLocation loc, Operands &&... operands)
 
 Term (VecOwn< Argument > operands, SrcLocation loc={})
 
- 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={})
 

Protected Attributes

std::optional< FunctorOpfinalTranslatorOpType
 
std::optional< TypeAttributefinalTranslatorReturnType
 
std::string function
 Function. More...
 
- Protected Attributes inherited from souffle::ast::Term
VecOwn< Argumentargs
 Arguments. More...
 

Detailed Description

Intrinsic Functor class for functors are in-built.

Definition at line 47 of file IntrinsicFunctor.h.

Constructor & Destructor Documentation

◆ IntrinsicFunctor() [1/3]

template<typename... Operands>
souffle::ast::IntrinsicFunctor::IntrinsicFunctor ( std::string  op,
Operands &&...  operands 
)
inline

Definition at line 50 of file IntrinsicFunctor.h.

51  {})

◆ IntrinsicFunctor() [2/3]

template<typename... Operands>
souffle::ast::IntrinsicFunctor::IntrinsicFunctor ( SrcLocation  loc,
std::string  op,
Operands &&...  operands 
)
inline

Definition at line 54 of file IntrinsicFunctor.h.

55  {

◆ IntrinsicFunctor() [3/3]

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

Definition at line 57 of file IntrinsicFunctor.h.

Member Function Documentation

◆ clone()

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

Create clone.

Implements souffle::ast::Functor.

Definition at line 70 of file IntrinsicFunctor.h.

75  {
76  finalTranslatorOpType = newType;
77  }
78 
79  void setFinalReturnType(TypeAttribute newType) {

◆ equal()

bool souffle::ast::IntrinsicFunctor::equal ( const Node ) const
inlineoverrideprotectedvirtual

Abstract equality check for two AST nodes.

Reimplemented from souffle::ast::Node.

Definition at line 112 of file IntrinsicFunctor.h.

◆ getBaseFunctionOp()

const std::string& souffle::ast::IntrinsicFunctor::getBaseFunctionOp ( ) const
inline

Get (base type) function.

Definition at line 61 of file IntrinsicFunctor.h.

64  {

◆ getFinalOpType()

std::optional<FunctorOp> souffle::ast::IntrinsicFunctor::getFinalOpType ( ) const
inline

Definition at line 89 of file IntrinsicFunctor.h.

91  :
92  void print(std::ostream& os) const override {

◆ getFinalReturnType()

std::optional<TypeAttribute> souffle::ast::IntrinsicFunctor::getFinalReturnType ( ) const
inline

Definition at line 93 of file IntrinsicFunctor.h.

93  {
94  os << "(" << join(args, function) << ")";
95  } else {

References souffle::ast::Term::args, and souffle::join().

Here is the call graph for this function:

◆ print()

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

Output to a given output stream.

Implements souffle::ast::Node.

Definition at line 98 of file IntrinsicFunctor.h.

99  {
100  os << function;
101  }
102  os << "(" << join(args) << ")";
103  }
104  }
105 
106  bool equal(const Node& node) const override {
107  const auto& other = static_cast<const IntrinsicFunctor&>(node);
108  return function == other.function && Functor::equal(node);
109  }
110 

◆ setFinalOpType()

void souffle::ast::IntrinsicFunctor::setFinalOpType ( FunctorOp  newType)
inline

Definition at line 81 of file IntrinsicFunctor.h.

83  {

◆ setFinalReturnType()

void souffle::ast::IntrinsicFunctor::setFinalReturnType ( TypeAttribute  newType)
inline

Definition at line 85 of file IntrinsicFunctor.h.

87  {

◆ setFunction()

void souffle::ast::IntrinsicFunctor::setFunction ( std::string  functor)
inline

Set function.

Definition at line 66 of file IntrinsicFunctor.h.

66  {
67  copy->setFinalOpType(finalTranslatorOpType.value());
68  }

References souffle::detail::brie::copy(), and finalTranslatorOpType.

Here is the call graph for this function:

Field Documentation

◆ finalTranslatorOpType

std::optional<FunctorOp> souffle::ast::IntrinsicFunctor::finalTranslatorOpType
protected

Definition at line 121 of file IntrinsicFunctor.h.

Referenced by setFunction().

◆ finalTranslatorReturnType

std::optional<TypeAttribute> souffle::ast::IntrinsicFunctor::finalTranslatorReturnType
protected

Definition at line 122 of file IntrinsicFunctor.h.

◆ function

std::string souffle::ast::IntrinsicFunctor::function
protected

Function.

Definition at line 118 of file IntrinsicFunctor.h.


The documentation for this class was generated from the following file:
souffle::ast::Term::args
VecOwn< Argument > args
Arguments.
Definition: Term.h:86
TypeAttribute
Type attribute class.
souffle::ast::IntrinsicFunctor::setFinalReturnType
void setFinalReturnType(TypeAttribute newType)
Definition: IntrinsicFunctor.h:85
souffle::ast::IntrinsicFunctor::finalTranslatorOpType
std::optional< FunctorOp > finalTranslatorOpType
Definition: IntrinsicFunctor.h:121
souffle::ast::IntrinsicFunctor::IntrinsicFunctor
IntrinsicFunctor(std::string op, Operands &&... operands)
Definition: IntrinsicFunctor.h:50
souffle::ast::IntrinsicFunctor::equal
bool equal(const Node &node) const override
Abstract equality check for two AST nodes.
Definition: IntrinsicFunctor.h:112
souffle::join
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...
Definition: StreamUtil.h:175
souffle::ast::IntrinsicFunctor::print
void print(std::ostream &os) const override
Output to a given output stream.
Definition: IntrinsicFunctor.h:98
souffle::detail::brie::copy
auto copy(span< A, arity > s)
Definition: Brie.h:98
souffle::ast::Node::Node
Node(SrcLocation loc={})
Definition: Node.h:42
souffle::ast::Term::equal
bool equal(const Node &node) const override
Abstract equality check for two AST nodes.
Definition: Term.h:80