Index: doc/aaron_comp_II/comp_II.tex
===================================================================
--- doc/aaron_comp_II/comp_II.tex	(revision d2f54696c6679b2d8c2baf4a750b424b10e89ac3)
+++ doc/aaron_comp_II/comp_II.tex	(revision 82da9b8065ec7d8d29537c4723a631459218431c)
@@ -37,4 +37,7 @@
 \setlength{\headsep}{0.25in}
 
+\usepackage{caption}
+\usepackage{subcaption}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -62,5 +65,5 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-\newcommand{\bigO}[1]{O\left( #1 \right)}
+\newcommand{\bigO}[1]{O\!\left( #1 \right)}
 
 \begin{document}
@@ -404,25 +407,48 @@
 If cross-argument resolution dependencies cannot be completely eliminated, effective caching strategies to reduce duplicated work between equivalent argument-parameter matches in different combinations may mitigate the asymptotic defecits of the whole-combination matching approach. 
 The final area of investigation is heuristics and algorithmic approaches to reduce the number of argument interpretations considered in the common case; if argument-parameter matches cannot be made independent, even small reductions in $i$ should yield significant reductions in the $i^{p+1}$ resolver runtime factor. 
+
 The discussion below presents a number of largely orthagonal axes for expression resolution algorithm design to be investigated, noting prior work where applicable. 
+Though some of the proposed improvements to the expression resolution algorithm are based on heuristics rather than asymptoticly superior algorithms, it should be noted that user programmers often employ idioms and other programming patterns to reduce the mental burden of producing correct code, and if these patterns can be identified and exploited by the compiler then the significant reduction in expression resolution time for common, idiomatic expressions should result in lower total compilation time even for code including difficult-to-resolve expressions that push the expression resolver to its theoretical worst case.
 
 \subsection{Argument-Parameter Matching}
-The first axis we consider is argument-parameter matching --- whether the type matching for a candidate function to a set of candidate arguments is directed by the argument types or the parameter types. 
-
-\subsubsection{Argument-directed (``Bottom-up'')}
-Baker's algorithm for expression resolution\cite{Baker82} pre-computes argument candidates, from the leaves of the expression tree up.
+The first axis for consideration is argument-parameter matching direction --- whether the type matching for a candidate function to a set of candidate arguments is directed by the argument types or the parameter types. 
+All expression resolution algorithms form a DAG of interpretations, some explicitly, some implicitly; in this DAG, arcs point from function-call interpretations to argument interpretations, as below:
+\begin{figure}[h]
+\centering
+\begin{subfigure}[h]{2in}
+\begin{lstlisting}
+int *p;  // $p_i$
+char *p; // $p_c$ 
+
+double *f(int*, int*); // $f_d$
+char *f(char*, char*); // $f_c$
+
+f( f( p, p ), p );
+\end{lstlisting}
+\end{subfigure}~\begin{subfigure}[h]{2in}
+\includegraphics{resolution_dag}
+\end{subfigure}
+\caption{Resolution DAG for a simple expression. Functions that do not have a valid argument matching are covered with an \textsf{X}.}\label{fig:res_dag}
+\end{figure}
+
+Note that some interpretations may be part of more than one super-interpretation, as with $p_i$ in the bottom row, while some valid subexpression interpretations, like $f_d$ in the middle row, are not used in any interpretation of their containing expression.
+
+\subsubsection{Argument-directed (Bottom-up)}
+Baker's algorithm for expression resolution~\cite{Baker82} pre-computes argument candidates, from the leaves of the expression tree up.
 For each candidate function, Baker attempts to match argument types to parameter types in sequence, failing if any parameter cannot be matched.
 
-Bilson\cite{Bilson03} similarly pre-computes argument candidates in the original \CFA compiler, but then explicitly enumerates all possible argument combinations for a multi-parameter function; these argument combinations are matched to the parameter types of the candidate function as a unit rather than individual arguments.
-This is less efficient than Baker's approach, as the same argument may be compared to the same parameter many times, but allows a more straightforward handling of polymorphic type binding and multiple return types.
-It is possible the efficiency losses here relative to Baker could be significantly reduced by application of memoization to the argument-parameter type comparisons.
-
-\subsubsection{Parameter-directed (``Top-down'')}
-Unlike Baker and Bilson, Cormack's algorithm\cite{Cormack81} requests argument candidates which match the type of each parameter of each candidate function, from the top-level expression down; memoization of these requests is presented as an optimization.
+Bilson~\cite{Bilson03} similarly pre-computes argument candidates in the original \CFA compiler, but then explicitly enumerates all possible argument combinations for a multi-parameter function; these argument combinations are matched to the parameter types of the candidate function as a unit rather than individual arguments.
+This approach is less efficient than Baker's approach, as the same argument may be compared to the same parameter many times, but allows a more straightforward handling of polymorphic type-binding and multiple return-types.
+It is possible the efficiency losses here relative to Baker could be significantly reduced by keeping a memoized cache of argument-parameter type comparisons and reading previously-seen argument-parameter matches from this cache rather than recomputing them.
+
+\subsubsection{Parameter-directed (Top-down)}
+Unlike Baker and Bilson, Cormack's algorithm~\cite{Cormack81} requests argument candidates that match the type of each parameter of each candidate function, from the top-level expression down; memoization of these requests is presented as an optimization.
 As presented, this algorithm requires the result of the expression to have a known type, though an algorithm based on Cormack's could reasonably request a candidate set of any return type, though such a set may be quite large.
 
 \subsubsection{Hybrid}
 This proposal includes the investigation of hybrid top-down/bottom-up argument-parameter matching.
-A reasonable hybrid approach might be to take a top-down approach when the expression to be matched is known to have a fixed type, and a bottom-up approach in untyped contexts.
-This may include switches from one type to another at different levels of the expression tree, for instance:
+A reasonable hybrid approach might take a top-down approach when the expression to be matched has a fixed type, and a bottom-up approach in untyped contexts.
+This approach may involve switching from one type to another at different levels of the expression tree. 
+For instance:
 \begin{lstlisting}
 forall(otype T)
@@ -433,10 +459,13 @@
 int x = f( f( '!' ) );
 \end{lstlisting}
-Here, the outer call to ©f© must have a return type that is (implicitly convertable to) ©int©, so a top-down approach could be used to select \textit{(1)} as the proper interpretation of ©f©. \textit{(1)}'s parameter ©x© here, however, is an unbound type variable, and can thus take a value of any complete type, providing no guidance for the choice of candidate for the inner ©f©. The leaf expression ©'!'©, however, gives us a zero-cost interpretation of the inner ©f© as \textit{(2)}, providing a minimal-cost expression resolution where ©T© is bound to ©void*©.
-
-Deciding when to switch between bottom-up and top-down resolution in a hybrid algorithm is a necessarily heuristic process, and though finding good heuristics for it is an open question, one reasonable approach might be to switch from top-down to bottom-up when the number of candidate functions exceeds some threshold.
+The outer call to ©f© must have a return type that is (implicitly convertable to) ©int©, so a top-down approach is used to select \textit{(1)} as the proper interpretation of ©f©. \textit{(1)}'s parameter ©x©, however, is an unbound type variable, and can thus take a value of any complete type, providing no guidance for the choice of candidate for the inner call to ©f©. The leaf expression ©'!'©, however, determines a zero-cost interpretation of the inner ©f© as \textit{(2)}, providing a minimal-cost expression resolution where ©T© is bound to ©void*©.
+
+Deciding when to switch between bottom-up and top-down resolution to minimize wasted work in a hybrid algorithm is a necessarily heuristic process, and though finding good heuristics for which subexpressions to swich matching strategies on is an open question, one reasonable approach might be to set a threshold $t$ for the number of candidate functions, and to use top-down resolution for any subexpression with fewer than $t$ candidate functions, to minimize the number of unmatchable argument interpretations computed, but to use bottom-up resolution for any subexpression with at least $t$ candidate functions, to reduce duplication in argument interpretation computation between the different candidate functions. 
+
+\subsubsection{Common Subexpression Caching}
+With any of these argument-parameter approaches, it may be a useful optimization to cache the resolution results for common subexpressions; in Figure~\ref{fig:res_dag} this optimization would result in the list of interpretations $[p_c, p_i]$ for ©p© only being calculated once, and re-used for each of the three instances of ©p©.
 
 \subsection{Implicit Conversion Application}
-Baker's\cite{Baker82} and Cormack's\cite{Cormack81} algorithms do not account for implicit conversions\footnote{Baker does briefly comment on an approach for handling implicit conversions.}; both assume that there is at most one valid interpretation of a given expression for each distinct type.
+Baker's and Cormack's algorithms do not account for implicit conversions\footnote{Baker does briefly comment on an approach for handling implicit conversions.}; both assume that there is at most one valid interpretation of a given expression for each distinct type.
 Integrating implicit conversion handling into their algorithms provides some choice of implementation approach. 
 
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision d2f54696c6679b2d8c2baf4a750b424b10e89ac3)
+++ src/Parser/ParseNode.h	(revision 82da9b8065ec7d8d29537c4723a631459218431c)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:28:16 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 10 13:08:46 2016
-// Update Count     : 436
+// Last Modified On : Wed Aug 10 21:51:49 2016
+// Update Count     : 437
 //
 
@@ -415,4 +415,7 @@
 Statement *build_while( ExpressionNode *ctl, StatementNode *stmt, bool kind = false );
 Statement *build_for( ForCtl *forctl, StatementNode *stmt );
+Statement *build_branch( std::string identifier, BranchStmt::Type kind );
+Statement *build_case( ExpressionNode *ctl );
+Statement *build_default();
 
 //##############################################################################
Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision d2f54696c6679b2d8c2baf4a750b424b10e89ac3)
+++ src/Parser/StatementNode.cc	(revision 82da9b8065ec7d8d29537c4723a631459218431c)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 14:59:41 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 10 13:54:21 2016
-// Update Count     : 170
+// Last Modified On : Wed Aug 10 22:08:38 2016
+// Update Count     : 173
 //
 
@@ -224,6 +224,8 @@
 	  case Case:
 		return new CaseStmt( labs, maybeBuild<Expression>(get_control() ), branches );
+		assert( false );
 	  case Default:
 		return new CaseStmt( labs, 0, branches, true );
+		assert( false );
 	  case While:
 		// assert( branches.size() == 1 );
@@ -268,6 +270,8 @@
 	  case Break:
 		return new BranchStmt( labs, get_target(), BranchStmt::Break );
+		assert( false );
 	  case Continue:
 		return new BranchStmt( labs, get_target(), BranchStmt::Continue );
+		assert( false );
 	  case Return:
 	  case Throw :
@@ -314,5 +318,5 @@
 	std::list<Statement *> branches;
 	buildList<Statement, StatementNode>( then_stmt, branches );
-	assert( branches.size() >= 1 );
+	assert( branches.size() == 1 );
 	thenb = branches.front();
 
@@ -320,5 +324,5 @@
 		std::list<Statement *> branches;
 		buildList<Statement, StatementNode>( else_stmt, branches );
-		assert( branches.size() >= 1 );
+		assert( branches.size() == 1 );
 		elseb = branches.front();
 	} // if
@@ -329,6 +333,15 @@
 	std::list<Statement *> branches;
 	buildList<Statement, StatementNode>( stmt, branches );
-	assert( branches.size() >= 1 );
+	assert( branches.size() >= 0 );						// size == 0 for switch (...) {}, i.e., no declaration or statements
 	return new SwitchStmt( noLabels, maybeBuild<Expression>(ctl), branches );
+}
+Statement *build_case( ExpressionNode *ctl ) {
+	std::list<Statement *> branches;
+	buildList<Statement, StatementNode>( nullptr, branches );
+	return new CaseStmt( noLabels, maybeBuild<Expression>(ctl), branches );
+}
+Statement *build_default() {
+	std::list<Statement *> branches;
+	return new CaseStmt( noLabels, nullptr, branches, true );
 }
 
@@ -360,4 +373,8 @@
 	delete forctl;
 	return new ForStmt( noLabels, init, cond, incr, branches.front() );
+}
+
+Statement *build_branch( std::string identifier, BranchStmt::Type kind ) {
+	return new BranchStmt( noLabels, identifier, kind );
 }
 
Index: src/Parser/parser.cc
===================================================================
--- src/Parser/parser.cc	(revision d2f54696c6679b2d8c2baf4a750b424b10e89ac3)
+++ src/Parser/parser.cc	(revision 82da9b8065ec7d8d29537c4723a631459218431c)
@@ -1035,8 +1035,8 @@
      657,   658,   659,   660,   661,   662,   663,   673,   680,   682,
      692,   693,   698,   700,   706,   708,   712,   713,   718,   723,
-     727,   730,   733,   743,   746,   758,   759,   761,   765,   767,
-     771,   772,   777,   778,   782,   787,   788,   792,   794,   800,
-     801,   805,   807,   809,   811,   817,   818,   822,   824,   829,
-     831,   833,   838,   840,   845,   847,   851,   854,   858,   861,
+     726,   728,   730,   740,   742,   753,   754,   756,   760,   762,
+     766,   767,   772,   773,   777,   782,   783,   787,   789,   795,
+     796,   800,   802,   804,   806,   812,   813,   817,   819,   824,
+     826,   828,   833,   835,   840,   843,   847,   851,   856,   860,
      865,   867,   871,   873,   880,   882,   884,   893,   895,   897,
      899,   901,   906,   908,   910,   912,   917,   930,   931,   936,
@@ -5714,5 +5714,5 @@
 
 /* Line 1806 of yacc.c  */
-#line 726 "parser.yy"
+#line 725 "parser.yy"
     { (yyval.sn) = new StatementNode2( build_if( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn), nullptr ) ); }
     break;
@@ -5721,12 +5721,12 @@
 
 /* Line 1806 of yacc.c  */
+#line 727 "parser.yy"
+    { (yyval.sn) = new StatementNode2( build_if( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].sn), (yyvsp[(7) - (7)].sn) ) ); }
+    break;
+
+  case 151:
+
+/* Line 1806 of yacc.c  */
 #line 729 "parser.yy"
-    { (yyval.sn) = new StatementNode2( build_if( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].sn), (yyvsp[(7) - (7)].sn) ) ); }
-    break;
-
-  case 151:
-
-/* Line 1806 of yacc.c  */
-#line 732 "parser.yy"
     { (yyval.sn) = new StatementNode2( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
     break;
@@ -5735,5 +5735,5 @@
 
 /* Line 1806 of yacc.c  */
-#line 734 "parser.yy"
+#line 731 "parser.yy"
     {
 			StatementNode *sw = new StatementNode2( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) );
@@ -5750,5 +5750,5 @@
 
 /* Line 1806 of yacc.c  */
-#line 745 "parser.yy"
+#line 741 "parser.yy"
     { (yyval.sn) = new StatementNode2( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
     break;
@@ -5757,7 +5757,6 @@
 
 /* Line 1806 of yacc.c  */
-#line 747 "parser.yy"
+#line 743 "parser.yy"
     {
-			//StatementNode *sw = new StatementNode( StatementNode::Switch, $3, $8 );
 			StatementNode *sw = new StatementNode2( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) );
 			(yyval.sn) = (yyvsp[(7) - (9)].decl) != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( (yyvsp[(7) - (9)].decl) ))->set_link( sw )) ) : sw;
@@ -5768,5 +5767,5 @@
 
 /* Line 1806 of yacc.c  */
-#line 758 "parser.yy"
+#line 753 "parser.yy"
     { (yyval.en) = (yyvsp[(1) - (1)].en); }
     break;
@@ -5775,12 +5774,12 @@
 
 /* Line 1806 of yacc.c  */
+#line 755 "parser.yy"
+    { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
+    break;
+
+  case 158:
+
+/* Line 1806 of yacc.c  */
 #line 760 "parser.yy"
-    { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
-    break;
-
-  case 158:
-
-/* Line 1806 of yacc.c  */
-#line 765 "parser.yy"
     { (yyval.sn) = new StatementNode( StatementNode::Case, (yyvsp[(1) - (1)].en), 0 ); }
     break;
@@ -5789,19 +5788,19 @@
 
 /* Line 1806 of yacc.c  */
+#line 762 "parser.yy"
+    { (yyval.sn) = (StatementNode *)((yyvsp[(1) - (3)].sn)->set_link( new StatementNode( StatementNode::Case, (yyvsp[(3) - (3)].en), 0 ) ) ); }
+    break;
+
+  case 160:
+
+/* Line 1806 of yacc.c  */
+#line 766 "parser.yy"
+    { (yyval.sn) = (yyvsp[(2) - (3)].sn); }
+    break;
+
+  case 161:
+
+/* Line 1806 of yacc.c  */
 #line 767 "parser.yy"
-    { (yyval.sn) = (StatementNode *)((yyvsp[(1) - (3)].sn)->set_link( new StatementNode( StatementNode::Case, (yyvsp[(3) - (3)].en), 0 ) ) ); }
-    break;
-
-  case 160:
-
-/* Line 1806 of yacc.c  */
-#line 771 "parser.yy"
-    { (yyval.sn) = (yyvsp[(2) - (3)].sn); }
-    break;
-
-  case 161:
-
-/* Line 1806 of yacc.c  */
-#line 772 "parser.yy"
     { (yyval.sn) = new StatementNode( StatementNode::Default ); }
     break;
@@ -5810,5 +5809,5 @@
 
 /* Line 1806 of yacc.c  */
-#line 778 "parser.yy"
+#line 773 "parser.yy"
     { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (2)].sn)->set_link( (yyvsp[(2) - (2)].sn) )); }
     break;
@@ -5817,89 +5816,89 @@
 
 /* Line 1806 of yacc.c  */
+#line 777 "parser.yy"
+    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
+    break;
+
+  case 165:
+
+/* Line 1806 of yacc.c  */
 #line 782 "parser.yy"
+    { (yyval.sn) = 0; }
+    break;
+
+  case 167:
+
+/* Line 1806 of yacc.c  */
+#line 788 "parser.yy"
     { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
     break;
 
-  case 165:
-
-/* Line 1806 of yacc.c  */
-#line 787 "parser.yy"
+  case 168:
+
+/* Line 1806 of yacc.c  */
+#line 790 "parser.yy"
+    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(3) - (3)].sn) ) ) ) ); }
+    break;
+
+  case 169:
+
+/* Line 1806 of yacc.c  */
+#line 795 "parser.yy"
     { (yyval.sn) = 0; }
     break;
 
-  case 167:
-
-/* Line 1806 of yacc.c  */
-#line 793 "parser.yy"
-    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
-    break;
-
-  case 168:
-
-/* Line 1806 of yacc.c  */
-#line 795 "parser.yy"
-    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(3) - (3)].sn) ) ) ) ); }
-    break;
-
-  case 169:
-
-/* Line 1806 of yacc.c  */
-#line 800 "parser.yy"
+  case 171:
+
+/* Line 1806 of yacc.c  */
+#line 801 "parser.yy"
+    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); }
+    break;
+
+  case 172:
+
+/* Line 1806 of yacc.c  */
+#line 803 "parser.yy"
+    { (yyval.sn) = (yyvsp[(1) - (3)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(2) - (3)].sn), *(yyvsp[(3) - (3)].sn) ) ) ) ); }
+    break;
+
+  case 173:
+
+/* Line 1806 of yacc.c  */
+#line 805 "parser.yy"
+    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( (yyvsp[(3) - (3)].sn) ))); }
+    break;
+
+  case 174:
+
+/* Line 1806 of yacc.c  */
+#line 807 "parser.yy"
+    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (4)].sn)->set_link( (yyvsp[(2) - (4)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(3) - (4)].sn), *(yyvsp[(4) - (4)].sn) ) ) ) ) ) ); }
+    break;
+
+  case 175:
+
+/* Line 1806 of yacc.c  */
+#line 812 "parser.yy"
+    { (yyval.sn) = new StatementNode( StatementNode::Break ); }
+    break;
+
+  case 177:
+
+/* Line 1806 of yacc.c  */
+#line 818 "parser.yy"
     { (yyval.sn) = 0; }
     break;
 
-  case 171:
-
-/* Line 1806 of yacc.c  */
-#line 806 "parser.yy"
-    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); }
-    break;
-
-  case 172:
-
-/* Line 1806 of yacc.c  */
-#line 808 "parser.yy"
-    { (yyval.sn) = (yyvsp[(1) - (3)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(2) - (3)].sn), *(yyvsp[(3) - (3)].sn) ) ) ) ); }
-    break;
-
-  case 173:
-
-/* Line 1806 of yacc.c  */
-#line 810 "parser.yy"
-    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( (yyvsp[(3) - (3)].sn) ))); }
-    break;
-
-  case 174:
-
-/* Line 1806 of yacc.c  */
-#line 812 "parser.yy"
-    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (4)].sn)->set_link( (yyvsp[(2) - (4)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(3) - (4)].sn), *(yyvsp[(4) - (4)].sn) ) ) ) ) ) ); }
-    break;
-
-  case 175:
-
-/* Line 1806 of yacc.c  */
-#line 817 "parser.yy"
-    { (yyval.sn) = new StatementNode( StatementNode::Break ); }
-    break;
-
-  case 177:
-
-/* Line 1806 of yacc.c  */
-#line 823 "parser.yy"
+  case 178:
+
+/* Line 1806 of yacc.c  */
+#line 820 "parser.yy"
     { (yyval.sn) = 0; }
     break;
 
-  case 178:
+  case 179:
 
 /* Line 1806 of yacc.c  */
 #line 825 "parser.yy"
-    { (yyval.sn) = 0; }
-    break;
-
-  case 179:
-
-/* Line 1806 of yacc.c  */
-#line 830 "parser.yy"
     { (yyval.sn) = new StatementNode2( build_while( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
     break;
@@ -5908,5 +5907,5 @@
 
 /* Line 1806 of yacc.c  */
-#line 832 "parser.yy"
+#line 827 "parser.yy"
     { (yyval.sn) = new StatementNode2( build_while( (yyvsp[(5) - (7)].en), (yyvsp[(2) - (7)].sn) ) ); }
     break;
@@ -5915,12 +5914,12 @@
 
 /* Line 1806 of yacc.c  */
+#line 829 "parser.yy"
+    { (yyval.sn) = new StatementNode2( build_for( (yyvsp[(4) - (6)].fctl), (yyvsp[(6) - (6)].sn) ) ); }
+    break;
+
+  case 182:
+
+/* Line 1806 of yacc.c  */
 #line 834 "parser.yy"
-    { (yyval.sn) = new StatementNode2( build_for( (yyvsp[(4) - (6)].fctl), (yyvsp[(6) - (6)].sn) ) ); }
-    break;
-
-  case 182:
-
-/* Line 1806 of yacc.c  */
-#line 839 "parser.yy"
     { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].en) ); }
     break;
@@ -5929,5 +5928,5 @@
 
 /* Line 1806 of yacc.c  */
-#line 841 "parser.yy"
+#line 836 "parser.yy"
     { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (4)].decl), (yyvsp[(2) - (4)].en), (yyvsp[(4) - (4)].en) ); }
     break;
@@ -5936,20 +5935,20 @@
 
 /* Line 1806 of yacc.c  */
+#line 842 "parser.yy"
+    { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Goto ) ); }
+    break;
+
+  case 185:
+
+/* Line 1806 of yacc.c  */
 #line 846 "parser.yy"
-    { (yyval.sn) = new StatementNode( StatementNode::Goto, (yyvsp[(2) - (3)].tok) ); }
-    break;
-
-  case 185:
+    { (yyval.sn) = new StatementNode( StatementNode::Goto, (yyvsp[(3) - (4)].en) ); }
+    break;
+
+  case 186:
 
 /* Line 1806 of yacc.c  */
 #line 850 "parser.yy"
-    { (yyval.sn) = new StatementNode( StatementNode::Goto, (yyvsp[(3) - (4)].en) ); }
-    break;
-
-  case 186:
-
-/* Line 1806 of yacc.c  */
-#line 853 "parser.yy"
-    { (yyval.sn) = new StatementNode( StatementNode::Continue ); }
+    { (yyval.sn) = new StatementNode2( build_branch( "", BranchStmt::Continue ) ); }
     break;
 
@@ -5957,6 +5956,6 @@
 
 /* Line 1806 of yacc.c  */
-#line 857 "parser.yy"
-    { (yyval.sn) = new StatementNode( StatementNode::Continue, (yyvsp[(2) - (3)].tok) ); }
+#line 855 "parser.yy"
+    { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Continue ) ); delete (yyvsp[(2) - (3)].tok); }
     break;
 
@@ -5964,6 +5963,6 @@
 
 /* Line 1806 of yacc.c  */
-#line 860 "parser.yy"
-    { (yyval.sn) = new StatementNode( StatementNode::Break ); }
+#line 859 "parser.yy"
+    { (yyval.sn) = new StatementNode2( build_branch( "", BranchStmt::Break ) ); }
     break;
 
@@ -5972,5 +5971,5 @@
 /* Line 1806 of yacc.c  */
 #line 864 "parser.yy"
-    { (yyval.sn) = new StatementNode( StatementNode::Break, (yyvsp[(2) - (3)].tok) ); }
+    { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Break ) ); delete (yyvsp[(2) - (3)].tok); }
     break;
 
@@ -9151,5 +9150,5 @@
 
 /* Line 1806 of yacc.c  */
-#line 9154 "Parser/parser.cc"
+#line 9153 "Parser/parser.cc"
       default: break;
     }
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision d2f54696c6679b2d8c2baf4a750b424b10e89ac3)
+++ src/Parser/parser.yy	(revision 82da9b8065ec7d8d29537c4723a631459218431c)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 10 13:09:53 2016
-// Update Count     : 1844
+// Last Modified On : Wed Aug 10 23:03:05 2016
+// Update Count     : 1846
 //
 
@@ -723,11 +723,8 @@
 	IF '(' comma_expression ')' statement				%prec THEN
 		// explicitly deal with the shift/reduce conflict on if/else
-		//{ $$ = new StatementNode( StatementNode::If, $3, $5 ); }
 		{ $$ = new StatementNode2( build_if( $3, $5, nullptr ) ); }
 	| IF '(' comma_expression ')' statement ELSE statement
-		//{ $$ = new StatementNode( StatementNode::If, $3, (StatementNode *)mkList((*$5, *$7 )) ); }
 		{ $$ = new StatementNode2( build_if( $3, $5, $7 ) ); }
 	| SWITCH '(' comma_expression ')' case_clause		// CFA
-		//{ $$ = new StatementNode( StatementNode::Switch, $3, $5 ); }
 		{ $$ = new StatementNode2( build_switch( $3, $5 ) ); }
 	| SWITCH '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt '}' // CFA
@@ -742,9 +739,7 @@
 		}
 	| CHOOSE '(' comma_expression ')' case_clause		// CFA
-		//{ $$ = new StatementNode( StatementNode::Switch, $3, $5 ); }
 		{ $$ = new StatementNode2( build_switch( $3, $5 ) ); }
 	| CHOOSE '(' comma_expression ')' '{' push declaration_list_opt choose_clause_list_opt '}' // CFA
 		{
-			//StatementNode *sw = new StatementNode( StatementNode::Switch, $3, $8 );
 			StatementNode *sw = new StatementNode2( build_switch( $3, $8 ) );
 			$$ = $7 != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( $7 ))->set_link( sw )) ) : sw;
@@ -844,5 +839,6 @@
 jump_statement:
 	GOTO IDENTIFIER ';'
-		{ $$ = new StatementNode( StatementNode::Goto, $2 ); }
+		//{ $$ = new StatementNode( StatementNode::Goto, $2 ); }
+		{ $$ = new StatementNode2( build_branch( *$2, BranchStmt::Goto ) ); }
 	| GOTO '*' comma_expression ';'						// GCC, computed goto
 		// The syntax for the GCC computed goto violates normal expression precedence, e.g., goto *i+3; => goto *(i+3);
@@ -851,16 +847,20 @@
 	| CONTINUE ';'
 		// A semantic check is required to ensure this statement appears only in the body of an iteration statement.
-		{ $$ = new StatementNode( StatementNode::Continue ); }
+		//{ $$ = new StatementNode( StatementNode::Continue ); }
+		{ $$ = new StatementNode2( build_branch( "", BranchStmt::Continue ) ); }
 	| CONTINUE IDENTIFIER ';'							// CFA, multi-level continue
 		// A semantic check is required to ensure this statement appears only in the body of an iteration statement, and
 		// the target of the transfer appears only at the start of an iteration statement.
-		{ $$ = new StatementNode( StatementNode::Continue, $2 ); }
+		//{ $$ = new StatementNode( StatementNode::Continue, $2 ); }
+		{ $$ = new StatementNode2( build_branch( *$2, BranchStmt::Continue ) ); delete $2; }
 	| BREAK ';'
 		// A semantic check is required to ensure this statement appears only in the body of an iteration statement.
-		{ $$ = new StatementNode( StatementNode::Break ); }
+		//{ $$ = new StatementNode( StatementNode::Break ); }
+		{ $$ = new StatementNode2( build_branch( "", BranchStmt::Break ) ); }
 	| BREAK IDENTIFIER ';'								// CFA, multi-level exit
 		// A semantic check is required to ensure this statement appears only in the body of an iteration statement, and
 		// the target of the transfer appears only at the start of an iteration statement.
-		{ $$ = new StatementNode( StatementNode::Break, $2 ); }
+		//{ $$ = new StatementNode( StatementNode::Break, $2 ); }
+		{ $$ = new StatementNode2( build_branch( *$2, BranchStmt::Break ) ); delete $2; }
 	| RETURN comma_expression_opt ';'
 		{ $$ = new StatementNode( StatementNode::Return, $2, 0 ); }
