26 unsigned width_suffix=0;
29 for(
unsigned i=0; i<src.size(); i++)
33 if(ch==
'u' || ch==
'U')
35 else if(ch==
'l' || ch==
'L')
37 else if(ch==
'i' || ch==
'I')
42 if((i+1)<src.size() && isdigit(src[i+1]))
47 else if(ch==
'j' || ch==
'J')
53 if(src.size()>=2 && src[0]==
'0' && tolower(src[1])==
'x')
57 std::string without_prefix(src, 2, std::string::npos);
60 else if(src.size()>=2 && src[0]==
'0' && tolower(src[1])==
'b')
65 std::string without_prefix(src, 2, std::string::npos);
68 else if(src.size()>=2 && src[0]==
'0' && isdigit(src[1]))
88 c_type=
is_unsigned?ID_unsigned_long_int:ID_signed_long_int;
90 c_type=
is_unsigned?ID_unsigned_long_long_int:ID_signed_long_long_int;
93 is_unsigned ? ID_unsignedbv : ID_signedbv, width_suffix);
94 type.
set(ID_C_c_type, c_type);
106 bool is_hex_or_oct_or_bin=(base==8) || (base==16) || (base==2);
108 #define FITS(width, signed) \
109 ((signed?!is_unsigned:(is_unsigned || is_hex_or_oct_or_bin)) && \
110 (power(2, signed?width-1:width)>value_abs))
120 c_type=ID_signed_int;
126 c_type=ID_unsigned_int;
132 c_type=ID_signed_long_int;
139 c_type=ID_unsigned_long_int;
145 c_type=ID_signed_long_long_int;
152 c_type=ID_unsigned_long_long_int;
162 c_type=ID_unsigned_long_long_int;
165 c_type=ID_signed_long_long_int;
169 type.
set(ID_C_c_type, c_type);
181 result.
set(ID_C_base, base);