Index: src/Concurrency/Keywords.cc
===================================================================
--- src/Concurrency/Keywords.cc	(revision ef42b1433bc416cbf274adb71339c8b32a281a39)
+++ src/Concurrency/Keywords.cc	(revision b32ada3178d846d1ee56e8cdd6c3755f2d532471)
@@ -17,4 +17,5 @@
 #include "Concurrency/Keywords.h"
 
+#include "SymTab/AddVisit.h"
 #include "SynTree/Declaration.h"
 #include "SynTree/Expression.h"
@@ -29,4 +30,5 @@
 	namespace {
 		const std::list<Label> noLabels;
+		const std::list< Attribute * > noAttributes;
 		Type::StorageClasses noStorage;
 		Type::Qualifiers noQualifiers;
@@ -63,8 +65,24 @@
 	//                                           void main( MyCoroutine * this );
 	//
-	class CoroutineKeyword final : public Mutator {
+	class CoroutineKeyword final : public Visitor {
+	    template< typename Visitor >
+	    friend void SymTab::acceptAndAdd( std::list< Declaration * > &translationUnit, Visitor &visitor );
 	  public:
 
-		static void implement( std::list< Declaration * > & translationUnit ) {}
+		using Visitor::visit;
+		virtual void visit( StructDecl * decl ) override final;
+
+		void handle( StructDecl * );
+		Declaration * addField( StructDecl * );
+		void addRoutines( StructDecl *, Declaration * );
+
+		static void implement( std::list< Declaration * > & translationUnit ) {
+			CoroutineKeyword impl;
+			SymTab::acceptAndAdd( translationUnit, impl );
+		}
+
+	  private:
+		std::list< Declaration * > declsToAdd, declsToAddAfter;
+		StructDecl* coroutine_decl = nullptr;
 	};
 
@@ -97,6 +115,6 @@
 
 		using Visitor::visit;
-		virtual void visit( FunctionDecl *functionDecl ) override final;
-		virtual void visit(   StructDecl *functionDecl ) override final;
+		virtual void visit( FunctionDecl * decl ) override final;
+		virtual void visit(   StructDecl * decl ) override final;
 
 		std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* );
@@ -125,4 +143,89 @@
 
 	//=============================================================================================
+	// Coroutine keyword implementation
+	//=============================================================================================
+	void CoroutineKeyword::visit(StructDecl * decl) {
+		if( decl->get_name() == "coroutine_desc" ) {
+			assert( !coroutine_decl );
+			coroutine_decl = decl;
+		}
+		else if ( false ) {
+			handle( decl );
+		}
+
+	}
+
+	void CoroutineKeyword::handle( StructDecl * decl ) {
+		if( ! decl->has_body() ) return;
+
+		if( !coroutine_decl ) throw SemanticError( "coroutine keyword requires coroutines to be in scope, add #include <coroutine>", decl );
+
+		Declaration * field = addField( decl );
+		addRoutines( decl, field );
+	}
+
+	Declaration * CoroutineKeyword::addField( StructDecl * decl ) {
+		Declaration * cor = new ObjectDecl(
+			"__cor",
+			noStorage,
+			LinkageSpec::Cforall,
+			nullptr,
+			new StructInstType(
+				noQualifiers,
+				coroutine_decl
+			),
+			nullptr
+		);
+
+		decl->get_members().push_front( cor );
+
+		return cor;
+	}
+
+	void CoroutineKeyword::addRoutines( StructDecl * decl, Declaration * field ) {
+		FunctionType * type = new FunctionType( noQualifiers, false );
+		type->get_parameters().push_back(
+			new ObjectDecl(
+				"this",
+				noStorage,
+				LinkageSpec::Cforall,
+				nullptr,
+				new PointerType(
+					noQualifiers,
+					new StructInstType(
+						noQualifiers,
+						decl
+					)
+				),
+				nullptr
+			)
+		);
+
+		CompoundStmt * statement = new CompoundStmt( noLabels );
+		statement->push_back( 
+			new ReturnStmt(
+				noLabels,
+				new UntypedMemberExpr(
+					new NameExpr( "__cor" ),
+					new NameExpr( "this" )
+				)
+			)
+		);
+
+		declsToAddAfter.push_back( 
+			new FunctionDecl(
+				"get_coroutine",
+				Type::Static,
+				LinkageSpec::Cforall,
+				type,
+				statement,
+				noAttributes,
+				Type::Inline
+			)
+		);
+	}
+	
+
+	//=============================================================================================
 	// Mutex keyword implementation
 	//=============================================================================================
@@ -137,4 +240,7 @@
 		CompoundStmt* body = decl->get_statements();
 		if( ! body ) return;
+
+		if( !monitor_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl );
+		if( !guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl );
 
 		addStatments( body, mutexArgs );
@@ -183,7 +289,4 @@
 
 	void MutexKeyword::addStatments( CompoundStmt * body, const std::list<DeclarationWithType * > & args ) {
-		assert(monitor_decl);
-		assert(guard_decl);
-
 		ObjectDecl * monitors = new ObjectDecl(
 			"__monitors",
