27 unsigned width_suffix=0;
30 for(
unsigned i=0; i<src.size(); i++)
34 if(ch==
'u' || ch==
'U')
36 else if(ch==
'l' || ch==
'L')
38 else if(ch==
'i' || ch==
'I')
43 if((i+1)<src.size() && isdigit(src[i+1]))
48 else if(ch==
'j' || ch==
'J')
54 if(src.size()>=2 && src[0]==
'0' && tolower(src[1])==
'x')
58 std::string without_prefix(src, 2, std::string::npos);
61 else if(src.size()>=2 && src[0]==
'0' && tolower(src[1])==
'b')
66 std::string without_prefix(src, 2, std::string::npos);
69 else if(src.size()>=2 && src[0]==
'0' && isdigit(src[1]))
89 c_type=
is_unsigned?ID_unsigned_long_int:ID_signed_long_int;
91 c_type=
is_unsigned?ID_unsigned_long_long_int:ID_signed_long_long_int;
94 is_unsigned ? ID_unsignedbv : ID_signedbv, width_suffix);
95 type.
set(ID_C_c_type, c_type);
107 bool is_hex_or_oct_or_bin=(base==8) || (base==16) || (base==2);
109 #define FITS(width, signed) \
110 ((signed?!is_unsigned:(is_unsigned || is_hex_or_oct_or_bin)) && \
111 (power(2, signed?width-1:width)>value_abs))
121 c_type=ID_signed_int;
127 c_type=ID_unsigned_int;
133 c_type=ID_signed_long_int;
140 c_type=ID_unsigned_long_int;
146 c_type=ID_signed_long_long_int;
153 c_type=ID_unsigned_long_long_int;
163 c_type=ID_unsigned_long_long_int;
166 c_type=ID_signed_long_long_int;
170 type.
set(ID_C_c_type, c_type);
182 result.
set(ID_C_base, base);