Ignore:
Timestamp:
May 10, 2017, 5:00:47 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
8514fe19, dbfb35d
Parents:
0f9bef3 (diff), 29cf9c8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r0f9bef3 r6250a312  
    393393        | '(' compound_statement ')'                                            // GCC, lambda expression
    394394                { $$ = new ExpressionNode( build_valexpr( $2 ) ); }
     395        | primary_expression '{' argument_expression_list '}' // CFA
     396                {
     397                        Token fn;
     398                        fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
     399                        $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     400                }
    395401        ;
    396402
     
    425431        | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99, compound-literal
    426432                { $$ = new ExpressionNode( build_compoundLiteral( $2, new InitializerNode( $5, true ) ) ); }
    427         | postfix_expression '{' argument_expression_list '}' // CFA
     433        | '^' primary_expression '{' argument_expression_list '}' // CFA
    428434                {
    429435                        Token fn;
    430                         fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
    431                         $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     436                        fn.str = new string( "^?{}" );                          // location undefined
     437                        $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $2 )->set_last( $4 ) ) );
    432438                }
    433439        ;
     
    730736        | exception_statement
    731737        | asm_statement
    732         | '^' postfix_expression '{' argument_expression_list '}' ';' // CFA
    733                 {
    734                         Token fn;
    735                         fn.str = new string( "^?{}" );                          // location undefined
    736                         $$ = new StatementNode( build_expr( new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $2 )->set_last( $4 ) ) ) ) );
    737                 }
    738         ;
    739738
    740739labeled_statement:
Note: See TracChangeset for help on using the changeset viewer.