Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 5f2f2d75adcd9f673ef8bda86f25d409347089be)
+++ src/CodeGen/CodeGenerator.cc	(revision cda48b6ebb3fe47a472e098d755ee821ad1681f7)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Thu Jun 04 15:00:00 2015
-// Update Count     : 125
+// Last Modified On : Thu Jun 11 13:22:39 2015
+// Update Count     : 137
 //
 
@@ -43,13 +43,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 );
 	}
@@ -62,5 +70,5 @@
 		} // if
 	}
-  
+ 
 	//*** Declarations
 	void CodeGenerator::visit( FunctionDecl *functionDecl ) {
@@ -104,9 +112,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;
@@ -115,5 +123,5 @@
 			cur_indent -= CodeGenerator::tabsize; 
 
-			output << string( cur_indent, ' ' ) << "}";
+			output << indent << "}";
 		} // if
 	}
@@ -138,5 +146,5 @@
 
 		if ( ! memb.empty() ) {
-			output << endl << "{" << endl;
+			output << " {" << endl;
 
 			cur_indent += CodeGenerator::tabsize; 
@@ -144,5 +152,5 @@
 				ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i );
 				assert( obj );
-				output << string( cur_indent, ' ' ) << mangleName( obj ); 
+				output << indent << mangleName( obj ); 
 				if ( obj->get_init() ) {
 					output << " = ";
@@ -154,5 +162,5 @@
 			cur_indent -= CodeGenerator::tabsize; 
 
-			output << "}" << endl;
+			output << indent << "}";
 		} // if
 	}
@@ -444,5 +452,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 );
 
@@ -454,5 +462,5 @@
 		cur_indent -= CodeGenerator::tabsize; 
 
-		output << string( cur_indent, ' ' ) << "}";
+		output << indent << "}";
 	}
 
@@ -494,9 +502,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";
@@ -511,5 +519,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;
@@ -564,5 +572,5 @@
 		whileStmt->get_body()->accept( *this );
 
-		output << string( cur_indent, ' ' );
+		output << indent;
 
 		if ( whileStmt->get_isDoWhile() ) {
@@ -596,5 +604,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 5f2f2d75adcd9f673ef8bda86f25d409347089be)
+++ src/CodeGen/CodeGenerator.h	(revision cda48b6ebb3fe47a472e098d755ee821ad1681f7)
@@ -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;
