Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r1dbc8590 r637dd9c  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri May 11 17:51:38 2018
    13 // Update Count     : 3261
     12// Last Modified On : Thu May  3 08:20:09 2018
     13// Update Count     : 3225
    1414//
    1515
     
    302302
    303303%type<decl> field_declaration field_declaration_list field_declarator field_declaring_list
    304 %type<en> field field_list field_name fraction_constants_opt
     304%type<en> field field_list field_name fraction_constants
    305305
    306306%type<decl> external_function_definition function_definition function_array function_declarator function_no_ptr function_ptr
     
    499499        | type_name '.' no_attr_identifier                                      // CFA, nested type
    500500                { SemanticError( yylloc, "Qualified names are currently unimplemented." ); $$ = nullptr; }
    501 //              { $$ = nullptr; }
    502501        | type_name '.' '[' push field_list pop ']'                     // CFA, nested type / tuple field selector
    503502                { SemanticError( yylloc, "Qualified names are currently unimplemented." ); $$ = nullptr; }
    504 //              { $$ = nullptr; }
    505503        | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11
    506504                { SemanticError( yylloc, "_Generic is currently unimplemented." ); $$ = nullptr; }
     
    535533        | postfix_expression '.' no_attr_identifier
    536534                { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); }
    537         | postfix_expression '.' INTEGERconstant                        // CFA, tuple index
    538                 { $$ = new ExpressionNode( build_fieldSel( $1, build_constantInteger( *$3 ) ) ); }
     535        | postfix_expression '.' '[' push field_list pop ']' // CFA, tuple field selector
     536                { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $5 ) ) ); }
    539537        | postfix_expression FLOATING_FRACTIONconstant          // CFA, tuple index
    540538                { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_FLOATING_FRACTIONconstant( *$2 ) ) ); }
    541         | postfix_expression '.' '[' push field_list pop ']' // CFA, tuple field selector
    542                 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $5 ) ) ); }
    543539        | postfix_expression ARROW no_attr_identifier
    544540                {
    545541                        $$ = new ExpressionNode( build_pfieldSel( $1, *$3 == "0" || *$3 == "1" ? build_constantInteger( *$3 ) : build_varref( $3 ) ) );
    546542                }
     543        | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector
     544                        { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); }
    547545        | postfix_expression ARROW INTEGERconstant                      // CFA, tuple index
    548546                { $$ = new ExpressionNode( build_pfieldSel( $1, build_constantInteger( *$3 ) ) ); }
    549         | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector
    550                 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); }
    551547        | postfix_expression ICR
    552548                { $$ = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, $1 ) ); }
     
    601597
    602598field_name:
    603         INTEGERconstant fraction_constants_opt
     599        INTEGERconstant fraction_constants
    604600                { $$ = new ExpressionNode( build_field_name_fraction_constants( build_constantInteger( *$1 ), $2 ) ); }
    605         | FLOATINGconstant fraction_constants_opt
     601        | FLOATINGconstant fraction_constants
    606602                { $$ = new ExpressionNode( build_field_name_fraction_constants( build_field_name_FLOATINGconstant( *$1 ), $2 ) ); }
    607         | no_attr_identifier fraction_constants_opt
     603        | no_attr_identifier fraction_constants
    608604                {
    609605                        $$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) );
     
    611607        ;
    612608
    613 fraction_constants_opt:
     609fraction_constants:
    614610        // empty
    615611                { $$ = nullptr; }
    616         | fraction_constants_opt FLOATING_FRACTIONconstant
     612        | fraction_constants FLOATING_FRACTIONconstant
    617613                {
    618614                        Expression * constant = build_field_name_FLOATING_FRACTIONconstant( *$2 );
     
    23942390external_definition_list:
    23952391        external_definition
    2396         | external_definition_list
    2397                 { forall = xxx; }
    2398           push external_definition
     2392        | external_definition_list { forall = xxx; } push external_definition
    23992393                { $$ = $1 ? $1->appendList( $4 ) : $4; }
    24002394        ;
     
    24362430                {
    24372431                        for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) {
    2438                                 if ( isMangled( iter->linkage ) ) {             // ignore extern "C"
    2439                                         iter->addQualifiers( $1->clone() );
    2440                                 } // if
     2432                                iter->addQualifiers( $1->clone() );
    24412433                        } // for
    24422434                        xxx = false;
     
    24512443                {
    24522444                        for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) {
    2453                                 if ( isMangled( iter->linkage ) ) {             // ignore extern "C"
    2454                                         iter->addQualifiers( $1->clone() );
    2455                                 } // if
     2445                                iter->addQualifiers( $1->clone() );
    24562446                        } // for
    24572447                        xxx = false;
     
    24672457                {
    24682458                        for ( DeclarationNode * iter = $6; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) {
    2469                                 if ( isMangled( iter->linkage ) && isMangled( $2->linkage ) ) { // ignore extern "C"
    2470                                         iter->addQualifiers( $1->clone() );
    2471                                         iter->addQualifiers( $2->clone() );
    2472                                 } // if
     2459                                iter->addQualifiers( $1->clone() );
     2460                                iter->addQualifiers( $2->clone() );
    24732461                        } // for
    24742462                        xxx = false;
Note: See TracChangeset for help on using the changeset viewer.