tipc
A TIP to LLVM compiler
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TipCons Class Reference

Abstract base class for all proper types. More...

#include <TipCons.h>

Inheritance diagram for TipCons:
Inheritance graph
[legend]
Collaboration diagram for TipCons:
Collaboration graph
[legend]

Public Member Functions

 TipCons ()=default
 
const std::vector< std::shared_ptr< TipType > > & getArguments () const
 
void setArguments (std::vector< std::shared_ptr< TipType >> &args)
 
virtual int arity () const
 
bool doMatch (TipType const *t) const
 Check for dynamic subtype and artity agreement We explicitly test the types here which is not robust to the addition of new subtypes of TipCons. Extend this if you add such a subtype. More...
 
- Public Member Functions inherited from TipType
virtual bool operator== (const TipType &other) const =0
 
virtual bool operator!= (const TipType &other) const =0
 
virtual ~TipType ()=default
 
virtual void accept (TipTypeVisitor *visitor)=0
 

Protected Member Functions

 TipCons (std::vector< std::shared_ptr< TipType >> arguments)
 
- Protected Member Functions inherited from TipType
virtual std::ostream & print (std::ostream &out) const =0
 

Protected Attributes

std::vector< std::shared_ptr< TipType > > arguments
 

Detailed Description

Abstract base class for all proper types.

This virtual type adds common functionality for composite types that have type sub-expressions.

Constructor & Destructor Documentation

◆ TipCons() [1/2]

TipCons::TipCons ( )
default

◆ TipCons() [2/2]

TipCons::TipCons ( std::vector< std::shared_ptr< TipType >>  arguments)
protected

Member Function Documentation

◆ arity()

int TipCons::arity ( ) const
virtual

◆ doMatch()

bool TipCons::doMatch ( TipType const *  t) const

Check for dynamic subtype and artity agreement We explicitly test the types here which is not robust to the addition of new subtypes of TipCons. Extend this if you add such a subtype.

◆ getArguments()

const std::vector< std::shared_ptr< TipType > > & TipCons::getArguments ( ) const

◆ setArguments()

void TipCons::setArguments ( std::vector< std::shared_ptr< TipType >> &  args)

Member Data Documentation

◆ arguments

std::vector<std::shared_ptr<TipType> > TipCons::arguments
protected

The documentation for this class was generated from the following files: