Changeset 0d0931d for src/Parser/ExpressionNode.cc
- Timestamp:
- Mar 14, 2023, 12:56:41 PM (14 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- c19ca4b
- Parents:
- a96ce07
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
ra96ce07 r0d0931d 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat May 16 13:17:07 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Tue Mar 14 09:10:22202313 // Update Count : 108 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Mar 14 12:00:00 2023 13 // Update Count : 1082 14 14 // 15 15 … … 122 122 if ( str[i] == '1' ) v |= 1; 123 123 i += 1; 124 124 if ( i == last - 1 || (str[i] != '0' && str[i] != '1') ) break; 125 125 v <<= 1; 126 126 } // for … … 168 168 if ( posn = str.find_last_of( "pP" ); posn != string::npos ) { 169 169 ltype = 5; str.erase( posn, 1 ); 170 170 // size_t 171 171 } else if ( posn = str.find_last_of( "zZ" ); posn != string::npos ) { 172 172 Unsigned = true; type = 2; ltype = 4; str.erase( posn, 1 ); 173 173 // signed char 174 174 } else if ( posn = str.rfind( "hh" ); posn != string::npos ) { 175 175 type = 1; str.erase( posn, 2 ); 176 176 // signed char 177 177 } else if ( posn = str.rfind( "HH" ); posn != string::npos ) { 178 178 type = 1; str.erase( posn, 2 ); 179 179 // short 180 180 } else if ( posn = str.find_last_of( "hH" ); posn != string::npos ) { 181 181 type = 0; str.erase( posn, 1 ); 182 182 // int (natural number) 183 183 } else if ( posn = str.find_last_of( "nN" ); posn != string::npos ) { 184 184 type = 2; str.erase( posn, 1 ); … … 436 436 Type * strtype; 437 437 switch ( str[0] ) { // str has >= 2 characters, i.e, null string "" => safe to look at subscripts 0/1 438 438 case 'u': 439 439 if ( str[1] == '8' ) goto Default; // utf-8 characters => array of char 440 440 // lookup type of associated typedef 441 441 strtype = new TypeInstType( Type::Qualifiers( ), "char16_t", false ); 442 442 break; 443 443 case 'U': 444 444 strtype = new TypeInstType( Type::Qualifiers( ), "char32_t", false ); 445 445 break; 446 446 case 'L': 447 447 strtype = new TypeInstType( Type::Qualifiers( ), "wchar_t", false ); 448 448 break; 449 450 449 Default: // char default string type 450 default: 451 451 strtype = new BasicType( Type::Qualifiers( ), BasicType::Char ); 452 452 } // switch
Note: See TracChangeset
for help on using the changeset viewer.