Changeset d807ca28 for src/Parser/parser.yy
- Timestamp:
- May 25, 2018, 5:01:37 PM (6 years ago)
- 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:
- 3ed994e
- Parents:
- 2c88368
- git-author:
- Rob Schluntz <rschlunt@…> (05/25/18 16:59:30)
- git-committer:
- Rob Schluntz <rschlunt@…> (05/25/18 17:01:37)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r2c88368 rd807ca28 175 175 bool flag; 176 176 CatchStmt::Kind catch_kind; 177 GenericExpr * genexpr; 177 178 } 178 179 … … 259 260 %type<flag> asm_volatile_opt 260 261 %type<en> handler_predicate_opt 262 %type<genexpr> generic_association generic_assoc_list 261 263 262 264 // statements … … 501 503 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 502 504 | 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 } 504 510 ; 505 511 506 512 generic_assoc_list: // C11 507 |generic_association513 generic_association 508 514 | 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 } 509 521 ; 510 522 511 523 generic_association: // C11 512 524 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 } 513 529 | DEFAULT ':' assignment_expression 530 { $$ = new GenericExpr( nullptr, { { maybeMoveBuild<Expression>($3) } } ); } 514 531 ; 515 532
Note: See TracChangeset
for help on using the changeset viewer.