Changes in src/AST/Print.cpp [e67991f:a7d50b6]
- File:
-
- 1 edited
-
src/AST/Print.cpp (modified) (84 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Print.cpp
re67991f ra7d50b6 37 37 } 38 38 39 class Printer final: public Visitor {39 class Printer : public Visitor { 40 40 public: 41 41 ostream & os; … … 272 272 273 273 public: 274 virtual const ast::DeclWithType * visit( const ast::ObjectDecl * node ) override final{274 virtual const ast::DeclWithType * visit( const ast::ObjectDecl * node ) { 275 275 if ( ! node->name.empty() ) os << node->name << ": "; 276 276 … … 314 314 } 315 315 316 virtual const ast::DeclWithType * visit( const ast::FunctionDecl * node ) override final{316 virtual const ast::DeclWithType * visit( const ast::FunctionDecl * node ) { 317 317 if ( !node->name.empty() ) os << node->name << ": "; 318 318 … … 342 342 } 343 343 344 virtual const ast::Decl * visit( const ast::StructDecl * node ) override final{344 virtual const ast::Decl * visit( const ast::StructDecl * node ) { 345 345 print(node); 346 346 return node; 347 347 } 348 348 349 virtual const ast::Decl * visit( const ast::UnionDecl * node ) override final{349 virtual const ast::Decl * visit( const ast::UnionDecl * node ) { 350 350 print(node); 351 351 return node; 352 352 } 353 353 354 virtual const ast::Decl * visit( const ast::EnumDecl * node ) override final{354 virtual const ast::Decl * visit( const ast::EnumDecl * node ) { 355 355 print(node); 356 356 return node; 357 357 } 358 358 359 virtual const ast::Decl * visit( const ast::TraitDecl * node ) override final{359 virtual const ast::Decl * visit( const ast::TraitDecl * node ) { 360 360 print(node); 361 361 return node; 362 362 } 363 363 364 virtual const ast::Decl * visit( const ast::TypeDecl * node ) override final{364 virtual const ast::Decl * visit( const ast::TypeDecl * node ) { 365 365 preprint( node ); 366 366 if ( ! short_mode && node->init ) { … … 374 374 } 375 375 376 virtual const ast::Decl * visit( const ast::TypedefDecl * node ) override final{377 preprint( node ); 378 return node; 379 } 380 381 virtual const ast::AsmDecl * visit( const ast::AsmDecl * node ) override final{376 virtual const ast::Decl * visit( const ast::TypedefDecl * node ) { 377 preprint( node ); 378 return node; 379 } 380 381 virtual const ast::AsmDecl * visit( const ast::AsmDecl * node ) { 382 382 safe_print( node->stmt ); 383 383 return node; 384 384 } 385 385 386 virtual const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * node ) override final{386 virtual const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * node ) { 387 387 os << "Static Assert with condition: "; 388 388 ++indent; … … 396 396 } 397 397 398 virtual const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) override final{398 virtual const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) { 399 399 os << "Compound Statement:" << endl; 400 400 ++indent; … … 404 404 } 405 405 406 virtual const ast::Stmt * visit( const ast::ExprStmt * node ) override final{406 virtual const ast::Stmt * visit( const ast::ExprStmt * node ) { 407 407 ++indent; 408 408 os << "Expression Statement:" << endl << indent; … … 412 412 } 413 413 414 virtual const ast::Stmt * visit( const ast::AsmStmt * node ) override final{414 virtual const ast::Stmt * visit( const ast::AsmStmt * node ) { 415 415 os << "Assembler Statement:" << endl; 416 416 ++indent; … … 433 433 } 434 434 435 virtual const ast::Stmt * visit( const ast::DirectiveStmt * node ) override final{435 virtual const ast::Stmt * visit( const ast::DirectiveStmt * node ) { 436 436 os << "GCC Directive: " << node->directive << endl; 437 437 return node; 438 438 } 439 439 440 virtual const ast::Stmt * visit( const ast::IfStmt * node ) override final{440 virtual const ast::Stmt * visit( const ast::IfStmt * node ) { 441 441 os << "If on condition:" << endl; 442 442 ++indent; … … 473 473 } 474 474 475 virtual const ast::Stmt * visit( const ast::WhileStmt * node ) override final{475 virtual const ast::Stmt * visit( const ast::WhileStmt * node ) { 476 476 if ( node->isDoWhile ) { os << "Do-"; } 477 477 os << "While on condition:" << endl; … … 490 490 } 491 491 492 virtual const ast::Stmt * visit( const ast::ForStmt * node ) override final{492 virtual const ast::Stmt * visit( const ast::ForStmt * node ) { 493 493 os << "For Statement" << endl; 494 494 … … 532 532 } 533 533 534 virtual const ast::Stmt * visit( const ast::SwitchStmt * node ) override final{534 virtual const ast::Stmt * visit( const ast::SwitchStmt * node ) { 535 535 os << "Switch on condition: "; 536 536 safe_print( node->cond ); … … 546 546 } 547 547 548 virtual const ast::Stmt * visit( const ast::CaseStmt * node ) override final{548 virtual const ast::Stmt * visit( const ast::CaseStmt * node ) { 549 549 if ( node->isDefault() ) { 550 550 os << indent << "Default "; … … 565 565 } 566 566 567 virtual const ast::Stmt * visit( const ast::BranchStmt * node ) override final{567 virtual const ast::Stmt * visit( const ast::BranchStmt * node ) { 568 568 os << "Branch (" << node->kindName() << ")" << endl; 569 569 ++indent; … … 586 586 } 587 587 588 virtual const ast::Stmt * visit( const ast::ReturnStmt * node ) override final{588 virtual const ast::Stmt * visit( const ast::ReturnStmt * node ) { 589 589 os << "Return Statement, returning"; 590 590 if ( node->expr ) { … … 601 601 } 602 602 603 virtual const ast::Stmt * visit( const ast::ThrowStmt * node ) override final{603 virtual const ast::Stmt * visit( const ast::ThrowStmt * node ) { 604 604 if ( node->target ) os << "Non-Local "; 605 605 … … 621 621 } 622 622 623 virtual const ast::Stmt * visit( const ast::TryStmt * node ) override final{623 virtual const ast::Stmt * visit( const ast::TryStmt * node ) { 624 624 ++indent; 625 625 os << "Try Statement" << endl << indent-1 … … 642 642 } 643 643 644 virtual const ast::Stmt * visit( const ast::CatchStmt * node ) override final{644 virtual const ast::Stmt * visit( const ast::CatchStmt * node ) { 645 645 os << "Catch "; 646 646 switch ( node->kind ) { … … 667 667 } 668 668 669 virtual const ast::Stmt * visit( const ast::FinallyStmt * node ) override final{669 virtual const ast::Stmt * visit( const ast::FinallyStmt * node ) { 670 670 os << "Finally Statement" << endl; 671 671 os << indent << "... with block:" << endl; … … 678 678 } 679 679 680 virtual const ast::Stmt * visit( const ast::WaitForStmt * node ) override final{680 virtual const ast::Stmt * visit( const ast::WaitForStmt * node ) { 681 681 os << "Waitfor Statement" << endl; 682 682 indent += 2; … … 732 732 } 733 733 734 virtual const ast:: Decl * visit( const ast::WithStmt * node ) override final{734 virtual const ast::Stmt * visit( const ast::WithStmt * node ) { 735 735 os << "With statement" << endl; 736 736 os << indent << "... with expressions:" << endl; … … 744 744 } 745 745 746 virtual const ast::NullStmt * visit( const ast::NullStmt * node ) override final{746 virtual const ast::NullStmt * visit( const ast::NullStmt * node ) { 747 747 os << "Null Statement" << endl; 748 748 print( node->labels ); … … 751 751 } 752 752 753 virtual const ast::Stmt * visit( const ast::DeclStmt * node ) override final{753 virtual const ast::Stmt * visit( const ast::DeclStmt * node ) { 754 754 os << "Declaration of "; 755 755 safe_print( node->decl ); … … 758 758 } 759 759 760 virtual const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * node ) override final{760 virtual const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * node ) { 761 761 os << "Implicit Ctor Dtor Statement" << endl; 762 762 os << indent << "... with Ctor/Dtor: "; … … 769 769 } 770 770 771 virtual const ast::Expr * visit( const ast::ApplicationExpr * node ) override final{771 virtual const ast::Expr * visit( const ast::ApplicationExpr * node ) { 772 772 ++indent; 773 773 os << "Application of" << endl << indent; … … 784 784 } 785 785 786 virtual const ast::Expr * visit( const ast::UntypedExpr * node ) override final{786 virtual const ast::Expr * visit( const ast::UntypedExpr * node ) { 787 787 ++indent; 788 788 os << "Applying untyped:" << endl; … … 797 797 } 798 798 799 virtual const ast::Expr * visit( const ast::NameExpr * node ) override final{799 virtual const ast::Expr * visit( const ast::NameExpr * node ) { 800 800 os << "Name: " << node->name; 801 801 postprint( node ); … … 804 804 } 805 805 806 virtual const ast::Expr * visit( const ast::AddressExpr * node ) override final{806 virtual const ast::Expr * visit( const ast::AddressExpr * node ) { 807 807 os << "Address of:" << endl; 808 808 ++indent; … … 815 815 } 816 816 817 virtual const ast::Expr * visit( const ast::LabelAddressExpr * node ) override final{817 virtual const ast::Expr * visit( const ast::LabelAddressExpr * node ) { 818 818 os << "Address of label:" << node->arg; 819 819 … … 821 821 } 822 822 823 virtual const ast::Expr * visit( const ast::CastExpr * node ) override final{823 virtual const ast::Expr * visit( const ast::CastExpr * node ) { 824 824 ++indent; 825 825 os << (node->isGenerated ? "Generated" : "Explicit") << " cast of:" << endl << indent; … … 841 841 } 842 842 843 virtual const ast::Expr * visit( const ast::KeywordCastExpr * node ) override final{843 virtual const ast::Expr * visit( const ast::KeywordCastExpr * node ) { 844 844 ++indent; 845 845 os << "Keyword Cast of:" << endl << indent; … … 852 852 } 853 853 854 virtual const ast::Expr * visit( const ast::VirtualCastExpr * node ) override final{854 virtual const ast::Expr * visit( const ast::VirtualCastExpr * node ) { 855 855 ++indent; 856 856 os << "Virtual Cast of:" << endl << indent; … … 869 869 } 870 870 871 virtual const ast::Expr * visit( const ast::UntypedMemberExpr * node ) override final{871 virtual const ast::Expr * visit( const ast::UntypedMemberExpr * node ) { 872 872 ++indent; 873 873 os << "Untyped Member Expression, with field: " << endl << indent; … … 881 881 } 882 882 883 virtual const ast::Expr * visit( const ast::MemberExpr * node ) override final{883 virtual const ast::Expr * visit( const ast::MemberExpr * node ) { 884 884 ++indent; 885 885 os << "Member Expression, with field:" << endl << indent; … … 893 893 } 894 894 895 virtual const ast::Expr * visit( const ast::VariableExpr * node ) override final{895 virtual const ast::Expr * visit( const ast::VariableExpr * node ) { 896 896 os << "Variable Expression: "; 897 897 short_print( node->var ); … … 901 901 } 902 902 903 virtual const ast::Expr * visit( const ast::ConstantExpr * node ) override final{903 virtual const ast::Expr * visit( const ast::ConstantExpr * node ) { 904 904 os << "Constant Expression (" << node->rep; 905 905 if ( node->result ) { … … 913 913 } 914 914 915 virtual const ast::Expr * visit( const ast::SizeofExpr * node ) override final{915 virtual const ast::Expr * visit( const ast::SizeofExpr * node ) { 916 916 os << "Sizeof Expression on: "; 917 917 ++indent; … … 924 924 } 925 925 926 virtual const ast::Expr * visit( const ast::AlignofExpr * node ) override final{926 virtual const ast::Expr * visit( const ast::AlignofExpr * node ) { 927 927 os << "Alignof Expression on: "; 928 928 ++indent; … … 935 935 } 936 936 937 virtual const ast::Expr * visit( const ast::UntypedOffsetofExpr * node ) override final{937 virtual const ast::Expr * visit( const ast::UntypedOffsetofExpr * node ) { 938 938 os << "Untyped Offsetof Expression on member " << node->member << " of "; 939 939 ++indent; … … 945 945 } 946 946 947 virtual const ast::Expr * visit( const ast::OffsetofExpr * node ) override final{947 virtual const ast::Expr * visit( const ast::OffsetofExpr * node ) { 948 948 os << "Offsetof Expression on member " << node->member->name << " of "; 949 949 ++indent; … … 955 955 } 956 956 957 virtual const ast::Expr * visit( const ast::OffsetPackExpr * node ) override final{957 virtual const ast::Expr * visit( const ast::OffsetPackExpr * node ) { 958 958 os << "Offset Pack Expression on: "; 959 959 ++indent; … … 965 965 } 966 966 967 virtual const ast::Expr * visit( const ast::LogicalExpr * node ) override final{967 virtual const ast::Expr * visit( const ast::LogicalExpr * node ) { 968 968 os << "Short-circuited operation (" << (node->isAnd ? "and" : "or") << ") on: "; 969 969 safe_print( node->arg1 ); … … 975 975 } 976 976 977 virtual const ast::Expr * visit( const ast::ConditionalExpr * node ) override final{977 virtual const ast::Expr * visit( const ast::ConditionalExpr * node ) { 978 978 ++indent; 979 979 os << "Conditional expression on:" << endl << indent; … … 989 989 } 990 990 991 virtual const ast::Expr * visit( const ast::CommaExpr * node ) override final{991 virtual const ast::Expr * visit( const ast::CommaExpr * node ) { 992 992 ++indent; 993 993 os << "Comma Expression:" << endl << indent; … … 1001 1001 } 1002 1002 1003 virtual const ast::Expr * visit( const ast::TypeExpr * node ) override final{1003 virtual const ast::Expr * visit( const ast::TypeExpr * node ) { 1004 1004 safe_print( node->type ); 1005 1005 postprint( node ); … … 1008 1008 } 1009 1009 1010 virtual const ast::Expr * visit( const ast::AsmExpr * node ) override final{1010 virtual const ast::Expr * visit( const ast::AsmExpr * node ) { 1011 1011 os << "Asm Expression:" << endl; 1012 1012 ++indent; … … 1019 1019 } 1020 1020 1021 virtual const ast::Expr * visit( const ast::ImplicitCopyCtorExpr * node ) override final{1021 virtual const ast::Expr * visit( const ast::ImplicitCopyCtorExpr * node ) { 1022 1022 ++indent; 1023 1023 os << "Implicit Copy Constructor Expression:" << endl << indent; 1024 1024 safe_print( node->callExpr ); 1025 --indent; 1026 postprint( node ); 1027 1028 return node; 1029 } 1030 1031 virtual const ast::Expr * visit( const ast::ConstructorExpr * node ) override final { 1025 os << endl << indent-1 << "... with temporaries:" << endl; 1026 printAll( node->tempDecls ); 1027 os << endl << indent-1 << "... with return temporaries:" << endl; 1028 printAll( node->returnDecls ); 1029 --indent; 1030 postprint( node ); 1031 1032 return node; 1033 } 1034 1035 virtual const ast::Expr * visit( const ast::ConstructorExpr * node ) { 1032 1036 os << "Constructor Expression:" << endl << indent+1; 1033 1037 indent += 2; … … 1039 1043 } 1040 1044 1041 virtual const ast::Expr * visit( const ast::CompoundLiteralExpr * node ) override final{1045 virtual const ast::Expr * visit( const ast::CompoundLiteralExpr * node ) { 1042 1046 ++indent; 1043 1047 os << "Compound Literal Expression: " << endl << indent; … … 1051 1055 } 1052 1056 1053 virtual const ast::Expr * visit( const ast::RangeExpr * node ) override final{1057 virtual const ast::Expr * visit( const ast::RangeExpr * node ) { 1054 1058 os << "Range Expression: "; 1055 1059 safe_print( node->low ); … … 1061 1065 } 1062 1066 1063 virtual const ast::Expr * visit( const ast::UntypedTupleExpr * node ) override final{1067 virtual const ast::Expr * visit( const ast::UntypedTupleExpr * node ) { 1064 1068 os << "Untyped Tuple:" << endl; 1065 1069 ++indent; … … 1071 1075 } 1072 1076 1073 virtual const ast::Expr * visit( const ast::TupleExpr * node ) override final{1077 virtual const ast::Expr * visit( const ast::TupleExpr * node ) { 1074 1078 os << "Tuple:" << endl; 1075 1079 ++indent; … … 1081 1085 } 1082 1086 1083 virtual const ast::Expr * visit( const ast::TupleIndexExpr * node ) override final{1087 virtual const ast::Expr * visit( const ast::TupleIndexExpr * node ) { 1084 1088 os << "Tuple Index Expression, with tuple:" << endl; 1085 1089 ++indent; … … 1093 1097 } 1094 1098 1095 virtual const ast::Expr * visit( const ast::TupleAssignExpr * node ) override final{1099 virtual const ast::Expr * visit( const ast::TupleAssignExpr * node ) { 1096 1100 os << "Tuple Assignment Expression, with stmt expr:" << endl; 1097 1101 ++indent; … … 1104 1108 } 1105 1109 1106 virtual const ast::Expr * visit( const ast::StmtExpr * node ) override final{1110 virtual const ast::Expr * visit( const ast::StmtExpr * node ) { 1107 1111 ++indent; 1108 1112 os << "Statement Expression:" << endl << indent; … … 1122 1126 } 1123 1127 1124 virtual const ast::Expr * visit( const ast::UniqueExpr * node ) override final{1128 virtual const ast::Expr * visit( const ast::UniqueExpr * node ) { 1125 1129 ++indent; 1126 1130 os << "Unique Expression with id: " << node->id << endl << indent; … … 1136 1140 } 1137 1141 1138 virtual const ast::Expr * visit( const ast::UntypedInitExpr * node ) override final{1142 virtual const ast::Expr * visit( const ast::UntypedInitExpr * node ) { 1139 1143 ++indent; 1140 1144 os << "Untyped Init Expression" << endl << indent; … … 1152 1156 } 1153 1157 1154 virtual const ast::Expr * visit( const ast::InitExpr * node ) override final{1158 virtual const ast::Expr * visit( const ast::InitExpr * node ) { 1155 1159 ++indent; 1156 1160 os << "Init Expression" << endl << indent; … … 1163 1167 } 1164 1168 1165 virtual const ast::Expr * visit( const ast::DeletedExpr * node ) override final{1169 virtual const ast::Expr * visit( const ast::DeletedExpr * node ) { 1166 1170 ++indent; 1167 1171 os << "Deleted Expression" << endl << indent; … … 1174 1178 } 1175 1179 1176 virtual const ast::Expr * visit( const ast::DefaultArgExpr * node ) override final{1180 virtual const ast::Expr * visit( const ast::DefaultArgExpr * node ) { 1177 1181 ++indent; 1178 1182 os << "Default Argument Expression" << endl << indent; … … 1183 1187 } 1184 1188 1185 virtual const ast::Expr * visit( const ast::GenericExpr * node ) override final{1189 virtual const ast::Expr * visit( const ast::GenericExpr * node ) { 1186 1190 ++indent; 1187 1191 os << "C11 _Generic Expression" << endl << indent; … … 1206 1210 } 1207 1211 1208 virtual const ast::Type * visit( const ast::VoidType * node ) override final{1212 virtual const ast::Type * visit( const ast::VoidType * node ) { 1209 1213 preprint( node ); 1210 1214 os << "void"; … … 1212 1216 } 1213 1217 1214 virtual const ast::Type * visit( const ast::BasicType * node ) override final{1218 virtual const ast::Type * visit( const ast::BasicType * node ) { 1215 1219 preprint( node ); 1216 1220 os << ast::BasicType::typeNames[ node->kind ]; … … 1218 1222 } 1219 1223 1220 virtual const ast::Type * visit( const ast::PointerType * node ) override final{1224 virtual const ast::Type * visit( const ast::PointerType * node ) { 1221 1225 preprint( node ); 1222 1226 if ( ! node->isArray() ) { … … 1241 1245 } 1242 1246 1243 virtual const ast::Type * visit( const ast::ArrayType * node ) override final{1247 virtual const ast::Type * visit( const ast::ArrayType * node ) { 1244 1248 preprint( node ); 1245 1249 if ( node->isStatic ) { … … 1265 1269 } 1266 1270 1267 virtual const ast::Type * visit( const ast::ReferenceType * node ) override final{1271 virtual const ast::Type * visit( const ast::ReferenceType * node ) { 1268 1272 preprint( node ); 1269 1273 os << "reference to "; … … 1273 1277 } 1274 1278 1275 virtual const ast::Type * visit( const ast::QualifiedType * node ) override final{1279 virtual const ast::Type * visit( const ast::QualifiedType * node ) { 1276 1280 preprint( node ); 1277 1281 ++indent; … … 1286 1290 } 1287 1291 1288 virtual const ast::Type * visit( const ast::FunctionType * node ) override final{1292 virtual const ast::Type * visit( const ast::FunctionType * node ) { 1289 1293 preprint( node ); 1290 1294 … … 1315 1319 } 1316 1320 1317 virtual const ast::Type * visit( const ast::StructInstType * node ) override final{1321 virtual const ast::Type * visit( const ast::StructInstType * node ) { 1318 1322 preprint( node ); 1319 1323 os << "instance of struct " << node->name; … … 1326 1330 } 1327 1331 1328 virtual const ast::Type * visit( const ast::UnionInstType * node ) override final{1332 virtual const ast::Type * visit( const ast::UnionInstType * node ) { 1329 1333 preprint( node ); 1330 1334 os << "instance of union " << node->name; … … 1337 1341 } 1338 1342 1339 virtual const ast::Type * visit( const ast::EnumInstType * node ) override final{1343 virtual const ast::Type * visit( const ast::EnumInstType * node ) { 1340 1344 preprint( node ); 1341 1345 os << "instance of enum " << node->name; … … 1348 1352 } 1349 1353 1350 virtual const ast::Type * visit( const ast::TraitInstType * node ) override final{1354 virtual const ast::Type * visit( const ast::TraitInstType * node ) { 1351 1355 preprint( node ); 1352 1356 os << "instance of trait " << node->name; … … 1356 1360 } 1357 1361 1358 virtual const ast::Type * visit( const ast::TypeInstType * node ) override final{1362 virtual const ast::Type * visit( const ast::TypeInstType * node ) { 1359 1363 preprint( node ); 1360 1364 os << "instance of type " << node->name … … 1365 1369 } 1366 1370 1367 virtual const ast::Type * visit( const ast::TupleType * node ) override final{1371 virtual const ast::Type * visit( const ast::TupleType * node ) { 1368 1372 preprint( node ); 1369 1373 os << "tuple of types" << endl; … … 1375 1379 } 1376 1380 1377 virtual const ast::Type * visit( const ast::TypeofType * node ) override final{1381 virtual const ast::Type * visit( const ast::TypeofType * node ) { 1378 1382 preprint( node ); 1379 1383 if ( node->kind == ast::TypeofType::Basetypeof ) { os << "base-"; } … … 1384 1388 } 1385 1389 1386 virtual const ast::Type * visit( const ast::VarArgsType * node ) override final{1390 virtual const ast::Type * visit( const ast::VarArgsType * node ) { 1387 1391 preprint( node ); 1388 1392 os << "builtin var args pack"; … … 1390 1394 } 1391 1395 1392 virtual const ast::Type * visit( const ast::ZeroType * node ) override final{1396 virtual const ast::Type * visit( const ast::ZeroType * node ) { 1393 1397 preprint( node ); 1394 1398 os << "zero_t"; … … 1396 1400 } 1397 1401 1398 virtual const ast::Type * visit( const ast::OneType * node ) override final{1402 virtual const ast::Type * visit( const ast::OneType * node ) { 1399 1403 preprint( node ); 1400 1404 os << "one_t"; … … 1402 1406 } 1403 1407 1404 virtual const ast::Type * visit( const ast::GlobalScopeType * node ) override final{1408 virtual const ast::Type * visit( const ast::GlobalScopeType * node ) { 1405 1409 preprint( node ); 1406 1410 os << "Global Scope Type"; … … 1408 1412 } 1409 1413 1410 virtual const ast::Designation * visit( const ast::Designation * node ) override final{1414 virtual const ast::Designation * visit( const ast::Designation * node ) { 1411 1415 if ( node->designators.empty() ) return node; 1412 1416 os << "... designated by: " << endl; … … 1421 1425 } 1422 1426 1423 virtual const ast::Init * visit( const ast::SingleInit * node ) override final{1427 virtual const ast::Init * visit( const ast::SingleInit * node ) { 1424 1428 os << "Simple Initializer: "; 1425 1429 safe_print( node->value ); … … 1427 1431 } 1428 1432 1429 virtual const ast::Init * visit( const ast::ListInit * node ) override final{1433 virtual const ast::Init * visit( const ast::ListInit * node ) { 1430 1434 os << "Compound initializer: " << endl; 1431 1435 ++indent; … … 1445 1449 } 1446 1450 1447 virtual const ast::Init * visit( const ast::ConstructorInit * node ) override final{1451 virtual const ast::Init * visit( const ast::ConstructorInit * node ) { 1448 1452 os << "Constructor initializer: " << endl; 1449 1453 if ( node->ctor ) { … … 1470 1474 } 1471 1475 1472 virtual const ast::Attribute * visit( const ast::Attribute * node ) override final{1476 virtual const ast::Attribute * visit( const ast::Attribute * node ) { 1473 1477 if ( node->empty() ) return node; 1474 1478 os << "Attribute with name: " << node->name; … … 1481 1485 } 1482 1486 1483 virtual const ast::TypeSubstitution * visit( const ast::TypeSubstitution * node ) override final{1487 virtual const ast::TypeSubstitution * visit( const ast::TypeSubstitution * node ) { 1484 1488 os << indent << "Types:" << endl; 1485 1489 for ( const auto& i : *node ) {
Note:
See TracChangeset
for help on using the changeset viewer.