Represents a constant. More...
#include <Constant.h>
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::node * | get_original_node () |
virtual bool | is_constant () |
virtual bool | is_variable () |
virtual il::type * | get_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 |
Represents a constant.
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 | ( | ) |
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.