Go to the documentation of this file.
23 #define STL_INT_MAX_VALUE 32767LL
24 #define STL_INT_MIN_VALUE -32768LL
32 #define PREFIX_SEPARATOR '#'
34 #define OUT_OF_RANGE_MSG "Int literal out of range"
40 if(offset == std::string::npos)
44 const std::string literal{src.substr(offset)};
45 return std::stoll(literal,
nullptr, base);
50 long long literal_value;
55 catch(std::out_of_range &)
59 if(STL_INT_MIN_VALUE <= literal_value && STL_INT_MAX_VALUE >= literal_value)
67 long long literal_value;
72 catch(std::out_of_range &)
76 if(STL_INT_MIN_VALUE <= literal_value && STL_INT_MAX_VALUE >= literal_value)
84 long long literal_value;
89 catch(std::out_of_range &)
93 if(STL_INT_MIN_VALUE <= literal_value && STL_INT_MAX_VALUE >= literal_value)
101 long long literal_value;
106 catch(std::out_of_range &)
110 if(STL_INT_MIN_VALUE <= literal_value && STL_INT_MAX_VALUE >= literal_value)
118 long long literal_value;
123 catch(std::out_of_range &)
127 if(STL_INT_MIN_VALUE <= literal_value && STL_INT_MAX_VALUE >= literal_value)
135 long long literal_value;
140 catch(std::out_of_range &)
144 if(STL_INT_MIN_VALUE <= literal_value && STL_INT_MAX_VALUE >= literal_value)
#define BASE_16
Base of hexadecimal integer literals.
#define BASE_2
Base of binary integer literals.
static long long get_literal_value(const std::string &src, unsigned int base)
#define OUT_OF_RANGE_MSG
Message for the case of a literal being out of range.
constant_exprt convert_dint_dec_literal_value(const std::string &src)
Converts a string into the corresponding 'DInt' expression.
constant_exprt convert_int_dec_literal_value(const std::string &src)
Converts a string into the corresponding 'Int' expression.
Statement List Language Conversion.
#define PREFIX_SEPARATOR
Character between a prefix and another prefix or the actual literal.
Statement List Language Conversion.
constant_exprt convert_int_bit_literal(const std::string &src)
Converts a string into the corresponding 'Int' or 'DInt' expression.
Pre-defined bitvector types.
#define BASE_10
Base of decimal integer literals.
signedbv_typet get_int_type()
Creates a new type that resembles the 'Int' type of the Siemens PLC languages.
constant_exprt convert_dint_hex_literal_value(const std::string &src)
Converts a string into the corresponding 'DInt' expression.
constant_exprt convert_int_hex_literal_value(const std::string &src)
Converts a string into the corresponding 'Int' expression.
constant_exprt convert_int_dec_literal(const std::string &src)
Converts a string into the corresponding 'Int' or 'DInt' expression.
constant_exprt convert_int_bit_literal_value(const std::string &src)
Converts a string into the corresponding 'Int' expression.
constant_exprt convert_int_hex_literal(const std::string &src)
Converts a string into the corresponding 'Int' or 'DInt' expression.
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.
Statement List Type Helper.