Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rc6b1105 r8e9cbb2  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun 27 17:47:56 2016
    13 // Update Count     : 1627
     12// Last Modified On : Thu Jun 30 21:15:54 2016
     13// Update Count     : 1657
    1414//
    1515
     
    303303constant:
    304304                // ENUMERATIONconstant is not included here; it is treated as a variable with type "enumeration constant".
    305         INTEGERconstant                                                         { $$ = new ConstantNode( ConstantNode::Integer, $1 ); }
    306         | FLOATINGconstant                                                      { $$ = new ConstantNode( ConstantNode::Float, $1 ); }
    307         | CHARACTERconstant                                                     { $$ = new ConstantNode( ConstantNode::Character, $1 ); }
     305INTEGERconstant                                                                 { $$ = makeConstant( ConstantNode::Integer, $1 ); }
     306        | FLOATINGconstant                                                      { $$ = makeConstant( ConstantNode::Float, $1 ); }
     307        | CHARACTERconstant                                                     { $$ = makeConstant( ConstantNode::Character, $1 ); }
    308308        ;
    309309
     
    330330
    331331string_literal_list:                                                                    // juxtaposed strings are concatenated
    332         STRINGliteral                                                           { $$ = new ConstantNode( ConstantNode::String, $1 ); }
     332        STRINGliteral                                                           { $$ = makeConstantStr( ConstantNode::String, $1 ); }
    333333        | string_literal_list STRINGliteral                     { $$ = $1->appendstr( $2 ); }
    334334        ;
     
    682682                { $$ = new StatementNode( $1 ); }
    683683        | EXTENSION declaration                                                         // GCC
    684                 { $$ = new StatementNode( $2 )/*->set_extension( true )*/; }
     684                {       // mark all fields in list
     685                        for ( DeclarationNode *iter = $2; iter != NULL; iter = (DeclarationNode *)iter->get_link() )
     686                                iter->set_extension( true );
     687                        $$ = new StatementNode( $2 );
     688                }
    685689        | function_definition
    686690                { $$ = new StatementNode( $1 ); }
     
    14721476        new_field_declaring_list ';'                                            // CFA, new style field declaration
    14731477        | EXTENSION new_field_declaring_list ';'                        // GCC
    1474                 { $$ = $2/*->set_extension( true )*/; }
     1478                { $$ = $2->set_extension( true ); }
    14751479        | field_declaring_list ';'
    14761480        | EXTENSION field_declaring_list ';'                            // GCC
    1477                 { $$ = $2/*->set_extension( true )*/; }
     1481                {       // mark all fields in list
     1482                        for ( DeclarationNode *iter = $2; iter != NULL; iter = (DeclarationNode *)iter->get_link() )
     1483                                iter->set_extension( true );
     1484                        $$ = $2;
     1485                }
    14781486        ;
    14791487
     
    19911999                }
    19922000        | EXTENSION external_definition
    1993                 { $$ = $2/*->set_extension( true )*/; }
     2001                {       // mark all fields in list
     2002                        for ( DeclarationNode *iter = $2; iter != NULL; iter = (DeclarationNode *)iter->get_link() )
     2003                                iter->set_extension( true );
     2004                        $$ = $2;
     2005                }
    19942006        ;
    19952007
Note: See TracChangeset for help on using the changeset viewer.