Changeset e048ece
- Timestamp:
- Mar 11, 2024, 1:00:41 PM (9 months ago)
- Branches:
- master
- Children:
- 6c8b76b
- Parents:
- 9398177
- Location:
- src/Parser
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r9398177 re048ece 45 45 46 46 using namespace std; 47 48 // These must harmonize with the corresponding DeclarationNode enumerations.49 const char * DeclarationNode::basicTypeNames[] = {50 "void", "_Bool", "char", "int", "int128",51 "float", "double", "long double", "float80", "float128",52 "_float16", "_float32", "_float32x", "_float64", "_float64x", "_float128", "_float128x", "NoBasicTypeNames"53 };54 const char * DeclarationNode::complexTypeNames[] = {55 "_Complex", "NoComplexTypeNames", "_Imaginary"56 }; // Imaginary unsupported => parse, but make invisible and print error message57 const char * DeclarationNode::signednessNames[] = {58 "signed", "unsigned", "NoSignednessNames"59 };60 const char * DeclarationNode::lengthNames[] = {61 "short", "long", "long long", "NoLengthNames"62 };63 const char * DeclarationNode::builtinTypeNames[] = {64 "__builtin_va_list", "__auto_type", "zero_t", "one_t", "NoBuiltinTypeNames"65 };66 47 67 48 UniqueName DeclarationNode::anonymous( "__anonymous" ); … … 484 465 485 466 checkQualifiers( type, q->type ); 486 BuiltinType const builtin = type->builtintype;487 if ( (builtin == Zero || builtin ==One) && q->type->qualifiers.any() && error.length() == 0 ) {488 SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, builtinTypeNames[builtin] );467 TypeData::BuiltinType const builtin = type->builtintype; 468 if ( (builtin == TypeData::Zero || builtin == TypeData::One) && q->type->qualifiers.any() && error.length() == 0 ) { 469 SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, TypeData::builtinTypeNames[builtin] ); 489 470 } // if 490 471 type = ::addQualifiers( q->type, type ); -
src/Parser/DeclarationNode.h
r9398177 re048ece 22 22 23 23 struct DeclarationNode final : public ParseList<DeclarationNode> { 24 // These enumerations must harmonize with their names in DeclarationNode.cc.25 enum BasicType {26 Void, Bool, Char, Int, Int128,27 Float, Double, LongDouble, uuFloat80, uuFloat128,28 uFloat16, uFloat32, uFloat32x, uFloat64, uFloat64x, uFloat128, uFloat128x,29 NoBasicType30 };31 static const char * basicTypeNames[];32 enum ComplexType { Complex, NoComplexType, Imaginary };33 // Imaginary unsupported => parse, but make invisible and print error message34 static const char * complexTypeNames[];35 enum Signedness { Signed, Unsigned, NoSignedness };36 static const char * signednessNames[];37 enum Length { Short, Long, LongLong, NoLength };38 static const char * lengthNames[];39 enum BuiltinType { Valist, AutoType, Zero, One, NoBuiltinType };40 static const char * builtinTypeNames[];41 42 24 static DeclarationNode * newFromTypeData( TypeData * ); 43 25 static DeclarationNode * newStorageClass( ast::Storage::Classes ); -
src/Parser/ExpressionNode.cc
r9398177 re048ece 319 319 DeclarationNode::newFromTypeData( 320 320 addType( 321 build_basic_type( DeclarationNode::Int128 ),322 build_signedness( DeclarationNode::Unsigned ) ) ),321 build_basic_type( TypeData::Int128 ), 322 build_signedness( TypeData::Unsigned ) ) ), 323 323 new InitializerNode( 324 324 (new InitializerNode( new ExpressionNode( v2 == 0 ? ret2 : ret ) ))->set_last( new InitializerNode( new ExpressionNode( v2 == 0 ? ret : ret2 ) ) ), true ) -
src/Parser/TypeData.cc
r9398177 re048ece 33 33 using namespace std; 34 34 35 // These must harmonize with the corresponding enumerations in the header. 36 const char * TypeData::basicTypeNames[] = { 37 "void", "_Bool", "char", "int", "int128", 38 "float", "double", "long double", "float80", "float128", 39 "_float16", "_float32", "_float32x", "_float64", "_float64x", "_float128", "_float128x", 40 "NoBasicTypeNames" 41 }; 42 const char * TypeData::complexTypeNames[] = { 43 "_Complex", "NoComplexTypeNames", "_Imaginary" 44 }; // Imaginary unsupported => parse, but make invisible and print error message 45 const char * TypeData::signednessNames[] = { 46 "signed", "unsigned", "NoSignednessNames" 47 }; 48 const char * TypeData::lengthNames[] = { 49 "short", "long", "long long", "NoLengthNames" 50 }; 51 const char * TypeData::builtinTypeNames[] = { 52 "__builtin_va_list", "__auto_type", "zero_t", "one_t", "NoBuiltinTypeNames" 53 }; 54 35 55 TypeData::TypeData( Kind k ) : location( yylloc ), kind( k ), base( nullptr ), forall( nullptr ) /*, PTR1( (void*)(0xdeadbeefdeadbeef)), PTR2( (void*)(0xdeadbeefdeadbeef) ) */ { 36 56 switch ( kind ) { … … 239 259 break; 240 260 case Builtin: 241 assert( builtintype == DeclarationNode::Zero || builtintype == DeclarationNode::One );261 assert( builtintype == Zero || builtintype == One ); 242 262 newtype->builtintype = builtintype; 243 263 break; … … 261 281 switch ( kind ) { 262 282 case Basic: 263 if ( signedness != DeclarationNode::NoSignedness ) os << DeclarationNode::signednessNames[ signedness ] << " ";264 if ( length != DeclarationNode::NoLength ) os << DeclarationNode::lengthNames[ length ] << " ";265 if ( complextype != DeclarationNode::NoComplexType ) os << DeclarationNode::complexTypeNames[ complextype ] << " ";266 if ( basictype != DeclarationNode::NoBasicType ) os << DeclarationNode::basicTypeNames[ basictype ] << " ";283 if ( signedness != NoSignedness ) os << signednessNames[ signedness ] << " "; 284 if ( length != NoLength ) os << lengthNames[ length ] << " "; 285 if ( complextype != NoComplexType ) os << complexTypeNames[ complextype ] << " "; 286 if ( basictype != NoBasicType ) os << basicTypeNames[ basictype ] << " "; 267 287 break; 268 288 case Pointer: … … 429 449 break; 430 450 case Builtin: 431 os << DeclarationNode::builtinTypeNames[builtintype];451 os << builtinTypeNames[builtintype]; 432 452 break; 433 453 case GlobalScope: … … 495 515 } 496 516 497 TypeData * build_basic_type( DeclarationNode::BasicType basic ) {517 TypeData * build_basic_type( TypeData::BasicType basic ) { 498 518 TypeData * type = new TypeData( TypeData::Basic ); 499 519 type->basictype = basic; … … 501 521 } 502 522 503 TypeData * build_complex_type( DeclarationNode::ComplexType complex ) {523 TypeData * build_complex_type( TypeData::ComplexType complex ) { 504 524 TypeData * type = new TypeData( TypeData::Basic ); 505 525 type->complextype = complex; … … 507 527 } 508 528 509 TypeData * build_signedness( DeclarationNode::Signedness signedness ) {529 TypeData * build_signedness( TypeData::Signedness signedness ) { 510 530 TypeData * type = new TypeData( TypeData::Basic ); 511 531 type->signedness = signedness; … … 513 533 } 514 534 515 TypeData * build_builtin_type( DeclarationNode::BuiltinType bit ) {535 TypeData * build_builtin_type( TypeData::BuiltinType bit ) { 516 536 TypeData * type = new TypeData( TypeData::Builtin ); 517 537 type->builtintype = bit; … … 519 539 } 520 540 521 TypeData * build_length( DeclarationNode::Length length ) {541 TypeData * build_length( TypeData::Length length ) { 522 542 TypeData * type = new TypeData( TypeData::Basic ); 523 543 type->length = length; … … 622 642 assert( src->kind == TypeData::Basic ); 623 643 624 if ( dst->basictype == DeclarationNode::NoBasicType ) {644 if ( dst->basictype == TypeData::NoBasicType ) { 625 645 dst->basictype = src->basictype; 626 } else if ( src->basictype != DeclarationNode::NoBasicType ) {646 } else if ( src->basictype != TypeData::NoBasicType ) { 627 647 SemanticError( yylloc, "multiple declaration types \"%s\" and \"%s\".", 628 DeclarationNode::basicTypeNames[ dst->basictype ],629 DeclarationNode::basicTypeNames[ src->basictype ] );648 TypeData::basicTypeNames[ dst->basictype ], 649 TypeData::basicTypeNames[ src->basictype ] ); 630 650 } 631 if ( dst->complextype == DeclarationNode::NoComplexType ) {651 if ( dst->complextype == TypeData::NoComplexType ) { 632 652 dst->complextype = src->complextype; 633 } else if ( src->complextype != DeclarationNode::NoComplexType ) {653 } else if ( src->complextype != TypeData::NoComplexType ) { 634 654 SemanticError( yylloc, "multiple declaration types \"%s\" and \"%s\".", 635 DeclarationNode::complexTypeNames[ src->complextype ],636 DeclarationNode::complexTypeNames[ src->complextype ] );655 TypeData::complexTypeNames[ src->complextype ], 656 TypeData::complexTypeNames[ src->complextype ] ); 637 657 } 638 if ( dst->signedness == DeclarationNode::NoSignedness ) {658 if ( dst->signedness == TypeData::NoSignedness ) { 639 659 dst->signedness = src->signedness; 640 } else if ( src->signedness != DeclarationNode::NoSignedness ) {660 } else if ( src->signedness != TypeData::NoSignedness ) { 641 661 SemanticError( yylloc, "conflicting type specifier \"%s\" and \"%s\".", 642 DeclarationNode::signednessNames[ dst->signedness ],643 DeclarationNode::signednessNames[ src->signedness ] );662 TypeData::signednessNames[ dst->signedness ], 663 TypeData::signednessNames[ src->signedness ] ); 644 664 } 645 if ( dst->length == DeclarationNode::NoLength ) {665 if ( dst->length == TypeData::NoLength ) { 646 666 dst->length = src->length; 647 } else if ( dst->length == DeclarationNode::Long && src->length == DeclarationNode::Long ) {648 dst->length = DeclarationNode::LongLong;649 } else if ( src->length != DeclarationNode::NoLength ) {667 } else if ( dst->length == TypeData::Long && src->length == TypeData::Long ) { 668 dst->length = TypeData::LongLong; 669 } else if ( src->length != TypeData::NoLength ) { 650 670 SemanticError( yylloc, "conflicting type specifier \"%s\" and \"%s\".", 651 DeclarationNode::lengthNames[ dst->length ],652 DeclarationNode::lengthNames[ src->length ] );671 TypeData::lengthNames[ dst->length ], 672 TypeData::lengthNames[ src->length ] ); 653 673 } 654 674 } // if … … 1091 1111 case TypeData::Builtin: 1092 1112 switch ( td->builtintype ) { 1093 case DeclarationNode::Zero:1113 case TypeData::Zero: 1094 1114 return new ast::ZeroType(); 1095 case DeclarationNode::One:1115 case TypeData::One: 1096 1116 return new ast::OneType(); 1097 1117 default: … … 1149 1169 1150 1170 1151 static string genTSError( string msg, DeclarationNode::BasicType basictype ) {1152 SemanticError( yylloc, "invalid type specifier \"%s\" for type \"%s\".", msg.c_str(), DeclarationNode::basicTypeNames[basictype] );1171 static string genTSError( string msg, TypeData::BasicType basictype ) { 1172 SemanticError( yylloc, "invalid type specifier \"%s\" for type \"%s\".", msg.c_str(), TypeData::basicTypeNames[basictype] ); 1153 1173 } // genTSError 1154 1174 … … 1157 1177 1158 1178 switch ( td->basictype ) { 1159 case DeclarationNode::Void:1160 if ( td->signedness != DeclarationNode::NoSignedness ) {1161 genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype );1162 } // if 1163 if ( td->length != DeclarationNode::NoLength ) {1164 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );1179 case TypeData::Void: 1180 if ( td->signedness != TypeData::NoSignedness ) { 1181 genTSError( TypeData::signednessNames[ td->signedness ], td->basictype ); 1182 } // if 1183 if ( td->length != TypeData::NoLength ) { 1184 genTSError( TypeData::lengthNames[ td->length ], td->basictype ); 1165 1185 } // if 1166 1186 return new ast::VoidType( buildQualifiers( td ) ); 1167 1187 break; 1168 1188 1169 case DeclarationNode::Bool:1170 if ( td->signedness != DeclarationNode::NoSignedness ) {1171 genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype );1172 } // if 1173 if ( td->length != DeclarationNode::NoLength ) {1174 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );1189 case TypeData::Bool: 1190 if ( td->signedness != TypeData::NoSignedness ) { 1191 genTSError( TypeData::signednessNames[ td->signedness ], td->basictype ); 1192 } // if 1193 if ( td->length != TypeData::NoLength ) { 1194 genTSError( TypeData::lengthNames[ td->length ], td->basictype ); 1175 1195 } // if 1176 1196 … … 1178 1198 break; 1179 1199 1180 case DeclarationNode::Char:1200 case TypeData::Char: 1181 1201 // C11 Standard 6.2.5.15: The three types char, signed char, and unsigned char are collectively called the 1182 1202 // character types. The implementation shall define char to have the same range, representation, and behavior as … … 1184 1204 static ast::BasicType::Kind chartype[] = { ast::BasicType::SignedChar, ast::BasicType::UnsignedChar, ast::BasicType::Char }; 1185 1205 1186 if ( td->length != DeclarationNode::NoLength ) {1187 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );1206 if ( td->length != TypeData::NoLength ) { 1207 genTSError( TypeData::lengthNames[ td->length ], td->basictype ); 1188 1208 } // if 1189 1209 … … 1191 1211 break; 1192 1212 1193 case DeclarationNode::Int:1213 case TypeData::Int: 1194 1214 static ast::BasicType::Kind inttype[2][4] = { 1195 1215 { ast::BasicType::ShortSignedInt, ast::BasicType::LongSignedInt, ast::BasicType::LongLongSignedInt, ast::BasicType::SignedInt }, … … 1198 1218 1199 1219 Integral: ; 1200 if ( td->signedness == DeclarationNode::NoSignedness ) {1201 const_cast<TypeData *>(td)->signedness = DeclarationNode::Signed;1220 if ( td->signedness == TypeData::NoSignedness ) { 1221 const_cast<TypeData *>(td)->signedness = TypeData::Signed; 1202 1222 } // if 1203 1223 ret = inttype[ td->signedness ][ td->length ]; 1204 1224 break; 1205 1225 1206 case DeclarationNode::Int128:1207 ret = td->signedness == DeclarationNode::Unsigned ? ast::BasicType::UnsignedInt128 : ast::BasicType::SignedInt128;1208 if ( td->length != DeclarationNode::NoLength ) {1209 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );1210 } // if 1211 break; 1212 1213 case DeclarationNode::Float:1214 case DeclarationNode::Double:1215 case DeclarationNode::LongDouble: // not set until below1216 case DeclarationNode::uuFloat80:1217 case DeclarationNode::uuFloat128:1218 case DeclarationNode::uFloat16:1219 case DeclarationNode::uFloat32:1220 case DeclarationNode::uFloat32x:1221 case DeclarationNode::uFloat64:1222 case DeclarationNode::uFloat64x:1223 case DeclarationNode::uFloat128:1224 case DeclarationNode::uFloat128x:1226 case TypeData::Int128: 1227 ret = td->signedness == TypeData::Unsigned ? ast::BasicType::UnsignedInt128 : ast::BasicType::SignedInt128; 1228 if ( td->length != TypeData::NoLength ) { 1229 genTSError( TypeData::lengthNames[ td->length ], td->basictype ); 1230 } // if 1231 break; 1232 1233 case TypeData::Float: 1234 case TypeData::Double: 1235 case TypeData::LongDouble: // not set until below 1236 case TypeData::uuFloat80: 1237 case TypeData::uuFloat128: 1238 case TypeData::uFloat16: 1239 case TypeData::uFloat32: 1240 case TypeData::uFloat32x: 1241 case TypeData::uFloat64: 1242 case TypeData::uFloat64x: 1243 case TypeData::uFloat128: 1244 case TypeData::uFloat128x: 1225 1245 static ast::BasicType::Kind floattype[2][12] = { 1226 1246 { ast::BasicType::FloatComplex, ast::BasicType::DoubleComplex, ast::BasicType::LongDoubleComplex, (ast::BasicType::Kind)-1, (ast::BasicType::Kind)-1, ast::BasicType::uFloat16Complex, ast::BasicType::uFloat32Complex, ast::BasicType::uFloat32xComplex, ast::BasicType::uFloat64Complex, ast::BasicType::uFloat64xComplex, ast::BasicType::uFloat128Complex, ast::BasicType::uFloat128xComplex, }, … … 1229 1249 1230 1250 FloatingPoint: ; 1231 if ( td->signedness != DeclarationNode::NoSignedness ) {1232 genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype );1233 } // if 1234 if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) {1235 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );1236 } // if 1237 if ( td->basictype != DeclarationNode::Double && td->length == DeclarationNode::Long ) {1238 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );1239 } // if 1240 if ( td->complextype == DeclarationNode::Imaginary ) {1241 genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype );1242 } // if 1243 if ( (td->basictype == DeclarationNode::uuFloat80 || td->basictype == DeclarationNode::uuFloat128) && td->complextype == DeclarationNode::Complex ) { // gcc unsupported1244 genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype );1245 } // if 1246 if ( td->length == DeclarationNode::Long ) {1247 const_cast<TypeData *>(td)->basictype = DeclarationNode::LongDouble;1248 } // if 1249 1250 ret = floattype[ td->complextype ][ td->basictype - DeclarationNode::Float ];1251 //printf( "XXXX %d %d %d %d\n", td->complextype, td->basictype, DeclarationNode::Float, ret );1252 break; 1253 1254 case DeclarationNode::NoBasicType:1251 if ( td->signedness != TypeData::NoSignedness ) { 1252 genTSError( TypeData::signednessNames[ td->signedness ], td->basictype ); 1253 } // if 1254 if ( td->length == TypeData::Short || td->length == TypeData::LongLong ) { 1255 genTSError( TypeData::lengthNames[ td->length ], td->basictype ); 1256 } // if 1257 if ( td->basictype != TypeData::Double && td->length == TypeData::Long ) { 1258 genTSError( TypeData::lengthNames[ td->length ], td->basictype ); 1259 } // if 1260 if ( td->complextype == TypeData::Imaginary ) { 1261 genTSError( TypeData::complexTypeNames[ td->complextype ], td->basictype ); 1262 } // if 1263 if ( (td->basictype == TypeData::uuFloat80 || td->basictype == TypeData::uuFloat128) && td->complextype == TypeData::Complex ) { // gcc unsupported 1264 genTSError( TypeData::complexTypeNames[ td->complextype ], td->basictype ); 1265 } // if 1266 if ( td->length == TypeData::Long ) { 1267 const_cast<TypeData *>(td)->basictype = TypeData::LongDouble; 1268 } // if 1269 1270 ret = floattype[ td->complextype ][ td->basictype - TypeData::Float ]; 1271 //printf( "XXXX %d %d %d %d\n", td->complextype, td->basictype, TypeData::Float, ret ); 1272 break; 1273 1274 case TypeData::NoBasicType: 1255 1275 // No basic type in declaration => default double for Complex/Imaginary and int type for integral types 1256 if ( td->complextype == DeclarationNode::Complex || td->complextype == DeclarationNode::Imaginary ) {1257 const_cast<TypeData *>(td)->basictype = DeclarationNode::Double;1276 if ( td->complextype == TypeData::Complex || td->complextype == TypeData::Imaginary ) { 1277 const_cast<TypeData *>(td)->basictype = TypeData::Double; 1258 1278 goto FloatingPoint; 1259 1279 } // if 1260 1280 1261 const_cast<TypeData *>(td)->basictype = DeclarationNode::Int;1281 const_cast<TypeData *>(td)->basictype = TypeData::Int; 1262 1282 goto Integral; 1263 1283 default: … … 1803 1823 if ( ! param->type ) { // generate type int for empty parameter type 1804 1824 param->type = new TypeData( TypeData::Basic ); 1805 param->type->basictype = DeclarationNode::Int;1825 param->type->basictype = TypeData::Int; 1806 1826 } // if 1807 1827 } // for -
src/Parser/TypeData.h
r9398177 re048ece 24 24 25 25 struct TypeData { 26 // Type flags used in this type, and there names (harmonize with implementation). 27 enum BasicType { 28 Void, Bool, Char, Int, Int128, 29 Float, Double, LongDouble, uuFloat80, uuFloat128, 30 uFloat16, uFloat32, uFloat32x, uFloat64, uFloat64x, uFloat128, uFloat128x, 31 NoBasicType 32 }; 33 static const char * basicTypeNames[]; 34 enum ComplexType { Complex, NoComplexType, Imaginary }; 35 // Imaginary unsupported => parse, but make invisible and print error message 36 static const char * complexTypeNames[]; 37 enum Signedness { Signed, Unsigned, NoSignedness }; 38 static const char * signednessNames[]; 39 enum Length { Short, Long, LongLong, NoLength }; 40 static const char * lengthNames[]; 41 enum BuiltinType { Valist, AutoType, Zero, One, NoBuiltinType }; 42 static const char * builtinTypeNames[]; 43 26 44 enum Kind { Basic, Pointer, Reference, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic, 27 45 SymbolicInst, Tuple, Basetypeof, Typeof, Vtable, Builtin, GlobalScope, Qualified, Unknown }; … … 86 104 Kind kind; 87 105 TypeData * base; 88 DeclarationNode::BasicType basictype = DeclarationNode::NoBasicType;89 DeclarationNode::ComplexType complextype = DeclarationNode::NoComplexType;90 DeclarationNode::Signedness signedness = DeclarationNode::NoSignedness;91 DeclarationNode::Length length = DeclarationNode::NoLength;92 DeclarationNode::BuiltinType builtintype = DeclarationNode::NoBuiltinType;106 BasicType basictype = NoBasicType; 107 ComplexType complextype = NoComplexType; 108 Signedness signedness = NoSignedness; 109 Length length = NoLength; 110 BuiltinType builtintype = NoBuiltinType; 93 111 94 112 ast::CV::Qualifiers qualifiers; … … 118 136 119 137 TypeData * build_type_qualifier( ast::CV::Qualifiers ); 120 TypeData * build_basic_type( DeclarationNode::BasicType );121 TypeData * build_complex_type( DeclarationNode::ComplexType );122 TypeData * build_signedness( DeclarationNode::Signedness );123 TypeData * build_builtin_type( DeclarationNode::BuiltinType );124 TypeData * build_length( DeclarationNode::Length );138 TypeData * build_basic_type( TypeData::BasicType ); 139 TypeData * build_complex_type( TypeData::ComplexType ); 140 TypeData * build_signedness( TypeData::Signedness ); 141 TypeData * build_builtin_type( TypeData::BuiltinType ); 142 TypeData * build_length( TypeData::Length ); 125 143 TypeData * build_forall( DeclarationNode * ); 126 144 TypeData * build_global_scope(); -
src/Parser/parser.yy
r9398177 re048ece 2302 2302 basic_type_name_type: 2303 2303 VOID 2304 { $$ = build_basic_type( DeclarationNode::Void ); }2304 { $$ = build_basic_type( TypeData::Void ); } 2305 2305 | BOOL // C99 2306 { $$ = build_basic_type( DeclarationNode::Bool ); }2306 { $$ = build_basic_type( TypeData::Bool ); } 2307 2307 | CHAR 2308 { $$ = build_basic_type( DeclarationNode::Char ); }2308 { $$ = build_basic_type( TypeData::Char ); } 2309 2309 | INT 2310 { $$ = build_basic_type( DeclarationNode::Int ); }2310 { $$ = build_basic_type( TypeData::Int ); } 2311 2311 | INT128 2312 { $$ = build_basic_type( DeclarationNode::Int128 ); }2312 { $$ = build_basic_type( TypeData::Int128 ); } 2313 2313 | UINT128 2314 { $$ = addType( build_basic_type( DeclarationNode::Int128 ), build_signedness( DeclarationNode::Unsigned ) ); }2314 { $$ = addType( build_basic_type( TypeData::Int128 ), build_signedness( TypeData::Unsigned ) ); } 2315 2315 | FLOAT 2316 { $$ = build_basic_type( DeclarationNode::Float ); }2316 { $$ = build_basic_type( TypeData::Float ); } 2317 2317 | DOUBLE 2318 { $$ = build_basic_type( DeclarationNode::Double ); }2318 { $$ = build_basic_type( TypeData::Double ); } 2319 2319 | uuFLOAT80 2320 { $$ = build_basic_type( DeclarationNode::uuFloat80 ); }2320 { $$ = build_basic_type( TypeData::uuFloat80 ); } 2321 2321 | uuFLOAT128 2322 { $$ = build_basic_type( DeclarationNode::uuFloat128 ); }2322 { $$ = build_basic_type( TypeData::uuFloat128 ); } 2323 2323 | uFLOAT16 2324 { $$ = build_basic_type( DeclarationNode::uFloat16 ); }2324 { $$ = build_basic_type( TypeData::uFloat16 ); } 2325 2325 | uFLOAT32 2326 { $$ = build_basic_type( DeclarationNode::uFloat32 ); }2326 { $$ = build_basic_type( TypeData::uFloat32 ); } 2327 2327 | uFLOAT32X 2328 { $$ = build_basic_type( DeclarationNode::uFloat32x ); }2328 { $$ = build_basic_type( TypeData::uFloat32x ); } 2329 2329 | uFLOAT64 2330 { $$ = build_basic_type( DeclarationNode::uFloat64 ); }2330 { $$ = build_basic_type( TypeData::uFloat64 ); } 2331 2331 | uFLOAT64X 2332 { $$ = build_basic_type( DeclarationNode::uFloat64x ); }2332 { $$ = build_basic_type( TypeData::uFloat64x ); } 2333 2333 | uFLOAT128 2334 { $$ = build_basic_type( DeclarationNode::uFloat128 ); }2334 { $$ = build_basic_type( TypeData::uFloat128 ); } 2335 2335 | DECIMAL32 2336 2336 { SemanticError( yylloc, "_Decimal32 is currently unimplemented." ); $$ = nullptr; } … … 2340 2340 { SemanticError( yylloc, "_Decimal128 is currently unimplemented." ); $$ = nullptr; } 2341 2341 | COMPLEX // C99 2342 { $$ = build_complex_type( DeclarationNode::Complex ); }2342 { $$ = build_complex_type( TypeData::Complex ); } 2343 2343 | IMAGINARY // C99 2344 { $$ = build_complex_type( DeclarationNode::Imaginary ); }2344 { $$ = build_complex_type( TypeData::Imaginary ); } 2345 2345 | SIGNED 2346 { $$ = build_signedness( DeclarationNode::Signed ); }2346 { $$ = build_signedness( TypeData::Signed ); } 2347 2347 | UNSIGNED 2348 { $$ = build_signedness( DeclarationNode::Unsigned ); }2348 { $$ = build_signedness( TypeData::Unsigned ); } 2349 2349 | SHORT 2350 { $$ = build_length( DeclarationNode::Short ); }2350 { $$ = build_length( TypeData::Short ); } 2351 2351 | LONG 2352 { $$ = build_length( DeclarationNode::Long ); }2352 { $$ = build_length( TypeData::Long ); } 2353 2353 | VA_LIST // GCC, __builtin_va_list 2354 { $$ = build_builtin_type( DeclarationNode::Valist ); }2354 { $$ = build_builtin_type( TypeData::Valist ); } 2355 2355 | AUTO_TYPE 2356 { $$ = build_builtin_type( DeclarationNode::AutoType ); }2356 { $$ = build_builtin_type( TypeData::AutoType ); } 2357 2357 | vtable 2358 2358 ; … … 2416 2416 { $$ = DeclarationNode::newTypeof( $3, true ); } 2417 2417 | ZERO_T // CFA 2418 { $$ = DeclarationNode::newFromTypeData( build_builtin_type( DeclarationNode::Zero ) ); }2418 { $$ = DeclarationNode::newFromTypeData( build_builtin_type( TypeData::Zero ) ); } 2419 2419 | ONE_T // CFA 2420 { $$ = DeclarationNode::newFromTypeData( build_builtin_type( DeclarationNode::One ) ); }2420 { $$ = DeclarationNode::newFromTypeData( build_builtin_type( TypeData::One ) ); } 2421 2421 ; 2422 2422 … … 2856 2856 cfa_parameter_list_ellipsis_opt: // CFA, abstract + real 2857 2857 // empty 2858 { $$ = DeclarationNode::newFromTypeData( build_basic_type( DeclarationNode::Void ) ); }2858 { $$ = DeclarationNode::newFromTypeData( build_basic_type( TypeData::Void ) ); } 2859 2859 | ELLIPSIS 2860 2860 { $$ = nullptr; }
Note: See TracChangeset
for help on using the changeset viewer.