Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 68cd1ce1134527e1c664cfdf84df37a7025de8a7)
+++ src/CodeGen/CodeGenerator.cc	(revision b5b09071113f2e9f4fb6ed95bf2a6b23f0f3c912)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 13 07:12:27 2015
-// Update Count     : 129
+// Last Modified By : Rob Schluntz
+// Last Modified On : Mon Jun 15 12:43:21 2015
+// Update Count     : 138
 //
 
@@ -44,13 +44,21 @@
 	}
 
-	CodeGenerator::CodeGenerator( std::ostream &os ) : cur_indent( 0 ), insideFunction( false ), output( os ) { }
-
-	CodeGenerator::CodeGenerator( std::ostream &os, std::string init, int indent, bool infunp )
-			: cur_indent( indent ), insideFunction( infunp ), output( os ) {
+	ostream & CodeGenerator::Indenter::operator()( ostream & output ) {
+	  return output << string( cg.cur_indent, ' ' );
+	}
+
+	ostream & operator<<( ostream & output, CodeGenerator::Indenter &indent ) {
+		return indent( output );
+	}
+
+	CodeGenerator::CodeGenerator( std::ostream &os ) : indent(*this), cur_indent( 0 ), insideFunction( false ), output( os ) { }
+
+	CodeGenerator::CodeGenerator( std::ostream &os, std::string init, int indentation, bool infunp )
+			: indent(*this), cur_indent( indentation ), insideFunction( infunp ), output( os ) {
 		//output << std::string( init );
 	}
 
-	CodeGenerator::CodeGenerator( std::ostream &os, char *init, int indent, bool infunp )
-			: cur_indent( indent ), insideFunction( infunp ), output( os ) {
+	CodeGenerator::CodeGenerator( std::ostream &os, char *init, int indentation, bool infunp )
+			: indent(*this), cur_indent( indentation ), insideFunction( infunp ), output( os ) {
 		//output << std::string( init );
 	}
@@ -63,5 +71,5 @@
 		} // if
 	}
-  
+ 
 	//*** Declarations
 	void CodeGenerator::visit( FunctionDecl *functionDecl ) {
@@ -105,9 +113,9 @@
 
 		if ( ! memb.empty() ) {
-			output << endl << string( cur_indent, ' ' ) << "{" << endl;
+			output << endl << indent << "{" << endl;
 
 			cur_indent += CodeGenerator::tabsize; 
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
-				output << string( cur_indent, ' ' ); 
+				output << indent; 
 				(*i)->accept(*this );
 				output << ";" << endl;
@@ -116,5 +124,5 @@
 			cur_indent -= CodeGenerator::tabsize; 
 
-			output << string( cur_indent, ' ' ) << "}";
+			output << indent << "}";
 		} // if
 	}
@@ -139,5 +147,5 @@
 
 		if ( ! memb.empty() ) {
-			output << endl << "{" << endl;
+			output << " {" << endl;
 
 			cur_indent += CodeGenerator::tabsize; 
@@ -145,5 +153,5 @@
 				ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i );
 				assert( obj );
-				output << string( cur_indent, ' ' ) << mangleName( obj ); 
+				output << indent << mangleName( obj ); 
 				if ( obj->get_init() ) {
 					output << " = ";
@@ -155,5 +163,5 @@
 			cur_indent -= CodeGenerator::tabsize; 
 
-			output << "}" << endl;
+			output << indent << "}";
 		} // if
 	}
@@ -445,5 +453,5 @@
 
 		for ( std::list<Statement *>::iterator i = ks.begin(); i != ks.end();  i++) {
-			output << string( cur_indent, ' ' ) << printLabels( (*i)->get_labels() );
+			output << indent << printLabels( (*i)->get_labels() );
 			(*i)->accept(*this );
 
@@ -455,5 +463,5 @@
 		cur_indent -= CodeGenerator::tabsize; 
 
-		output << string( cur_indent, ' ' ) << "}";
+		output << indent << "}";
 	}
 
@@ -495,9 +503,9 @@
 		cur_indent -= CodeGenerator::tabsize;
 
-		output << string( cur_indent, ' ' ) << "}";
+		output << indent << "}";
 	}
 
 	void CodeGenerator::visit( CaseStmt *caseStmt ) {
-		output << string( cur_indent, ' ' );
+		output << indent;
 		if ( caseStmt->isDefault()) {
 			output << "default";
@@ -512,5 +520,5 @@
 		cur_indent += CodeGenerator::tabsize;
 		for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end();  i++) {
-			output << string( cur_indent, ' ' ) << printLabels( (*i)->get_labels() )  ;
+			output << indent << printLabels( (*i)->get_labels() )  ;
 			(*i)->accept(*this );
 			output << endl;
@@ -565,5 +573,5 @@
 		whileStmt->get_body()->accept( *this );
 
-		output << string( cur_indent, ' ' );
+		output << indent;
 
 		if ( whileStmt->get_isDoWhile() ) {
@@ -597,5 +605,5 @@
 
 	void CodeGenerator::visit( NullStmt *nullStmt ) {
-		//output << string( cur_indent, ' ' ) << CodeGenerator::printLabels( nullStmt->get_labels() );
+		//output << indent << CodeGenerator::printLabels( nullStmt->get_labels() );
 		output << "/* null statement */ ;";
 	}
Index: src/CodeGen/CodeGenerator.h
===================================================================
--- src/CodeGen/CodeGenerator.h	(revision 68cd1ce1134527e1c664cfdf84df37a7025de8a7)
+++ src/CodeGen/CodeGenerator.h	(revision b5b09071113f2e9f4fb6ed95bf2a6b23f0f3c912)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jun  8 14:34:43 2015
-// Update Count     : 15
+// Last Modified By : Rob Schluntz
+// Last Modified On : Thu Jun 11 13:24:23 2015
+// Update Count     : 23
 //
 
@@ -80,5 +80,13 @@
 
 		template< class Iterator > void genCommaList( Iterator begin, Iterator end );
+
+		struct Indenter {
+			Indenter(CodeGenerator &cg) : cg(cg) {}
+			CodeGenerator & cg;
+			std::ostream& operator()(std::ostream & os);
+		};
 	  private:
+
+		Indenter indent;
 		int cur_indent;
 		bool insideFunction;
