Ignore:
Timestamp:
May 30, 2018, 9:28:18 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, with_gc
Children:
bd946e4
Parents:
35718a9 (diff), ae32d96 (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 plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r35718a9 r94b1022a  
    175175        bool flag;
    176176        CatchStmt::Kind catch_kind;
     177        GenericExpr * genexpr;
    177178}
    178179
     
    259260%type<flag> asm_volatile_opt
    260261%type<en> handler_predicate_opt
     262%type<genexpr> generic_association generic_assoc_list
    261263
    262264// statements
     
    501503                { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
    502504        | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11
    503                 { SemanticError( yylloc, "_Generic is currently unimplemented." ); $$ = nullptr; }
     505                {
     506                        // add the missing control expression to the GenericExpr and return it
     507                        $5->control = maybeMoveBuild<Expression>( $3 );
     508                        $$ = new ExpressionNode( $5 );
     509                }
    504510        ;
    505511
    506512generic_assoc_list:                                                                             // C11
    507         | generic_association
     513        generic_association
    508514        | generic_assoc_list ',' generic_association
     515                {
     516                        // steal the association node from the singleton and delete the wrapper
     517                        $1->associations.splice($1->associations.end(), $3->associations);
     518                        delete $3;
     519                        $$ = $1;
     520                }
    509521        ;
    510522
    511523generic_association:                                                                    // C11
    512524        type_no_function ':' assignment_expression
     525                {
     526                        // create a GenericExpr wrapper with one association pair
     527                        $$ = new GenericExpr( nullptr, { { maybeMoveBuildType($1), maybeMoveBuild<Expression>($3) } } );
     528                }
    513529        | DEFAULT ':' assignment_expression
     530                { $$ = new GenericExpr( nullptr, { { maybeMoveBuild<Expression>($3) } } ); }
    514531        ;
    515532
     
    20812098                { $$ = $2; }
    20822099        | '=' VOID
    2083                 { $$ = nullptr; }
     2100                { $$ = new InitializerNode( true ); }
    20842101        | ATassign initializer
    20852102                { $$ = $2->set_maybeConstructed( false ); }
Note: See TracChangeset for help on using the changeset viewer.