Changeset dd020c0
- Timestamp:
- Mar 3, 2017, 10:12:02 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 8191203
- Parents:
- f37147b
- Location:
- src
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 14:56:29201713 // Update Count : 4 1812 // Last Modified On : Fri Mar 3 21:18:47 2017 13 // Update Count : 465 14 14 // 15 15 … … 134 134 135 135 handleStorageClass( functionDecl ); 136 if ( functionDecl->get_isInline() ) { 137 output << "inline "; 138 } // if 139 if ( functionDecl->get_isNoreturn() ) { 140 output << "_Noreturn "; 141 } // if 136 DeclarationNode::print_FuncSpec( output, functionDecl->get_funcSpec() ); 137 142 138 output << genType( functionDecl->get_functionType(), mangleName( functionDecl ), pretty ); 143 139 … … 835 831 } 836 832 837 838 833 void CodeGenerator::visit( ReturnStmt * returnStmt ) { 839 834 output << "return "; … … 899 894 } 900 895 901 void CodeGenerator::handleStorageClass( Declaration * decl ) {896 void CodeGenerator::handleStorageClass( DeclarationWithType * decl ) { 902 897 switch ( decl->get_storageClass() ) { 898 //output << DeclarationNode::storageClassNames[decl->get_storageClass()] << ' '; 903 899 case DeclarationNode::Extern: 904 900 output << "extern "; … … 913 909 output << "register "; 914 910 break; 915 case DeclarationNode::Inline:916 output << "inline ";917 break;918 case DeclarationNode::Fortran:919 output << "fortran ";920 break;921 case DeclarationNode::Noreturn:922 output << "_Noreturn ";923 break;924 911 case DeclarationNode::Threadlocal: 925 output << "_Thread_local ";926 break;912 output << "_Thread_local "; 913 break; 927 914 case DeclarationNode::NoStorageClass: 928 915 break; 916 default: 917 assert( false ); 929 918 } // switch 930 } 919 } // CodeGenerator::handleStorageClass 931 920 932 921 std::string genName( DeclarationWithType * decl ) { -
src/CodeGen/CodeGenerator.h
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 9 15:06:21201713 // Update Count : 4912 // Last Modified On : Wed Mar 1 16:20:04 2017 13 // Update Count : 50 14 14 // 15 15 … … 123 123 124 124 void printDesignators( std::list< Expression * > & ); 125 void handleStorageClass( Declaration *decl );125 void handleStorageClass( DeclarationWithType *decl ); 126 126 void handleAggregate( AggregateDecl *aggDecl ); 127 127 void handleTypedef( NamedTypeDecl *namedType ); -
src/CodeGen/FixNames.cc
rf37147b rdd020c0 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Mon Apr 11 15:38:10 201613 // Update Count : 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 21:52:17 2017 13 // Update Count : 6 14 14 // 15 15 … … 44 44 LinkageSpec::Cforall, 45 45 main_type = new FunctionType( Type::Qualifiers(), true ), 46 nullptr , false, false46 nullptr 47 47 ) }; 48 48 main_type->get_returnVals().push_back( … … 50 50 ); 51 51 52 auto && name = SymTab::Mangler::mangle( mainDecl.get() );52 auto && name = SymTab::Mangler::mangle( mainDecl.get() ); 53 53 // std::cerr << name << std::endl; 54 54 return name; … … 61 61 LinkageSpec::Cforall, 62 62 main_type = new FunctionType( Type::Qualifiers(), false ), 63 nullptr , false, false63 nullptr 64 64 ) }; 65 65 main_type->get_returnVals().push_back( -
src/GenPoly/Box.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 14:57:16201713 // Update Count : 29712 // Last Modified On : Fri Mar 3 21:57:15 2017 13 // Update Count : 310 14 14 // 15 15 … … 299 299 // because each unit generates copies of the default routines for each aggregate. 300 300 FunctionDecl *layoutDecl = new FunctionDecl( 301 layoutofName( typeDecl ), functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ), true, false ); 301 layoutofName( typeDecl ), functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ), 302 std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ); 302 303 layoutDecl->fixUniqueId(); 303 304 return layoutDecl; … … 910 911 adapterBody->get_kids().push_back( bodyStmt ); 911 912 std::string adapterName = makeAdapterName( mangleName ); 912 return new FunctionDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, adapterType, adapterBody , false, false);913 return new FunctionDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, adapterType, adapterBody ); 913 914 } 914 915 -
src/GenPoly/Specialize.cc
rf37147b rdd020c0 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Apr 28 15:17:45 201613 // Update Count : 2 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 21:54:45 2017 13 // Update Count : 28 14 14 // 15 15 … … 155 155 } // if 156 156 // create new thunk with same signature as formal type (C linkage, empty body) 157 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, newType, new CompoundStmt( noLabels ) , false, false);157 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, newType, new CompoundStmt( noLabels ) ); 158 158 thunkFunc->fixUniqueId(); 159 159 -
src/InitTweak/FixGlobalInit.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 04 15:14:56 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 29 22:33:15 201613 // Update Count : 412 // Last Modified On : Fri Mar 3 21:55:33 2017 13 // Update Count : 9 14 14 // 15 15 … … 87 87 dtorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) ); 88 88 } 89 initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) , false, false);89 initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) ); 90 90 initFunction->get_attributes().push_back( new Attribute( "constructor", ctorParameters ) ); 91 destroyFunction = new FunctionDecl( "_destroy_" + fixedName, DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) , false, false);91 destroyFunction = new FunctionDecl( "_destroy_" + fixedName, DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) ); 92 92 destroyFunction->get_attributes().push_back( new Attribute( "destructor", dtorParameters ) ); 93 93 } -
src/InitTweak/FixInit.cc
rf37147b rdd020c0 10 10 // Created On : Wed Jan 13 16:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 14:58:43201713 // Update Count : 3 512 // Last Modified On : Fri Mar 3 21:56:11 2017 13 // Update Count : 39 14 14 // 15 15 … … 731 731 732 732 // void __objName_dtor_atexitN(...) {...} 733 FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) , false, false);733 FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) ); 734 734 dtorCaller->fixUniqueId(); 735 735 dtorCaller->get_statements()->push_back( dtorStmt ); -
src/Parser/DeclarationNode.cc
rf37147b rdd020c0 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 23 22:21:06201713 // Update Count : 77512 // Last Modified On : Fri Mar 3 21:38:34 2017 13 // Update Count : 862 14 14 // 15 15 … … 32 32 33 33 // These must remain in the same order as the corresponding DeclarationNode enumerations. 34 const char * DeclarationNode::storageName[] = { "extern", "static", "auto", "register", "inline", "fortran", "_Noreturn", "_Thread_local", "NoStorageClass" }; 35 const char * DeclarationNode::qualifierName[] = { "const", "restrict", "volatile", "lvalue", "_Atomic", "NoQualifier" }; 36 const char * DeclarationNode::basicTypeName[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "NoBasicType" }; 37 const char * DeclarationNode::complexTypeName[] = { "_Complex", "_Imaginary", "NoComplexType" }; 38 const char * DeclarationNode::signednessName[] = { "signed", "unsigned", "NoSignedness" }; 39 const char * DeclarationNode::lengthName[] = { "short", "long", "long long", "NoLength" }; 40 const char * DeclarationNode::aggregateName[] = { "struct", "union", "context" }; 41 const char * DeclarationNode::typeClassName[] = { "otype", "dtype", "ftype" }; 42 const char * DeclarationNode::builtinTypeName[] = { "__builtin_va_list" }; 34 const char * DeclarationNode::storageClassNames[] = { "extern", "static", "auto", "register", "_Thread_local", "inline", "fortran", "_Noreturn", "NoStorageClassNames" }; 35 const char * DeclarationNode::funcSpecifierNames[] = { "inline", "fortran", "_Noreturn", "NoFunctionSpecifierNames" }; 36 const char * DeclarationNode::typeQualifierNames[] = { "const", "restrict", "volatile", "lvalue", "_Atomic", "NoTypeQualifierNames" }; 37 const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "NoBasicTypeNames" }; 38 const char * DeclarationNode::complexTypeNames[] = { "_Complex", "_Imaginary", "NoComplexTypeNames" }; 39 const char * DeclarationNode::signednessNames[] = { "signed", "unsigned", "NoSignednessNames" }; 40 const char * DeclarationNode::lengthNames[] = { "short", "long", "long long", "NoLengthNames" }; 41 const char * DeclarationNode::aggregateNames[] = { "struct", "union", "context", "NoAggregateNames" }; 42 const char * DeclarationNode::typeClassNames[] = { "otype", "dtype", "ftype", "NoTypeClassNames" }; 43 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", "NoBuiltinTypeNames" }; 43 44 44 45 UniqueName DeclarationNode::anonymous( "__anonymous" ); … … 50 51 storageClass( NoStorageClass ), 51 52 bitfieldWidth( nullptr ), 52 isInline( false ),53 isNoreturn( false ),54 53 hasEllipsis( false ), 55 54 linkage( ::linkage ), … … 92 91 newnode->storageClass = storageClass; 93 92 newnode->bitfieldWidth = maybeClone( bitfieldWidth ); 94 newnode->isInline = isInline; 95 newnode->isNoreturn = isNoreturn; 93 newnode->funcSpec = funcSpec; 96 94 newnode->enumeratorValue.reset( maybeClone( enumeratorValue.get() ) ); 97 95 newnode->hasEllipsis = hasEllipsis; … … 118 116 } 119 117 118 void DeclarationNode::print_FuncSpec( std::ostream & output, DeclarationNode::FuncSpec funcSpec ) { 119 if ( funcSpec.any() ) { // function specifiers? 120 for ( unsigned int i = 0; i < DeclarationNode::NoFuncSpecifier; i += 1 ) { 121 if ( funcSpec[i] ) { 122 output << DeclarationNode::funcSpecifierNames[i] << ' '; 123 } // if 124 } // for 125 } // if 126 } // print_FuncSpec 127 120 128 void DeclarationNode::print( std::ostream &os, int indent ) const { 121 129 os << string( indent, ' ' ); … … 130 138 } // if 131 139 132 if ( storageClass != NoStorageClass ) os << DeclarationNode::storage Name[storageClass] << ' ';133 if ( isInline ) os << DeclarationNode::storageName[Inline] << ' ';134 if ( isNoreturn ) os << DeclarationNode::storageName[Noreturn] << ' '; 140 if ( storageClass != NoStorageClass ) os << DeclarationNode::storageClassNames[storageClass] << ' '; 141 print_FuncSpec( os, funcSpec ); 142 135 143 if ( type ) { 136 144 type->print( os, indent ); … … 183 191 } // DeclarationNode::newFunction 184 192 185 DeclarationNode * DeclarationNode::newQualifier( Qualifier q ) { 193 194 DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClass sc ) { 195 DeclarationNode * newnode = new DeclarationNode; 196 newnode->storageClass = sc; 197 return newnode; 198 } // DeclarationNode::newStorageClass 199 200 DeclarationNode * DeclarationNode::newFuncSpecifier( DeclarationNode::FuncSpecifier fs ) { 201 DeclarationNode * newnode = new DeclarationNode; 202 newnode->funcSpec[ fs ] = true; 203 return newnode; 204 } // DeclarationNode::newFuncSpecifier 205 206 DeclarationNode * DeclarationNode::newTypeQualifier( TypeQualifier tq ) { 186 207 DeclarationNode * newnode = new DeclarationNode; 187 208 newnode->type = new TypeData(); 188 newnode->type-> qualifiers[ q ] = 1;209 newnode->type->typeQualifiers[ tq ] = true; 189 210 return newnode; 190 211 } // DeclarationNode::newQualifier 212 213 DeclarationNode * DeclarationNode::newBasicType( BasicType bt ) { 214 DeclarationNode * newnode = new DeclarationNode; 215 newnode->type = new TypeData( TypeData::Basic ); 216 newnode->type->basictype = bt; 217 return newnode; 218 } // DeclarationNode::newBasicType 219 220 DeclarationNode * DeclarationNode::newComplexType( ComplexType ct ) { 221 DeclarationNode * newnode = new DeclarationNode; 222 newnode->type = new TypeData( TypeData::Basic ); 223 newnode->type->complextype = ct; 224 return newnode; 225 } // DeclarationNode::newComplexType 226 227 DeclarationNode * DeclarationNode::newSignedNess( Signedness sn ) { 228 DeclarationNode * newnode = new DeclarationNode; 229 newnode->type = new TypeData( TypeData::Basic ); 230 newnode->type->signedness = sn; 231 return newnode; 232 } // DeclarationNode::newSignedNess 233 234 DeclarationNode * DeclarationNode::newLength( Length lnth ) { 235 DeclarationNode * newnode = new DeclarationNode; 236 newnode->type = new TypeData( TypeData::Basic ); 237 newnode->type->length = lnth; 238 return newnode; 239 } // DeclarationNode::newLength 191 240 192 241 DeclarationNode * DeclarationNode::newForall( DeclarationNode * forall ) { … … 196 245 return newnode; 197 246 } // DeclarationNode::newForall 198 199 DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClass sc ) {200 DeclarationNode * newnode = new DeclarationNode;201 newnode->storageClass = sc;202 return newnode;203 } // DeclarationNode::newStorageClass204 205 DeclarationNode * DeclarationNode::newBasicType( BasicType bt ) {206 DeclarationNode * newnode = new DeclarationNode;207 newnode->type = new TypeData( TypeData::Basic );208 newnode->type->basictype = bt;209 return newnode;210 } // DeclarationNode::newBasicType211 212 DeclarationNode * DeclarationNode::newComplexType( ComplexType ct ) {213 DeclarationNode * newnode = new DeclarationNode;214 newnode->type = new TypeData( TypeData::Basic );215 newnode->type->complextype = ct;216 return newnode;217 } // DeclarationNode::newComplexType218 219 DeclarationNode * DeclarationNode::newSignedNess( Signedness sn ) {220 DeclarationNode * newnode = new DeclarationNode;221 newnode->type = new TypeData( TypeData::Basic );222 newnode->type->signedness = sn;223 return newnode;224 } // DeclarationNode::newSignedNess225 226 DeclarationNode * DeclarationNode::newLength( Length lnth ) {227 DeclarationNode * newnode = new DeclarationNode;228 newnode->type = new TypeData( TypeData::Basic );229 newnode->type->length = lnth;230 return newnode;231 } // DeclarationNode::newLength232 247 233 248 DeclarationNode * DeclarationNode::newFromTypedef( string * name ) { … … 428 443 429 444 void DeclarationNode::checkQualifiers( const TypeData * src, const TypeData * dst ) { 430 TypeData::Qualifiers qsrc = src->qualifiers, qdst = dst->qualifiers; // optimization431 432 if ( (qsrc & qdst).any() ) { // common qualifier ?433 for ( int i = 0; i < NoQualifier; i += 1 ) {// find common qualifiers445 const TypeData::TypeQualifiers &qsrc = src->typeQualifiers, &qdst = dst->typeQualifiers; // optimization 446 447 if ( (qsrc & qdst).any() ) { // common qualifier ? 448 for ( unsigned int i = 0; i < NoTypeQualifier; i += 1 ) { // find common qualifiers 434 449 if ( qsrc[i] && qdst[i] ) { 435 appendError( error, string( "duplicate " ) + DeclarationNode:: qualifierName[i] );450 appendError( error, string( "duplicate " ) + DeclarationNode::typeQualifierNames[i] ); 436 451 } // if 437 452 } // for … … 440 455 441 456 void DeclarationNode::checkStorageClasses( DeclarationNode * q ) { 457 const FuncSpec &src = funcSpec, &dst = q->funcSpec; // optimization 458 if ( (src & dst).any() ) { // common specifier ? 459 for ( unsigned int i = 0; i < NoFuncSpecifier; i += 1 ) { // find common specifier 460 if ( src[i] && dst[i] ) { 461 appendError( error, string( "duplicate " ) + DeclarationNode::funcSpecifierNames[i] ); 462 } // if 463 } // for 464 } // if 465 442 466 if ( storageClass != NoStorageClass && q->storageClass != NoStorageClass ) { 443 467 if ( storageClass == q->storageClass ) { // duplicate qualifier 444 appendError( error, string( "duplicate " ) + storage Name[ storageClass ] );468 appendError( error, string( "duplicate " ) + storageClassNames[ storageClass ] ); 445 469 } else { // only one storage class 446 appendError( error, string( "conflicting " ) + storage Name[ storageClass ] + " & " + storageName[ q->storageClass ] );470 appendError( error, string( "conflicting " ) + storageClassNames[ storageClass ] + " & " + storageClassNames[ q->storageClass ] ); 447 471 q->storageClass = storageClass; // FIX ERROR, prevent assertions from triggering 448 472 } // if 449 473 } // if 474 450 475 appendError( error, q->error ); 451 476 } // DeclarationNode::checkStorageClasses 452 477 453 478 DeclarationNode * DeclarationNode::copyStorageClasses( DeclarationNode * q ) { 454 isInline = isInline || q->isInline;455 isNoreturn = isNoreturn || q->isNoreturn; 479 funcSpec = funcSpec | q->funcSpec; 480 456 481 // do not overwrite an existing value with NoStorageClass 457 482 if ( q->storageClass != NoStorageClass ) { … … 481 506 src = nullptr; 482 507 } else { 483 dst-> qualifiers |= src->qualifiers;508 dst->typeQualifiers |= src->typeQualifiers; 484 509 } // if 485 510 } // addQualifiersToType … … 539 564 switch ( dst->kind ) { 540 565 case TypeData::Unknown: 541 src-> qualifiers |= dst->qualifiers;566 src->typeQualifiers |= dst->typeQualifiers; 542 567 dst = src; 543 568 src = nullptr; 544 569 break; 545 570 case TypeData::Basic: 546 dst-> qualifiers |= src->qualifiers;571 dst->typeQualifiers |= src->typeQualifiers; 547 572 if ( src->kind != TypeData::Unknown ) { 548 573 assert( src->kind == TypeData::Basic ); … … 551 576 dst->basictype = src->basictype; 552 577 } else if ( src->basictype != DeclarationNode::NoBasicType ) 553 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::basicTypeName [ src->basictype ] + " in type: ", src );578 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: ", src ); 554 579 555 580 if ( dst->complextype == DeclarationNode::NoComplexType ) { 556 581 dst->complextype = src->complextype; 557 582 } else if ( src->complextype != DeclarationNode::NoComplexType ) 558 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::complexTypeName [ src->complextype ] + " in type: ", src );583 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: ", src ); 559 584 560 585 if ( dst->signedness == DeclarationNode::NoSignedness ) { 561 586 dst->signedness = src->signedness; 562 587 } else if ( src->signedness != DeclarationNode::NoSignedness ) 563 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::signednessName [ src->signedness ] + " in type: ", src );588 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: ", src ); 564 589 565 590 if ( dst->length == DeclarationNode::NoLength ) { … … 568 593 dst->length = DeclarationNode::LongLong; 569 594 } else if ( src->length != DeclarationNode::NoLength ) 570 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::lengthName [ src->length ] + " in type: ", src );595 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: ", src ); 571 596 } // if 572 597 break; … … 580 605 dst->base->aggInst.params = maybeClone( src->aggregate.actuals ); 581 606 } // if 582 dst->base-> qualifiers |= src->qualifiers;607 dst->base->typeQualifiers |= src->typeQualifiers; 583 608 src = nullptr; 584 609 break; … … 612 637 type->aggInst.hoistType = o->type->enumeration.body; 613 638 } // if 614 type-> qualifiers |= o->type->qualifiers;639 type->typeQualifiers |= o->type->typeQualifiers; 615 640 } else { 616 641 type = o->type; … … 768 793 p->type->base->aggInst.params = maybeClone( type->aggregate.actuals ); 769 794 } // if 770 p->type->base-> qualifiers |= type->qualifiers;795 p->type->base->typeQualifiers |= type->typeQualifiers; 771 796 break; 772 797 … … 805 830 lastArray->base->aggInst.params = maybeClone( type->aggregate.actuals ); 806 831 } // if 807 lastArray->base-> qualifiers |= type->qualifiers;832 lastArray->base->typeQualifiers |= type->typeQualifiers; 808 833 break; 809 834 default: … … 1005 1030 } // if 1006 1031 1007 // if ( variable.name ) {1008 1032 if ( variable.tyClass != NoTypeClass ) { 1009 1033 static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype }; 1010 1034 assertf( sizeof(kindMap)/sizeof(kindMap[0] == NoTypeClass-1), "DeclarationNode::build: kindMap is out of sync." ); 1011 1035 assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." ); 1012 // TypeDecl * ret = new TypeDecl( *variable.name, DeclarationNode::NoStorageClass, nullptr, kindMap[ variable.tyClass ] );1013 1036 TypeDecl * ret = new TypeDecl( *name, DeclarationNode::NoStorageClass, nullptr, kindMap[ variable.tyClass ] ); 1014 1037 buildList( variable.assertions, ret->get_assertions() ); … … 1017 1040 1018 1041 if ( type ) { 1019 return buildDecl( type, name ? *name : string( "" ), storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, asmName, maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); 1020 } // if 1021 1022 if ( ! isInline && ! isNoreturn ) { 1023 assertf( name, "ObjectDecl are assumed to have names\n" ); 1024 return (new ObjectDecl( *name, storageClass, linkage, maybeBuild< Expression >( bitfieldWidth ), nullptr, maybeBuild< Initializer >( initializer ) ))->set_asmName( asmName )->set_extension( extension ); 1025 } // if 1026 1027 throw SemanticError( "invalid function specifier ", this ); 1042 // Function specifiers can only appear on a function definition/declaration. 1043 // 1044 // inline _Noreturn int f(); // allowed 1045 // inline _Noreturn int g( int i ); // allowed 1046 // inline _Noreturn int i; // disallowed 1047 if ( type->kind != TypeData::Function && funcSpec.any() ) { 1048 throw SemanticError( "invalid function specifier for ", this ); 1049 } // if 1050 return buildDecl( type, name ? *name : string( "" ), storageClass, maybeBuild< Expression >( bitfieldWidth ), funcSpec, linkage, asmName, maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); 1051 } // if 1052 1053 // SUE's cannot have function specifiers, either 1054 // 1055 // inlne _Noreturn struct S { ... }; // disallowed 1056 // inlne _Noreturn enum E { ... }; // disallowed 1057 if ( funcSpec.any() ) { 1058 throw SemanticError( "invalid function specifier for ", this ); 1059 } // if 1060 assertf( name, "ObjectDecl must a have name\n" ); 1061 return (new ObjectDecl( *name, storageClass, linkage, maybeBuild< Expression >( bitfieldWidth ), nullptr, maybeBuild< Initializer >( initializer ) ))->set_asmName( asmName )->set_extension( extension ); 1028 1062 } 1029 1063 … … 1032 1066 1033 1067 if ( attr.expr ) { 1034 // return new AttrType( buildQualifiers( type ), *attr.name, attr.expr->build() );1035 1068 return new AttrType( buildQualifiers( type ), *name, attr.expr->build(), attributes ); 1036 1069 } else if ( attr.type ) { 1037 // return new AttrType( buildQualifiers( type ), *attr.name, attr.type->buildType() );1038 1070 return new AttrType( buildQualifiers( type ), *name, attr.type->buildType(), attributes ); 1039 1071 } // if -
src/Parser/ParseNode.h
rf37147b rdd020c0 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 23 15:22:10201713 // Update Count : 66212 // Last Modified On : Fri Mar 3 21:34:27 2017 13 // Update Count : 704 14 14 // 15 15 … … 19 19 #include <string> 20 20 #include <list> 21 #include <bitset> 21 22 #include <iterator> 22 23 #include <memory> … … 203 204 // These must remain in the same order as the corresponding DeclarationNode names. 204 205 205 // enum StorageClass { Extern, Static, Auto, Register, NoStorageClass }; 206 // enum FunctionSpec { Inline, Fortran, Noreturn, NoFunctionSpec }; 207 // enum Qualifier { Const, Restrict, Volatile, Lvalue, Atomic, Threadlocal, Mutex, NoQualifier }; 208 209 enum StorageClass { Extern, Static, Auto, Register, Inline, Fortran, Noreturn, Threadlocal, NoStorageClass, }; 210 enum Qualifier { Const, Restrict, Volatile, Lvalue, Atomic, NoQualifier }; 206 enum StorageClass { Extern, Static, Auto, Register, Threadlocal, NoStorageClass }; 207 enum FuncSpecifier { Inline, Noreturn, Fortran, NoFuncSpecifier, 208 InlineSpec = 1 << Inline, NoreturnSpec = 1 << Noreturn, FortranSpec = 1 << Fortran }; 209 enum TypeQualifier { Const, Restrict, Volatile, Lvalue, Atomic, NoTypeQualifier }; 211 210 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType }; 212 211 enum ComplexType { Complex, Imaginary, NoComplexType }; … … 217 216 enum BuiltinType { Valist, Zero, One, NoBuiltinType }; 218 217 219 static const char * storageName[]; 220 static const char * qualifierName[]; 221 static const char * basicTypeName[]; 222 static const char * complexTypeName[]; 223 static const char * signednessName[]; 224 static const char * lengthName[]; 225 static const char * aggregateName[]; 226 static const char * typeClassName[]; 227 static const char * builtinTypeName[]; 228 229 static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle = false ); 230 static DeclarationNode * newQualifier( Qualifier ); 231 static DeclarationNode * newForall( DeclarationNode * ); 218 static const char * storageClassNames[]; 219 static const char * funcSpecifierNames[]; 220 static const char * typeQualifierNames[]; 221 static const char * basicTypeNames[]; 222 static const char * complexTypeNames[]; 223 static const char * signednessNames[]; 224 static const char * lengthNames[]; 225 static const char * aggregateNames[]; 226 static const char * typeClassNames[]; 227 static const char * builtinTypeNames[]; 228 232 229 static DeclarationNode * newStorageClass( StorageClass ); 230 static DeclarationNode * newFuncSpecifier( FuncSpecifier ); 231 static DeclarationNode * newTypeQualifier( TypeQualifier ); 233 232 static DeclarationNode * newBasicType( BasicType ); 234 233 static DeclarationNode * newComplexType( ComplexType ); 235 static DeclarationNode * newSignedNess( Signedness sn);236 static DeclarationNode * newLength( Length lnth);234 static DeclarationNode * newSignedNess( Signedness ); 235 static DeclarationNode * newLength( Length ); 237 236 static DeclarationNode * newBuiltinType( BuiltinType ); 237 static DeclarationNode * newForall( DeclarationNode * ); 238 238 static DeclarationNode * newFromTypedef( std::string * ); 239 static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle = false ); 239 240 static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 240 241 static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body ); … … 324 325 TypeData * type; 325 326 StorageClass storageClass; 327 328 typedef std::bitset< DeclarationNode::NoFuncSpecifier > FuncSpec; 329 FuncSpec funcSpec; 330 static void print_FuncSpec( std::ostream & output, FuncSpec funcSpec ); 331 326 332 ExpressionNode * bitfieldWidth; 327 bool isInline, isNoreturn;328 333 std::unique_ptr<ExpressionNode> enumeratorValue; 329 334 bool hasEllipsis; -
src/Parser/TypeData.cc
rf37147b rdd020c0 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 23 21:48:55201713 // Update Count : 48512 // Last Modified On : Fri Mar 3 21:59:10 2017 13 // Update Count : 516 14 14 // 15 15 … … 157 157 TypeData * TypeData::clone() const { 158 158 TypeData * newtype = new TypeData( kind ); 159 newtype-> qualifiers = qualifiers;159 newtype->typeQualifiers = typeQualifiers; 160 160 newtype->base = maybeClone( base ); 161 161 newtype->forall = maybeClone( forall ); … … 226 226 227 227 void TypeData::print( ostream &os, int indent ) const { 228 for ( int i = 0; i < DeclarationNode::No Qualifier; i += 1 ) {229 if ( qualifiers[i] ) os << DeclarationNode::qualifierName[ i ] << ' ';228 for ( int i = 0; i < DeclarationNode::NoTypeQualifier; i += 1 ) { 229 if ( typeQualifiers[i] ) os << DeclarationNode::typeQualifierNames[ i ] << ' '; 230 230 } // for 231 231 … … 250 250 break; 251 251 case Basic: 252 if ( signedness != DeclarationNode::NoSignedness ) os << DeclarationNode::signednessName [ signedness ] << " ";253 if ( length != DeclarationNode::NoLength ) os << DeclarationNode::lengthName [ length ] << " ";252 if ( signedness != DeclarationNode::NoSignedness ) os << DeclarationNode::signednessNames[ signedness ] << " "; 253 if ( length != DeclarationNode::NoLength ) os << DeclarationNode::lengthNames[ length ] << " "; 254 254 assert( basictype != DeclarationNode::NoBasicType ); 255 os << DeclarationNode::basicTypeName [ basictype ] << " ";256 if ( complextype != DeclarationNode::NoComplexType ) os << DeclarationNode::complexTypeName [ complextype ] << " ";255 os << DeclarationNode::basicTypeNames[ basictype ] << " "; 256 if ( complextype != DeclarationNode::NoComplexType ) os << DeclarationNode::complexTypeNames[ complextype ] << " "; 257 257 break; 258 258 case Array: … … 301 301 break; 302 302 case Aggregate: 303 os << DeclarationNode::aggregateName [ aggregate.kind ] << ' ' << *aggregate.name << endl;303 os << DeclarationNode::aggregateNames[ aggregate.kind ] << ' ' << *aggregate.name << endl; 304 304 if ( aggregate.params ) { 305 305 os << string( indent + 2, ' ' ) << "with type parameters " << endl; … … 399 399 FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false ); 400 400 dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 401 td->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, nullptr , false, false) );401 td->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, nullptr ) ); 402 402 403 403 // add copy ctor: void ?{}(T *, T) … … 405 405 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 406 406 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 407 td->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, nullptr , false, false) );407 td->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, nullptr ) ); 408 408 409 409 // add default ctor: void ?{}(T *) 410 410 FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false ); 411 411 ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 412 td->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, nullptr , false, false) );412 td->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, nullptr ) ); 413 413 414 414 // add assignment operator: T * ?=?(T *, T) … … 417 417 assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 418 418 assignType->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 419 td->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, nullptr , false, false) );419 td->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, nullptr ) ); 420 420 } // if 421 421 } // for … … 494 494 Type::Qualifiers buildQualifiers( const TypeData * td ) { 495 495 Type::Qualifiers q; 496 q.isConst = td-> qualifiers[ DeclarationNode::Const ];497 q.isVolatile = td-> qualifiers[ DeclarationNode::Volatile ];498 q.isRestrict = td-> qualifiers[ DeclarationNode::Restrict ];499 q.isLvalue = td-> qualifiers[ DeclarationNode::Lvalue ];500 q.isAtomic = td-> qualifiers[ DeclarationNode::Atomic ];;496 q.isConst = td->typeQualifiers[ DeclarationNode::Const ]; 497 q.isVolatile = td->typeQualifiers[ DeclarationNode::Volatile ]; 498 q.isRestrict = td->typeQualifiers[ DeclarationNode::Restrict ]; 499 q.isLvalue = td->typeQualifiers[ DeclarationNode::Lvalue ]; 500 q.isAtomic = td->typeQualifiers[ DeclarationNode::Atomic ];; 501 501 return q; 502 502 } // buildQualifiers … … 516 516 case DeclarationNode::Bool: 517 517 if ( td->signedness != DeclarationNode::NoSignedness ) { 518 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessName [ td->signedness ] + " in type: ", td );518 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessNames[ td->signedness ] + " in type: ", td ); 519 519 } // if 520 520 if ( td->length != DeclarationNode::NoLength ) { 521 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName [ td->length ] + " in type: ", td );521 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td ); 522 522 } // if 523 523 … … 532 532 533 533 if ( td->length != DeclarationNode::NoLength ) { 534 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName [ td->length ] + " in type: ", td );534 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td ); 535 535 } // if 536 536 … … 562 562 FloatingPoint: ; 563 563 if ( td->signedness != DeclarationNode::NoSignedness ) { 564 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessName [ td->signedness ] + " in type: ", td );564 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessNames[ td->signedness ] + " in type: ", td ); 565 565 } // if 566 566 if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) { 567 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName [ td->length ] + " in type: ", td );567 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td ); 568 568 } // if 569 569 if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) { … … 784 784 } // buildTypeof 785 785 786 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, ConstantExpr *asmName, Initializer * init, std::list< Attribute * > attributes ) {786 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, DeclarationNode::FuncSpec funcSpec, LinkageSpec::Spec linkage, ConstantExpr *asmName, Initializer * init, std::list< Attribute * > attributes ) { 787 787 if ( td->kind == TypeData::Function ) { 788 788 if ( td->function.idList ) { // KR function ? … … 793 793 Statement * stmt = maybeBuild<Statement>( td->function.body ); 794 794 CompoundStmt * body = dynamic_cast< CompoundStmt* >( stmt ); 795 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn, attributes);795 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, attributes, funcSpec ); 796 796 return decl->set_asmName( asmName ); 797 797 } else if ( td->kind == TypeData::Aggregate ) { … … 802 802 return buildSymbolic( td, name, sc ); 803 803 } else { 804 return (new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, attributes , isInline, isNoreturn))->set_asmName( asmName );804 return (new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, attributes ))->set_asmName( asmName ); 805 805 } // if 806 806 return nullptr; … … 820 820 break; 821 821 default: 822 ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base, "", DeclarationNode::NoStorageClass, nullptr, false, false, LinkageSpec::Cforall, nullptr ) ) );822 ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base, "", DeclarationNode::NoStorageClass, nullptr, DeclarationNode::FuncSpecifier(), LinkageSpec::Cforall, nullptr ) ) ); 823 823 } // switch 824 824 } else { -
src/Parser/TypeData.h
rf37147b rdd020c0 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 23 17:14:46201713 // Update Count : 1 5812 // Last Modified On : Fri Mar 3 20:56:53 2017 13 // Update Count : 167 14 14 // 15 15 … … 76 76 DeclarationNode::Length length = DeclarationNode::NoLength; 77 77 DeclarationNode::BuiltinType builtintype = DeclarationNode::NoBuiltinType; 78 typedef std::bitset< DeclarationNode::No Qualifier >Qualifiers;79 Qualifiers qualifiers;78 typedef std::bitset< DeclarationNode::NoTypeQualifier > TypeQualifiers; 79 TypeQualifiers typeQualifiers; 80 80 DeclarationNode * forall; 81 81 … … 113 113 TupleType * buildTuple( const TypeData * ); 114 114 TypeofType * buildTypeof( const TypeData * ); 115 Declaration * buildDecl( const TypeData *, const std::string &, DeclarationNode::StorageClass, Expression *, bool isInline, bool isNoreturn, LinkageSpec::Spec, ConstantExpr *asmName, Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() );115 Declaration * buildDecl( const TypeData *, const std::string &, DeclarationNode::StorageClass, Expression *, DeclarationNode::FuncSpec funcSpec, LinkageSpec::Spec, ConstantExpr *asmName, Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() ); 116 116 FunctionType * buildFunction( const TypeData * ); 117 117 void buildKRFunction( const TypeData::Function_t & function ); -
src/Parser/parser.cc
rf37147b rdd020c0 892 892 240, 299, 115, -1, 242, -1, 237, 242, -1, 241, 893 893 237, 242, -1, 243, -1, 242, 243, -1, 5, -1, 894 7, -1, 4, -1, 6, -1, 8, -1, 9, -1,895 72, -1, 74, -1, 16, -1, 21, -1, 20, -1,894 7, -1, 4, -1, 6, -1, 74, -1, 8, -1, 895 9, -1, 72, -1, 16, -1, 21, -1, 20, -1, 896 896 18, -1, 19, -1, 17, -1, 22, -1, 23, -1, 897 897 15, -1, 27, -1, 28, -1, 29, -1, 26, -1, … … 1092 1092 1391, 1396, 1397, 1401, 1403, 1405, 1407, 1409, 1412, 1411, 1093 1093 1423, 1424, 1426, 1436, 1437, 1442, 1444, 1446, 1448, 1450, 1094 1453, 1455, 145 8, 1463, 1465, 1467, 1469, 1471, 1473, 1475,1095 147 7, 1479, 1481, 1483, 1485, 1487, 1489, 1491, 1497, 1498,1096 1 500, 1502, 1504, 1509, 1510, 1516, 1517, 1519, 1521, 1526,1097 152 8, 1530, 1532, 1537, 1538, 1540, 1542, 1547, 1548, 1550,1098 155 5, 1556, 1558, 1560, 1565, 1566, 1568, 1573, 1574, 1576,1099 157 8, 1583, 1585, 1587, 1592, 1593, 1597, 1598, 1602, 1605,1100 160 4, 1608, 1610, 1614, 1619, 1624, 1626, 1632, 1633, 1638,1101 163 9, 1644, 1647, 1655, 1656, 1658, 1660, 1665, 1666, 1672,1102 167 3, 1675, 1678, 1681, 1686, 1687, 1692, 1697, 1700, 1699,1103 170 3, 1707, 1715, 1717, 1723, 1724, 1732, 1733, 1737, 1738,1104 173 9, 1741, 1743, 1750, 1751, 1753, 1755, 1760, 1761, 1767,1105 176 8, 1772, 1773, 1778, 1779, 1780, 1782, 1790, 1791, 1793,1106 179 6, 1798, 1802, 1803, 1804, 1806, 1808, 1813, 1818, 1826,1107 182 8, 1837, 1839, 1844, 1845, 1846, 1850, 1851, 1852, 1856,1108 185 7, 1858, 1862, 1863, 1864, 1869, 1870, 1875, 1876, 1878,1109 188 3, 1884, 1889, 1890, 1891, 1892, 1893, 1908, 1909, 1914,1110 191 5, 1921, 1923, 1926, 1928, 1930, 1953, 1954, 1956, 1958,1111 196 3, 1964, 1966, 1971, 1976, 1977, 1983, 1982, 1986, 1990,1112 199 2, 1994, 1996, 2002, 2003, 2008, 2013, 2015, 2020, 2022,1113 202 3, 2025, 2030, 2032, 2034, 2039, 2041, 2046, 2051, 2059,1114 206 5, 2064, 2078, 2079, 2084, 2085, 2089, 2094, 2099, 2107,1115 211 2, 2123, 2124, 2129, 2130, 2136, 2137, 2141, 2142, 2143,1116 214 8, 2147, 2158, 2166, 2172, 2178, 2187, 2193, 2199, 2205,1117 221 1, 2219, 2225, 2233, 2239, 2248, 2249, 2250, 2254, 2260,1118 226 1, 2271, 2272, 2276, 2277, 2282, 2287, 2288, 2294, 2295,1119 229 7, 2302, 2303, 2304, 2305, 2340, 2342, 2343, 2345, 2350,1120 235 5, 2360, 2362, 2364, 2369, 2371, 2373, 2375, 2380, 2382,1121 239 1, 2393, 2394, 2399, 2401, 2403, 2408, 2410, 2412, 2417,1122 241 9, 2421, 2433, 2434, 2435, 2439, 2441, 2443, 2448, 2450,1123 245 2, 2457, 2459, 2461, 2476, 2478, 2479, 2481, 2486, 2487,1124 249 2, 2494, 2496, 2501, 2503, 2505, 2507, 2512, 2514, 2516,1125 252 6, 2528, 2529, 2531, 2536, 2538, 2540, 2545, 2547, 2549,1126 255 1, 2556, 2558, 2560, 2573, 2575, 2576, 2578, 2583, 2588,1127 259 6, 2598, 2600, 2605, 2607, 2612, 2614, 2631, 2632, 2634,1128 263 9, 2641, 2643, 2645, 2647, 2652, 2653, 2655, 2657, 2662,1129 266 4, 2666, 2672, 2674, 2676, 2680, 2682, 2684, 2686, 2720,1130 272 1, 2723, 2728, 2730, 2732, 2734, 2736, 2741, 2742, 2744,1131 274 6, 2751, 2753, 2755, 2761, 2762, 2764, 2773, 2776, 2778,1132 278 1, 2783, 2785, 2799, 2800, 2802, 2807, 2809, 2811, 2813,1133 281 5, 2820, 2821, 2823, 2825, 2830, 2832, 2840, 2841, 2842,1134 284 7, 2848, 2853, 2855, 2857, 2859, 2861, 2863, 2870, 2872,1135 287 4, 2876, 2878, 2881, 2883, 2885, 2887, 2889, 2894, 2896,1136 289 8, 2903, 2929, 2930, 2932, 2936, 2937, 2941, 2943, 2945,1137 294 7, 2949, 2951, 2958, 2960, 2962, 2964, 2966, 2968, 2973,1138 29 80, 2982, 3000, 3002, 3007, 30081094 1453, 1455, 1457, 1462, 1464, 1466, 1468, 1470, 1472, 1474, 1095 1476, 1478, 1480, 1482, 1484, 1486, 1488, 1490, 1496, 1497, 1096 1499, 1501, 1503, 1508, 1509, 1515, 1516, 1518, 1520, 1525, 1097 1527, 1529, 1531, 1536, 1537, 1539, 1541, 1546, 1547, 1549, 1098 1554, 1555, 1557, 1559, 1564, 1565, 1567, 1572, 1573, 1575, 1099 1577, 1582, 1584, 1586, 1591, 1592, 1596, 1597, 1601, 1604, 1100 1603, 1607, 1609, 1613, 1618, 1623, 1625, 1631, 1632, 1637, 1101 1638, 1643, 1646, 1654, 1655, 1657, 1659, 1664, 1665, 1671, 1102 1672, 1674, 1677, 1680, 1685, 1686, 1691, 1696, 1699, 1698, 1103 1702, 1706, 1714, 1716, 1722, 1723, 1731, 1732, 1736, 1737, 1104 1738, 1740, 1742, 1749, 1750, 1752, 1754, 1759, 1760, 1766, 1105 1767, 1771, 1772, 1777, 1778, 1779, 1781, 1789, 1790, 1792, 1106 1795, 1797, 1801, 1802, 1803, 1805, 1807, 1812, 1817, 1825, 1107 1827, 1836, 1838, 1843, 1844, 1845, 1849, 1850, 1851, 1855, 1108 1856, 1857, 1861, 1862, 1863, 1868, 1869, 1874, 1875, 1877, 1109 1882, 1883, 1888, 1889, 1890, 1891, 1892, 1907, 1908, 1913, 1110 1914, 1920, 1922, 1925, 1927, 1929, 1952, 1953, 1955, 1957, 1111 1962, 1963, 1965, 1970, 1975, 1976, 1982, 1981, 1985, 1989, 1112 1991, 1993, 1995, 2001, 2002, 2007, 2012, 2014, 2019, 2021, 1113 2022, 2024, 2029, 2031, 2033, 2038, 2040, 2045, 2050, 2058, 1114 2064, 2063, 2077, 2078, 2083, 2084, 2088, 2093, 2098, 2106, 1115 2111, 2122, 2123, 2128, 2129, 2135, 2136, 2140, 2141, 2142, 1116 2147, 2146, 2157, 2165, 2171, 2177, 2186, 2192, 2198, 2204, 1117 2210, 2218, 2224, 2232, 2238, 2247, 2248, 2249, 2253, 2259, 1118 2260, 2270, 2271, 2275, 2276, 2281, 2286, 2287, 2293, 2294, 1119 2296, 2301, 2302, 2303, 2304, 2339, 2341, 2342, 2344, 2349, 1120 2354, 2359, 2361, 2363, 2368, 2370, 2372, 2374, 2379, 2381, 1121 2390, 2392, 2393, 2398, 2400, 2402, 2407, 2409, 2411, 2416, 1122 2418, 2420, 2432, 2433, 2434, 2438, 2440, 2442, 2447, 2449, 1123 2451, 2456, 2458, 2460, 2475, 2477, 2478, 2480, 2485, 2486, 1124 2491, 2493, 2495, 2500, 2502, 2504, 2506, 2511, 2513, 2515, 1125 2525, 2527, 2528, 2530, 2535, 2537, 2539, 2544, 2546, 2548, 1126 2550, 2555, 2557, 2559, 2572, 2574, 2575, 2577, 2582, 2587, 1127 2595, 2597, 2599, 2604, 2606, 2611, 2613, 2630, 2631, 2633, 1128 2638, 2640, 2642, 2644, 2646, 2651, 2652, 2654, 2656, 2661, 1129 2663, 2665, 2671, 2673, 2675, 2679, 2681, 2683, 2685, 2719, 1130 2720, 2722, 2727, 2729, 2731, 2733, 2735, 2740, 2741, 2743, 1131 2745, 2750, 2752, 2754, 2760, 2761, 2763, 2772, 2775, 2777, 1132 2780, 2782, 2784, 2798, 2799, 2801, 2806, 2808, 2810, 2812, 1133 2814, 2819, 2820, 2822, 2824, 2829, 2831, 2839, 2840, 2841, 1134 2846, 2847, 2852, 2854, 2856, 2858, 2860, 2862, 2869, 2871, 1135 2873, 2875, 2877, 2880, 2882, 2884, 2886, 2888, 2893, 2895, 1136 2897, 2902, 2928, 2929, 2931, 2935, 2936, 2940, 2942, 2944, 1137 2946, 2948, 2950, 2957, 2959, 2961, 2963, 2965, 2967, 2972, 1138 2979, 2981, 2999, 3001, 3006, 3007 1139 1139 }; 1140 1140 #endif … … 1451 1451 static const yytype_uint16 yydefact[] = 1452 1452 { 1453 307, 307, 327, 325, 328, 326, 3 29, 330, 313, 315,1453 307, 307, 327, 325, 328, 326, 330, 331, 313, 315, 1454 1454 314, 0, 316, 341, 333, 338, 336, 337, 335, 334, 1455 1455 339, 340, 346, 347, 345, 342, 343, 344, 571, 395, 1456 396, 0, 0, 0, 307, 0, 317, 33 1, 332, 9,1456 396, 0, 0, 0, 307, 0, 317, 332, 329, 9, 1457 1457 381, 0, 10, 16, 17, 0, 2, 72, 73, 589, 1458 1458 11, 307, 547, 253, 3, 477, 3, 266, 0, 3, … … 6909 6909 /* Line 1806 of yacc.c */ 6910 6910 #line 1402 "parser.yy" 6911 { (yyval.decl) = DeclarationNode::new Qualifier( DeclarationNode::Const ); }6911 { (yyval.decl) = DeclarationNode::newTypeQualifier( DeclarationNode::Const ); } 6912 6912 break; 6913 6913 … … 6916 6916 /* Line 1806 of yacc.c */ 6917 6917 #line 1404 "parser.yy" 6918 { (yyval.decl) = DeclarationNode::new Qualifier( DeclarationNode::Restrict ); }6918 { (yyval.decl) = DeclarationNode::newTypeQualifier( DeclarationNode::Restrict ); } 6919 6919 break; 6920 6920 … … 6923 6923 /* Line 1806 of yacc.c */ 6924 6924 #line 1406 "parser.yy" 6925 { (yyval.decl) = DeclarationNode::new Qualifier( DeclarationNode::Volatile ); }6925 { (yyval.decl) = DeclarationNode::newTypeQualifier( DeclarationNode::Volatile ); } 6926 6926 break; 6927 6927 … … 6930 6930 /* Line 1806 of yacc.c */ 6931 6931 #line 1408 "parser.yy" 6932 { (yyval.decl) = DeclarationNode::new Qualifier( DeclarationNode::Lvalue ); }6932 { (yyval.decl) = DeclarationNode::newTypeQualifier( DeclarationNode::Lvalue ); } 6933 6933 break; 6934 6934 … … 6937 6937 /* Line 1806 of yacc.c */ 6938 6938 #line 1410 "parser.yy" 6939 { (yyval.decl) = DeclarationNode::new Qualifier( DeclarationNode::Atomic ); }6939 { (yyval.decl) = DeclarationNode::newTypeQualifier( DeclarationNode::Atomic ); } 6940 6940 break; 6941 6941 … … 7011 7011 7012 7012 /* Line 1806 of yacc.c */ 7013 #line 145 2"parser.yy"7014 { (yyval.decl) = new DeclarationNode; (yyval.decl)->isInline = true; }7013 #line 1451 "parser.yy" 7014 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); } 7015 7015 break; 7016 7016 … … 7019 7019 /* Line 1806 of yacc.c */ 7020 7020 #line 1454 "parser.yy" 7021 { (yyval.decl) = DeclarationNode::new StorageClass( DeclarationNode::Fortran); }7021 { (yyval.decl) = DeclarationNode::newFuncSpecifier( DeclarationNode::Inline ); } 7022 7022 break; 7023 7023 … … 7025 7025 7026 7026 /* Line 1806 of yacc.c */ 7027 #line 145 7"parser.yy"7028 { (yyval.decl) = new DeclarationNode; (yyval.decl)->isNoreturn = true; }7027 #line 1456 "parser.yy" 7028 { (yyval.decl) = DeclarationNode::newFuncSpecifier( DeclarationNode::Fortran ); } 7029 7029 break; 7030 7030 … … 7032 7032 7033 7033 /* Line 1806 of yacc.c */ 7034 #line 145 9"parser.yy"7035 { (yyval.decl) = DeclarationNode::new StorageClass( DeclarationNode::Threadlocal); }7034 #line 1458 "parser.yy" 7035 { (yyval.decl) = DeclarationNode::newFuncSpecifier( DeclarationNode::Noreturn ); } 7036 7036 break; 7037 7037 … … 7039 7039 7040 7040 /* Line 1806 of yacc.c */ 7041 #line 146 4"parser.yy"7041 #line 1463 "parser.yy" 7042 7042 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Char ); } 7043 7043 break; … … 7046 7046 7047 7047 /* Line 1806 of yacc.c */ 7048 #line 146 6"parser.yy"7048 #line 1465 "parser.yy" 7049 7049 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Double ); } 7050 7050 break; … … 7053 7053 7054 7054 /* Line 1806 of yacc.c */ 7055 #line 146 8"parser.yy"7055 #line 1467 "parser.yy" 7056 7056 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Float ); } 7057 7057 break; … … 7060 7060 7061 7061 /* Line 1806 of yacc.c */ 7062 #line 14 70"parser.yy"7062 #line 1469 "parser.yy" 7063 7063 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Int ); } 7064 7064 break; … … 7067 7067 7068 7068 /* Line 1806 of yacc.c */ 7069 #line 147 2"parser.yy"7069 #line 1471 "parser.yy" 7070 7070 { (yyval.decl) = DeclarationNode::newLength( DeclarationNode::Long ); } 7071 7071 break; … … 7074 7074 7075 7075 /* Line 1806 of yacc.c */ 7076 #line 147 4"parser.yy"7076 #line 1473 "parser.yy" 7077 7077 { (yyval.decl) = DeclarationNode::newLength( DeclarationNode::Short ); } 7078 7078 break; … … 7081 7081 7082 7082 /* Line 1806 of yacc.c */ 7083 #line 147 6"parser.yy"7083 #line 1475 "parser.yy" 7084 7084 { (yyval.decl) = DeclarationNode::newSignedNess( DeclarationNode::Signed ); } 7085 7085 break; … … 7088 7088 7089 7089 /* Line 1806 of yacc.c */ 7090 #line 147 8"parser.yy"7090 #line 1477 "parser.yy" 7091 7091 { (yyval.decl) = DeclarationNode::newSignedNess( DeclarationNode::Unsigned ); } 7092 7092 break; … … 7095 7095 7096 7096 /* Line 1806 of yacc.c */ 7097 #line 14 80"parser.yy"7097 #line 1479 "parser.yy" 7098 7098 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Void ); } 7099 7099 break; … … 7102 7102 7103 7103 /* Line 1806 of yacc.c */ 7104 #line 148 2"parser.yy"7104 #line 1481 "parser.yy" 7105 7105 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Bool ); } 7106 7106 break; … … 7109 7109 7110 7110 /* Line 1806 of yacc.c */ 7111 #line 148 4"parser.yy"7111 #line 1483 "parser.yy" 7112 7112 { (yyval.decl) = DeclarationNode::newComplexType( DeclarationNode::Complex ); } 7113 7113 break; … … 7116 7116 7117 7117 /* Line 1806 of yacc.c */ 7118 #line 148 6"parser.yy"7118 #line 1485 "parser.yy" 7119 7119 { (yyval.decl) = DeclarationNode::newComplexType( DeclarationNode::Imaginary ); } 7120 7120 break; … … 7123 7123 7124 7124 /* Line 1806 of yacc.c */ 7125 #line 148 8"parser.yy"7125 #line 1487 "parser.yy" 7126 7126 { (yyval.decl) = DeclarationNode::newBuiltinType( DeclarationNode::Valist ); } 7127 7127 break; … … 7130 7130 7131 7131 /* Line 1806 of yacc.c */ 7132 #line 14 90"parser.yy"7132 #line 1489 "parser.yy" 7133 7133 { (yyval.decl) = DeclarationNode::newBuiltinType( DeclarationNode::Zero ); } 7134 7134 break; … … 7137 7137 7138 7138 /* Line 1806 of yacc.c */ 7139 #line 149 2"parser.yy"7139 #line 1491 "parser.yy" 7140 7140 { (yyval.decl) = DeclarationNode::newBuiltinType( DeclarationNode::One ); } 7141 7141 break; … … 7144 7144 7145 7145 /* Line 1806 of yacc.c */ 7146 #line 149 9"parser.yy"7146 #line 1498 "parser.yy" 7147 7147 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7148 7148 break; … … 7151 7151 7152 7152 /* Line 1806 of yacc.c */ 7153 #line 150 1"parser.yy"7153 #line 1500 "parser.yy" 7154 7154 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7155 7155 break; … … 7158 7158 7159 7159 /* Line 1806 of yacc.c */ 7160 #line 150 3"parser.yy"7160 #line 1502 "parser.yy" 7161 7161 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 7162 7162 break; … … 7165 7165 7166 7166 /* Line 1806 of yacc.c */ 7167 #line 150 5"parser.yy"7167 #line 1504 "parser.yy" 7168 7168 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addType( (yyvsp[(1) - (3)].decl) ); } 7169 7169 break; … … 7172 7172 7173 7173 /* Line 1806 of yacc.c */ 7174 #line 151 1"parser.yy"7174 #line 1510 "parser.yy" 7175 7175 { (yyval.decl) = (yyvsp[(2) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 7176 7176 break; … … 7179 7179 7180 7180 /* Line 1806 of yacc.c */ 7181 #line 151 8"parser.yy"7181 #line 1517 "parser.yy" 7182 7182 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7183 7183 break; … … 7186 7186 7187 7187 /* Line 1806 of yacc.c */ 7188 #line 15 20"parser.yy"7188 #line 1519 "parser.yy" 7189 7189 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7190 7190 break; … … 7193 7193 7194 7194 /* Line 1806 of yacc.c */ 7195 #line 152 2"parser.yy"7195 #line 1521 "parser.yy" 7196 7196 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addType( (yyvsp[(2) - (2)].decl) ); } 7197 7197 break; … … 7200 7200 7201 7201 /* Line 1806 of yacc.c */ 7202 #line 152 7"parser.yy"7202 #line 1526 "parser.yy" 7203 7203 { (yyval.decl) = (yyvsp[(3) - (4)].decl); } 7204 7204 break; … … 7207 7207 7208 7208 /* Line 1806 of yacc.c */ 7209 #line 152 9"parser.yy"7209 #line 1528 "parser.yy" 7210 7210 { (yyval.decl) = DeclarationNode::newTypeof( (yyvsp[(3) - (4)].en) ); } 7211 7211 break; … … 7214 7214 7215 7215 /* Line 1806 of yacc.c */ 7216 #line 153 1"parser.yy"7216 #line 1530 "parser.yy" 7217 7217 { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].decl) ); } 7218 7218 break; … … 7221 7221 7222 7222 /* Line 1806 of yacc.c */ 7223 #line 153 3"parser.yy"7223 #line 1532 "parser.yy" 7224 7224 { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); } 7225 7225 break; … … 7228 7228 7229 7229 /* Line 1806 of yacc.c */ 7230 #line 153 9"parser.yy"7230 #line 1538 "parser.yy" 7231 7231 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7232 7232 break; … … 7235 7235 7236 7236 /* Line 1806 of yacc.c */ 7237 #line 154 1"parser.yy"7237 #line 1540 "parser.yy" 7238 7238 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7239 7239 break; … … 7242 7242 7243 7243 /* Line 1806 of yacc.c */ 7244 #line 154 3"parser.yy"7244 #line 1542 "parser.yy" 7245 7245 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 7246 7246 break; … … 7249 7249 7250 7250 /* Line 1806 of yacc.c */ 7251 #line 154 9"parser.yy"7251 #line 1548 "parser.yy" 7252 7252 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7253 7253 break; … … 7256 7256 7257 7257 /* Line 1806 of yacc.c */ 7258 #line 155 1"parser.yy"7258 #line 1550 "parser.yy" 7259 7259 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7260 7260 break; … … 7263 7263 7264 7264 /* Line 1806 of yacc.c */ 7265 #line 155 7"parser.yy"7265 #line 1556 "parser.yy" 7266 7266 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7267 7267 break; … … 7270 7270 7271 7271 /* Line 1806 of yacc.c */ 7272 #line 155 9"parser.yy"7272 #line 1558 "parser.yy" 7273 7273 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7274 7274 break; … … 7277 7277 7278 7278 /* Line 1806 of yacc.c */ 7279 #line 156 1"parser.yy"7279 #line 1560 "parser.yy" 7280 7280 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 7281 7281 break; … … 7284 7284 7285 7285 /* Line 1806 of yacc.c */ 7286 #line 156 7"parser.yy"7286 #line 1566 "parser.yy" 7287 7287 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7288 7288 break; … … 7291 7291 7292 7292 /* Line 1806 of yacc.c */ 7293 #line 156 9"parser.yy"7293 #line 1568 "parser.yy" 7294 7294 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7295 7295 break; … … 7298 7298 7299 7299 /* Line 1806 of yacc.c */ 7300 #line 157 5"parser.yy"7300 #line 1574 "parser.yy" 7301 7301 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7302 7302 break; … … 7305 7305 7306 7306 /* Line 1806 of yacc.c */ 7307 #line 157 7"parser.yy"7307 #line 1576 "parser.yy" 7308 7308 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7309 7309 break; … … 7312 7312 7313 7313 /* Line 1806 of yacc.c */ 7314 #line 157 9"parser.yy"7314 #line 1578 "parser.yy" 7315 7315 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 7316 7316 break; … … 7319 7319 7320 7320 /* Line 1806 of yacc.c */ 7321 #line 158 4"parser.yy"7321 #line 1583 "parser.yy" 7322 7322 { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(1) - (1)].tok) ); } 7323 7323 break; … … 7326 7326 7327 7327 /* Line 1806 of yacc.c */ 7328 #line 158 6"parser.yy"7328 #line 1585 "parser.yy" 7329 7329 { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(2) - (2)].tok) )->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7330 7330 break; … … 7333 7333 7334 7334 /* Line 1806 of yacc.c */ 7335 #line 158 8"parser.yy"7335 #line 1587 "parser.yy" 7336 7336 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7337 7337 break; … … 7340 7340 7341 7341 /* Line 1806 of yacc.c */ 7342 #line 160 3"parser.yy"7342 #line 1602 "parser.yy" 7343 7343 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (5)].aggKey), nullptr, nullptr, (yyvsp[(4) - (5)].decl), true )->addQualifiers( (yyvsp[(2) - (5)].decl) ); } 7344 7344 break; … … 7347 7347 7348 7348 /* Line 1806 of yacc.c */ 7349 #line 160 5"parser.yy"7349 #line 1604 "parser.yy" 7350 7350 { typedefTable.makeTypedef( *(yyvsp[(3) - (3)].tok) ); } 7351 7351 break; … … 7354 7354 7355 7355 /* Line 1806 of yacc.c */ 7356 #line 160 7"parser.yy"7356 #line 1606 "parser.yy" 7357 7357 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), (yyvsp[(3) - (7)].tok), nullptr, (yyvsp[(6) - (7)].decl), true )->addQualifiers( (yyvsp[(2) - (7)].decl) ); } 7358 7358 break; … … 7361 7361 7362 7362 /* Line 1806 of yacc.c */ 7363 #line 160 9"parser.yy"7363 #line 1608 "parser.yy" 7364 7364 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (8)].aggKey), nullptr, (yyvsp[(4) - (8)].en), (yyvsp[(7) - (8)].decl), false )->addQualifiers( (yyvsp[(2) - (8)].decl) ); } 7365 7365 break; … … 7368 7368 7369 7369 /* Line 1806 of yacc.c */ 7370 #line 161 5"parser.yy"7370 #line 1614 "parser.yy" 7371 7371 { 7372 7372 typedefTable.makeTypedef( *(yyvsp[(3) - (3)].tok) ); … … 7378 7378 7379 7379 /* Line 1806 of yacc.c */ 7380 #line 16 20"parser.yy"7380 #line 1619 "parser.yy" 7381 7381 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) ); } 7382 7382 break; … … 7385 7385 7386 7386 /* Line 1806 of yacc.c */ 7387 #line 162 5"parser.yy"7387 #line 1624 "parser.yy" 7388 7388 { (yyval.aggKey) = DeclarationNode::Struct; } 7389 7389 break; … … 7392 7392 7393 7393 /* Line 1806 of yacc.c */ 7394 #line 162 7"parser.yy"7394 #line 1626 "parser.yy" 7395 7395 { (yyval.aggKey) = DeclarationNode::Union; } 7396 7396 break; … … 7399 7399 7400 7400 /* Line 1806 of yacc.c */ 7401 #line 163 2"parser.yy"7401 #line 1631 "parser.yy" 7402 7402 { (yyval.decl) = nullptr; } 7403 7403 break; … … 7406 7406 7407 7407 /* Line 1806 of yacc.c */ 7408 #line 163 4"parser.yy"7408 #line 1633 "parser.yy" 7409 7409 { (yyval.decl) = (yyvsp[(1) - (2)].decl) ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); } 7410 7410 break; … … 7413 7413 7414 7414 /* Line 1806 of yacc.c */ 7415 #line 16 40"parser.yy"7415 #line 1639 "parser.yy" 7416 7416 { 7417 7417 distExt( (yyvsp[(2) - (3)].decl) ); // mark all fields in list … … 7423 7423 7424 7424 /* Line 1806 of yacc.c */ 7425 #line 164 5"parser.yy"7425 #line 1644 "parser.yy" 7426 7426 { 7427 7427 (yyval.decl) = distAttr( (yyvsp[(1) - (3)].decl), (yyvsp[(2) - (3)].decl) ); } … … 7431 7431 7432 7432 /* Line 1806 of yacc.c */ 7433 #line 164 8"parser.yy"7433 #line 1647 "parser.yy" 7434 7434 { 7435 7435 distExt( (yyvsp[(3) - (4)].decl) ); // mark all fields in list … … 7441 7441 7442 7442 /* Line 1806 of yacc.c */ 7443 #line 165 7"parser.yy"7443 #line 1656 "parser.yy" 7444 7444 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addName( (yyvsp[(2) - (2)].tok) ); } 7445 7445 break; … … 7448 7448 7449 7449 /* Line 1806 of yacc.c */ 7450 #line 165 9"parser.yy"7450 #line 1658 "parser.yy" 7451 7451 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(1) - (3)].decl)->cloneType( (yyvsp[(3) - (3)].tok) ) ); } 7452 7452 break; … … 7455 7455 7456 7456 /* Line 1806 of yacc.c */ 7457 #line 166 1"parser.yy"7457 #line 1660 "parser.yy" 7458 7458 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(1) - (2)].decl)->cloneType( 0 ) ); } 7459 7459 break; … … 7462 7462 7463 7463 /* Line 1806 of yacc.c */ 7464 #line 166 7"parser.yy"7464 #line 1666 "parser.yy" 7465 7465 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(4) - (4)].decl)->addQualifiers( (yyvsp[(3) - (4)].decl) ) ); } 7466 7466 break; … … 7469 7469 7470 7470 /* Line 1806 of yacc.c */ 7471 #line 167 2"parser.yy"7471 #line 1671 "parser.yy" 7472 7472 { (yyval.decl) = DeclarationNode::newName( 0 ); /* XXX */ } 7473 7473 break; … … 7476 7476 7477 7477 /* Line 1806 of yacc.c */ 7478 #line 167 4"parser.yy"7478 #line 1673 "parser.yy" 7479 7479 { (yyval.decl) = DeclarationNode::newBitfield( (yyvsp[(1) - (1)].en) ); } 7480 7480 break; … … 7483 7483 7484 7484 /* Line 1806 of yacc.c */ 7485 #line 167 7"parser.yy"7485 #line 1676 "parser.yy" 7486 7486 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); } 7487 7487 break; … … 7490 7490 7491 7491 /* Line 1806 of yacc.c */ 7492 #line 16 80"parser.yy"7492 #line 1679 "parser.yy" 7493 7493 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); } 7494 7494 break; … … 7497 7497 7498 7498 /* Line 1806 of yacc.c */ 7499 #line 168 6"parser.yy"7499 #line 1685 "parser.yy" 7500 7500 { (yyval.en) = nullptr; } 7501 7501 break; … … 7504 7504 7505 7505 /* Line 1806 of yacc.c */ 7506 #line 168 8"parser.yy"7506 #line 1687 "parser.yy" 7507 7507 { (yyval.en) = (yyvsp[(1) - (1)].en); } 7508 7508 break; … … 7511 7511 7512 7512 /* Line 1806 of yacc.c */ 7513 #line 169 3"parser.yy"7513 #line 1692 "parser.yy" 7514 7514 { (yyval.en) = (yyvsp[(2) - (2)].en); } 7515 7515 break; … … 7518 7518 7519 7519 /* Line 1806 of yacc.c */ 7520 #line 169 8"parser.yy"7520 #line 1697 "parser.yy" 7521 7521 { (yyval.decl) = DeclarationNode::newEnum( nullptr, (yyvsp[(4) - (6)].decl), true )->addQualifiers( (yyvsp[(2) - (6)].decl) ); } 7522 7522 break; … … 7525 7525 7526 7526 /* Line 1806 of yacc.c */ 7527 #line 1 700"parser.yy"7527 #line 1699 "parser.yy" 7528 7528 { typedefTable.makeTypedef( *(yyvsp[(3) - (3)].tok) ); } 7529 7529 break; … … 7532 7532 7533 7533 /* Line 1806 of yacc.c */ 7534 #line 170 2"parser.yy"7534 #line 1701 "parser.yy" 7535 7535 { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (8)].tok), (yyvsp[(6) - (8)].decl), true )->addQualifiers( (yyvsp[(2) - (8)].decl) ); } 7536 7536 break; … … 7539 7539 7540 7540 /* Line 1806 of yacc.c */ 7541 #line 170 8"parser.yy"7541 #line 1707 "parser.yy" 7542 7542 { 7543 7543 typedefTable.makeTypedef( *(yyvsp[(3) - (3)].tok) ); … … 7549 7549 7550 7550 /* Line 1806 of yacc.c */ 7551 #line 171 6"parser.yy"7551 #line 1715 "parser.yy" 7552 7552 { (yyval.decl) = DeclarationNode::newEnumConstant( (yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].en) ); } 7553 7553 break; … … 7556 7556 7557 7557 /* Line 1806 of yacc.c */ 7558 #line 171 8"parser.yy"7558 #line 1717 "parser.yy" 7559 7559 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( DeclarationNode::newEnumConstant( (yyvsp[(3) - (4)].tok), (yyvsp[(4) - (4)].en) ) ); } 7560 7560 break; … … 7563 7563 7564 7564 /* Line 1806 of yacc.c */ 7565 #line 172 3"parser.yy"7565 #line 1722 "parser.yy" 7566 7566 { (yyval.en) = nullptr; } 7567 7567 break; … … 7570 7570 7571 7571 /* Line 1806 of yacc.c */ 7572 #line 172 5"parser.yy"7572 #line 1724 "parser.yy" 7573 7573 { (yyval.en) = (yyvsp[(2) - (2)].en); } 7574 7574 break; … … 7577 7577 7578 7578 /* Line 1806 of yacc.c */ 7579 #line 173 2"parser.yy"7579 #line 1731 "parser.yy" 7580 7580 { (yyval.decl) = nullptr; } 7581 7581 break; … … 7584 7584 7585 7585 /* Line 1806 of yacc.c */ 7586 #line 17 40"parser.yy"7586 #line 1739 "parser.yy" 7587 7587 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7588 7588 break; … … 7591 7591 7592 7592 /* Line 1806 of yacc.c */ 7593 #line 174 2"parser.yy"7593 #line 1741 "parser.yy" 7594 7594 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7595 7595 break; … … 7598 7598 7599 7599 /* Line 1806 of yacc.c */ 7600 #line 174 4"parser.yy"7600 #line 1743 "parser.yy" 7601 7601 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7602 7602 break; … … 7605 7605 7606 7606 /* Line 1806 of yacc.c */ 7607 #line 175 2"parser.yy"7607 #line 1751 "parser.yy" 7608 7608 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7609 7609 break; … … 7612 7612 7613 7613 /* Line 1806 of yacc.c */ 7614 #line 175 4"parser.yy"7614 #line 1753 "parser.yy" 7615 7615 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7616 7616 break; … … 7619 7619 7620 7620 /* Line 1806 of yacc.c */ 7621 #line 175 6"parser.yy"7621 #line 1755 "parser.yy" 7622 7622 { (yyval.decl) = (yyvsp[(1) - (9)].decl)->appendList( (yyvsp[(5) - (9)].decl) )->appendList( (yyvsp[(9) - (9)].decl) ); } 7623 7623 break; … … 7626 7626 7627 7627 /* Line 1806 of yacc.c */ 7628 #line 176 2"parser.yy"7628 #line 1761 "parser.yy" 7629 7629 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7630 7630 break; … … 7633 7633 7634 7634 /* Line 1806 of yacc.c */ 7635 #line 176 7"parser.yy"7635 #line 1766 "parser.yy" 7636 7636 { (yyval.decl) = nullptr; } 7637 7637 break; … … 7640 7640 7641 7641 /* Line 1806 of yacc.c */ 7642 #line 177 4"parser.yy"7642 #line 1773 "parser.yy" 7643 7643 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7644 7644 break; … … 7647 7647 7648 7648 /* Line 1806 of yacc.c */ 7649 #line 178 1"parser.yy"7649 #line 1780 "parser.yy" 7650 7650 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7651 7651 break; … … 7654 7654 7655 7655 /* Line 1806 of yacc.c */ 7656 #line 178 3"parser.yy"7656 #line 1782 "parser.yy" 7657 7657 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7658 7658 break; … … 7661 7661 7662 7662 /* Line 1806 of yacc.c */ 7663 #line 179 2"parser.yy"7663 #line 1791 "parser.yy" 7664 7664 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); } 7665 7665 break; … … 7668 7668 7669 7669 /* Line 1806 of yacc.c */ 7670 #line 179 5"parser.yy"7670 #line 1794 "parser.yy" 7671 7671 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); } 7672 7672 break; … … 7675 7675 7676 7676 /* Line 1806 of yacc.c */ 7677 #line 179 7"parser.yy"7677 #line 1796 "parser.yy" 7678 7678 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addName( (yyvsp[(3) - (4)].tok) )->addQualifiers( (yyvsp[(1) - (4)].decl) ); } 7679 7679 break; … … 7682 7682 7683 7683 /* Line 1806 of yacc.c */ 7684 #line 180 7"parser.yy"7684 #line 1806 "parser.yy" 7685 7685 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7686 7686 break; … … 7689 7689 7690 7690 /* Line 1806 of yacc.c */ 7691 #line 181 4"parser.yy"7691 #line 1813 "parser.yy" 7692 7692 { 7693 7693 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7699 7699 7700 7700 /* Line 1806 of yacc.c */ 7701 #line 181 9"parser.yy"7701 #line 1818 "parser.yy" 7702 7702 { 7703 7703 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7709 7709 7710 7710 /* Line 1806 of yacc.c */ 7711 #line 182 7"parser.yy"7711 #line 1826 "parser.yy" 7712 7712 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addInitializer( (yyvsp[(2) - (2)].en) ? new InitializerNode( (yyvsp[(2) - (2)].en) ) : nullptr ); } 7713 7713 break; … … 7716 7716 7717 7717 /* Line 1806 of yacc.c */ 7718 #line 182 9"parser.yy"7718 #line 1828 "parser.yy" 7719 7719 { (yyval.decl) = (yyvsp[(2) - (3)].decl)->addType( (yyvsp[(1) - (3)].decl) )->addInitializer( (yyvsp[(3) - (3)].en) ? new InitializerNode( (yyvsp[(3) - (3)].en) ) : nullptr ); } 7720 7720 break; … … 7723 7723 7724 7724 /* Line 1806 of yacc.c */ 7725 #line 183 8"parser.yy"7725 #line 1837 "parser.yy" 7726 7726 { (yyval.decl) = DeclarationNode::newName( (yyvsp[(1) - (1)].tok) ); } 7727 7727 break; … … 7730 7730 7731 7731 /* Line 1806 of yacc.c */ 7732 #line 18 40"parser.yy"7732 #line 1839 "parser.yy" 7733 7733 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( DeclarationNode::newName( (yyvsp[(3) - (3)].tok) ) ); } 7734 7734 break; … … 7737 7737 7738 7738 /* Line 1806 of yacc.c */ 7739 #line 186 5"parser.yy"7739 #line 1864 "parser.yy" 7740 7740 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 7741 7741 break; … … 7744 7744 7745 7745 /* Line 1806 of yacc.c */ 7746 #line 187 5"parser.yy"7746 #line 1874 "parser.yy" 7747 7747 { (yyval.in) = nullptr; } 7748 7748 break; … … 7751 7751 7752 7752 /* Line 1806 of yacc.c */ 7753 #line 187 7"parser.yy"7753 #line 1876 "parser.yy" 7754 7754 { (yyval.in) = (yyvsp[(2) - (2)].in); } 7755 7755 break; … … 7758 7758 7759 7759 /* Line 1806 of yacc.c */ 7760 #line 187 9"parser.yy"7760 #line 1878 "parser.yy" 7761 7761 { (yyval.in) = (yyvsp[(2) - (2)].in)->set_maybeConstructed( false ); } 7762 7762 break; … … 7765 7765 7766 7766 /* Line 1806 of yacc.c */ 7767 #line 1882 "parser.yy" 7768 { (yyval.in) = new InitializerNode( (yyvsp[(1) - (1)].en) ); } 7769 break; 7770 7771 case 481: 7772 7773 /* Line 1806 of yacc.c */ 7767 7774 #line 1883 "parser.yy" 7768 { (yyval.in) = new InitializerNode( (yyvsp[(1) - (1)].en) ); }7769 break;7770 7771 case 481:7772 7773 /* Line 1806 of yacc.c */7774 #line 1884 "parser.yy"7775 7775 { (yyval.in) = new InitializerNode( (yyvsp[(2) - (4)].in), true ); } 7776 7776 break; … … 7779 7779 7780 7780 /* Line 1806 of yacc.c */ 7781 #line 188 9"parser.yy"7781 #line 1888 "parser.yy" 7782 7782 { (yyval.in) = nullptr; } 7783 7783 break; … … 7786 7786 7787 7787 /* Line 1806 of yacc.c */ 7788 #line 1890 "parser.yy" 7789 { (yyval.in) = (yyvsp[(2) - (2)].in)->set_designators( (yyvsp[(1) - (2)].en) ); } 7790 break; 7791 7792 case 485: 7793 7794 /* Line 1806 of yacc.c */ 7788 7795 #line 1891 "parser.yy" 7789 { (yyval.in) = (yyvsp[(2) - (2)].in)->set_designators( (yyvsp[(1) - (2)].en) ); }7790 break;7791 7792 case 485:7793 7794 /* Line 1806 of yacc.c */7795 #line 1892 "parser.yy"7796 7796 { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (3)].in)->set_last( (yyvsp[(3) - (3)].in) ) ); } 7797 7797 break; … … 7800 7800 7801 7801 /* Line 1806 of yacc.c */ 7802 #line 189 4"parser.yy"7802 #line 1893 "parser.yy" 7803 7803 { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (4)].in)->set_last( (yyvsp[(4) - (4)].in)->set_designators( (yyvsp[(3) - (4)].en) ) ) ); } 7804 7804 break; … … 7807 7807 7808 7808 /* Line 1806 of yacc.c */ 7809 #line 19 10"parser.yy"7809 #line 1909 "parser.yy" 7810 7810 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (2)].tok) ) ); } 7811 7811 break; … … 7814 7814 7815 7815 /* Line 1806 of yacc.c */ 7816 #line 191 6"parser.yy"7816 #line 1915 "parser.yy" 7817 7817 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (2)].en)->set_last( (yyvsp[(2) - (2)].en) ) ); } 7818 7818 break; … … 7821 7821 7822 7822 /* Line 1806 of yacc.c */ 7823 #line 192 2"parser.yy"7823 #line 1921 "parser.yy" 7824 7824 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(2) - (2)].tok) ) ); } 7825 7825 break; … … 7828 7828 7829 7829 /* Line 1806 of yacc.c */ 7830 #line 192 5"parser.yy"7830 #line 1924 "parser.yy" 7831 7831 { (yyval.en) = (yyvsp[(3) - (5)].en); } 7832 7832 break; … … 7835 7835 7836 7836 /* Line 1806 of yacc.c */ 7837 #line 192 7"parser.yy"7837 #line 1926 "parser.yy" 7838 7838 { (yyval.en) = (yyvsp[(3) - (5)].en); } 7839 7839 break; … … 7842 7842 7843 7843 /* Line 1806 of yacc.c */ 7844 #line 192 9"parser.yy"7844 #line 1928 "parser.yy" 7845 7845 { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].en) ) ); } 7846 7846 break; … … 7849 7849 7850 7850 /* Line 1806 of yacc.c */ 7851 #line 193 1"parser.yy"7851 #line 1930 "parser.yy" 7852 7852 { (yyval.en) = (yyvsp[(4) - (6)].en); } 7853 7853 break; … … 7856 7856 7857 7857 /* Line 1806 of yacc.c */ 7858 #line 195 5"parser.yy"7858 #line 1954 "parser.yy" 7859 7859 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7860 7860 break; … … 7863 7863 7864 7864 /* Line 1806 of yacc.c */ 7865 #line 195 7"parser.yy"7865 #line 1956 "parser.yy" 7866 7866 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7867 7867 break; … … 7870 7870 7871 7871 /* Line 1806 of yacc.c */ 7872 #line 195 9"parser.yy"7872 #line 1958 "parser.yy" 7873 7873 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 7874 7874 break; … … 7877 7877 7878 7878 /* Line 1806 of yacc.c */ 7879 #line 196 5"parser.yy"7879 #line 1964 "parser.yy" 7880 7880 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7881 7881 break; … … 7884 7884 7885 7885 /* Line 1806 of yacc.c */ 7886 #line 196 7"parser.yy"7886 #line 1966 "parser.yy" 7887 7887 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7888 7888 break; … … 7891 7891 7892 7892 /* Line 1806 of yacc.c */ 7893 #line 197 2"parser.yy"7893 #line 1971 "parser.yy" 7894 7894 { (yyval.decl) = DeclarationNode::newFromTypeGen( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); } 7895 7895 break; … … 7898 7898 7899 7899 /* Line 1806 of yacc.c */ 7900 #line 197 8"parser.yy"7900 #line 1977 "parser.yy" 7901 7901 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(3) - (4)].decl) ); } 7902 7902 break; … … 7905 7905 7906 7906 /* Line 1806 of yacc.c */ 7907 #line 198 3"parser.yy"7907 #line 1982 "parser.yy" 7908 7908 { typedefTable.addToEnclosingScope( *(yyvsp[(2) - (2)].tok), TypedefTable::TD ); } 7909 7909 break; … … 7912 7912 7913 7913 /* Line 1806 of yacc.c */ 7914 #line 198 5"parser.yy"7914 #line 1984 "parser.yy" 7915 7915 { (yyval.decl) = DeclarationNode::newTypeParam( (yyvsp[(1) - (4)].tclass), (yyvsp[(2) - (4)].tok) )->addAssertions( (yyvsp[(4) - (4)].decl) ); } 7916 7916 break; … … 7919 7919 7920 7920 /* Line 1806 of yacc.c */ 7921 #line 199 1"parser.yy"7921 #line 1990 "parser.yy" 7922 7922 { (yyval.tclass) = DeclarationNode::Otype; } 7923 7923 break; … … 7926 7926 7927 7927 /* Line 1806 of yacc.c */ 7928 #line 199 3"parser.yy"7928 #line 1992 "parser.yy" 7929 7929 { (yyval.tclass) = DeclarationNode::Dtype; } 7930 7930 break; … … 7933 7933 7934 7934 /* Line 1806 of yacc.c */ 7935 #line 199 5"parser.yy"7935 #line 1994 "parser.yy" 7936 7936 { (yyval.tclass) = DeclarationNode::Ftype; } 7937 7937 break; … … 7940 7940 7941 7941 /* Line 1806 of yacc.c */ 7942 #line 199 7"parser.yy"7942 #line 1996 "parser.yy" 7943 7943 { (yyval.tclass) = DeclarationNode::Ttype; } 7944 7944 break; … … 7947 7947 7948 7948 /* Line 1806 of yacc.c */ 7949 #line 200 2"parser.yy"7949 #line 2001 "parser.yy" 7950 7950 { (yyval.decl) = nullptr; } 7951 7951 break; … … 7954 7954 7955 7955 /* Line 1806 of yacc.c */ 7956 #line 200 4"parser.yy"7956 #line 2003 "parser.yy" 7957 7957 { (yyval.decl) = (yyvsp[(1) - (2)].decl) ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); } 7958 7958 break; … … 7961 7961 7962 7962 /* Line 1806 of yacc.c */ 7963 #line 200 9"parser.yy"7963 #line 2008 "parser.yy" 7964 7964 { 7965 7965 typedefTable.openTrait( *(yyvsp[(2) - (5)].tok) ); … … 7971 7971 7972 7972 /* Line 1806 of yacc.c */ 7973 #line 201 4"parser.yy"7973 #line 2013 "parser.yy" 7974 7974 { (yyval.decl) = (yyvsp[(4) - (5)].decl); } 7975 7975 break; … … 7978 7978 7979 7979 /* Line 1806 of yacc.c */ 7980 #line 201 6"parser.yy"7980 #line 2015 "parser.yy" 7981 7981 { (yyval.decl) = nullptr; } 7982 7982 break; … … 7985 7985 7986 7986 /* Line 1806 of yacc.c */ 7987 #line 202 1"parser.yy"7987 #line 2020 "parser.yy" 7988 7988 { (yyval.en) = new ExpressionNode( build_typevalue( (yyvsp[(1) - (1)].decl) ) ); } 7989 7989 break; … … 7992 7992 7993 7993 /* Line 1806 of yacc.c */ 7994 #line 202 4"parser.yy"7994 #line 2023 "parser.yy" 7995 7995 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( new ExpressionNode( build_typevalue( (yyvsp[(3) - (3)].decl) ) ) ) ); } 7996 7996 break; … … 7999 7999 8000 8000 /* Line 1806 of yacc.c */ 8001 #line 202 6"parser.yy"8001 #line 2025 "parser.yy" 8002 8002 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) )); } 8003 8003 break; … … 8006 8006 8007 8007 /* Line 1806 of yacc.c */ 8008 #line 203 1"parser.yy"8008 #line 2030 "parser.yy" 8009 8009 { (yyval.decl) = (yyvsp[(2) - (2)].decl); } 8010 8010 break; … … 8013 8013 8014 8014 /* Line 1806 of yacc.c */ 8015 #line 203 3"parser.yy"8015 #line 2032 "parser.yy" 8016 8016 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) ); } 8017 8017 break; … … 8020 8020 8021 8021 /* Line 1806 of yacc.c */ 8022 #line 203 5"parser.yy"8022 #line 2034 "parser.yy" 8023 8023 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl)->copyStorageClasses( (yyvsp[(1) - (3)].decl) ) ); } 8024 8024 break; … … 8027 8027 8028 8028 /* Line 1806 of yacc.c */ 8029 #line 20 40"parser.yy"8029 #line 2039 "parser.yy" 8030 8030 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addAssertions( (yyvsp[(2) - (2)].decl) ); } 8031 8031 break; … … 8034 8034 8035 8035 /* Line 1806 of yacc.c */ 8036 #line 204 2"parser.yy"8036 #line 2041 "parser.yy" 8037 8037 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addAssertions( (yyvsp[(2) - (4)].decl) )->addType( (yyvsp[(4) - (4)].decl) ); } 8038 8038 break; … … 8041 8041 8042 8042 /* Line 1806 of yacc.c */ 8043 #line 204 7"parser.yy"8043 #line 2046 "parser.yy" 8044 8044 { 8045 8045 typedefTable.addToEnclosingScope( *(yyvsp[(1) - (1)].tok), TypedefTable::TD ); … … 8051 8051 8052 8052 /* Line 1806 of yacc.c */ 8053 #line 205 2"parser.yy"8053 #line 2051 "parser.yy" 8054 8054 { 8055 8055 typedefTable.addToEnclosingScope( *(yyvsp[(1) - (6)].tok), TypedefTable::TG ); … … 8061 8061 8062 8062 /* Line 1806 of yacc.c */ 8063 #line 20 60"parser.yy"8063 #line 2059 "parser.yy" 8064 8064 { 8065 8065 typedefTable.addToEnclosingScope( *(yyvsp[(2) - (9)].tok), TypedefTable::ID ); … … 8071 8071 8072 8072 /* Line 1806 of yacc.c */ 8073 #line 206 5"parser.yy"8073 #line 2064 "parser.yy" 8074 8074 { 8075 8075 typedefTable.enterTrait( *(yyvsp[(2) - (8)].tok) ); … … 8081 8081 8082 8082 /* Line 1806 of yacc.c */ 8083 #line 20 70"parser.yy"8083 #line 2069 "parser.yy" 8084 8084 { 8085 8085 typedefTable.leaveTrait(); … … 8092 8092 8093 8093 /* Line 1806 of yacc.c */ 8094 #line 20 80"parser.yy"8094 #line 2079 "parser.yy" 8095 8095 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); } 8096 8096 break; … … 8099 8099 8100 8100 /* Line 1806 of yacc.c */ 8101 #line 20 90"parser.yy"8101 #line 2089 "parser.yy" 8102 8102 { 8103 8103 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 8109 8109 8110 8110 /* Line 1806 of yacc.c */ 8111 #line 209 5"parser.yy"8111 #line 2094 "parser.yy" 8112 8112 { 8113 8113 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 8119 8119 8120 8120 /* Line 1806 of yacc.c */ 8121 #line 2 100"parser.yy"8121 #line 2099 "parser.yy" 8122 8122 { 8123 8123 typedefTable.addToEnclosingScope2( *(yyvsp[(5) - (5)].tok), TypedefTable::ID ); … … 8129 8129 8130 8130 /* Line 1806 of yacc.c */ 8131 #line 210 8"parser.yy"8131 #line 2107 "parser.yy" 8132 8132 { 8133 8133 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 8139 8139 8140 8140 /* Line 1806 of yacc.c */ 8141 #line 211 3"parser.yy"8141 #line 2112 "parser.yy" 8142 8142 { 8143 8143 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 8149 8149 8150 8150 /* Line 1806 of yacc.c */ 8151 #line 212 3"parser.yy"8151 #line 2122 "parser.yy" 8152 8152 {} 8153 8153 break; … … 8156 8156 8157 8157 /* Line 1806 of yacc.c */ 8158 #line 212 5"parser.yy"8158 #line 2124 "parser.yy" 8159 8159 { parseTree = parseTree ? parseTree->appendList( (yyvsp[(1) - (1)].decl) ) : (yyvsp[(1) - (1)].decl); } 8160 8160 break; … … 8163 8163 8164 8164 /* Line 1806 of yacc.c */ 8165 #line 213 1"parser.yy"8165 #line 2130 "parser.yy" 8166 8166 { (yyval.decl) = (yyvsp[(1) - (3)].decl) ? (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ) : (yyvsp[(3) - (3)].decl); } 8167 8167 break; … … 8170 8170 8171 8171 /* Line 1806 of yacc.c */ 8172 #line 213 6"parser.yy"8172 #line 2135 "parser.yy" 8173 8173 { (yyval.decl) = nullptr; } 8174 8174 break; … … 8177 8177 8178 8178 /* Line 1806 of yacc.c */ 8179 #line 214 4"parser.yy"8179 #line 2143 "parser.yy" 8180 8180 { 8181 8181 (yyval.decl) = DeclarationNode::newAsmStmt( new StatementNode( build_asmstmt( false, (yyvsp[(3) - (5)].constant), 0 ) ) ); … … 8186 8186 8187 8187 /* Line 1806 of yacc.c */ 8188 #line 214 8"parser.yy"8188 #line 2147 "parser.yy" 8189 8189 { 8190 8190 linkageStack.push( linkage ); // handle nested extern "C"/"Cforall" … … 8196 8196 8197 8197 /* Line 1806 of yacc.c */ 8198 #line 215 3"parser.yy"8198 #line 2152 "parser.yy" 8199 8199 { 8200 8200 linkage = linkageStack.top(); … … 8207 8207 8208 8208 /* Line 1806 of yacc.c */ 8209 #line 215 9"parser.yy"8209 #line 2158 "parser.yy" 8210 8210 { 8211 8211 distExt( (yyvsp[(2) - (2)].decl) ); // mark all fields in list … … 8217 8217 8218 8218 /* Line 1806 of yacc.c */ 8219 #line 217 3"parser.yy"8219 #line 2172 "parser.yy" 8220 8220 { 8221 8221 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8228 8228 8229 8229 /* Line 1806 of yacc.c */ 8230 #line 217 9"parser.yy"8230 #line 2178 "parser.yy" 8231 8231 { 8232 8232 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8239 8239 8240 8240 /* Line 1806 of yacc.c */ 8241 #line 218 8"parser.yy"8241 #line 2187 "parser.yy" 8242 8242 { 8243 8243 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8250 8250 8251 8251 /* Line 1806 of yacc.c */ 8252 #line 219 4"parser.yy"8252 #line 2193 "parser.yy" 8253 8253 { 8254 8254 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8261 8261 8262 8262 /* Line 1806 of yacc.c */ 8263 #line 2 200"parser.yy"8263 #line 2199 "parser.yy" 8264 8264 { 8265 8265 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8272 8272 8273 8273 /* Line 1806 of yacc.c */ 8274 #line 220 6"parser.yy"8274 #line 2205 "parser.yy" 8275 8275 { 8276 8276 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8283 8283 8284 8284 /* Line 1806 of yacc.c */ 8285 #line 221 2"parser.yy"8285 #line 2211 "parser.yy" 8286 8286 { 8287 8287 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8294 8294 8295 8295 /* Line 1806 of yacc.c */ 8296 #line 22 20"parser.yy"8296 #line 2219 "parser.yy" 8297 8297 { 8298 8298 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8305 8305 8306 8306 /* Line 1806 of yacc.c */ 8307 #line 222 6"parser.yy"8307 #line 2225 "parser.yy" 8308 8308 { 8309 8309 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8316 8316 8317 8317 /* Line 1806 of yacc.c */ 8318 #line 223 4"parser.yy"8318 #line 2233 "parser.yy" 8319 8319 { 8320 8320 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8327 8327 8328 8328 /* Line 1806 of yacc.c */ 8329 #line 22 40"parser.yy"8329 #line 2239 "parser.yy" 8330 8330 { 8331 8331 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 8338 8338 8339 8339 /* Line 1806 of yacc.c */ 8340 #line 225 5"parser.yy"8340 #line 2254 "parser.yy" 8341 8341 { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 8342 8342 break; … … 8345 8345 8346 8346 /* Line 1806 of yacc.c */ 8347 #line 22 60"parser.yy"8347 #line 2259 "parser.yy" 8348 8348 { (yyval.decl) = nullptr; } 8349 8349 break; … … 8352 8352 8353 8353 /* Line 1806 of yacc.c */ 8354 #line 226 2"parser.yy"8354 #line 2261 "parser.yy" 8355 8355 { 8356 8356 DeclarationNode * name = new DeclarationNode(); … … 8363 8363 8364 8364 /* Line 1806 of yacc.c */ 8365 #line 227 1"parser.yy"8365 #line 2270 "parser.yy" 8366 8366 { (yyval.decl) = nullptr; } 8367 8367 break; … … 8370 8370 8371 8371 /* Line 1806 of yacc.c */ 8372 #line 227 8"parser.yy"8372 #line 2277 "parser.yy" 8373 8373 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 8374 8374 break; … … 8377 8377 8378 8378 /* Line 1806 of yacc.c */ 8379 #line 228 3"parser.yy"8379 #line 2282 "parser.yy" 8380 8380 { (yyval.decl) = (yyvsp[(4) - (6)].decl); } 8381 8381 break; … … 8384 8384 8385 8385 /* Line 1806 of yacc.c */ 8386 #line 228 9"parser.yy"8386 #line 2288 "parser.yy" 8387 8387 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) ); } 8388 8388 break; … … 8391 8391 8392 8392 /* Line 1806 of yacc.c */ 8393 #line 229 4"parser.yy"8393 #line 2293 "parser.yy" 8394 8394 { (yyval.decl) = nullptr; } 8395 8395 break; … … 8398 8398 8399 8399 /* Line 1806 of yacc.c */ 8400 #line 229 6"parser.yy"8400 #line 2295 "parser.yy" 8401 8401 { (yyval.decl) = DeclarationNode::newAttribute( (yyvsp[(1) - (1)].tok) ); } 8402 8402 break; … … 8405 8405 8406 8406 /* Line 1806 of yacc.c */ 8407 #line 229 8"parser.yy"8407 #line 2297 "parser.yy" 8408 8408 { (yyval.decl) = DeclarationNode::newAttribute( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); } 8409 8409 break; … … 8412 8412 8413 8413 /* Line 1806 of yacc.c */ 8414 #line 230 6"parser.yy"8414 #line 2305 "parser.yy" 8415 8415 { (yyval.tok) = Token{ new string( "__const__" ) }; } 8416 8416 break; … … 8419 8419 8420 8420 /* Line 1806 of yacc.c */ 8421 #line 234 1"parser.yy"8421 #line 2340 "parser.yy" 8422 8422 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8423 8423 break; … … 8426 8426 8427 8427 /* Line 1806 of yacc.c */ 8428 #line 234 4"parser.yy"8428 #line 2343 "parser.yy" 8429 8429 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8430 8430 break; … … 8433 8433 8434 8434 /* Line 1806 of yacc.c */ 8435 #line 234 6"parser.yy"8435 #line 2345 "parser.yy" 8436 8436 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8437 8437 break; … … 8440 8440 8441 8441 /* Line 1806 of yacc.c */ 8442 #line 235 1"parser.yy"8442 #line 2350 "parser.yy" 8443 8443 { 8444 8444 typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) ); … … 8450 8450 8451 8451 /* Line 1806 of yacc.c */ 8452 #line 235 6"parser.yy"8452 #line 2355 "parser.yy" 8453 8453 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8454 8454 break; … … 8457 8457 8458 8458 /* Line 1806 of yacc.c */ 8459 #line 236 1"parser.yy"8459 #line 2360 "parser.yy" 8460 8460 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8461 8461 break; … … 8464 8464 8465 8465 /* Line 1806 of yacc.c */ 8466 #line 236 3"parser.yy"8466 #line 2362 "parser.yy" 8467 8467 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8468 8468 break; … … 8471 8471 8472 8472 /* Line 1806 of yacc.c */ 8473 #line 236 5"parser.yy"8473 #line 2364 "parser.yy" 8474 8474 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addQualifiers( (yyvsp[(4) - (4)].decl) ); } 8475 8475 break; … … 8478 8478 8479 8479 /* Line 1806 of yacc.c */ 8480 #line 23 70"parser.yy"8480 #line 2369 "parser.yy" 8481 8481 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8482 8482 break; … … 8485 8485 8486 8486 /* Line 1806 of yacc.c */ 8487 #line 237 2"parser.yy"8487 #line 2371 "parser.yy" 8488 8488 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8489 8489 break; … … 8492 8492 8493 8493 /* Line 1806 of yacc.c */ 8494 #line 237 4"parser.yy"8494 #line 2373 "parser.yy" 8495 8495 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8496 8496 break; … … 8499 8499 8500 8500 /* Line 1806 of yacc.c */ 8501 #line 237 6"parser.yy"8501 #line 2375 "parser.yy" 8502 8502 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8503 8503 break; … … 8506 8506 8507 8507 /* Line 1806 of yacc.c */ 8508 #line 238 1"parser.yy"8508 #line 2380 "parser.yy" 8509 8509 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8510 8510 break; … … 8513 8513 8514 8514 /* Line 1806 of yacc.c */ 8515 #line 238 3"parser.yy"8515 #line 2382 "parser.yy" 8516 8516 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8517 8517 break; … … 8520 8520 8521 8521 /* Line 1806 of yacc.c */ 8522 #line 239 2"parser.yy"8522 #line 2391 "parser.yy" 8523 8523 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8524 8524 break; … … 8527 8527 8528 8528 /* Line 1806 of yacc.c */ 8529 #line 239 5"parser.yy"8529 #line 2394 "parser.yy" 8530 8530 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8531 8531 break; … … 8534 8534 8535 8535 /* Line 1806 of yacc.c */ 8536 #line 2 400"parser.yy"8536 #line 2399 "parser.yy" 8537 8537 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); } 8538 8538 break; … … 8541 8541 8542 8542 /* Line 1806 of yacc.c */ 8543 #line 240 2"parser.yy"8543 #line 2401 "parser.yy" 8544 8544 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8545 8545 break; … … 8548 8548 8549 8549 /* Line 1806 of yacc.c */ 8550 #line 240 4"parser.yy"8550 #line 2403 "parser.yy" 8551 8551 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8552 8552 break; … … 8555 8555 8556 8556 /* Line 1806 of yacc.c */ 8557 #line 240 9"parser.yy"8557 #line 2408 "parser.yy" 8558 8558 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8559 8559 break; … … 8562 8562 8563 8563 /* Line 1806 of yacc.c */ 8564 #line 241 1"parser.yy"8564 #line 2410 "parser.yy" 8565 8565 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8566 8566 break; … … 8569 8569 8570 8570 /* Line 1806 of yacc.c */ 8571 #line 241 3"parser.yy"8571 #line 2412 "parser.yy" 8572 8572 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8573 8573 break; … … 8576 8576 8577 8577 /* Line 1806 of yacc.c */ 8578 #line 241 8"parser.yy"8578 #line 2417 "parser.yy" 8579 8579 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8580 8580 break; … … 8583 8583 8584 8584 /* Line 1806 of yacc.c */ 8585 #line 24 20"parser.yy"8585 #line 2419 "parser.yy" 8586 8586 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8587 8587 break; … … 8590 8590 8591 8591 /* Line 1806 of yacc.c */ 8592 #line 242 2"parser.yy"8592 #line 2421 "parser.yy" 8593 8593 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8594 8594 break; … … 8597 8597 8598 8598 /* Line 1806 of yacc.c */ 8599 #line 24 40"parser.yy"8599 #line 2439 "parser.yy" 8600 8600 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addIdList( (yyvsp[(3) - (4)].decl) ); } 8601 8601 break; … … 8604 8604 8605 8605 /* Line 1806 of yacc.c */ 8606 #line 244 2"parser.yy"8606 #line 2441 "parser.yy" 8607 8607 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8608 8608 break; … … 8611 8611 8612 8612 /* Line 1806 of yacc.c */ 8613 #line 244 4"parser.yy"8613 #line 2443 "parser.yy" 8614 8614 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8615 8615 break; … … 8618 8618 8619 8619 /* Line 1806 of yacc.c */ 8620 #line 244 9"parser.yy"8620 #line 2448 "parser.yy" 8621 8621 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8622 8622 break; … … 8625 8625 8626 8626 /* Line 1806 of yacc.c */ 8627 #line 245 1"parser.yy"8627 #line 2450 "parser.yy" 8628 8628 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8629 8629 break; … … 8632 8632 8633 8633 /* Line 1806 of yacc.c */ 8634 #line 245 3"parser.yy"8634 #line 2452 "parser.yy" 8635 8635 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8636 8636 break; … … 8639 8639 8640 8640 /* Line 1806 of yacc.c */ 8641 #line 245 8"parser.yy"8641 #line 2457 "parser.yy" 8642 8642 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8643 8643 break; … … 8646 8646 8647 8647 /* Line 1806 of yacc.c */ 8648 #line 24 60"parser.yy"8648 #line 2459 "parser.yy" 8649 8649 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8650 8650 break; … … 8653 8653 8654 8654 /* Line 1806 of yacc.c */ 8655 #line 246 2"parser.yy"8655 #line 2461 "parser.yy" 8656 8656 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8657 8657 break; … … 8660 8660 8661 8661 /* Line 1806 of yacc.c */ 8662 #line 247 7"parser.yy"8662 #line 2476 "parser.yy" 8663 8663 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8664 8664 break; … … 8667 8667 8668 8668 /* Line 1806 of yacc.c */ 8669 #line 24 80"parser.yy"8669 #line 2479 "parser.yy" 8670 8670 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8671 8671 break; … … 8674 8674 8675 8675 /* Line 1806 of yacc.c */ 8676 #line 248 2"parser.yy"8676 #line 2481 "parser.yy" 8677 8677 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8678 8678 break; … … 8681 8681 8682 8682 /* Line 1806 of yacc.c */ 8683 #line 248 8"parser.yy"8683 #line 2487 "parser.yy" 8684 8684 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8685 8685 break; … … 8688 8688 8689 8689 /* Line 1806 of yacc.c */ 8690 #line 249 3"parser.yy"8690 #line 2492 "parser.yy" 8691 8691 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8692 8692 break; … … 8695 8695 8696 8696 /* Line 1806 of yacc.c */ 8697 #line 249 5"parser.yy"8697 #line 2494 "parser.yy" 8698 8698 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8699 8699 break; … … 8702 8702 8703 8703 /* Line 1806 of yacc.c */ 8704 #line 249 7"parser.yy"8704 #line 2496 "parser.yy" 8705 8705 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addQualifiers( (yyvsp[(4) - (4)].decl) ); } 8706 8706 break; … … 8709 8709 8710 8710 /* Line 1806 of yacc.c */ 8711 #line 250 2"parser.yy"8711 #line 2501 "parser.yy" 8712 8712 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8713 8713 break; … … 8716 8716 8717 8717 /* Line 1806 of yacc.c */ 8718 #line 250 4"parser.yy"8718 #line 2503 "parser.yy" 8719 8719 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8720 8720 break; … … 8723 8723 8724 8724 /* Line 1806 of yacc.c */ 8725 #line 250 6"parser.yy"8725 #line 2505 "parser.yy" 8726 8726 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8727 8727 break; … … 8730 8730 8731 8731 /* Line 1806 of yacc.c */ 8732 #line 250 8"parser.yy"8732 #line 2507 "parser.yy" 8733 8733 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8734 8734 break; … … 8737 8737 8738 8738 /* Line 1806 of yacc.c */ 8739 #line 251 3"parser.yy"8739 #line 2512 "parser.yy" 8740 8740 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); } 8741 8741 break; … … 8744 8744 8745 8745 /* Line 1806 of yacc.c */ 8746 #line 251 5"parser.yy"8746 #line 2514 "parser.yy" 8747 8747 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8748 8748 break; … … 8751 8751 8752 8752 /* Line 1806 of yacc.c */ 8753 #line 251 7"parser.yy"8753 #line 2516 "parser.yy" 8754 8754 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8755 8755 break; … … 8758 8758 8759 8759 /* Line 1806 of yacc.c */ 8760 #line 252 7"parser.yy"8760 #line 2526 "parser.yy" 8761 8761 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8762 8762 break; … … 8765 8765 8766 8766 /* Line 1806 of yacc.c */ 8767 #line 25 30"parser.yy"8767 #line 2529 "parser.yy" 8768 8768 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8769 8769 break; … … 8772 8772 8773 8773 /* Line 1806 of yacc.c */ 8774 #line 253 2"parser.yy"8774 #line 2531 "parser.yy" 8775 8775 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8776 8776 break; … … 8779 8779 8780 8780 /* Line 1806 of yacc.c */ 8781 #line 253 7"parser.yy"8781 #line 2536 "parser.yy" 8782 8782 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8783 8783 break; … … 8786 8786 8787 8787 /* Line 1806 of yacc.c */ 8788 #line 253 9"parser.yy"8788 #line 2538 "parser.yy" 8789 8789 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8790 8790 break; … … 8793 8793 8794 8794 /* Line 1806 of yacc.c */ 8795 #line 254 1"parser.yy"8795 #line 2540 "parser.yy" 8796 8796 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addQualifiers( (yyvsp[(4) - (4)].decl) ); } 8797 8797 break; … … 8800 8800 8801 8801 /* Line 1806 of yacc.c */ 8802 #line 254 6"parser.yy"8802 #line 2545 "parser.yy" 8803 8803 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8804 8804 break; … … 8807 8807 8808 8808 /* Line 1806 of yacc.c */ 8809 #line 254 8"parser.yy"8809 #line 2547 "parser.yy" 8810 8810 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8811 8811 break; … … 8814 8814 8815 8815 /* Line 1806 of yacc.c */ 8816 #line 25 50"parser.yy"8816 #line 2549 "parser.yy" 8817 8817 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8818 8818 break; … … 8821 8821 8822 8822 /* Line 1806 of yacc.c */ 8823 #line 255 2"parser.yy"8823 #line 2551 "parser.yy" 8824 8824 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8825 8825 break; … … 8828 8828 8829 8829 /* Line 1806 of yacc.c */ 8830 #line 255 7"parser.yy"8830 #line 2556 "parser.yy" 8831 8831 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); } 8832 8832 break; … … 8835 8835 8836 8836 /* Line 1806 of yacc.c */ 8837 #line 255 9"parser.yy"8837 #line 2558 "parser.yy" 8838 8838 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8839 8839 break; … … 8842 8842 8843 8843 /* Line 1806 of yacc.c */ 8844 #line 256 1"parser.yy"8844 #line 2560 "parser.yy" 8845 8845 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8846 8846 break; … … 8849 8849 8850 8850 /* Line 1806 of yacc.c */ 8851 #line 257 4"parser.yy"8851 #line 2573 "parser.yy" 8852 8852 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8853 8853 break; … … 8856 8856 8857 8857 /* Line 1806 of yacc.c */ 8858 #line 257 7"parser.yy"8858 #line 2576 "parser.yy" 8859 8859 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8860 8860 break; … … 8863 8863 8864 8864 /* Line 1806 of yacc.c */ 8865 #line 257 9"parser.yy"8865 #line 2578 "parser.yy" 8866 8866 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8867 8867 break; … … 8870 8870 8871 8871 /* Line 1806 of yacc.c */ 8872 #line 258 4"parser.yy"8872 #line 2583 "parser.yy" 8873 8873 { 8874 8874 typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) ); … … 8880 8880 8881 8881 /* Line 1806 of yacc.c */ 8882 #line 258 9"parser.yy"8882 #line 2588 "parser.yy" 8883 8883 { 8884 8884 typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) ); … … 8890 8890 8891 8891 /* Line 1806 of yacc.c */ 8892 #line 259 7"parser.yy"8892 #line 2596 "parser.yy" 8893 8893 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8894 8894 break; … … 8897 8897 8898 8898 /* Line 1806 of yacc.c */ 8899 #line 259 9"parser.yy"8899 #line 2598 "parser.yy" 8900 8900 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8901 8901 break; … … 8904 8904 8905 8905 /* Line 1806 of yacc.c */ 8906 #line 260 1"parser.yy"8906 #line 2600 "parser.yy" 8907 8907 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addQualifiers( (yyvsp[(4) - (4)].decl) ); } 8908 8908 break; … … 8911 8911 8912 8912 /* Line 1806 of yacc.c */ 8913 #line 260 6"parser.yy"8913 #line 2605 "parser.yy" 8914 8914 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8915 8915 break; … … 8918 8918 8919 8919 /* Line 1806 of yacc.c */ 8920 #line 260 8"parser.yy"8920 #line 2607 "parser.yy" 8921 8921 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8922 8922 break; … … 8925 8925 8926 8926 /* Line 1806 of yacc.c */ 8927 #line 261 3"parser.yy"8927 #line 2612 "parser.yy" 8928 8928 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); } 8929 8929 break; … … 8932 8932 8933 8933 /* Line 1806 of yacc.c */ 8934 #line 261 5"parser.yy"8934 #line 2614 "parser.yy" 8935 8935 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8936 8936 break; … … 8939 8939 8940 8940 /* Line 1806 of yacc.c */ 8941 #line 263 3"parser.yy"8941 #line 2632 "parser.yy" 8942 8942 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8943 8943 break; … … 8946 8946 8947 8947 /* Line 1806 of yacc.c */ 8948 #line 263 5"parser.yy"8948 #line 2634 "parser.yy" 8949 8949 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8950 8950 break; … … 8953 8953 8954 8954 /* Line 1806 of yacc.c */ 8955 #line 26 40"parser.yy"8955 #line 2639 "parser.yy" 8956 8956 { (yyval.decl) = DeclarationNode::newPointer( 0 ); } 8957 8957 break; … … 8960 8960 8961 8961 /* Line 1806 of yacc.c */ 8962 #line 264 2"parser.yy"8962 #line 2641 "parser.yy" 8963 8963 { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); } 8964 8964 break; … … 8967 8967 8968 8968 /* Line 1806 of yacc.c */ 8969 #line 264 4"parser.yy"8969 #line 2643 "parser.yy" 8970 8970 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8971 8971 break; … … 8974 8974 8975 8975 /* Line 1806 of yacc.c */ 8976 #line 264 6"parser.yy"8976 #line 2645 "parser.yy" 8977 8977 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8978 8978 break; … … 8981 8981 8982 8982 /* Line 1806 of yacc.c */ 8983 #line 264 8"parser.yy"8983 #line 2647 "parser.yy" 8984 8984 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addQualifiers( (yyvsp[(4) - (4)].decl) ); } 8985 8985 break; … … 8988 8988 8989 8989 /* Line 1806 of yacc.c */ 8990 #line 265 4"parser.yy"8990 #line 2653 "parser.yy" 8991 8991 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8992 8992 break; … … 8995 8995 8996 8996 /* Line 1806 of yacc.c */ 8997 #line 265 6"parser.yy"8997 #line 2655 "parser.yy" 8998 8998 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8999 8999 break; … … 9002 9002 9003 9003 /* Line 1806 of yacc.c */ 9004 #line 265 8"parser.yy"9004 #line 2657 "parser.yy" 9005 9005 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 9006 9006 break; … … 9009 9009 9010 9010 /* Line 1806 of yacc.c */ 9011 #line 266 3"parser.yy"9011 #line 2662 "parser.yy" 9012 9012 { (yyval.decl) = DeclarationNode::newFunction( nullptr, nullptr, (yyvsp[(3) - (5)].decl), nullptr ); } 9013 9013 break; … … 9016 9016 9017 9017 /* Line 1806 of yacc.c */ 9018 #line 266 5"parser.yy"9018 #line 2664 "parser.yy" 9019 9019 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 9020 9020 break; … … 9023 9023 9024 9024 /* Line 1806 of yacc.c */ 9025 #line 266 7"parser.yy"9025 #line 2666 "parser.yy" 9026 9026 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 9027 9027 break; … … 9030 9030 9031 9031 /* Line 1806 of yacc.c */ 9032 #line 267 3"parser.yy"9032 #line 2672 "parser.yy" 9033 9033 { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); } 9034 9034 break; … … 9037 9037 9038 9038 /* Line 1806 of yacc.c */ 9039 #line 267 5"parser.yy"9039 #line 2674 "parser.yy" 9040 9040 { (yyval.decl) = DeclarationNode::newArray( 0, 0, false )->addArray( (yyvsp[(3) - (3)].decl) ); } 9041 9041 break; … … 9044 9044 9045 9045 /* Line 1806 of yacc.c */ 9046 #line 268 1"parser.yy"9046 #line 2680 "parser.yy" 9047 9047 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(3) - (5)].en), 0, false ); } 9048 9048 break; … … 9051 9051 9052 9052 /* Line 1806 of yacc.c */ 9053 #line 268 3"parser.yy"9053 #line 2682 "parser.yy" 9054 9054 { (yyval.decl) = DeclarationNode::newVarArray( 0 ); } 9055 9055 break; … … 9058 9058 9059 9059 /* Line 1806 of yacc.c */ 9060 #line 268 5"parser.yy"9060 #line 2684 "parser.yy" 9061 9061 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addArray( DeclarationNode::newArray( (yyvsp[(4) - (6)].en), 0, false ) ); } 9062 9062 break; … … 9065 9065 9066 9066 /* Line 1806 of yacc.c */ 9067 #line 268 7"parser.yy"9067 #line 2686 "parser.yy" 9068 9068 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addArray( DeclarationNode::newVarArray( 0 ) ); } 9069 9069 break; … … 9072 9072 9073 9073 /* Line 1806 of yacc.c */ 9074 #line 272 2"parser.yy"9074 #line 2721 "parser.yy" 9075 9075 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 9076 9076 break; … … 9079 9079 9080 9080 /* Line 1806 of yacc.c */ 9081 #line 272 4"parser.yy"9081 #line 2723 "parser.yy" 9082 9082 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 9083 9083 break; … … 9086 9086 9087 9087 /* Line 1806 of yacc.c */ 9088 #line 272 9"parser.yy"9088 #line 2728 "parser.yy" 9089 9089 { (yyval.decl) = DeclarationNode::newPointer( nullptr ); } 9090 9090 break; … … 9093 9093 9094 9094 /* Line 1806 of yacc.c */ 9095 #line 273 1"parser.yy"9095 #line 2730 "parser.yy" 9096 9096 { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); } 9097 9097 break; … … 9100 9100 9101 9101 /* Line 1806 of yacc.c */ 9102 #line 273 3"parser.yy"9102 #line 2732 "parser.yy" 9103 9103 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( nullptr ) ); } 9104 9104 break; … … 9107 9107 9108 9108 /* Line 1806 of yacc.c */ 9109 #line 273 5"parser.yy"9109 #line 2734 "parser.yy" 9110 9110 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 9111 9111 break; … … 9114 9114 9115 9115 /* Line 1806 of yacc.c */ 9116 #line 273 7"parser.yy"9116 #line 2736 "parser.yy" 9117 9117 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addQualifiers( (yyvsp[(4) - (4)].decl) ); } 9118 9118 break; … … 9121 9121 9122 9122 /* Line 1806 of yacc.c */ 9123 #line 274 3"parser.yy"9123 #line 2742 "parser.yy" 9124 9124 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 9125 9125 break; … … 9128 9128 9129 9129 /* Line 1806 of yacc.c */ 9130 #line 274 5"parser.yy"9130 #line 2744 "parser.yy" 9131 9131 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 9132 9132 break; … … 9135 9135 9136 9136 /* Line 1806 of yacc.c */ 9137 #line 274 7"parser.yy"9137 #line 2746 "parser.yy" 9138 9138 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 9139 9139 break; … … 9142 9142 9143 9143 /* Line 1806 of yacc.c */ 9144 #line 275 2"parser.yy"9144 #line 2751 "parser.yy" 9145 9145 { (yyval.decl) = DeclarationNode::newFunction( nullptr, nullptr, (yyvsp[(3) - (5)].decl), nullptr ); } 9146 9146 break; … … 9149 9149 9150 9150 /* Line 1806 of yacc.c */ 9151 #line 275 4"parser.yy"9151 #line 2753 "parser.yy" 9152 9152 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 9153 9153 break; … … 9156 9156 9157 9157 /* Line 1806 of yacc.c */ 9158 #line 275 6"parser.yy"9158 #line 2755 "parser.yy" 9159 9159 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 9160 9160 break; … … 9163 9163 9164 9164 /* Line 1806 of yacc.c */ 9165 #line 276 3"parser.yy"9165 #line 2762 "parser.yy" 9166 9166 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 9167 9167 break; … … 9170 9170 9171 9171 /* Line 1806 of yacc.c */ 9172 #line 277 4"parser.yy"9172 #line 2773 "parser.yy" 9173 9173 { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); } 9174 9174 break; … … 9177 9177 9178 9178 /* Line 1806 of yacc.c */ 9179 #line 277 7"parser.yy"9179 #line 2776 "parser.yy" 9180 9180 { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[(3) - (6)].decl) ); } 9181 9181 break; … … 9184 9184 9185 9185 /* Line 1806 of yacc.c */ 9186 #line 277 9"parser.yy"9186 #line 2778 "parser.yy" 9187 9187 { (yyval.decl) = DeclarationNode::newArray( 0, (yyvsp[(3) - (5)].decl), false ); } 9188 9188 break; … … 9191 9191 9192 9192 /* Line 1806 of yacc.c */ 9193 #line 278 2"parser.yy"9193 #line 2781 "parser.yy" 9194 9194 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), false ); } 9195 9195 break; … … 9198 9198 9199 9199 /* Line 1806 of yacc.c */ 9200 #line 278 4"parser.yy"9200 #line 2783 "parser.yy" 9201 9201 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(4) - (7)].decl), true ); } 9202 9202 break; … … 9205 9205 9206 9206 /* Line 1806 of yacc.c */ 9207 #line 278 6"parser.yy"9207 #line 2785 "parser.yy" 9208 9208 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(3) - (7)].decl), true ); } 9209 9209 break; … … 9212 9212 9213 9213 /* Line 1806 of yacc.c */ 9214 #line 280 1"parser.yy"9214 #line 2800 "parser.yy" 9215 9215 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 9216 9216 break; … … 9219 9219 9220 9220 /* Line 1806 of yacc.c */ 9221 #line 280 3"parser.yy"9221 #line 2802 "parser.yy" 9222 9222 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 9223 9223 break; … … 9226 9226 9227 9227 /* Line 1806 of yacc.c */ 9228 #line 280 8"parser.yy"9228 #line 2807 "parser.yy" 9229 9229 { (yyval.decl) = DeclarationNode::newPointer( 0 ); } 9230 9230 break; … … 9233 9233 9234 9234 /* Line 1806 of yacc.c */ 9235 #line 28 10"parser.yy"9235 #line 2809 "parser.yy" 9236 9236 { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); } 9237 9237 break; … … 9240 9240 9241 9241 /* Line 1806 of yacc.c */ 9242 #line 281 2"parser.yy"9242 #line 2811 "parser.yy" 9243 9243 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 9244 9244 break; … … 9247 9247 9248 9248 /* Line 1806 of yacc.c */ 9249 #line 281 4"parser.yy"9249 #line 2813 "parser.yy" 9250 9250 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 9251 9251 break; … … 9254 9254 9255 9255 /* Line 1806 of yacc.c */ 9256 #line 281 6"parser.yy"9256 #line 2815 "parser.yy" 9257 9257 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addQualifiers( (yyvsp[(4) - (4)].decl) ); } 9258 9258 break; … … 9261 9261 9262 9262 /* Line 1806 of yacc.c */ 9263 #line 282 2"parser.yy"9263 #line 2821 "parser.yy" 9264 9264 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 9265 9265 break; … … 9268 9268 9269 9269 /* Line 1806 of yacc.c */ 9270 #line 282 4"parser.yy"9270 #line 2823 "parser.yy" 9271 9271 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 9272 9272 break; … … 9275 9275 9276 9276 /* Line 1806 of yacc.c */ 9277 #line 282 6"parser.yy"9277 #line 2825 "parser.yy" 9278 9278 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 9279 9279 break; … … 9282 9282 9283 9283 /* Line 1806 of yacc.c */ 9284 #line 283 1"parser.yy"9284 #line 2830 "parser.yy" 9285 9285 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 9286 9286 break; … … 9289 9289 9290 9290 /* Line 1806 of yacc.c */ 9291 #line 283 3"parser.yy"9291 #line 2832 "parser.yy" 9292 9292 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 9293 9293 break; … … 9296 9296 9297 9297 /* Line 1806 of yacc.c */ 9298 #line 284 3"parser.yy"9298 #line 2842 "parser.yy" 9299 9299 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 9300 9300 break; … … 9303 9303 9304 9304 /* Line 1806 of yacc.c */ 9305 #line 285 4"parser.yy"9305 #line 2853 "parser.yy" 9306 9306 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9307 9307 break; … … 9310 9310 9311 9311 /* Line 1806 of yacc.c */ 9312 #line 285 6"parser.yy"9312 #line 2855 "parser.yy" 9313 9313 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9314 9314 break; … … 9317 9317 9318 9318 /* Line 1806 of yacc.c */ 9319 #line 285 8"parser.yy"9319 #line 2857 "parser.yy" 9320 9320 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9321 9321 break; … … 9324 9324 9325 9325 /* Line 1806 of yacc.c */ 9326 #line 28 60"parser.yy"9326 #line 2859 "parser.yy" 9327 9327 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9328 9328 break; … … 9331 9331 9332 9332 /* Line 1806 of yacc.c */ 9333 #line 286 2"parser.yy"9333 #line 2861 "parser.yy" 9334 9334 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9335 9335 break; … … 9338 9338 9339 9339 /* Line 1806 of yacc.c */ 9340 #line 286 4"parser.yy"9340 #line 2863 "parser.yy" 9341 9341 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9342 9342 break; … … 9345 9345 9346 9346 /* Line 1806 of yacc.c */ 9347 #line 287 1"parser.yy"9347 #line 2870 "parser.yy" 9348 9348 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9349 9349 break; … … 9352 9352 9353 9353 /* Line 1806 of yacc.c */ 9354 #line 287 3"parser.yy"9354 #line 2872 "parser.yy" 9355 9355 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9356 9356 break; … … 9359 9359 9360 9360 /* Line 1806 of yacc.c */ 9361 #line 287 5"parser.yy"9361 #line 2874 "parser.yy" 9362 9362 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9363 9363 break; … … 9366 9366 9367 9367 /* Line 1806 of yacc.c */ 9368 #line 287 7"parser.yy"9368 #line 2876 "parser.yy" 9369 9369 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( (yyvsp[(2) - (3)].decl) )->addNewArray( (yyvsp[(1) - (3)].decl) ); } 9370 9370 break; … … 9373 9373 9374 9374 /* Line 1806 of yacc.c */ 9375 #line 287 9"parser.yy"9375 #line 2878 "parser.yy" 9376 9376 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9377 9377 break; … … 9380 9380 9381 9381 /* Line 1806 of yacc.c */ 9382 #line 288 2"parser.yy"9382 #line 2881 "parser.yy" 9383 9383 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9384 9384 break; … … 9387 9387 9388 9388 /* Line 1806 of yacc.c */ 9389 #line 288 4"parser.yy"9389 #line 2883 "parser.yy" 9390 9390 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9391 9391 break; … … 9394 9394 9395 9395 /* Line 1806 of yacc.c */ 9396 #line 288 6"parser.yy"9396 #line 2885 "parser.yy" 9397 9397 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9398 9398 break; … … 9401 9401 9402 9402 /* Line 1806 of yacc.c */ 9403 #line 288 8"parser.yy"9403 #line 2887 "parser.yy" 9404 9404 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( (yyvsp[(2) - (3)].decl) )->addNewArray( (yyvsp[(1) - (3)].decl) ); } 9405 9405 break; … … 9408 9408 9409 9409 /* Line 1806 of yacc.c */ 9410 #line 28 90"parser.yy"9410 #line 2889 "parser.yy" 9411 9411 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9412 9412 break; … … 9415 9415 9416 9416 /* Line 1806 of yacc.c */ 9417 #line 289 5"parser.yy"9417 #line 2894 "parser.yy" 9418 9418 { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[(3) - (6)].decl) ); } 9419 9419 break; … … 9422 9422 9423 9423 /* Line 1806 of yacc.c */ 9424 #line 289 7"parser.yy"9424 #line 2896 "parser.yy" 9425 9425 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), false ); } 9426 9426 break; … … 9429 9429 9430 9430 /* Line 1806 of yacc.c */ 9431 #line 290 2"parser.yy"9431 #line 2901 "parser.yy" 9432 9432 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), true ); } 9433 9433 break; … … 9436 9436 9437 9437 /* Line 1806 of yacc.c */ 9438 #line 290 4"parser.yy"9438 #line 2903 "parser.yy" 9439 9439 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(4) - (7)].decl)->addQualifiers( (yyvsp[(3) - (7)].decl) ), true ); } 9440 9440 break; … … 9443 9443 9444 9444 /* Line 1806 of yacc.c */ 9445 #line 293 1"parser.yy"9445 #line 2930 "parser.yy" 9446 9446 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 9447 9447 break; … … 9450 9450 9451 9451 /* Line 1806 of yacc.c */ 9452 #line 294 2"parser.yy"9452 #line 2941 "parser.yy" 9453 9453 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9454 9454 break; … … 9457 9457 9458 9458 /* Line 1806 of yacc.c */ 9459 #line 294 4"parser.yy"9459 #line 2943 "parser.yy" 9460 9460 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9461 9461 break; … … 9464 9464 9465 9465 /* Line 1806 of yacc.c */ 9466 #line 294 6"parser.yy"9466 #line 2945 "parser.yy" 9467 9467 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9468 9468 break; … … 9471 9471 9472 9472 /* Line 1806 of yacc.c */ 9473 #line 294 8"parser.yy"9473 #line 2947 "parser.yy" 9474 9474 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9475 9475 break; … … 9478 9478 9479 9479 /* Line 1806 of yacc.c */ 9480 #line 29 50"parser.yy"9480 #line 2949 "parser.yy" 9481 9481 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9482 9482 break; … … 9485 9485 9486 9486 /* Line 1806 of yacc.c */ 9487 #line 295 2"parser.yy"9487 #line 2951 "parser.yy" 9488 9488 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9489 9489 break; … … 9492 9492 9493 9493 /* Line 1806 of yacc.c */ 9494 #line 295 9"parser.yy"9494 #line 2958 "parser.yy" 9495 9495 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 9496 9496 break; … … 9499 9499 9500 9500 /* Line 1806 of yacc.c */ 9501 #line 296 1"parser.yy"9501 #line 2960 "parser.yy" 9502 9502 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 9503 9503 break; … … 9506 9506 9507 9507 /* Line 1806 of yacc.c */ 9508 #line 296 3"parser.yy"9508 #line 2962 "parser.yy" 9509 9509 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9510 9510 break; … … 9513 9513 9514 9514 /* Line 1806 of yacc.c */ 9515 #line 296 5"parser.yy"9515 #line 2964 "parser.yy" 9516 9516 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 9517 9517 break; … … 9520 9520 9521 9521 /* Line 1806 of yacc.c */ 9522 #line 296 7"parser.yy"9522 #line 2966 "parser.yy" 9523 9523 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 9524 9524 break; … … 9527 9527 9528 9528 /* Line 1806 of yacc.c */ 9529 #line 296 9"parser.yy"9529 #line 2968 "parser.yy" 9530 9530 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9531 9531 break; … … 9534 9534 9535 9535 /* Line 1806 of yacc.c */ 9536 #line 297 4"parser.yy"9536 #line 2973 "parser.yy" 9537 9537 { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (5)].decl) ); } 9538 9538 break; … … 9541 9541 9542 9542 /* Line 1806 of yacc.c */ 9543 #line 298 1"parser.yy"9543 #line 2980 "parser.yy" 9544 9544 { (yyval.decl) = DeclarationNode::newFunction( nullptr, (yyvsp[(1) - (6)].decl), (yyvsp[(4) - (6)].decl), nullptr ); } 9545 9545 break; … … 9548 9548 9549 9549 /* Line 1806 of yacc.c */ 9550 #line 298 3"parser.yy"9550 #line 2982 "parser.yy" 9551 9551 { (yyval.decl) = DeclarationNode::newFunction( nullptr, (yyvsp[(1) - (6)].decl), (yyvsp[(4) - (6)].decl), nullptr ); } 9552 9552 break; … … 9555 9555 9556 9556 /* Line 1806 of yacc.c */ 9557 #line 300 7"parser.yy"9557 #line 3006 "parser.yy" 9558 9558 { (yyval.en) = nullptr; } 9559 9559 break; … … 9562 9562 9563 9563 /* Line 1806 of yacc.c */ 9564 #line 300 9"parser.yy"9564 #line 3008 "parser.yy" 9565 9565 { (yyval.en) = (yyvsp[(2) - (2)].en); } 9566 9566 break; … … 9800 9800 9801 9801 /* Line 2067 of yacc.c */ 9802 #line 301 2"parser.yy"9802 #line 3011 "parser.yy" 9803 9803 9804 9804 // ----end of grammar---- -
src/Parser/parser.yy
rf37147b rdd020c0 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 28 09:58:10201713 // Update Count : 22 0812 // Last Modified On : Fri Mar 3 21:35:28 2017 13 // Update Count : 2222 14 14 // 15 15 … … 1400 1400 type_qualifier_name: 1401 1401 CONST 1402 { $$ = DeclarationNode::new Qualifier( DeclarationNode::Const ); }1402 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Const ); } 1403 1403 | RESTRICT 1404 { $$ = DeclarationNode::new Qualifier( DeclarationNode::Restrict ); }1404 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Restrict ); } 1405 1405 | VOLATILE 1406 { $$ = DeclarationNode::new Qualifier( DeclarationNode::Volatile ); }1406 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Volatile ); } 1407 1407 | LVALUE // CFA 1408 { $$ = DeclarationNode::new Qualifier( DeclarationNode::Lvalue ); }1408 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Lvalue ); } 1409 1409 | ATOMIC 1410 { $$ = DeclarationNode::new Qualifier( DeclarationNode::Atomic ); }1410 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Atomic ); } 1411 1411 | FORALL '(' 1412 1412 { … … 1448 1448 | REGISTER 1449 1449 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Register ); } 1450 | INLINE // C991451 //{ $$ = DeclarationNode::newStorageClass( DeclarationNode::Inline ); }1452 { $$ = new DeclarationNode; $$->isInline = true; }1453 | FORTRAN // C991454 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); }1455 | NORETURN // C111456 //{ $$ = DeclarationNode::newStorageClass( DeclarationNode::Noreturn ); }1457 { $$ = new DeclarationNode; $$->isNoreturn = true; }1458 1450 | THREADLOCAL // C11 1459 1451 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); } 1452 // Put function specifiers here to simplify parsing rules, but separate them semantically. 1453 | INLINE // C99 1454 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Inline ); } 1455 | FORTRAN // C99 1456 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Fortran ); } 1457 | NORETURN // C11 1458 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Noreturn ); } 1460 1459 ; 1461 1460 -
src/SymTab/Autogen.cc
rf37147b rdd020c0 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 15:02:50201713 // Update Count : 1312 // Last Modified On : Fri Mar 3 22:00:55 2017 13 // Update Count : 30 14 14 // 15 15 … … 163 163 DeclarationNode::StorageClass sc = functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static; 164 164 LinkageSpec::Spec spec = isIntrinsic ? LinkageSpec::Intrinsic : LinkageSpec::AutoGen; 165 FunctionDecl * decl = new FunctionDecl( fname, sc, spec, ftype, new CompoundStmt( noLabels ), true, false ); 165 FunctionDecl * decl = new FunctionDecl( fname, sc, spec, ftype, new CompoundStmt( noLabels ), 166 std::list< Attribute * >(), DeclarationNode::FuncSpecifier( DeclarationNode::InlineSpec ) ); 166 167 decl->fixUniqueId(); 167 168 return decl; … … 717 718 TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), DeclarationNode::NoStorageClass, nullptr, TypeDecl::Any ); 718 719 TypeInstType * inst = new TypeInstType( Type::Qualifiers(), newDecl->get_name(), newDecl ); 719 newDecl->get_assertions().push_back( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genAssignType( inst ), nullptr, true, false ) ); 720 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genDefaultType( inst ), nullptr, true, false ) ); 721 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genCopyType( inst ), nullptr, true, false ) ); 722 newDecl->get_assertions().push_back( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genDefaultType( inst ), nullptr, true, false ) ); 720 newDecl->get_assertions().push_back( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genAssignType( inst ), nullptr, 721 std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ) ); 722 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genDefaultType( inst ), nullptr, 723 std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ) ); 724 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genCopyType( inst ), nullptr, 725 std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ) ); 726 newDecl->get_assertions().push_back( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genDefaultType( inst ), nullptr, 727 std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ) ); 723 728 typeParams.push_back( newDecl ); 724 729 done.insert( ty->get_baseType() ); -
src/SymTab/Validate.cc
rf37147b rdd020c0 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 23 21:33:55201713 // Update Count : 3 1812 // Last Modified On : Fri Mar 3 21:02:23 2017 13 // Update Count : 332 14 14 // 15 15 … … 660 660 // Note, qualifiers on the typedef are superfluous for the forward declaration. 661 661 if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( tyDecl->get_base() ) ) { 662 return aggDecl->get_baseStruct() ? Mutator::mutate( aggDecl->get_baseStruct() ) :new StructDecl( aggDecl->get_name() );662 return new StructDecl( aggDecl->get_name() ); 663 663 } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( tyDecl->get_base() ) ) { 664 return aggDecl->get_baseUnion() ? Mutator::mutate( aggDecl->get_baseUnion() ) :new UnionDecl( aggDecl->get_name() );664 return new UnionDecl( aggDecl->get_name() ); 665 665 } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( tyDecl->get_base() ) ) { 666 666 return new EnumDecl( enumDecl->get_name() ); … … 691 691 DeclarationWithType *ret = Mutator::mutate( objDecl ); 692 692 typedefNames.endScope(); 693 // is the type a function? 694 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) { 693 694 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) { // function type? 695 695 // replace the current object declaration with a function declaration 696 FunctionDecl * newDecl = new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, ret->get_isInline(), ret->get_isNoreturn(), objDecl->get_attributes() );696 FunctionDecl * newDecl = new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, objDecl->get_attributes(), ret->get_funcSpec() ); 697 697 objDecl->get_attributes().clear(); 698 698 objDecl->set_type( nullptr ); 699 699 delete objDecl; 700 700 return newDecl; 701 } else if ( objDecl->get_isInline() || objDecl->get_isNoreturn() ) {702 throw SemanticError( "invalid inline or _Noreturn specification in declaration of ", objDecl );703 701 } // if 704 702 return ret; -
src/SynTree/Declaration.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 9 14:28:05201713 // Update Count : 1 612 // Last Modified On : Wed Mar 1 20:11:57 2017 13 // Update Count : 17 14 14 // 15 15 … … 28 28 29 29 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage ) 30 : name( name ), storageClass( sc ), linkage( linkage ), isInline( false ), isNoreturn( false ),uniqueId( 0 ) {30 : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) { 31 31 } 32 32 33 33 Declaration::Declaration( const Declaration &other ) 34 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), isInline( other.isInline ), isNoreturn( other.isNoreturn ),uniqueId( other.uniqueId ) {34 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) { 35 35 } 36 36 -
src/SynTree/Declaration.h
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 14:53:35201713 // Update Count : 5712 // Last Modified On : Fri Mar 3 20:59:27 2017 13 // Update Count : 96 14 14 // 15 15 … … 38 38 LinkageSpec::Spec get_linkage() const { return linkage; } 39 39 void set_linkage( LinkageSpec::Spec newValue ) { linkage = newValue; } 40 bool get_isInline() const { return isInline; }41 void set_isInline( bool newValue ) { isInline = newValue; }42 bool get_isNoreturn() const { return isNoreturn; }43 void set_isNoreturn( bool newValue ) { isNoreturn = newValue; }44 40 UniqueId get_uniqueId() const { return uniqueId; } 45 41 bool get_extension() const { return extension; } … … 59 55 DeclarationNode::StorageClass storageClass; 60 56 LinkageSpec::Spec linkage; 61 bool isInline, isNoreturn;62 57 UniqueId uniqueId; 63 58 bool extension = false; … … 66 61 class DeclarationWithType : public Declaration { 67 62 public: 68 DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes );63 DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpec fs = DeclarationNode::FuncSpec() ); 69 64 DeclarationWithType( const DeclarationWithType &other ); 70 65 virtual ~DeclarationWithType(); … … 83 78 std::list< Attribute * >& get_attributes() { return attributes; } 84 79 const std::list< Attribute * >& get_attributes() const { return attributes; } 80 81 DeclarationNode::FuncSpec get_funcSpec() const { return fs; } 82 void set_functionSpecifiers( DeclarationNode::FuncSpec newValue ) { fs = newValue; } 85 83 86 84 virtual DeclarationWithType *clone() const = 0; … … 97 95 ConstantExpr *asmName; 98 96 std::list< Attribute * > attributes; 97 DeclarationNode::FuncSpec fs; 99 98 }; 100 99 … … 102 101 typedef DeclarationWithType Parent; 103 102 public: 104 ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false ); 103 ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, 104 const std::list< Attribute * > attributes = std::list< Attribute * >(), DeclarationNode::FuncSpec fs = DeclarationNode::FuncSpec() ); 105 105 ObjectDecl( const ObjectDecl &other ); 106 106 virtual ~ObjectDecl(); … … 129 129 typedef DeclarationWithType Parent; 130 130 public: 131 FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() ); 131 FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, 132 const std::list< Attribute * > attributes = std::list< Attribute * >(), DeclarationNode::FuncSpec fs = DeclarationNode::FuncSpec() ); 132 133 FunctionDecl( const FunctionDecl &other ); 133 134 virtual ~FunctionDecl(); -
src/SynTree/DeclarationWithType.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 13 14:49:43 201613 // Update Count : 712 // Last Modified On : Fri Mar 3 20:59:28 2017 13 // Update Count : 19 14 14 // 15 15 … … 19 19 #include "Common/utility.h" 20 20 21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes )22 : Declaration( name, sc, linkage ), asmName( nullptr ), attributes( attributes ) {21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpec fs ) 22 : Declaration( name, sc, linkage ), asmName( nullptr ), attributes( attributes ), fs( fs ) { 23 23 } 24 24 25 25 DeclarationWithType::DeclarationWithType( const DeclarationWithType &other ) 26 : Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel) {26 : Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel ), fs( other.fs ) { 27 27 cloneAll( other.attributes, attributes ); 28 28 asmName = maybeClone( other.asmName ); -
src/SynTree/FunctionDecl.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 15:01:52201713 // Update Count : 2312 // Last Modified On : Fri Mar 3 21:29:41 2017 13 // Update Count : 55 14 14 // 15 15 … … 26 26 extern bool translation_unit_nomain; 27 27 28 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes ) 29 : Parent( name, sc, linkage, attributes ), type( type ), statements( statements ) { 30 set_isInline( isInline ); 31 set_isNoreturn( isNoreturn ); 32 // this is a brazen hack to force the function "main" to have Cforall linkage 33 // because we want to replace the main even if it is inside an extern 28 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, std::list< Attribute * > attributes, DeclarationNode::FuncSpec fs ) 29 : Parent( name, sc, linkage, attributes, fs ), type( type ), statements( statements ) { 30 set_functionSpecifiers( fs ); 31 32 // hack forcing the function "main" to have Cforall linkage to replace main even if it is inside an extern 34 33 if ( name == "main" ) { 35 34 set_linkage( CodeGen::FixMain::mainLinkage() ); … … 65 64 os << LinkageSpec::linkageName( get_linkage() ) << " "; 66 65 } // if 67 if ( get_isInline() ) {68 os << "inline ";69 } // if70 if ( get_isNoreturn() ) {71 os << "_Noreturn ";72 } // if73 66 74 67 printAll( get_attributes(), os, indent ); 75 68 76 69 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 77 os << DeclarationNode::storage Name[ get_storageClass() ] << ' ';70 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 78 71 } // if 72 DeclarationNode::print_FuncSpec( os, get_funcSpec() ); 73 79 74 if ( get_type() ) { 80 75 get_type()->print( os, indent ); … … 97 92 os << get_name() << ": "; 98 93 } // if 99 if ( get_isInline() ) {100 os << "inline ";101 } // if102 if ( get_isNoreturn() ) {103 os << "_Noreturn ";104 } // if105 94 106 95 // xxx - should printShort print attributes? 107 96 108 97 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 109 os << DeclarationNode::storage Name[ get_storageClass() ] << ' ';98 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 110 99 } // if 100 DeclarationNode::print_FuncSpec( os, get_funcSpec() ); 101 111 102 if ( get_type() ) { 112 103 get_type()->print( os, indent ); -
src/SynTree/NamedTypeDecl.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 13 08:13:55 201513 // Update Count : 312 // Last Modified On : Tue Feb 28 16:13:24 2017 13 // Update Count : 4 14 14 // 15 15 … … 40 40 } // if 41 41 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 42 os << DeclarationNode::storage Name[ get_storageClass() ] << ' ';42 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 43 43 } // if 44 44 os << typeString(); … … 64 64 } // if 65 65 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 66 os << DeclarationNode::storage Name[ get_storageClass() ] << ' ';66 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 67 67 } // if 68 68 os << typeString(); -
src/SynTree/ObjectDecl.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Oct 1 23:05:56 201613 // Update Count : 3212 // Last Modified On : Fri Mar 3 20:59:27 2017 13 // Update Count : 45 14 14 // 15 15 … … 22 22 #include "Statement.h" 23 23 24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn ) 25 : Parent( name, sc, linkage, attributes ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) { 26 set_isInline( isInline ); 27 set_isNoreturn( isNoreturn ); 24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, DeclarationNode::FuncSpec fs ) 25 : Parent( name, sc, linkage, attributes, fs ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) { 26 set_functionSpecifiers( fs ); 28 27 } 29 28 … … 50 49 51 50 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 52 os << DeclarationNode::storage Name[ get_storageClass() ] << ' ';51 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 53 52 } // if 54 53 … … 86 85 87 86 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 88 os << DeclarationNode::storage Name[ get_storageClass() ] << ' ';87 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 89 88 } // if 90 89 -
src/SynTree/Type.h
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 23 16:38:53201713 // Update Count : 3412 // Last Modified On : Wed Mar 1 09:11:45 2017 13 // Update Count : 41 14 14 // 15 15 … … 21 21 #include "SynTree.h" 22 22 #include "Visitor.h" 23 #include "Common/utility.h"24 23 25 24 class Type : public BaseSyntaxNode { … … 213 212 bool get_isVarArgs() const { return isVarArgs; } 214 213 void set_isVarArgs( bool newValue ) { isVarArgs = newValue; } 215 216 214 bool isTtype() const; 217 215
Note: See TracChangeset
for help on using the changeset viewer.