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

User-Defined functor class. More...

#include <UserDefinedFunctor.h>

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

Public Member Functions

UserDefinedFunctorclone () const override
 Create clone. More...
 
std::optional< TypeAttributegetFinalReturnType () const
 
const std::string & getName () const
 return the name More...
 
void setFinalReturnType (TypeAttribute newType)
 
 UserDefinedFunctor (std::string name)
 
 UserDefinedFunctor (std::string name, VecOwn< Argument > args, SrcLocation loc={})
 
- 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
template<typename... Operands>
 Term (Operands &&... operands)
 
template<typename... Operands>
 Term (SrcLocation loc, Operands &&... operands)
 
 Term (VecOwn< Argument > operands, SrcLocation loc={})
 

Protected Attributes

std::optional< TypeAttributefinalTranslatorReturnType
 
const std::string name
 Name. More...
 
- Protected Attributes inherited from souffle::ast::Term
VecOwn< Argumentargs
 Arguments. More...
 

Detailed Description

User-Defined functor class.

Definition at line 46 of file UserDefinedFunctor.h.

Constructor & Destructor Documentation

◆ UserDefinedFunctor() [1/2]

souffle::ast::UserDefinedFunctor::UserDefinedFunctor ( std::string  name)
inlineexplicit

Definition at line 48 of file UserDefinedFunctor.h.

48 {

References name.

◆ UserDefinedFunctor() [2/2]

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

Definition at line 50 of file UserDefinedFunctor.h.

52  {

Member Function Documentation

◆ clone()

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

Create clone.

Implements souffle::ast::Functor.

Definition at line 58 of file UserDefinedFunctor.h.

60  {
61  finalTranslatorReturnType = newType;
62  }
63 
64  std::optional<TypeAttribute> getFinalReturnType() const {

◆ equal()

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

Abstract equality check for two AST nodes.

Reimplemented from souffle::ast::Term.

Definition at line 79 of file UserDefinedFunctor.h.

◆ getFinalReturnType()

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

Definition at line 70 of file UserDefinedFunctor.h.

73  {

◆ getName()

const std::string& souffle::ast::UserDefinedFunctor::getName ( ) const
inline

return the name

Definition at line 54 of file UserDefinedFunctor.h.

54  {
55  res->setFinalReturnType(finalTranslatorReturnType.value());
56  }

References finalTranslatorReturnType.

◆ print()

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

Output to a given output stream.

Implements souffle::ast::Node.

Definition at line 75 of file UserDefinedFunctor.h.

◆ setFinalReturnType()

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

Definition at line 66 of file UserDefinedFunctor.h.

68  :
69  void print(std::ostream& os) const override {

Field Documentation

◆ finalTranslatorReturnType

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

Definition at line 88 of file UserDefinedFunctor.h.

Referenced by getName().

◆ name

const std::string souffle::ast::UserDefinedFunctor::name
protected

Name.

Definition at line 85 of file UserDefinedFunctor.h.

Referenced by UserDefinedFunctor().


The documentation for this class was generated from the following file:
souffle::ast::UserDefinedFunctor::print
void print(std::ostream &os) const override
Output to a given output stream.
Definition: UserDefinedFunctor.h:75
souffle::ast::UserDefinedFunctor::getFinalReturnType
std::optional< TypeAttribute > getFinalReturnType() const
Definition: UserDefinedFunctor.h:70
souffle::ast::UserDefinedFunctor::finalTranslatorReturnType
std::optional< TypeAttribute > finalTranslatorReturnType
Definition: UserDefinedFunctor.h:88