Otawa  0.10
otawa::dfa::Value Class Reference

#include <otawa/dfa/State.h>

Public Types

enum  kind_t { NONE = 0, CONST = 1, INTERVAL = 2, CLP = 3 }
 

Public Member Functions

 Value (void)
 Build a none value. More...
 
 Value (t::uint32 base)
 Build a constant value. More...
 
 Value (t::uint32 lo, t::uint32 up)
 Build a value usually as an interval but if lo == up, it is considered as a constant. More...
 
 Value (t::uint32 base, t::uint32 delta, t::uint32 count)
 According to the triple (base, delta, count), build a value as: More...
 
kind_t kind (void) const
 Get the kind of the value. More...
 
 operator bool (void) const
 Test if the value is none or not. More...
 
bool isConst (void) const
 
bool isInterval (void) const
 
bool isCLP (void) const
 
t::uint32 value (void) const
 Get the value for a constant. More...
 
t::uint32 base (void) const
 Get base value of a CLP. More...
 
t::uint32 delta (void) const
 Get the delta value of a CLP. More...
 
t::uint32 count (void) const
 Get the count value of a CLP. More...
 
t::uint32 low (void) const
 Get the lower value of the interval. More...
 
t::uint32 up (void) const
 Get the upper value of the interval. More...
 

Static Public Member Functions

static Value parse (const string &str) throw (io::IOException)
 Parse value from a string. More...
 

Private Attributes

kind_t _kind
 
t::uint32 _base
 
t::uint32 _delta
 
t::uint32 _count
 

Member Enumeration Documentation

Enumerator
NONE 
CONST 
INTERVAL 
CLP 

Constructor & Destructor Documentation

otawa::dfa::Value::Value ( void  )

Build a none value.

otawa::dfa::Value::Value ( t::uint32  base)

Build a constant value.

Parameters
baseConstant value
otawa::dfa::Value::Value ( t::uint32  lo,
t::uint32  up 
)

Build a value usually as an interval but if lo == up, it is considered as a constant.

Parameters
loLower value.
upUpper value.

References _base, _count, _delta, _kind, CONST, and INTERVAL.

otawa::dfa::Value::Value ( t::uint32  base,
t::uint32  delta,
t::uint32  count 
)

According to the triple (base, delta, count), build a value as:

  • a constant (if count = 0),
  • an interval (if delta = 1),
  • a CLP, i.e., a value in { base + delta * k / 0 <= k <= count }
    Parameters
    baseBase value.
    deltaDelta value.
    countCount value.

References _base, _count, _delta, _kind, base(), CLP, CONST, count(), and INTERVAL.

Member Function Documentation

t::uint32 otawa::dfa::Value::base ( void  ) const
inline

Get base value of a CLP.

Returns
Base CLP value.

Referenced by Value().

t::uint32 otawa::dfa::Value::count ( void  ) const
inline

Get the count value of a CLP.

Returns
CLP count value.

Referenced by Value().

t::uint32 otawa::dfa::Value::delta ( void  ) const
inline

Get the delta value of a CLP.

Returns
CLP delta value.
bool otawa::dfa::Value::isCLP ( void  ) const
inline

References otawa::clp::NONE.

bool otawa::dfa::Value::isConst ( void  ) const
inline
bool otawa::dfa::Value::isInterval ( void  ) const
inline

References otawa::clp::NONE.

Value::kind_t otawa::dfa::Value::kind ( void  ) const
inline

Get the kind of the value.

Returns
Value kind.
t::uint32 otawa::dfa::Value::low ( void  ) const
inline

Get the lower value of the interval.

Returns
Interval lower value.
otawa::dfa::Value::operator bool ( void  ) const
inline

Test if the value is none or not.

Returns
True if it is not none, false else.

References otawa::clp::NONE.

Value otawa::dfa::Value::parse ( const string str)
throw (io::IOException
)
static

Parse value from a string.

Supported forms includes:

  • INT (decimal, hexadecimal, binary) – simple integer value,
  • [INT,INT] – interval of integers,
  • (INT,INT, INT) – CLP value.
Parameters
strString to parse.
Exceptions
io::IOExceptionIf the string cannot be parsed.

References delta.

Referenced by otawa::FlowFactLoader::scanRegSet().

t::uint32 otawa::dfa::Value::up ( void  ) const
inline

Get the upper value of the interval.

Returns
Interval upper value.
t::uint32 otawa::dfa::Value::value ( void  ) const
inline

Get the value for a constant.

Returns
Constant value.

Member Data Documentation

t::uint32 otawa::dfa::Value::_base
private

Referenced by Value().

t::uint32 otawa::dfa::Value::_count
private

Referenced by Value().

t::uint32 otawa::dfa::Value::_delta
private

Referenced by Value().

kind_t otawa::dfa::Value::_kind
private

Referenced by Value().


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