Ignore:
Timestamp:
Jun 30, 2016, 1:47:52 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
1bc1bb2
Parents:
84d4d6f
Message:

move implementation of ConstantNode? to ConstantExpr?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r84d4d6f rca35c51  
    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 13:26:01 2016
     13// Update Count     : 1639
    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        { $$ = (new StatementNode( $2 ))->set_extension( true ); }
    685685        | function_definition
    686686                { $$ = new StatementNode( $1 ); }
     
    14721472        new_field_declaring_list ';'                                            // CFA, new style field declaration
    14731473        | EXTENSION new_field_declaring_list ';'                        // GCC
    1474                 { $$ = $2/*->set_extension( true )*/; }
     1474                { $$ = $2->set_extension( true ); }
    14751475        | field_declaring_list ';'
    14761476        | EXTENSION field_declaring_list ';'                            // GCC
    1477                 { $$ = $2/*->set_extension( true )*/; }
     1477                { $$ = $2->set_extension( true ); }
    14781478        ;
    14791479
     
    19911991                }
    19921992        | EXTENSION external_definition
    1993                 { $$ = $2/*->set_extension( true )*/; }
     1993                { $$ = $2->set_extension( true ); }
    19941994        ;
    19951995
Note: See TracChangeset for help on using the changeset viewer.