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

Attribute class. More...

#include <Attribute.h>

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

Public Member Functions

 Attribute (std::string n, QualifiedName t, SrcLocation loc={})
 
Attributeclone () const override
 Create a clone (i.e. More...
 
const std::string & getName () const
 Return attribute name. More...
 
const QualifiedNamegetTypeName () const
 Return type name. More...
 
void setTypeName (QualifiedName name)
 Set type name. More...
 
- 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

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

std::string name
 Attribute name. More...
 
QualifiedName typeName
 Type name. More...
 

Detailed Description

Attribute class.

Example: x: number An attribute consists of a name and its type name.

Definition at line 42 of file Attribute.h.

Constructor & Destructor Documentation

◆ Attribute()

souffle::ast::Attribute::Attribute ( std::string  n,
QualifiedName  t,
SrcLocation  loc = {} 
)
inline

Definition at line 44 of file Attribute.h.

47  {

Member Function Documentation

◆ clone()

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

Create a clone (i.e.

deep copy) of this node

Implements souffle::ast::Node.

Definition at line 62 of file Attribute.h.

62  :" << typeName;
63  }
64 

◆ equal()

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

Abstract equality check for two AST nodes.

Reimplemented from souffle::ast::Node.

Definition at line 71 of file Attribute.h.

◆ getName()

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

Return attribute name.

Definition at line 48 of file Attribute.h.

52  {

◆ getTypeName()

const QualifiedName& souffle::ast::Attribute::getTypeName ( ) const
inline

Return type name.

Definition at line 53 of file Attribute.h.

56  {

◆ print()

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

Output to a given output stream.

Implements souffle::ast::Node.

Definition at line 67 of file Attribute.h.

70  :
71  /** Attribute name */

◆ setTypeName()

void souffle::ast::Attribute::setTypeName ( QualifiedName  name)
inline

Set type name.

Definition at line 58 of file Attribute.h.

60  :
61  void print(std::ostream& os) const override {

Field Documentation

◆ name

std::string souffle::ast::Attribute::name
private

Attribute name.

Definition at line 78 of file Attribute.h.

◆ typeName

QualifiedName souffle::ast::Attribute::typeName
private

Type name.

Definition at line 81 of file Attribute.h.


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