Go to the documentation of this file.
21 #define STL_DINT_MAX_VALUE 2147483647LL
22 #define STL_DINT_MIN_VALUE -2147483648LL
30 #define PREFIX_SEPARATOR '#'
32 #define OUT_OF_RANGE_MSG "DInt literal out of range"
40 if(STL_DINT_MIN_VALUE <= literal_value && STL_DINT_MAX_VALUE >= literal_value)
54 if(offset == std::string::npos)
58 const std::string literal{src.substr(offset)};
59 return std::stoll(literal,
nullptr, base);
69 catch(std::out_of_range &)
82 catch(std::out_of_range &)
95 catch(std::out_of_range &)
#define PREFIX_SEPARATOR
Character between a prefix and another prefix or the actual literal.
static constant_exprt convert_dint_literal_value(const long long literal_value)
Converts the value of a literal the corresponding 'DInt' expression.
static long long get_literal_value(const std::string &src, unsigned int base)
Removes every prefix from the given string and converts the remaining string to a number.
constant_exprt convert_dint_dec_literal_value(const std::string &src)
Converts a string into the corresponding 'DInt' expression.
#define OUT_OF_RANGE_MSG
Message for the case of a literal being out of range.
#define BASE_2
Base of binary double integer literals.
#define BASE_16
Base of hexadecimal double integer literals.
constant_exprt convert_dint_hex_literal_value(const std::string &src)
Converts a string into the corresponding 'DInt' expression.
#define BASE_10
Base of decimal double integer literals.
unsignedbv_typet size_type()
A constant literal expression.
constant_exprt convert_dint_bit_literal_value(const std::string &src)
Converts a string into the corresponding 'DInt' expression.
signedbv_typet get_dint_type()
Creates a new type that resembles the 'DInt' type of the Siemens PLC languages.