ROSE 0.11.145.141
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Rose::BinaryAnalysis::SymbolicExpression::Type Class Reference

Description

Type of symbolic expression.

Definition at line 222 of file SymbolicExpression.h.

#include <Rose/BinaryAnalysis/SymbolicExpression.h>

Public Types

enum  TypeClass {
  INTEGER ,
  FP ,
  MEMORY ,
  INVALID
}
 Type class. More...
 

Public Member Functions

 Type ()
 Create an invalid, empty type.
 
bool isValid () const
 Check whether this object is valid.
 
TypeClass typeClass () const
 Property: Type class.
 
size_t nBits () const
 Property: Total width of values.
 
size_t addressWidth () const
 Property: Width of memory addresses.
 
size_t exponentWidth () const
 Property: Exponent width.
 
size_t significandWidth () const
 Property: Significand width.
 
bool operator< (const Type &other) const
 Type comparison.
 
void print (std::ostream &, TypeStyle::Flag style=TypeStyle::FULL) const
 Print the type.
 
std::string toString (TypeStyle::Flag style=TypeStyle::FULL) const
 Print the type to a string.
 
bool operator== (const Type &other) const
 Type equality.
 
bool operator!= (const Type &other) const
 Type equality.
 

Static Public Member Functions

static Type none ()
 Create no type.
 
static Type integer (size_t nBits)
 Create a new integer type.
 
static Type memory (size_t addressWidth, size_t valueWidth)
 Create a new memory type.
 
static Type floatingPoint (size_t exponentWidth, size_t significandWidth)
 Create a new floating-point type.
 

Member Enumeration Documentation

◆ TypeClass

Type class.

Enumerator
INTEGER 

Integer type.

FP 

Floating-point type.

MEMORY 

Memory type.

INVALID 

Default constructed.

Definition at line 225 of file SymbolicExpression.h.

Constructor & Destructor Documentation

◆ Type()

Rose::BinaryAnalysis::SymbolicExpression::Type::Type ( )
inline

Create an invalid, empty type.

This is used mainly for default arguments.

Definition at line 263 of file SymbolicExpression.h.

References INVALID, nBits(), and typeClass().

Referenced by floatingPoint(), integer(), memory(), and none().

Member Function Documentation

◆ none()

static Type Rose::BinaryAnalysis::SymbolicExpression::Type::none ( )
inlinestatic

Create no type.

This is the same as a default constructor, but somewhat more self-documenting.

Definition at line 282 of file SymbolicExpression.h.

References Type().

◆ integer()

static Type Rose::BinaryAnalysis::SymbolicExpression::Type::integer ( size_t  nBits)
inlinestatic

Create a new integer type.

This is an integer type whose size is specified in bits. Whether an integer is signed is determined by the context in which it's used. For instance, unsigned less-than operation will interpret its arguments as unsigned integers, whereas a signed less-than operation will interpret its arguments as 2's complement signed integers.

Definition at line 291 of file SymbolicExpression.h.

References Type(), INTEGER, and nBits().

◆ memory()

static Type Rose::BinaryAnalysis::SymbolicExpression::Type::memory ( size_t  addressWidth,
size_t  valueWidth 
)
inlinestatic

Create a new memory type.

A memory type has an address width and a value width. The value width is the size of the value stored at each address.

Definition at line 298 of file SymbolicExpression.h.

References Type(), addressWidth(), and MEMORY.

◆ floatingPoint()

static Type Rose::BinaryAnalysis::SymbolicExpression::Type::floatingPoint ( size_t  exponentWidth,
size_t  significandWidth 
)
inlinestatic

Create a new floating-point type.

A floating point type describes an IEEE-754 style of value and is parameterized by two properties: the width of the exponent field, and the width of the significand field including the implied bit. The actual storage size of the floating point value is the sum of these two widths since although the implied bit is not stored, a sign bit is stored. Due to limitations of SMT-LIB, ROSE's symbolic layer doesn't handle all IEEE-754 floating-point types. In particular, the symbolic layer supports only binary formats and uses the implied bit convention for the integer part of the significand. Gradual underflow capability (i.e., denormalized significands) is assumed.

Definition at line 310 of file SymbolicExpression.h.

References Type(), exponentWidth(), FP, and significandWidth().

◆ isValid()

bool Rose::BinaryAnalysis::SymbolicExpression::Type::isValid ( ) const
inline

Check whether this object is valid.

A default constructed type is invalid.

Definition at line 317 of file SymbolicExpression.h.

References INVALID, and typeClass().

◆ typeClass()

TypeClass Rose::BinaryAnalysis::SymbolicExpression::Type::typeClass ( ) const
inline

◆ nBits()

size_t Rose::BinaryAnalysis::SymbolicExpression::Type::nBits ( ) const
inline

Property: Total width of values.

This is the total width in bits of the values represented by this type. For memory types, it's the width of the value stored at each address.

Definition at line 332 of file SymbolicExpression.h.

Referenced by Rose::BinaryAnalysis::SymbolicExpressionParser::Token::Token(), Type(), integer(), Rose::BinaryAnalysis::SymbolicExpression::Node::nBits(), and significandWidth().

◆ addressWidth()

size_t Rose::BinaryAnalysis::SymbolicExpression::Type::addressWidth ( ) const
inline

Property: Width of memory addresses.

Returns the width in bits of each memory address for a memory type. This should only be invoked on types for which typeClass returns MEMORY.

Definition at line 340 of file SymbolicExpression.h.

References MEMORY, and typeClass().

Referenced by Rose::BinaryAnalysis::SymbolicExpression::Node::domainWidth(), and memory().

◆ exponentWidth()

size_t Rose::BinaryAnalysis::SymbolicExpression::Type::exponentWidth ( ) const
inline

Property: Exponent width.

Returns the width in bits of the exponent for floating-point types. This should only be invoked on types for which typeClass returns FP.

Definition at line 349 of file SymbolicExpression.h.

References FP, and typeClass().

Referenced by floatingPoint(), and significandWidth().

◆ significandWidth()

size_t Rose::BinaryAnalysis::SymbolicExpression::Type::significandWidth ( ) const
inline

Property: Significand width.

Returns the logical width in bits of the significand for floating-point types, which includes the implied bit. The actual storage size of the significand is one bit fewer. This should only be invoked on types for which typeClass returns FP.

Definition at line 359 of file SymbolicExpression.h.

References exponentWidth(), FP, nBits(), and typeClass().

Referenced by floatingPoint().

◆ operator==()

bool Rose::BinaryAnalysis::SymbolicExpression::Type::operator== ( const Type other) const
inline

Type equality.

Types are equivalent if they have the same class and sizes.

Definition at line 370 of file SymbolicExpression.h.

◆ operator!=()

bool Rose::BinaryAnalysis::SymbolicExpression::Type::operator!= ( const Type other) const
inline

Type equality.

Types are equivalent if they have the same class and sizes.

Definition at line 373 of file SymbolicExpression.h.


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