Index: src/AST/Convert.cpp
===================================================================
--- src/AST/Convert.cpp	(revision 896737bef2a0b30fad7d7e9a0b8989c1324a5d40)
+++ src/AST/Convert.cpp	(revision 74dbbf628a225cb17200fe7c93c8b6b655aed9f0)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Convert.cpp --
+// Convert.cpp -- Convert between the new and old syntax trees.
 //
 // Author           : Thierry Delisle
 // Created On       : Thu May 09 15::37::05 2019
 // Last Modified By : Andrew Beach
-// Last Modified On : Fri May 17 11:14:00 2019
-// Update Count     : 2
+// Last Modified On : Fri May 17 12:13:00 2019
+// Update Count     : 3
 //
 
@@ -41,13 +41,488 @@
 
 //================================================================================================
-class ConverterNewToOld {
+class ConverterNewToOld : public ast::Visitor {
 public:
-	std::list< Declaration * > translationUnit;
+	template<typename T>
+	T * get() {
+		T * ret = strict_dynamic_cast< T * >( node );
+		node = nullptr;
+		return ret;
+	}
+
+private:
+	BaseSyntaxNode * node = nullptr;
+
+	// All the visit functions:
+
+	const ast::DeclWithType * visit( const ast::ObjectDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::DeclWithType * visit( const ast::FunctionDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Decl * visit( const ast::StructDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Decl * visit( const ast::UnionDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Decl * visit( const ast::EnumDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Decl * visit( const ast::TraitDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Decl * visit( const ast::TypeDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Decl * visit( const ast::TypedefDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::AsmDecl * visit( const ast::AsmDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::ExprStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::AsmStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::DirectiveStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::IfStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::WhileStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::ForStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::SwitchStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::CaseStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::BranchStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::ReturnStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::ThrowStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::TryStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::CatchStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::FinallyStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::WaitForStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::WithStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::NullStmt * visit( const ast::NullStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::DeclStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::ApplicationExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::UntypedExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::NameExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::AddressExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::LabelAddressExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::CastExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::KeywordCastExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::VirtualCastExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::UntypedMemberExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::MemberExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::VariableExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::ConstantExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::SizeofExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::AlignofExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::UntypedOffsetofExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::OffsetofExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::OffsetPackExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::LogicalExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::ConditionalExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::CommaExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::TypeExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::AsmExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::ImplicitCopyCtorExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::ConstructorExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::CompoundLiteralExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::RangeExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::UntypedTupleExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::TupleExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::TupleIndexExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::TupleAssignExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::StmtExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::UniqueExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::UntypedInitExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::InitExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::DeletedExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::DefaultArgExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Expr * visit( const ast::GenericExpr * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::VoidType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::BasicType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::PointerType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::ArrayType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::ReferenceType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::QualifiedType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::FunctionType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::StructInstType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::UnionInstType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::EnumInstType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::TraitInstType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::TypeInstType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::TupleType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::TypeofType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::VarArgsType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::ZeroType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::OneType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Type * visit( const ast::GlobalScopeType * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Designation * visit( const ast::Designation * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Init * visit( const ast::SingleInit * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Init * visit( const ast::ListInit * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Init * visit( const ast::ConstructorInit * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Constant * visit( const ast::Constant * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::Attribute * visit( const ast::Attribute * node ) override final {
+		(void)node;
+		return nullptr;
+	}
+
+	const ast::TypeSubstitution * visit( const ast::TypeSubstitution * node ) override final {
+		(void)node;
+		return nullptr;
+	}
 };
 
-std::list< Declaration * > convert( std::list< ast::ptr< ast::Decl > > & translationUnit ) {
-	ast::Pass<ConverterNewToOld> converter;
-	ast::accept_all(translationUnit, converter);
-	return converter.pass.translationUnit;
+std::list< Declaration * > convert( std::list< ast::ptr< ast::Decl > > && translationUnit ) {
+	ConverterNewToOld c;
+	std::list< Declaration * > decls;
+	for(auto d : translationUnit) {
+		d->accept( c );
+		decls.emplace_back( c.get<Declaration>() );
+		delete d;
+	}
+	return decls;
 }
 
@@ -753,5 +1228,5 @@
 #undef GET_ACCEPT_1
 
-std::list< ast::ptr< ast::Decl > > convert( const std::list< Declaration * > & translationUnit ) {
+std::list< ast::ptr< ast::Decl > > convert( const std::list< Declaration * > && translationUnit ) {
 	ConverterOldToNew c;
 	std::list< ast::ptr< ast::Decl > > decls;
Index: src/AST/Convert.hpp
===================================================================
--- src/AST/Convert.hpp	(revision 896737bef2a0b30fad7d7e9a0b8989c1324a5d40)
+++ src/AST/Convert.hpp	(revision 74dbbf628a225cb17200fe7c93c8b6b655aed9f0)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Convert.hpp --
+// Convert.hpp -- Convert between the new and old syntax trees.
 //
 // Author           : Thierry Delisle
 // Created On       : Thu May 09 15::37::05 2019
-// Last Modified By :
-// Last Modified On :
-// Update Count     :
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri May 17 11:25:00 2019
+// Update Count     : 1
 //
 
@@ -25,4 +25,4 @@
 };
 
-std::list< Declaration * > convert( const std::list< ast::ptr< ast::Decl > > & translationUnit );
-std::list< ast::ptr< ast::Decl > > convert( const std::list< Declaration * > & translationUnit );
+std::list< Declaration * > convert( const std::list< ast::ptr< ast::Decl > > && translationUnit );
+std::list< ast::ptr< ast::Decl > > convert( const std::list< Declaration * > && translationUnit );
