Changes in src/AST/Convert.cpp [4073b16:dd6d7c6]
- File:
-
- 1 edited
-
src/AST/Convert.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r4073b16 rdd6d7c6 1287 1287 1288 1288 const ast::Designation * visit( const ast::Designation * node ) override final { 1289 (void)node; 1289 auto designation = new Designation( get<Expression>().acceptL( node->designators ) ); 1290 designation->location = node->location; 1291 this->node = designation; 1290 1292 return nullptr; 1291 1293 } 1292 1294 1293 1295 const ast::Init * visit( const ast::SingleInit * node ) override final { 1294 (void)node; 1296 auto init = new SingleInit( 1297 get<Expression>().accept1( node->value ), 1298 ast::MaybeConstruct == node->maybeConstructed 1299 ); 1300 init->location = node->location; 1301 this->node = init; 1295 1302 return nullptr; 1296 1303 } 1297 1304 1298 1305 const ast::Init * visit( const ast::ListInit * node ) override final { 1299 (void)node; 1306 auto init = new ListInit( 1307 get<Initializer>().acceptL( node->initializers ), 1308 get<Designation>().acceptL( node->designations ), 1309 ast::MaybeConstruct == node->maybeConstructed 1310 ); 1311 init->location = node->location; 1312 this->node = init; 1300 1313 return nullptr; 1301 1314 } 1302 1315 1303 1316 const ast::Init * visit( const ast::ConstructorInit * node ) override final { 1304 (void)node; 1317 auto init = new ConstructorInit( 1318 get<Statement>().accept1( node->ctor ), 1319 get<Statement>().accept1( node->dtor ), 1320 get<Initializer>().accept1( node->init ) 1321 ); 1322 init->location = node->location; 1323 this->node = init; 1305 1324 return nullptr; 1306 1325 } 1307 1326 1308 1327 const ast::Attribute * visit( const ast::Attribute * node ) override final { 1309 (void)node; 1328 auto attr = new Attribute( 1329 node->name, 1330 get<Expression>().acceptL(node->parameters) 1331 ); 1332 this->node = attr; 1310 1333 return nullptr; 1311 1334 } 1312 1335 1313 1336 const ast::TypeSubstitution * visit( const ast::TypeSubstitution * node ) override final { 1314 (void)node; 1337 // Handled by convertTypeSubstitution helper instead. 1338 // TypeSubstitution is not a node in the old model, so the conversion result wouldn't fit in this->node. 1339 assert( 0 ); 1315 1340 return nullptr; 1316 1341 } … … 2617 2642 } 2618 2643 2619 virtual void visit( Designation * ) override final { 2620 2621 } 2622 2623 virtual void visit( SingleInit * ) override final { 2624 2625 } 2626 2627 virtual void visit( ListInit * ) override final { 2628 2629 } 2630 2631 virtual void visit( ConstructorInit * ) override final { 2632 2644 virtual void visit( Designation * old ) override final { 2645 this->node = new ast::Designation( 2646 old->location, 2647 GET_ACCEPT_V(designators, Expr) 2648 ); 2649 } 2650 2651 virtual void visit( SingleInit * old ) override final { 2652 this->node = new ast::SingleInit( 2653 old->location, 2654 GET_ACCEPT_1(value, Expr), 2655 (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::DoConstruct 2656 ); 2657 } 2658 2659 virtual void visit( ListInit * old ) override final { 2660 this->node = new ast::ListInit( 2661 old->location, 2662 GET_ACCEPT_V(initializers, Init), 2663 GET_ACCEPT_V(designations, Designation), 2664 (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::DoConstruct 2665 ); 2666 } 2667 2668 virtual void visit( ConstructorInit * old ) override final { 2669 this->node = new ast::ConstructorInit( 2670 old->location, 2671 GET_ACCEPT_1(ctor, Stmt), 2672 GET_ACCEPT_1(dtor, Stmt), 2673 GET_ACCEPT_1(init, Init) 2674 ); 2633 2675 } 2634 2676 2635 2677 virtual void visit( Constant * ) override final { 2636 2637 } 2638 2639 virtual void visit( Attribute * ) override final { 2640 2678 // Handled in visit( ConstantEpxr * ). 2679 // In the new tree, Constant fields are inlined into containing ConstantExpression. 2680 assert( 0 ); 2681 } 2682 2683 virtual void visit( Attribute * old ) override final { 2684 this->node = new ast::Attribute( 2685 old->name, 2686 GET_ACCEPT_V( parameters, Expr ) 2687 ); 2641 2688 } 2642 2689 2643 2690 virtual void visit( AttrExpr * ) override final { 2644 2645 assert( 0 ); 2691 assertf( false, "AttrExpr deprecated in new AST." ); 2646 2692 } 2647 2693 };
Note:
See TracChangeset
for help on using the changeset viewer.