sail::Constant Class Reference

Represents a constant. More...

#include <Constant.h>

Inheritance diagram for sail::Constant:
sail::Symbol

List of all members.

Public Member Functions

 Constant (il::const_expression *constant_exp)
 Constant (long constant, bool is_signed, short size)
virtual string to_string () const
virtual string to_string (bool print_original) const
virtual il::nodeget_original_node ()
virtual bool is_constant ()
virtual bool is_variable ()
virtual il::typeget_type ()
bool is_integer ()
bool is_string_constant ()
long int get_integer ()
string get_string_constant ()
bool is_signed ()
int get_size ()

Friends

class boost::serialization::access

Detailed Description

Represents a constant.


Member Function Documentation

long int sail::Constant::get_integer (  ) 

This function can only be called if this is an integer constant, so call is_integer() before calling this function.

il::node * sail::Constant::get_original_node (  )  [virtual]

This can return NULL if we made up the constant, e.g., for pointer arithmetic that did not exist in the original source code.

Implements sail::Symbol.

int sail::Constant::get_size (  ) 
Returns:
the size (in bits!), so divide by 8 to get size in bytes.
string sail::Constant::get_string_constant (  ) 

Calling this function is only valid for string constants.

bool sail::Constant::is_constant (  )  [virtual]

Implements the abstract is_constant() method of Symbol.

Implements sail::Symbol.

bool sail::Constant::is_integer (  ) 

Is this an integer constant?

bool sail::Constant::is_signed (  ) 

Is this constant signed?

bool sail::Constant::is_string_constant (  ) 

Is this a string constant?

bool sail::Constant::is_variable (  )  [virtual]

Implements the abstract is_variable() method of Symbol.

Implements sail::Symbol.


The documentation for this class was generated from the following files:
Generated on Sun Oct 17 14:01:32 2010 by  doxygen 1.6.3