Index: src/ControlStruct/ForExprMutator.cc
===================================================================
--- src/ControlStruct/ForExprMutator.cc	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/ControlStruct/ForExprMutator.cc	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Tue Jul 14 12:14:44 2015
-// Update Count     : 10
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug 17 15:32:46 2017
+// Update Count     : 11
 //
 
@@ -21,4 +21,20 @@
 
 namespace ControlStruct {
+	Statement *ForExprMutator::postmutate( IfStmt *ifStmt ) {
+		std::list<Statement *> &init = ifStmt->get_initialization();
+		if ( init.size() == 0 ) {
+			return ifStmt;
+		} // if
+
+		// create compound statement, move initializers outside, leave _for_ as-is
+		CompoundStmt *block = new CompoundStmt( std::list< Label >() );
+		std::list<Statement *> &stmts = block->get_kids();
+		stmts.splice( stmts.end(), init );
+
+		// add for to the new block
+		stmts.push_back( ifStmt );
+		return block;
+	}
+
 	Statement *ForExprMutator::postmutate( ForStmt *forStmt ) {
 		// hoist any initializer declarations to make them C89 (rather than C99)
@@ -31,11 +47,8 @@
 		CompoundStmt *block = new CompoundStmt( std::list< Label >() );
 		std::list<Statement *> &stmts = block->get_kids();
-		for ( std::list<Statement *>::iterator it = init.begin(); it != init.end(); ++it ) {
-			stmts.push_back( *it );
-		}	// for
+		stmts.splice( stmts.end(), init );
 
 		// add for to the new block
 		stmts.push_back( forStmt );
-		forStmt->set_initialization( std::list<Statement *>() );
 		return block;
 	}
Index: src/ControlStruct/ForExprMutator.h
===================================================================
--- src/ControlStruct/ForExprMutator.h	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/ControlStruct/ForExprMutator.h	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -10,10 +10,11 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 09:17:08 2017
-// Update Count     : 4
+// Last Modified On : Thu Aug 17 15:32:48 2017
+// Update Count     : 5
 //
 
 #pragma once
 
+class IfStmt;
 class ForStmt;
 class Statement;
@@ -22,4 +23,5 @@
 	class ForExprMutator {
 	  public:
+		Statement *postmutate( IfStmt * );
 		Statement *postmutate( ForStmt * );
 	};
Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/Parser/StatementNode.cc	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 14:59:41 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 16 16:39:43 2017
-// Update Count     : 340
+// Last Modified On : Thu Aug 17 16:01:31 2017
+// Update Count     : 345
 //
 
@@ -24,4 +24,5 @@
 #include "SynTree/Expression.h"    // for Expression, ConstantExpr
 #include "SynTree/Label.h"         // for Label, noLabels
+#include "SynTree/Declaration.h"
 #include "SynTree/Statement.h"     // for Statement, BranchStmt, CaseStmt
 #include "parserutility.h"         // for notZeroExpr
@@ -98,13 +99,7 @@
 	} // if
 
-	return new IfStmt( noLabels, notZeroExpr(
-							   /*ctl->condition
-								 ?*/ maybeMoveBuild< Expression >(ctl->condition)
-								 /*: new VariableExpr( init.end() )*/ )
-						   , thenb, elseb );
-	// ret->initialization = init;
-	// delete ctl;
-	// assert( ret );
-	// return ret;
+	Expression * cond = ctl->condition ? maybeMoveBuild< Expression >(ctl->condition) : new VariableExpr( dynamic_cast<DeclarationWithType *>( dynamic_cast<DeclStmt *>( init.back() )->decl ) );
+	delete ctl;
+	return new IfStmt( noLabels, notZeroExpr( cond ), thenb, elseb, init );
 }
 
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/Parser/parser.yy	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 16 18:09:14 2017
-// Update Count     : 2485
+// Last Modified On : Thu Aug 17 15:52:12 2017
+// Update Count     : 2489
 //
 
@@ -796,9 +796,9 @@
 
 selection_statement:
-	IF '(' if_control_expression ')' statement				%prec THEN
+	IF '(' push if_control_expression ')' statement				%prec THEN
 		// explicitly deal with the shift/reduce conflict on if/else
-		{ $$ = new StatementNode( build_if( $3, $5, nullptr ) ); }
-	| IF '(' if_control_expression ')' statement ELSE statement
-		{ $$ = new StatementNode( build_if( $3, $5, $7 ) ); }
+		{ $$ = new StatementNode( build_if( $4, $6, nullptr ) ); }
+	| IF '(' push if_control_expression ')' statement ELSE statement
+		{ $$ = new StatementNode( build_if( $4, $6, $8 ) ); }
 	| SWITCH '(' comma_expression ')' case_clause		// CFA
 		{ $$ = new StatementNode( build_switch( $3, $5 ) ); }
@@ -823,11 +823,11 @@
 
 if_control_expression:
-	comma_expression
+	comma_expression pop
 		{ $$ = new IfCtl( nullptr, $1 ); }
-	| c_declaration										// no semi-coln
+	| c_declaration										// no semi-colon
 		{ $$ = new IfCtl( $1, nullptr ); }
 	| cfa_declaration									// no semi-colon
 		{ $$ = new IfCtl( $1, nullptr ); }
-	| declaration comma_expression
+	| declaration comma_expression						// semi-colon separated
 		{ $$ = new IfCtl( $1, $2 ); }
  	;
Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/SymTab/Indexer.cc	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 21:37:33 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Mar 30 16:38:47 2017
-// Update Count     : 19
+// Last Modified On : Thu Aug 17 16:08:40 2017
+// Update Count     : 20
 //
 
@@ -351,4 +351,11 @@
 		acceptAll( compoundStmt->get_kids(), *this );
 		leaveScope();
+	}
+
+	void Indexer::visit( IfStmt *ifStmt ) {
+	    // for statements introduce a level of scope
+	    enterScope();
+	    Visitor::visit( ifStmt );
+	    leaveScope();
 	}
 
Index: src/SymTab/Indexer.h
===================================================================
--- src/SymTab/Indexer.h	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/SymTab/Indexer.h	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 21:38:55 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 09:46:34 2017
-// Update Count     : 7
+// Last Modified On : Thu Aug 17 16:09:12 2017
+// Update Count     : 8
 //
 
@@ -45,4 +45,5 @@
 
 		virtual void visit( CompoundStmt *compoundStmt );
+		virtual void visit( IfStmt *ifStmt );
 		virtual void visit( ForStmt *forStmt );
 		virtual void visit( CatchStmt *catchStmt );
Index: src/SynTree/Mutator.cc
===================================================================
--- src/SynTree/Mutator.cc	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/SynTree/Mutator.cc	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Mon Jul 24 16:32:00 2017
-// Update Count     : 25
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug 17 15:39:37 2017
+// Update Count     : 27
 //
 
@@ -114,4 +114,5 @@
 
 Statement *Mutator::mutate( IfStmt *ifStmt ) {
+	mutateAll( ifStmt->get_initialization(), *this );
 	ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) );
 	ifStmt->set_thenPart( maybeMutate( ifStmt->get_thenPart(), *this ) );
Index: src/SynTree/Statement.cc
===================================================================
--- src/SynTree/Statement.cc	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/SynTree/Statement.cc	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Mon Aug 14 12:26:00 2017
-// Update Count     : 65
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug 17 16:17:20 2017
+// Update Count     : 67
 //
 
@@ -32,5 +32,5 @@
 using std::endl;
 
-Statement::Statement( std::list<Label> _labels ) : labels( _labels ) {}
+Statement::Statement( std::list<Label> labels ) : labels( labels ) {}
 
 void Statement::print( __attribute__((unused)) std::ostream &, __attribute__((unused)) int indent ) const {}
@@ -38,5 +38,5 @@
 Statement::~Statement() {}
 
-ExprStmt::ExprStmt( std::list<Label> _labels, Expression *_expr ) : Statement( _labels ), expr( _expr ) {}
+ExprStmt::ExprStmt( std::list<Label> labels, Expression *expr ) : Statement( labels ), expr( expr ) {}
 
 ExprStmt::ExprStmt( const ExprStmt &other ) : Statement( other ), expr( maybeClone( other.expr ) ) {}
@@ -88,6 +88,6 @@
 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" };
 
-BranchStmt::BranchStmt( std::list<Label> labels, Label _target, Type _type ) throw ( SemanticError ) :
-	Statement( labels ), originalTarget( _target ), target( _target ), computedTarget( NULL ), type( _type ) {
+BranchStmt::BranchStmt( std::list<Label> labels, Label target, Type type ) throw ( SemanticError ) :
+	Statement( labels ), originalTarget( target ), target( target ), computedTarget( NULL ), type( type ) {
 	//actually this is a syntactic error signaled by the parser
 	if ( type == BranchStmt::Goto && target.empty() )
@@ -95,6 +95,6 @@
 }
 
-BranchStmt::BranchStmt( std::list<Label> labels, Expression *_computedTarget, Type _type ) throw ( SemanticError ) :
-	Statement( labels ), computedTarget( _computedTarget ), type( _type ) {
+BranchStmt::BranchStmt( std::list<Label> labels, Expression *computedTarget, Type type ) throw ( SemanticError ) :
+	Statement( labels ), computedTarget( computedTarget ), type( type ) {
 	if ( type != BranchStmt::Goto || computedTarget == 0 )
 		throw SemanticError("Computed target not valid in branch statement");
@@ -105,5 +105,5 @@
 }
 
-ReturnStmt::ReturnStmt( std::list<Label> labels, Expression *_expr ) : Statement( labels ), expr( _expr ) {}
+ReturnStmt::ReturnStmt( std::list<Label> labels, Expression *expr ) : Statement( labels ), expr( expr ) {}
 
 ReturnStmt::ReturnStmt( const ReturnStmt & other ) : Statement( other ), expr( maybeClone( other.expr ) ) {}
@@ -122,11 +122,14 @@
 }
 
-IfStmt::IfStmt( std::list<Label> _labels, Expression *_condition, Statement *_thenPart, Statement *_elsePart ):
-	Statement( _labels ), condition( _condition ), thenPart( _thenPart ), elsePart( _elsePart ) {}
+IfStmt::IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart, std::list<Statement *> initialization ):
+	Statement( labels ), condition( condition ), thenPart( thenPart ), elsePart( elsePart ), initialization( initialization ) {}
 
 IfStmt::IfStmt( const IfStmt & other ) :
-	Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {}
+	Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {
+	cloneAll( other.initialization, initialization );
+}
 
 IfStmt::~IfStmt() {
+	deleteAll( initialization );
 	delete condition;
 	delete thenPart;
@@ -139,4 +142,13 @@
 	condition->print( os, indent + 4 );
 
+	if ( !initialization.empty() ) {
+		os << string( indent + 2, ' ' ) << "initialization: \n";
+		for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) {
+			os << string( indent + 4, ' ' );
+			(*it)->print( os, indent + 4 );
+		}
+		os << endl;
+	}
+
 	os << string( indent+2, ' ' ) << "... then: " << endl;
 
@@ -151,6 +163,6 @@
 }
 
-SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_statements ):
-	Statement( _labels ), condition( _condition ), statements( _statements ) {
+SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, std::list<Statement *> &statements ):
+	Statement( labels ), condition( condition ), statements( statements ) {
 }
 
@@ -179,6 +191,6 @@
 }
 
-CaseStmt::CaseStmt( std::list<Label> _labels, Expression *_condition, std::list<Statement *> &_statements, bool deflt ) throw ( SemanticError ) :
-	Statement( _labels ), condition( _condition ), stmts( _statements ), _isDefault( deflt ) {
+CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :
+	Statement( labels ), condition( condition ), stmts( statements ), _isDefault( deflt ) {
 	if ( isDefault() && condition != 0 )
 		throw SemanticError("default with conditions");
@@ -216,6 +228,6 @@
 }
 
-WhileStmt::WhileStmt( std::list<Label> labels, Expression *condition_, Statement *body_, bool isDoWhile_ ):
-	Statement( labels ), condition( condition_), body( body_), isDoWhile( isDoWhile_) {
+WhileStmt::WhileStmt( std::list<Label> labels, Expression *condition, Statement *body, bool isDoWhile ):
+	Statement( labels ), condition( condition), body( body), isDoWhile( isDoWhile) {
 }
 
@@ -238,6 +250,6 @@
 }
 
-ForStmt::ForStmt( std::list<Label> labels, std::list<Statement *> initialization_, Expression *condition_, Expression *increment_, Statement *body_ ):
-	Statement( labels ), initialization( initialization_ ), condition( condition_ ), increment( increment_ ), body( body_ ) {
+ForStmt::ForStmt( std::list<Label> labels, std::list<Statement *> initialization, Expression *condition, Expression *increment, Statement *body ):
+	Statement( labels ), initialization( initialization ), condition( condition ), increment( increment ), body( body ) {
 }
 
@@ -317,6 +329,6 @@
 }
 
-TryStmt::TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &_handlers, FinallyStmt *_finallyBlock ) :
-	Statement( labels ), block( tryBlock ),  handlers( _handlers ), finallyBlock( _finallyBlock ) {
+TryStmt::TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock ) :
+	Statement( labels ), block( tryBlock ),  handlers( handlers ), finallyBlock( finallyBlock ) {
 }
 
@@ -351,6 +363,6 @@
 }
 
-CatchStmt::CatchStmt( std::list<Label> labels, Kind _kind, Declaration *_decl, Expression *_cond, Statement *_body ) :
-	Statement( labels ), kind ( _kind ), decl ( _decl ), cond ( _cond ), body( _body ) {
+CatchStmt::CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl, Expression *cond, Statement *body ) :
+	Statement( labels ), kind ( kind ), decl ( decl ), cond ( cond ), body( body ) {
 }
 
@@ -389,5 +401,5 @@
 
 
-FinallyStmt::FinallyStmt( std::list<Label> labels, CompoundStmt *_block ) : Statement( labels ), block( _block ) {
+FinallyStmt::FinallyStmt( std::list<Label> labels, CompoundStmt *block ) : Statement( labels ), block( block ) {
 	assert( labels.empty() ); // finally statement cannot be labeled
 }
Index: src/SynTree/Statement.h
===================================================================
--- src/SynTree/Statement.h	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/SynTree/Statement.h	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 16 16:28:55 2017
-// Update Count     : 70
+// Last Modified On : Thu Aug 17 15:37:53 2017
+// Update Count     : 72
 //
 
@@ -127,15 +127,15 @@
 class IfStmt : public Statement {
   public:
-	std::list<Statement *> initialization;
 	Expression *condition;
 	Statement *thenPart;
 	Statement *elsePart;
-
-	IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart );
+	std::list<Statement *> initialization;
+
+	IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart,
+			std::list<Statement *> initialization = std::list<Statement *>() );
 	IfStmt( const IfStmt &other );
 	virtual ~IfStmt();
 
 	std::list<Statement *> &get_initialization() { return initialization; }
-	void set_initialization( std::list<Statement *> newValue ) { initialization = newValue; }
 	Expression *get_condition() { return condition; }
 	void set_condition( Expression *newValue ) { condition = newValue; }
@@ -239,5 +239,4 @@
 
 	std::list<Statement *> &get_initialization() { return initialization; }
-	void set_initialization( std::list<Statement *> newValue ) { initialization = newValue; }
 	Expression *get_condition() { return condition; }
 	void set_condition( Expression *newValue ) { condition = newValue; }
Index: src/SynTree/Visitor.cc
===================================================================
--- src/SynTree/Visitor.cc	(revision 936e9f47be7f2533aa23362d452e6b7a2a5c72fa)
+++ src/SynTree/Visitor.cc	(revision 6d49ea3165b7fb8906721da9a6f6949632d35140)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Mon Jul 24 16:30:00 2017
-// Update Count     : 27
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug 17 15:39:38 2017
+// Update Count     : 29
 //
 
@@ -99,4 +99,5 @@
 
 void Visitor::visit( IfStmt *ifStmt ) {
+	acceptAll( ifStmt->get_initialization(), *this );
 	maybeAccept( ifStmt->get_condition(), *this );
 	maybeAccept( ifStmt->get_thenPart(), *this );
