Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9997fee r9a705dc8  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Apr 28 09:37:03 2018
    13 // Update Count     : 3201
     12// Last Modified On : Tue Apr 17 17:10:30 2018
     13// Update Count     : 3144
    1414//
    1515
     
    133133} // build_postfix_name
    134134
    135 bool forall = false, xxx = false;                                               // aggregate have one or more forall qualifiers ?
     135bool forall = false;                                                                    // aggregate have one or more forall qualifiers ?
    136136
    137137// https://www.gnu.org/software/bison/manual/bison.html#Location-Type
     
    282282%type<decl> aggregate_type aggregate_type_nobody
    283283
    284 %type<decl> assertion assertion_list assertion_list_opt
     284%type<decl> assertion assertion_list_opt
    285285
    286286%type<en>   bit_subrange_size_opt bit_subrange_size
     
    18661866                {
    18671867                        typedefTable.makeTypedef( *$3 );
    1868                         if ( forall ) typedefTable.changeKind( *$3, TypedefTable::TG ); // possibly update
    1869                         forall = false;                                                         // reset
    18701868                        $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 );
    18711869                }
     
    22372235                { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); }
    22382236        | type_specifier identifier_parameter_declarator
    2239         | assertion_list
    2240                 { $$ = DeclarationNode::newTypeParam( DeclarationNode::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); }
    22412237        ;
    22422238
     
    22552251        // empty
    22562252                { $$ = nullptr; }
    2257         | assertion_list
    2258         ;
    2259 
    2260 assertion_list:                                                                                 // CFA
    2261         assertion
    2262         | assertion_list assertion
     2253        | assertion_list_opt assertion
    22632254                { $$ = $1 ? $1->appendList( $2 ) : $2; }
    22642255        ;
     
    23872378external_definition_list:
    23882379        external_definition
    2389         | external_definition_list { forall = xxx; } push external_definition
    2390                 { $$ = $1 ? $1->appendList( $4 ) : $4; }
     2380        | external_definition_list push external_definition
     2381                { $$ = $1 ? $1->appendList( $3 ) : $3; }
    23912382        ;
    23922383
     
    24202411                        $$ = $2;
    24212412                }
    2422         | type_qualifier_list
    2423                 {
    2424                         if ( $1->type->forall ) xxx = forall = true; // remember generic type
    2425                 }
    2426           push '{' external_definition_list '}'                         // CFA, namespace
    2427                 {
    2428                         for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) {
    2429                                 iter->addQualifiers( $1->clone() );
    2430                         } // for
    2431                         xxx = false;
    2432                         delete $1;
    2433                         $$ = $5;
    2434                 }
    2435         | declaration_qualifier_list
    2436                 {
    2437                         if ( $1->type->forall ) xxx = forall = true; // remember generic type
    2438                 }
    2439           push '{' external_definition_list '}'                         // CFA, namespace
    2440                 {
    2441                         for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) {
    2442                                 iter->addQualifiers( $1->clone() );
    2443                         } // for
    2444                         xxx = false;
    2445                         delete $1;
    2446                         $$ = $5;
    2447                 }
    2448         | declaration_qualifier_list type_qualifier_list
    2449                 {
    2450                         if ( $1->type->forall ) xxx = forall = true; // remember generic type
    2451                 }
    2452           push '{' external_definition_list '}'                         // CFA, namespace
    2453                 {
    2454                         for ( DeclarationNode * iter = $6; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) {
    2455                                 iter->addQualifiers( $1->clone() );
    2456                                 iter->addQualifiers( $2->clone() );
    2457                         } // for
    2458                         xxx = false;
    2459                         delete $1;
    2460                         delete $2;
    2461                         $$ = $6;
    2462                 }
     2413        | type_qualifier_list '{' external_definition_list '}'                  // CFA, namespace
    24632414        ;
    24642415
     
    24862437with_clause_opt:
    24872438        // empty
    2488                 { $$ = nullptr; forall = false; }
     2439                { $$ = nullptr; }
    24892440        | WITH '(' tuple_expression_list ')'
    2490                 { $$ = $3; forall = false; }
     2441                { $$ = $3; }
    24912442        ;
    24922443
Note: See TracChangeset for help on using the changeset viewer.