Otawa  0.10
otawa::Type Class Referenceabstract

This class describes the type of the data in the program. More...

#include <otawa/type.h>

Inheritance diagram for otawa::Type:
otawa::BaseType otawa::NoType

Public Types

enum  kind_t {
  NONE = 0, BASE = 1, ENUM = 2, ARRAY = 3,
  STRUCT = 4, UNION = 5, PTR = 6, FUN = 7
}
 
enum  base_t {
  VOID = 0, BLOCK = 1, BOOL = 2, CHAR = 3,
  INT8 = 4, UINT8 =5, INT16 = 6, UINT16 = 7,
  INT32 = 8, UINT32 = 9, INT64 = 10, UINT64 = 11,
  FLOAT32 = 12, FLOAT64 = 13, FLOAT128 = 14, ADDR32 = 15,
  CSTRING = 16, STRING_ = 17, BASE_TOP = 18
}
 
typedef enum otawa::Type::kind_t kind_t
 
typedef enum otawa::Type::base_t base_t
 

Public Member Functions

bool equals (const Type &type) const
 
virtual kind_t kind (void) const =0
 Get the kind of the type. More...
 
virtual const BaseTypetoBase (void) const
 If the type is a base type, return it. More...
 
virtual void print (elm::io::Output &output) const
 Print a text representation of the type. More...
 
bool operator== (const Type &type) const
 
bool operator!= (const Type &type) const
 

Static Public Member Functions

static const BaseTypegetBaseType (base_t type)
 Get a base type from its base type value. More...
 

Static Public Attributes

static const NoType no_type
 
static const BaseType void_type
 
static const BaseType block_type
 
static const BaseType bool_type
 
static const BaseType char_type
 
static const BaseType int8_type
 
static const BaseType uint8_type
 
static const BaseType int16_type
 
static const BaseType uint16_type
 
static const BaseType int32_type
 
static const BaseType uint32_type
 
static const BaseType int64_type
 
static const BaseType uint64_type
 
static const BaseType float32_type
 
static const BaseType float64_type
 
static const BaseType float128_type
 
static const BaseType addr32_type
 
static const BaseType cstring_type
 
static const BaseType string_type
 

Protected Member Functions

virtual ~Type (void)
 

Detailed Description

This class describes the type of the data in the program.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
VOID 
BLOCK 
BOOL 
CHAR 
INT8 
UINT8 
INT16 
UINT16 
INT32 
UINT32 
INT64 
UINT64 
FLOAT32 
FLOAT64 
FLOAT128 
ADDR32 
CSTRING 
STRING_ 
BASE_TOP 
Enumerator
NONE 
BASE 
ENUM 
ARRAY 
STRUCT 
UNION 
PTR 
FUN 

Constructor & Destructor Documentation

virtual otawa::Type::~Type ( void  )
inlineprotectedvirtual

Member Function Documentation

bool otawa::Type::equals ( const Type type) const
inline

References otawa::type().

const BaseType & otawa::Type::getBaseType ( base_t  type)
static

Get a base type from its base type value.

Parameters
typeBase type.
Returns
Matching base type value.

References BASE_TOP, and otawa::type().

Type::kind_t otawa::Type::kind ( void  ) const
pure virtual

Get the kind of the type.

Returns
The kind of the type.

Implemented in otawa::BaseType, and otawa::NoType.

bool otawa::Type::operator!= ( const Type type) const
inline
bool otawa::Type::operator== ( const Type type) const
inline
void otawa::Type::print ( elm::io::Output output) const
virtual

Print a text representation of the type.

Parameters
outputOutput to display to.

Reimplemented in otawa::BaseType, and otawa::NoType.

Referenced by otawa::operator<<().

const BaseType * otawa::Type::toBase ( void  ) const
inlinevirtual

If the type is a base type, return it.

Else return null.

Returns
Base type or null.

Reimplemented in otawa::BaseType.

Member Data Documentation

const BaseType otawa::Type::addr32_type
static
const BaseType otawa::Type::block_type
static
const BaseType otawa::Type::bool_type
static
const BaseType otawa::Type::char_type
static
const BaseType otawa::Type::cstring_type
static
const BaseType otawa::Type::float128_type
static
const BaseType otawa::Type::float32_type
static
const BaseType otawa::Type::float64_type
static
const BaseType otawa::Type::int16_type
static
const BaseType otawa::Type::int64_type
static
const BaseType otawa::Type::int8_type
static
const NoType otawa::Type::no_type
static
const BaseType otawa::Type::string_type
static
const BaseType otawa::Type::uint16_type
static
const BaseType otawa::Type::uint64_type
static
const BaseType otawa::Type::uint8_type
static
const BaseType otawa::Type::void_type
static

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