souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Private Attributes
souffle::ast::Constant Class Referenceabstract

Abstract constant class. More...

#include <Constant.h>

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

Public Member Functions

Constantclone () const override=0
 Create clone. More...
 
const std::string & getConstant () const
 Get string representation of Constant. More...
 
- Public Member Functions inherited from souffle::ast::Argument
 Node (SrcLocation loc={})
 
- Public Member Functions inherited from souffle::ast::Node
virtual void apply (const NodeMapper &)
 Apply the mapper to all child nodes. More...
 
std::string extloc () const
 Return source location of the syntactic element. More...
 
virtual std::vector< const Node * > getChildNodes () const
 Obtain a list of all embedded AST child nodes. 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

 Constant (std::string value, SrcLocation loc={})
 
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...
 

Private Attributes

const std::string constant
 String representation of constant. More...
 

Detailed Description

Abstract constant class.

Definition at line 38 of file Constant.h.

Constructor & Destructor Documentation

◆ Constant()

souffle::ast::Constant::Constant ( std::string  value,
SrcLocation  loc = {} 
)
inlineprotected

Definition at line 57 of file Constant.h.

Member Function Documentation

◆ clone()

Constant* souffle::ast::Constant::clone ( ) const
overridepure virtual

◆ equal()

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

Abstract equality check for two AST nodes.

Reimplemented from souffle::ast::Node.

Reimplemented in souffle::ast::NumericConstant.

Definition at line 52 of file Constant.h.

52  : Argument(std::move(loc)), constant(std::move(value)){};
53 
54 private:
55  /** String representation of constant */

Referenced by souffle::ast::NumericConstant::getFixedType().

◆ getConstant()

const std::string& souffle::ast::Constant::getConstant ( ) const
inline

Get string representation of Constant.

Definition at line 43 of file Constant.h.

46  {

Referenced by souffle::ast::StringConstant::clone(), and souffle::ast::analysis::TypeConstraintsAnalysis::visitNumericConstant().

◆ print()

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

Output to a given output stream.

Implements souffle::ast::Node.

Reimplemented in souffle::ast::StringConstant.

Definition at line 48 of file Constant.h.

Field Documentation

◆ constant

const std::string souffle::ast::Constant::constant
private

String representation of constant.

Definition at line 58 of file Constant.h.


The documentation for this class was generated from the following file:
souffle::ast::Constant::constant
const std::string constant
String representation of constant.
Definition: Constant.h:58