Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ src/Makefile.in	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -143,5 +143,5 @@
 	Parser/driver_cfa_cpp-TypeData.$(OBJEXT) \
 	Parser/driver_cfa_cpp-LinkageSpec.$(OBJEXT) \
-	Parser/driver_cfa_cpp-parseutility.$(OBJEXT) \
+	Parser/driver_cfa_cpp-parserutility.$(OBJEXT) \
 	ResolvExpr/driver_cfa_cpp-AlternativeFinder.$(OBJEXT) \
 	ResolvExpr/driver_cfa_cpp-Alternative.$(OBJEXT) \
@@ -405,5 +405,5 @@
 	Parser/ExpressionNode.cc Parser/StatementNode.cc \
 	Parser/InitializerNode.cc Parser/TypeData.cc \
-	Parser/LinkageSpec.cc Parser/parseutility.cc \
+	Parser/LinkageSpec.cc Parser/parserutility.cc \
 	ResolvExpr/AlternativeFinder.cc ResolvExpr/Alternative.cc \
 	ResolvExpr/Unify.cc ResolvExpr/PtrsAssignable.cc \
@@ -438,5 +438,4 @@
 MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \
 	${cfa_cpplib_PROGRAMS}}
-BUILT_SOURCES = Parser/parser.h
 AM_YFLAGS = -d -t -v
 
@@ -449,6 +448,5 @@
 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14
 driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic
-all: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) all-am
+all: all-am
 
 .SUFFIXES:
@@ -663,5 +661,5 @@
 Parser/driver_cfa_cpp-LinkageSpec.$(OBJEXT): Parser/$(am__dirstamp) \
 	Parser/$(DEPDIR)/$(am__dirstamp)
-Parser/driver_cfa_cpp-parseutility.$(OBJEXT): Parser/$(am__dirstamp) \
+Parser/driver_cfa_cpp-parserutility.$(OBJEXT): Parser/$(am__dirstamp) \
 	Parser/$(DEPDIR)/$(am__dirstamp)
 ResolvExpr/$(am__dirstamp):
@@ -882,5 +880,5 @@
 	-rm -f Parser/driver_cfa_cpp-lex.$(OBJEXT)
 	-rm -f Parser/driver_cfa_cpp-parser.$(OBJEXT)
-	-rm -f Parser/driver_cfa_cpp-parseutility.$(OBJEXT)
+	-rm -f Parser/driver_cfa_cpp-parserutility.$(OBJEXT)
 	-rm -f ResolvExpr/driver_cfa_cpp-AdjustExprType.$(OBJEXT)
 	-rm -f ResolvExpr/driver_cfa_cpp-Alternative.$(OBJEXT)
@@ -994,5 +992,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-lex.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-parser.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-parseutility.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Po@am__quote@
@@ -1691,17 +1689,17 @@
 @am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-LinkageSpec.obj `if test -f 'Parser/LinkageSpec.cc'; then $(CYGPATH_W) 'Parser/LinkageSpec.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/LinkageSpec.cc'; fi`
 
-Parser/driver_cfa_cpp-parseutility.o: Parser/parseutility.cc
-@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parseutility.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parseutility.Tpo -c -o Parser/driver_cfa_cpp-parseutility.o `test -f 'Parser/parseutility.cc' || echo '$(srcdir)/'`Parser/parseutility.cc
-@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parseutility.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parseutility.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='Parser/parseutility.cc' object='Parser/driver_cfa_cpp-parseutility.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parseutility.o `test -f 'Parser/parseutility.cc' || echo '$(srcdir)/'`Parser/parseutility.cc
-
-Parser/driver_cfa_cpp-parseutility.obj: Parser/parseutility.cc
-@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parseutility.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parseutility.Tpo -c -o Parser/driver_cfa_cpp-parseutility.obj `if test -f 'Parser/parseutility.cc'; then $(CYGPATH_W) 'Parser/parseutility.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parseutility.cc'; fi`
-@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parseutility.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parseutility.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='Parser/parseutility.cc' object='Parser/driver_cfa_cpp-parseutility.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parseutility.obj `if test -f 'Parser/parseutility.cc'; then $(CYGPATH_W) 'Parser/parseutility.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parseutility.cc'; fi`
+Parser/driver_cfa_cpp-parserutility.o: Parser/parserutility.cc
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parserutility.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo -c -o Parser/driver_cfa_cpp-parserutility.o `test -f 'Parser/parserutility.cc' || echo '$(srcdir)/'`Parser/parserutility.cc
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='Parser/parserutility.cc' object='Parser/driver_cfa_cpp-parserutility.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parserutility.o `test -f 'Parser/parserutility.cc' || echo '$(srcdir)/'`Parser/parserutility.cc
+
+Parser/driver_cfa_cpp-parserutility.obj: Parser/parserutility.cc
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parserutility.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo -c -o Parser/driver_cfa_cpp-parserutility.obj `if test -f 'Parser/parserutility.cc'; then $(CYGPATH_W) 'Parser/parserutility.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parserutility.cc'; fi`
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='Parser/parserutility.cc' object='Parser/driver_cfa_cpp-parserutility.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parserutility.obj `if test -f 'Parser/parserutility.cc'; then $(CYGPATH_W) 'Parser/parserutility.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parserutility.cc'; fi`
 
 ResolvExpr/driver_cfa_cpp-AlternativeFinder.o: ResolvExpr/AlternativeFinder.cc
@@ -2676,6 +2674,5 @@
 	done
 check-am: all-am
-check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
+check: check-am
 all-am: Makefile $(PROGRAMS)
 installdirs:
@@ -2683,6 +2680,5 @@
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
+install: install-am
 install-exec: install-exec-am
 install-data: install-data-am
@@ -2742,5 +2738,4 @@
 	-rm -f Parser/parser.cc
 	-rm -f Parser/parser.h
-	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 clean: clean-am
@@ -2813,5 +2808,5 @@
 uninstall-am: uninstall-cfa_cpplibPROGRAMS
 
-.MAKE: all check install install-am install-strip
+.MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean \
Index: src/Parser/ExpressionNode.cc
===================================================================
--- src/Parser/ExpressionNode.cc	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ src/Parser/ExpressionNode.cc	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:17:07 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Jun 21 16:44:46 2017
-// Update Count     : 541
+// Last Modified On : Wed Jun 28 21:08:15 2017
+// Update Count     : 542
 //
 
@@ -27,5 +27,5 @@
 #include "SynTree/Declaration.h"
 #include "Common/UnimplementedError.h"
-#include "parseutility.h"
+#include "parserutility.h"
 #include "Common/utility.h"
 
Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ src/Parser/StatementNode.cc	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Sat May 16 14:59:41 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Mon Jun 12 13:03:00 2017
-// Update Count     : 329
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Jun 28 21:08:37 2017
+// Update Count     : 330
 //
 
@@ -21,5 +21,5 @@
 #include "SynTree/Statement.h"
 #include "SynTree/Expression.h"
-#include "parseutility.h"
+#include "parserutility.h"
 #include "Common/utility.h"
 
Index: src/Parser/TypedefTable.h
===================================================================
--- src/Parser/TypedefTable.h	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ src/Parser/TypedefTable.h	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 15:24:36 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Aug 15 18:25:04 2016
-// Update Count     : 28
+// Last Modified On : Wed Jun 28 21:06:19 2017
+// Update Count     : 32
 //
 
@@ -22,5 +22,5 @@
 #include <stack>
 
-#include "lex.h"
+#include "parser.hh"
 #include "parser.h"
 
Index: c/Parser/lex.h
===================================================================
--- src/Parser/lex.h	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ 	(revision )
@@ -1,50 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-// 
-// lex.h -- 
-// 
-// Author           : Peter A. Buhr
-// Created On       : Sat Sep 22 08:58:10 2001
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Aug 21 11:28:47 2016
-// Update Count     : 347
-//
-
-#ifndef PARSER_LEX_H
-#define PARSER_LEX_H
-
-int yylex();
-void yyerror( const char * );
-
-#include <string>
-#include "ParseNode.h"
-// External declarations for information sharing between lexer and scanner
-class TypedefTable;
-extern TypedefTable typedefTable;
-
-// current location in the input
-extern int yylineno;
-extern char *yyfilename;
-
-struct Location {
-    char *file;
-    int line;
-}; // Location
-
-struct Token {
-    std::string *str;									// must be pointer as used in union
-    Location loc;
-
-    operator std::string *() { return str; }
-}; // Token
-
-#endif // PARSER_LEX_H
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Parser/lex.ll
===================================================================
--- src/Parser/lex.ll	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ src/Parser/lex.ll	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -10,6 +10,6 @@
  * Created On       : Sat Sep 22 08:58:10 2001
  * Last Modified By : Peter A. Buhr
- * Last Modified On : Tue May 30 22:00:48 2017
- * Update Count     : 527
+ * Last Modified On : Wed Jun 28 21:03:45 2017
+ * Update Count     : 529
  */
 
@@ -27,6 +27,4 @@
 #include <cstdio>										// FILENAME_MAX
 
-#include "lex.h"
-#include "parser.h"										// YACC generated definitions based on C++ grammar
 #include "ParseNode.h"
 #include "TypedefTable.h"
Index: src/Parser/module.mk
===================================================================
--- src/Parser/module.mk	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ src/Parser/module.mk	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -11,9 +11,7 @@
 ## Created On       : Sat May 16 15:29:09 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Tue Aug 16 17:28:34 2016
-## Update Count     : 101
+## Last Modified On : Wed Jun 28 21:09:38 2017
+## Update Count     : 103
 ###############################################################################
-
-BUILT_SOURCES = Parser/parser.h
 
 AM_YFLAGS = -d -t -v
@@ -29,5 +27,5 @@
        Parser/TypeData.cc \
        Parser/LinkageSpec.cc \
-       Parser/parseutility.cc
+       Parser/parserutility.cc
 
 MAINTAINERCLEANFILES += Parser/parser.output
Index: src/Parser/parser.hh
===================================================================
--- src/Parser/parser.hh	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
+++ src/Parser/parser.hh	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -0,0 +1,50 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// lex.h -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Sat Sep 22 08:58:10 2001
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun Aug 21 11:28:47 2016
+// Update Count     : 347
+//
+
+#ifndef PARSER_LEX_H
+#define PARSER_LEX_H
+
+int yylex();
+void yyerror( const char * );
+
+#include <string>
+#include "ParseNode.h"
+// External declarations for information sharing between lexer and scanner
+class TypedefTable;
+extern TypedefTable typedefTable;
+
+// current location in the input
+extern int yylineno;
+extern char *yyfilename;
+
+struct Location {
+    char *file;
+    int line;
+}; // Location
+
+struct Token {
+    std::string *str;									// must be pointer as used in union
+    Location loc;
+
+    operator std::string *() { return str; }
+}; // Token
+
+#endif // PARSER_LEX_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ src/Parser/parser.yy	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jun 12 12:59:00 2017
-// Update Count     : 2402
+// Last Modified On : Wed Jun 28 21:00:57 2017
+// Update Count     : 2413
 //
 
@@ -48,6 +48,4 @@
 #include <cstdio>
 #include <stack>
-#include "lex.h"
-#include "parser.h"
 #include "ParseNode.h"
 #include "TypedefTable.h"
@@ -88,4 +86,23 @@
 bool forall = false;									// aggregate have one or more forall qualifiers ?
 %}
+
+// Types declaration
+%union
+{
+	Token tok;
+	ParseNode * pn;
+	ExpressionNode * en;
+	DeclarationNode * decl;
+	DeclarationNode::Aggregate aggKey;
+	DeclarationNode::TypeClass tclass;
+	StatementNode * sn;
+	ConstantExpr * constant;
+	ForCtl * fctl;
+	LabelNode * label;
+	InitializerNode * in;
+	OperKinds op;
+	std::string * str;
+	bool flag;
+}
 
 //************************* TERMINAL TOKENS ********************************
@@ -139,23 +156,4 @@
 
 %token ATassign											// @=
-
-// Types declaration
-%union
-{
-	Token tok;
-	ParseNode * pn;
-	ExpressionNode * en;
-	DeclarationNode * decl;
-	DeclarationNode::Aggregate aggKey;
-	DeclarationNode::TypeClass tclass;
-	StatementNode * sn;
-	ConstantExpr * constant;
-	ForCtl * fctl;
-	LabelNode * label;
-	InitializerNode * in;
-	OperKinds op;
-	std::string * str;
-	bool flag;
-}
 
 %type<tok> identifier  no_attr_identifier  zero_one
@@ -959,5 +957,11 @@
 
 handler_clause:
-	CATCH '(' push push exception_declaration pop ')' compound_statement pop
+	// TEMPORARY, TEST EXCEPTIONS
+	CATCH '(' push push INTEGERconstant pop ')' compound_statement pop
+		{ $$ = new StatementNode( build_catch( CatchStmt::Terminate, nullptr, new ExpressionNode( build_constantInteger( *$5 ) ), $8 ) ); }
+	| handler_clause CATCH '(' push push INTEGERconstant pop ')' compound_statement pop
+		{ $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( CatchStmt::Terminate, nullptr, new ExpressionNode( build_constantInteger( *$6 ) ), $9 ) ) ); }
+
+	| CATCH '(' push push exception_declaration pop ')' compound_statement pop
 		{ $$ = new StatementNode( build_catch( CatchStmt::Terminate, $5, nullptr, $8 ) ); }
 	| handler_clause CATCH '(' push push exception_declaration pop ')' compound_statement pop
Index: src/Parser/parserutility.cc
===================================================================
--- src/Parser/parserutility.cc	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
+++ src/Parser/parserutility.cc	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -0,0 +1,36 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// parseutility.cc --
+//
+// Author           : Rodolfo G. Esteves
+// Created On       : Sat May 16 15:30:39 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Jun 28 21:08:59 2017
+// Update Count     : 6
+//
+
+#include "parserutility.h"
+#include "SynTree/Type.h"
+#include "SynTree/Expression.h"
+
+// rewrite
+//    if ( x ) ...
+// as
+//    if ( (int)(x != 0) ) ...
+
+Expression *notZeroExpr( Expression *orig ) {
+	UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) );
+	comparison->get_args().push_back( orig );
+	comparison->get_args().push_back( new ConstantExpr( Constant( new ZeroType( emptyQualifiers ), "0", (unsigned long long int)0 ) ) );
+	return new CastExpr( comparison, new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/Parser/parserutility.h
===================================================================
--- src/Parser/parserutility.h	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
+++ src/Parser/parserutility.h	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -0,0 +1,29 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// parseutility.h -- 
+//
+// Author           : Rodolfo G. Esteves
+// Created On       : Sat May 16 15:31:46 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 16 15:32:58 2015
+// Update Count     : 2
+//
+
+#ifndef PARSEUTILITY_H
+#define PARSEUTILITY_H
+
+#include "SynTree/SynTree.h"
+
+Expression *notZeroExpr( Expression *orig );
+
+#endif // PARSEUTILITY_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: c/Parser/parseutility.cc
===================================================================
--- src/Parser/parseutility.cc	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ 	(revision )
@@ -1,36 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// parseutility.cc --
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Sat May 16 15:30:39 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Jun 21 15:33:41 2017
-// Update Count     : 5
-//
-
-#include "parseutility.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-
-// rewrite
-//    if ( x ) ...
-// as
-//    if ( (int)(x != 0) ) ...
-
-Expression *notZeroExpr( Expression *orig ) {
-	UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) );
-	comparison->get_args().push_back( orig );
-	comparison->get_args().push_back( new ConstantExpr( Constant( new ZeroType( emptyQualifiers ), "0", (unsigned long long int)0 ) ) );
-	return new CastExpr( comparison, new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: c/Parser/parseutility.h
===================================================================
--- src/Parser/parseutility.h	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ 	(revision )
@@ -1,29 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// parseutility.h -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Sat May 16 15:31:46 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat May 16 15:32:58 2015
-// Update Count     : 2
-//
-
-#ifndef PARSEUTILITY_H
-#define PARSEUTILITY_H
-
-#include "SynTree/SynTree.h"
-
-Expression *notZeroExpr( Expression *orig );
-
-#endif // PARSEUTILITY_H
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/main.cc
===================================================================
--- src/main.cc	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ src/main.cc	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -10,7 +10,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Fri May 15 23:12:02 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Wed Jun 28 15:34:00 2017
-// Update Count     : 438
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Jun 28 21:07:30 2017
+// Update Count     : 439
 //
 
@@ -25,5 +25,5 @@
 using namespace std;
 
-#include "Parser/lex.h"
+#include "Parser/parser.hh"
 #include "Parser/parser.h"
 #include "Parser/TypedefTable.h"
Index: ols/prettyprinter/lex.l
===================================================================
--- tools/prettyprinter/lex.l	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ 	(revision )
@@ -1,169 +1,0 @@
-/*                               -*- Mode: C -*- 
- * 
- * Pretty Printer Lexer, Copyright (C) Rodolfo Gabriel Esteves and Peter A. Buhr 2001
- *      Permission is granted to copy this grammar and to use it within software systems.
- *      THIS GRAMMAR IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
- * 
- * lex.l -- 
- * 
- * Author           : Rodolfo Gabriel Esteves
- * Created On       : Sat Dec 15 11:45:59 2001
- * Last Modified By : Peter A. Buhr
- * Last Modified On : Mon Apr  8 15:48:24 2002
- * Update Count     : 245
- */
-
-%option stack
-%option yylineno
-
-%{
-#include <list>
-#include <string>
-#include <iostream>
-
-#include "parse.h" 
-#include "yacc.tab.h" 
-
-#define RETURN_TOKEN( kind ) yylval.tokenp = new Token( yytext, ws_list, kind ); return kind;
-
-list<string> ws_list;
-string comment_str;
-string code_str;
-%}
-
-integer [0-9]+
-identifier [a-zA-Z_$][0-9a-zA-Z_$]*
-
-simple_escape ['"?\\]
-escape_sequence [\\]{simple_escape}
-c_char [^'\\\n]|{escape_sequence}
-s_char [^"\\\n]|{escape_sequence}
-
-%x C_COMMENT STR C_CODE
-
-/* ---------------------------- Token Section ---------------------------- */
-%%
-<INITIAL,C_CODE>"/*"	{				/* C style comments */
-			#if defined(DEBUG_ALL) | defined(DEBUG_COMMENT)
-    			    cerr << "\"/*\" : " << yytext << endl;
-			#endif
-			    if ( YYSTATE == C_CODE ) code_str += yytext;
-			    else comment_str += yytext;
-			    yy_push_state(C_COMMENT);
-			}
-<C_COMMENT>(.|"\n")	{				/* C style comments */
-			#if defined(DEBUG_ALL) | defined(DEBUG_COMMENT)
-    			    cerr << "<C_COMMENT>(.|\\n) : " << yytext << endl;
-			#endif
-			    if ( yy_top_state() == C_CODE ) code_str += yytext;
-			    else comment_str += yytext;
-			}
-<C_COMMENT>"*/"		{				/* C style comments */
-			#if defined(DEBUG_ALL) | defined(DEBUG_COMMENT)
-    			    cerr << "<C_COMMENT>\"*/\" : " << yytext << endl;
-			#endif
-			    if ( yy_top_state() == C_CODE ) code_str += yytext;
-			    else {
-				comment_str += yytext;
-				//cerr << "C COMMENT : " << endl << comment_str << endl;
-				ws_list.push_back( comment_str );
-				comment_str = "";
-			    }
-			    yy_pop_state();
-			}
-<INITIAL,C_CODE>"//"[^\n]*"\n" {			/* C++ style comments */
-			#if defined(DEBUG_ALL) | defined(DEBUG_COMMENT)
-    			    cerr << "\"//\"[^\\n]*\"\n\" : " << yytext << endl;
-			#endif
-			    if ( YYSTATE == C_CODE ) code_str += yytext;
-			    else {
-				comment_str += yytext;
-				//cerr << "C++ COMMENT : " << endl << comment_str << endl;
-				ws_list.push_back( comment_str );
-				comment_str = "";
-			    }
-			}
-
-";"			{ RETURN_TOKEN( ';' ) }
-":"			{ RETURN_TOKEN( ':' ) }
-"|"			{ RETURN_TOKEN( '|' ) }
-","			{ RETURN_TOKEN( ',' ) }
-"<"			{ RETURN_TOKEN( '<' ) }
-">"			{ RETURN_TOKEN( '>' ) }
-
-[[:space:]]+		{				/* [ \t\n]+ */
-			    ws_list.push_back( yytext );
-			    //cerr << "WS : " << "\"" << yytext << "\"" << endl;
-			}
-
-<INITIAL>"{"		{ RETURN_TOKEN( '{' ) }
-<INITIAL>"}"		{ RETURN_TOKEN( '}' ) }
-<C_CODE>"{"		{
-			#if defined(DEBUG_ALL) | defined(DEBUG_C)
-			    cerr << "<C_CODE>. : " << yytext << endl;
-			#endif
-			    code_str += yytext;
-			    RETURN_TOKEN( '{' )
-			}
-<C_CODE>"}"		{
-			#if defined(DEBUG_ALL) | defined(DEBUG_C)
-			    cerr << "<C_CODE>. : " << yytext << endl;
-			#endif
-			    code_str += yytext;
-			    RETURN_TOKEN( '}' )
-			}
-
-"%%"			{ RETURN_TOKEN( MARK ) }
-"%{"			{ RETURN_TOKEN( LCURL ) }
-<C_CODE>"%}"		{ RETURN_TOKEN( RCURL ) }
-
-^"%union"       	{ RETURN_TOKEN( UNION ) }
-^"%start"       	{ RETURN_TOKEN( START ) }
-^"%token"       	{ RETURN_TOKEN( TOKEN ) }
-^"%type"	       	{ RETURN_TOKEN( TYPE ) }
-^"%left"	       	{ RETURN_TOKEN( LEFT ) }
-^"%right"	       	{ RETURN_TOKEN( RIGHT ) }
-^"%nonassoc"    	{ RETURN_TOKEN( NONASSOC ) }
-^"%pure_parser"    	{ RETURN_TOKEN( PURE_PARSER ) }
-^"%semantic_parser"    	{ RETURN_TOKEN( SEMANTIC_PARSER ) }
-^"%expect"  	  	{ RETURN_TOKEN( EXPECT ) }
-^"%thong" 	   	{ RETURN_TOKEN( THONG ) }
-
-"%prec" 	   	{ RETURN_TOKEN( PREC ) }
-
-{integer}	    	{ RETURN_TOKEN( INTEGER ); }
-[']{c_char}[']    	{ RETURN_TOKEN( CHARACTER ); }
-{identifier}    	{ RETURN_TOKEN( IDENTIFIER ); }
-
-<C_CODE>["]{s_char}*["]	{				/* hide braces "{}" in strings */
-			#if defined(DEBUG_ALL) | defined(DEBUG_C)
-			    cerr << "<C_CODE>. : " << yytext << endl;
-			#endif
-			    code_str += yytext;
-			}
-
-<C_CODE>(.|\n)		{				/* must be last rule of C_CODE */
-			#if defined(DEBUG_ALL) | defined(DEBUG_C)
-			    cerr << "<C_CODE>. : " << yytext << endl;
-			#endif
-			    code_str += yytext;
-			}
-
-.			{ printf("UNKNOWN CHARACTER:%s\n", yytext); } /* unknown characters */
-%%
-void lexC(void) {
-    BEGIN(C_CODE);
-}
-
-string lexYacc(void) {
-    BEGIN(INITIAL);
-    //cerr << "CODE: " << endl << code_str << endl;
-    string temp( code_str );
-    code_str = "";
-    return temp;
-}
-
-/* Local Variables: */
-/* fill-column: 100 */
-/* compile-command: "gmake" */
-/* End: */
Index: tools/prettyprinter/lex.ll
===================================================================
--- tools/prettyprinter/lex.ll	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
+++ tools/prettyprinter/lex.ll	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -0,0 +1,169 @@
+/*                               -*- Mode: C -*- 
+ * 
+ * Pretty Printer Lexer, Copyright (C) Rodolfo Gabriel Esteves and Peter A. Buhr 2001
+ *      Permission is granted to copy this grammar and to use it within software systems.
+ *      THIS GRAMMAR IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
+ * 
+ * lex.l -- 
+ * 
+ * Author           : Rodolfo Gabriel Esteves
+ * Created On       : Sat Dec 15 11:45:59 2001
+ * Last Modified By : Peter A. Buhr
+ * Last Modified On : Mon Apr  8 15:48:24 2002
+ * Update Count     : 245
+ */
+
+%option stack
+%option yylineno
+
+%{
+#include <list>
+#include <string>
+#include <iostream>
+
+#include "parse.h" 
+#include "yacc.tab.h" 
+
+#define RETURN_TOKEN( kind ) yylval.tokenp = new Token( yytext, ws_list, kind ); return kind;
+
+list<string> ws_list;
+string comment_str;
+string code_str;
+%}
+
+integer [0-9]+
+identifier [a-zA-Z_$][0-9a-zA-Z_$]*
+
+simple_escape ['"?\\]
+escape_sequence [\\]{simple_escape}
+c_char [^'\\\n]|{escape_sequence}
+s_char [^"\\\n]|{escape_sequence}
+
+%x C_COMMENT STR C_CODE
+
+/* ---------------------------- Token Section ---------------------------- */
+%%
+<INITIAL,C_CODE>"/*"	{				/* C style comments */
+			#if defined(DEBUG_ALL) | defined(DEBUG_COMMENT)
+    			    cerr << "\"/*\" : " << yytext << endl;
+			#endif
+			    if ( YYSTATE == C_CODE ) code_str += yytext;
+			    else comment_str += yytext;
+			    yy_push_state(C_COMMENT);
+			}
+<C_COMMENT>(.|"\n")	{				/* C style comments */
+			#if defined(DEBUG_ALL) | defined(DEBUG_COMMENT)
+    			    cerr << "<C_COMMENT>(.|\\n) : " << yytext << endl;
+			#endif
+			    if ( yy_top_state() == C_CODE ) code_str += yytext;
+			    else comment_str += yytext;
+			}
+<C_COMMENT>"*/"		{				/* C style comments */
+			#if defined(DEBUG_ALL) | defined(DEBUG_COMMENT)
+    			    cerr << "<C_COMMENT>\"*/\" : " << yytext << endl;
+			#endif
+			    if ( yy_top_state() == C_CODE ) code_str += yytext;
+			    else {
+				comment_str += yytext;
+				//cerr << "C COMMENT : " << endl << comment_str << endl;
+				ws_list.push_back( comment_str );
+				comment_str = "";
+			    }
+			    yy_pop_state();
+			}
+<INITIAL,C_CODE>"//"[^\n]*"\n" {			/* C++ style comments */
+			#if defined(DEBUG_ALL) | defined(DEBUG_COMMENT)
+    			    cerr << "\"//\"[^\\n]*\"\n\" : " << yytext << endl;
+			#endif
+			    if ( YYSTATE == C_CODE ) code_str += yytext;
+			    else {
+				comment_str += yytext;
+				//cerr << "C++ COMMENT : " << endl << comment_str << endl;
+				ws_list.push_back( comment_str );
+				comment_str = "";
+			    }
+			}
+
+";"			{ RETURN_TOKEN( ';' ) }
+":"			{ RETURN_TOKEN( ':' ) }
+"|"			{ RETURN_TOKEN( '|' ) }
+","			{ RETURN_TOKEN( ',' ) }
+"<"			{ RETURN_TOKEN( '<' ) }
+">"			{ RETURN_TOKEN( '>' ) }
+
+[[:space:]]+		{				/* [ \t\n]+ */
+			    ws_list.push_back( yytext );
+			    //cerr << "WS : " << "\"" << yytext << "\"" << endl;
+			}
+
+<INITIAL>"{"		{ RETURN_TOKEN( '{' ) }
+<INITIAL>"}"		{ RETURN_TOKEN( '}' ) }
+<C_CODE>"{"		{
+			#if defined(DEBUG_ALL) | defined(DEBUG_C)
+			    cerr << "<C_CODE>. : " << yytext << endl;
+			#endif
+			    code_str += yytext;
+			    RETURN_TOKEN( '{' )
+			}
+<C_CODE>"}"		{
+			#if defined(DEBUG_ALL) | defined(DEBUG_C)
+			    cerr << "<C_CODE>. : " << yytext << endl;
+			#endif
+			    code_str += yytext;
+			    RETURN_TOKEN( '}' )
+			}
+
+"%%"			{ RETURN_TOKEN( MARK ) }
+"%{"			{ RETURN_TOKEN( LCURL ) }
+<C_CODE>"%}"		{ RETURN_TOKEN( RCURL ) }
+
+^"%union"       	{ RETURN_TOKEN( UNION ) }
+^"%start"       	{ RETURN_TOKEN( START ) }
+^"%token"       	{ RETURN_TOKEN( TOKEN ) }
+^"%type"	       	{ RETURN_TOKEN( TYPE ) }
+^"%left"	       	{ RETURN_TOKEN( LEFT ) }
+^"%right"	       	{ RETURN_TOKEN( RIGHT ) }
+^"%nonassoc"    	{ RETURN_TOKEN( NONASSOC ) }
+^"%pure_parser"    	{ RETURN_TOKEN( PURE_PARSER ) }
+^"%semantic_parser"    	{ RETURN_TOKEN( SEMANTIC_PARSER ) }
+^"%expect"  	  	{ RETURN_TOKEN( EXPECT ) }
+^"%thong" 	   	{ RETURN_TOKEN( THONG ) }
+
+"%prec" 	   	{ RETURN_TOKEN( PREC ) }
+
+{integer}	    	{ RETURN_TOKEN( INTEGER ); }
+[']{c_char}[']    	{ RETURN_TOKEN( CHARACTER ); }
+{identifier}    	{ RETURN_TOKEN( IDENTIFIER ); }
+
+<C_CODE>["]{s_char}*["]	{				/* hide braces "{}" in strings */
+			#if defined(DEBUG_ALL) | defined(DEBUG_C)
+			    cerr << "<C_CODE>. : " << yytext << endl;
+			#endif
+			    code_str += yytext;
+			}
+
+<C_CODE>(.|\n)		{				/* must be last rule of C_CODE */
+			#if defined(DEBUG_ALL) | defined(DEBUG_C)
+			    cerr << "<C_CODE>. : " << yytext << endl;
+			#endif
+			    code_str += yytext;
+			}
+
+.			{ printf("UNKNOWN CHARACTER:%s\n", yytext); } /* unknown characters */
+%%
+void lexC(void) {
+    BEGIN(C_CODE);
+}
+
+string lexYacc(void) {
+    BEGIN(INITIAL);
+    //cerr << "CODE: " << endl << code_str << endl;
+    string temp( code_str );
+    code_str = "";
+    return temp;
+}
+
+/* Local Variables: */
+/* fill-column: 100 */
+/* compile-command: "gmake" */
+/* End: */
Index: ols/prettyprinter/yacc.y
===================================================================
--- tools/prettyprinter/yacc.y	(revision fa4805fa298698201db6b7292ed9cb1cc00af9ef)
+++ 	(revision )
@@ -1,481 +1,0 @@
-/*                               -*- Mode: C -*- 
- * 
- *  Pretty Printer, Copyright (C) Rodolfo G. Esteves and Peter A. Buhr 2001
- *      Permission is granted to copy this grammar and to use it within software systems.
- *      THIS GRAMMAR IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
- * 
- * yacc.y -- 
- * 
- * Author           : Rodolfo G. Esteves
- * Created On       : Sat Dec 15 13:44:21 2001
- * Last Modified By : Peter A. Buhr
- * Last Modified On : Mon Jun 27 21:51:06 2016
- * Update Count     : 1028
- */
-
-%{
-#include <stdio.h>
-#include "parse.h"
-#include "filter.h"
-
-#define YYDEBUG 1			// get the pretty debugging code to compile
-
-extern list<string> ws_list;		// lex variable containing accumulated whitespace
-void lexC( void );
-string lexYacc( void );
-
-void yyerror( char *s ) {
-    extern int yylineno;
-
-    cerr << "Error in line: " << yylineno << ": " << s << endl;
-    return;
-}
-
-Token *declstart;
-Token *rulestart;
-Token *nameliststart;
-%}
-
-%union {
-    Token *tokenp;
-}
-
-%token<tokenp>	','
-%token<tokenp>	'<'
-%token<tokenp>	'>'
-%token<tokenp>	'{'
-%token<tokenp>	'}'
-%token<tokenp>	':'
-%token<tokenp>	';'
-%token<tokenp>	'|'
-
-%token<tokenp>	MARK			// %%
-%token<tokenp>	LCURL			// %{
-%token<tokenp>	RCURL			// %}
-
-%token<tokenp>	INTEGER			// integer constant
-%token<tokenp>	CHARACTER		// character constant
-%token<tokenp>	IDENTIFIER		// identifier
-%token<tokenp>	CODE			// C code
-
-%token<tokenp>	START			// %start
-%token<tokenp>	UNION			// %union
-%token<tokenp>	TOKEN			// %token
-%token<tokenp>	LEFT			// %left
-%token<tokenp>	RIGHT			// %right
-%token<tokenp>	NONASSOC		// %nonassoc
-%token<tokenp>	TYPE			// %type
-%token<tokenp>	PURE_PARSER		// %pure_parser
-%token<tokenp>	SEMANTIC_PARSER		// %semantic_parser
-%token<tokenp>	EXPECT			// %expect
-%token<tokenp>	THONG			// %thong
-
-%token<tokenp>	PREC			// %prec
-
-%token		END_TERMINALS		// ALL TERMINAL TOKEN NAMES MUST APPEAR BEFORE THIS
-
-%type<tokenp>	sections
-%token		_SECTIONS
-%type<tokenp>	mark
-%type<tokenp>	defsection_opt
-%token		_DEFSECTION_OPT
-%type<tokenp>	declarations
-%type<tokenp>	literalblock
-%token		_LITERALBLOCK
-%type<tokenp>	declaration
-%token		_DECLARATION
-%type<tokenp>	union
-%type<tokenp>	rword
-%type<tokenp>	tag_opt
-%token		_TAG_OPT
-%type<tokenp>	namenolist
-%token		_NAMENOLIST
-%type<tokenp>	nameno
-%token		_NAMENO
-%type<tokenp>	namelist
-%token		_NAMELIST
-%type<tokenp>	name
-%type<tokenp>	rulesection
-%token		_RULESECTION
-%type<tokenp>	rules
-%token		_RULE
-%type<tokenp>	lhs
-%token		_LHS
-%type<tokenp>	rhs
-%token		_RHS
-%type<tokenp>	prod
-%type<tokenp>	prec
-%token		_PREC
-%type<tokenp>	action
-%token		_ACTION
-%type<tokenp>	usersection_opt
-%token		_USERSECTION_OPT
-%type<tokenp>	ccode_opt
-%type<tokenp>	blocks
-
-%start grammar
-
-%%
-grammar		: sections
-			{
-			    filter( $1 );		/* filter parse tree */
-			    freeTree( $1 );		/* free parse-tree storage (optional: used with purify) */
-			}
-		;
-
-sections	: defsection_opt mark rulesection usersection_opt
-			{
-			    $$ = new Token( "sections", _SECTIONS );
-			    $1->left = $2;
-			    $2->left = $3;
-			    $3->left = $4;
-			    $$->down = $1;
-			}
-		;
-
-mark		: MARK
-		| error					/* missing %% */
-			{
-			    cerr << "no input grammar, missing %% mark" << endl;
-			    exit( -1 );
-			}
-		;
-
-defsection_opt	: /* empty */
-			{
-			    //cerr << "defsection_opt1: " << endl;
-			    $$ = new Token( "declaration_opt", _DEFSECTION_OPT );
-			}
-		| declarations
-			{
-			    //cerr << "defsection_opt2: " << $1->text << "(" << $1 << ")" << endl;
-			    $$ = new Token( "declaration_opt", _DEFSECTION_OPT );
-			    $$->down = declstart;
-			}
-		;
-
-declarations	: literalblock
-			{
-			    //cerr << "declarations1: " << $1->text << "(" << $1 << ")" << endl;
-			    $$ = declstart = $1;
-			}
-		| declaration
-			{
-			    //cerr << "declarations2: " << $1->text << "(" << $1 << ")" << endl;
-			    $$ = declstart = new Token( "declaration", _DECLARATION );
-			    $$->down = $1;
-			}
-		| declarations literalblock
-			{
-			    //cerr << "declarations3: "<< $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $1->left = $2;
-			    $$ = $2;
-			}
-		| declarations declaration
-			{
-			    //cerr << "declarations4: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $$ = new Token( "declaration", _DECLARATION );
-			    $1->left = $$;
-			    $$->down = $2;
-			}
-		;
-
-literalblock	: LCURL
-			{ lexC(); }
-		  ccode_opt
-			{ $<tokenp>$ = new Token( lexYacc(), CODE ); }
-		  RCURL
-			{
-			    //cerr << "literalblock: " << $1->text << "(" << $1 << ") " << $<tokenp>4->text << " " << $5->text << "(" << $5 << ")" << endl;
-			    $1->left = $<tokenp>4;
-			    $<tokenp>4->left = $5;
-			    $$ = new Token( "literalblock", _LITERALBLOCK );
-			    $$->down = $1;
-			}
-		;
-
-declaration	: union
-		| START IDENTIFIER
-			{
-			    $1->left = $2;
-			    $$ = $1;
-			}
-                | rword tag_opt namenolist
-			{
-			    Token *n = new Token( "namenolist", _NAMENOLIST );
-			    n->down = nameliststart;
-			    $1->left = $2;
-			    $2->left = n;
-			    $$ = $1;
-			}
-		| TYPE tag_opt namelist
-			{
-			    Token *n = new Token( "namelist", _NAMELIST );
-			    n->down = nameliststart;
-			    $1->left = $2;
-			    $2->left = n;
-			    $$ = $1;
-			}
-                | PURE_PARSER
-		| SEMANTIC_PARSER
-                | EXPECT INTEGER			/* bison */
-			{
-			    $1->left = $2;
-			    $$ = $1;
-			}
-                | THONG					/* bison */
-		;
-
-union		: UNION
-		  '{'
-			{ lexC(); }
-		  ccode_opt
-			{
-			    // Remove the trailing '}' which is added in lex.
-			    string temp( lexYacc() );
-			    $<tokenp>$ = new Token( temp.substr( 0, temp.length() - 1 ), CODE );
-			}
-		  '}'
-			{
-			    $1->left = $2;
-			    $2->left = $<tokenp>5;
-			    $<tokenp>5->left = $6;
-			    $$ = $1;
-			}
-		;
-
-rword		: TOKEN
-		| LEFT
-		| RIGHT
-		| NONASSOC
-		;
-
-tag_opt		: /* empty */
-			{
-			    //cerr << "tag_opt" << endl;
-			    $$ = new Token( "tag_opt", _TAG_OPT );
-			}
-		| '<' IDENTIFIER '>'
-			{
-			    $1->left = $2;
-			    $2->left = $3;
-			    $$ = new Token( "tag_opt", _TAG_OPT );
-			    $$->down = $1;
-			}
-		;
-
-namenolist	: nameno
-			{
-			    //cerr << "namenolist1: " << $1->text << "(" << $1 << ")" << endl;
-			    $$ = nameliststart = $1;
-			}
-		| namenolist nameno
-			{
-			    //cerr << "namenolist2: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $1->left = $2;
-			    $$ = $2;
-			}
-		| namenolist ',' nameno
-			{
-			    //cerr << "namenolist3: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ") " << $3->text << "(" << $3 << ")" << endl;
-			    $1->left = $2;
-			    $2->left = $3;
-			    $$ = $3;
-			}
-		;
-
-nameno		: name
-			{
-			    $$ = new Token( "nameno", _NAMENO );
-			    $$->down = $1;
-			}
-		| name INTEGER
-			{
-			    $$ = new Token( "nameno", _NAMENO );
-			    $1->left = $2;
-			    $$->down = $1;
-			}
-		;
-
-namelist	: name
-			{
-			    //cerr << "namelist1: " << $1->text << "(" << $1 << ")" << endl;
-			    $$ = nameliststart = $1;
-			}
-		| namelist name
-			{
-			    //cerr << "namelist2: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $1->left = $2;
-			    $$ = $2;
-			}
-		| namelist ',' name
-			{
-			    //cerr << "namelist3: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ") " << $3->text << "(" << $3 << ")" << endl;
-			    $1->left = $2;
-			    $2->left = $3;
-			    $$ = $3;
-			}
-		;
-
-name		: IDENTIFIER
-		| CHARACTER
-		;
-
-rulesection	: rules
-			{
-			    //cerr << "rulesection1: " << $1->text << "(" << $1 << ")" << endl;
-			    $$ = new Token( "rulesection", _RULESECTION );
-			    $$->down = $1;
-			}
-		| error					/* no rules */
-			{
-			    cerr << "no rules in the input grammar" << endl;
-			    exit( -1 );
-			}
-		;
-
-// These grammar rules are complex because the Yacc language is LR(2) due to the optional ';' at the end of
-// rules. The following rules convert the LR(2) grammar into LR(1) by lengthening the rules to allow
-// sufficient look ahead. Unfortunately, this change makes handling the semantic actions more complex because
-// there are two lists (rules, rhs) being built but only one list tail can be returned through $$ for
-// chaining.
-
-rules		: lhs rhs
-			{
-			    //cerr << "rules1: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $$ = rulestart;
-			}
-		| lhs rhs ';'
-			{
-			    //cerr << "rules2: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ") " << $3->text << "(" << $3 << ")" << endl;
-			    $2->addDownLeftTail( $3 );
-			    $$ = rulestart;
-			}
-		;
-
-lhs		: IDENTIFIER ':'
-			{
-			    //cerr << "lhs: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $$ = new Token( "lhs", _LHS );
-			    //cerr << " lhs: "  << $$->text << "(" << $$ << ")" << endl;
-			    $1->left = $2;
-			    $$->down = $1;
-			}
-		;
-
-rhs		: /* empty */
-			{
-			    //cerr << "rhs1: " << $<tokenp>0->text << "(" << $<tokenp>0 << ")"  << endl;
-			    rulestart = new Token( "rule", _RULE );
-			    rulestart->down = $<tokenp>0; // initial lhs is already on the stack from "rules"
-			    $$ = new Token( "rhs", _RHS );
-			    //cerr << "  rhs: " << $$->text << "(" << $$ << ")" << endl;
-			    $<tokenp>0->left = $$;
-			}
-		| rhs lhs
-			{
-			    //cerr << "rhs2: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    Token *temp = new Token( "rule", _RULE );
-			    rulestart->addLeftTail( temp );
-			    temp->down = $2;
-			    $$ = new Token( "rhs", _RHS );
-			    //cerr << "  rhs: "  << $$->text << "(" << $$ << ")" << endl;
-			    $2->left = $$;
-			}
-		| rhs ';' lhs
-			{
-			    //cerr << "rhs3: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ") " << $3->text << "(" << $3 << ")" << endl;
-			    $1->addDownLeftTail( $2 );
-			    Token *temp = new Token( "rule", _RULE );
-			    rulestart->addLeftTail( temp );
-			    temp->down = $3;
-			    $$ = new Token( "rhs", _RHS );
-			    //cerr << "  rhs: "  << $$->text << "(" << $$ << ")" << endl;
-			    $3->left = $$;
-			}
-		| rhs prod
-			{
-			    //cerr << "rhs4: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $1->addDownLeftTail( $2 );
-			    $$ = $1;
-			}
-		| rhs '|'
-			{
-			    //cerr << "rhs5: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $1->addDownLeftTail( $2 );
-			    $$ = new Token( "rhs", _RHS );
-			    $1->left = $$;
-			    //cerr << "  rhs: "  << $$->text << "(" << $$ << ")" << endl;
-			}
-		;
-
-prod		: action
-		| IDENTIFIER
-		| CHARACTER
-		| prec
-		;
-
-prec		: PREC name
-			{
-			    //cerr << "prec: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
-			    $1->left = $2;
-			    $$ = new Token( "prec", _PREC );
-			    $$->down = $1;
-			}
-		;
-
-action		: '{'
-			{ lexC(); }
-		  ccode_opt
-			{
-			    // Remove the trailing '}' added in lex.
-			    string temp( lexYacc() );
-			    $<tokenp>$ = new Token( temp.substr( 0, temp.length() - 1 ), CODE );
-			}
-		  '}'
-			{
-			    $1->left = $<tokenp>4;
-			    $<tokenp>4->left = $5;
-			    $$ = new Token( "action", _ACTION );
-			    $$->down = $1;
-			}
-		;
-
-usersection_opt	: /* empty */
-			{
-			    //cerr << "usersection_opt" << endl;
-			    // attach remaining WS to fictitious code
-			    Token *temp = new Token( "", ws_list, CODE );
-			    $$ = new Token( "usersection_opt", _USERSECTION_OPT );
-			    $$->down = temp;
-			}
-		| MARK
-			{ lexC(); }
-		  ccode_opt
-			{
-			    Token *temp = new Token( lexYacc(), CODE );
-			    //cerr << "usersection_opt: " << $1->text << " " << temp->text << endl;
-			    $1->left = temp;
-			    $$ = new Token( "usersection_opt", _USERSECTION_OPT );
-			    $$->down = $1;
-			}
-		;
-
-ccode_opt	: /* empty */			{}
-		| blocks
-		;
-
-// This rule matches internal braces "{}" in C code to the level of the braces of a union/action.  These
-// internal braces are returned as Tokens from the lexer but are unused because the braces are already
-// concatenated into the code string built by the lexer. Therefore, the tokens for the braces are immediately
-// deleted.
-
-blocks		: '{' { delete $1; } ccode_opt '}' { delete $4; }
-		| blocks '{' { delete $2; } ccode_opt '}' { delete $5; }
-		;
-%%
-
-/* Local Variables: */
-/* fill-column: 110 */
-/* compile-command: "gmake" */
-/* End: */
Index: tools/prettyprinter/yacc.yy
===================================================================
--- tools/prettyprinter/yacc.yy	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
+++ tools/prettyprinter/yacc.yy	(revision a67b60e61ca74c9f7db6048cc5cc87b412778d13)
@@ -0,0 +1,481 @@
+/*                               -*- Mode: C -*- 
+ * 
+ *  Pretty Printer, Copyright (C) Rodolfo G. Esteves and Peter A. Buhr 2001
+ *      Permission is granted to copy this grammar and to use it within software systems.
+ *      THIS GRAMMAR IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
+ * 
+ * yacc.y -- 
+ * 
+ * Author           : Rodolfo G. Esteves
+ * Created On       : Sat Dec 15 13:44:21 2001
+ * Last Modified By : Peter A. Buhr
+ * Last Modified On : Mon Jun 27 21:51:06 2016
+ * Update Count     : 1028
+ */
+
+%{
+#include <stdio.h>
+#include "parse.h"
+#include "filter.h"
+
+#define YYDEBUG 1			// get the pretty debugging code to compile
+
+extern list<string> ws_list;		// lex variable containing accumulated whitespace
+void lexC( void );
+string lexYacc( void );
+
+void yyerror( char *s ) {
+    extern int yylineno;
+
+    cerr << "Error in line: " << yylineno << ": " << s << endl;
+    return;
+}
+
+Token *declstart;
+Token *rulestart;
+Token *nameliststart;
+%}
+
+%union {
+    Token *tokenp;
+}
+
+%token<tokenp>	','
+%token<tokenp>	'<'
+%token<tokenp>	'>'
+%token<tokenp>	'{'
+%token<tokenp>	'}'
+%token<tokenp>	':'
+%token<tokenp>	';'
+%token<tokenp>	'|'
+
+%token<tokenp>	MARK			// %%
+%token<tokenp>	LCURL			// %{
+%token<tokenp>	RCURL			// %}
+
+%token<tokenp>	INTEGER			// integer constant
+%token<tokenp>	CHARACTER		// character constant
+%token<tokenp>	IDENTIFIER		// identifier
+%token<tokenp>	CODE			// C code
+
+%token<tokenp>	START			// %start
+%token<tokenp>	UNION			// %union
+%token<tokenp>	TOKEN			// %token
+%token<tokenp>	LEFT			// %left
+%token<tokenp>	RIGHT			// %right
+%token<tokenp>	NONASSOC		// %nonassoc
+%token<tokenp>	TYPE			// %type
+%token<tokenp>	PURE_PARSER		// %pure_parser
+%token<tokenp>	SEMANTIC_PARSER		// %semantic_parser
+%token<tokenp>	EXPECT			// %expect
+%token<tokenp>	THONG			// %thong
+
+%token<tokenp>	PREC			// %prec
+
+%token		END_TERMINALS		// ALL TERMINAL TOKEN NAMES MUST APPEAR BEFORE THIS
+
+%type<tokenp>	sections
+%token		_SECTIONS
+%type<tokenp>	mark
+%type<tokenp>	defsection_opt
+%token		_DEFSECTION_OPT
+%type<tokenp>	declarations
+%type<tokenp>	literalblock
+%token		_LITERALBLOCK
+%type<tokenp>	declaration
+%token		_DECLARATION
+%type<tokenp>	union
+%type<tokenp>	rword
+%type<tokenp>	tag_opt
+%token		_TAG_OPT
+%type<tokenp>	namenolist
+%token		_NAMENOLIST
+%type<tokenp>	nameno
+%token		_NAMENO
+%type<tokenp>	namelist
+%token		_NAMELIST
+%type<tokenp>	name
+%type<tokenp>	rulesection
+%token		_RULESECTION
+%type<tokenp>	rules
+%token		_RULE
+%type<tokenp>	lhs
+%token		_LHS
+%type<tokenp>	rhs
+%token		_RHS
+%type<tokenp>	prod
+%type<tokenp>	prec
+%token		_PREC
+%type<tokenp>	action
+%token		_ACTION
+%type<tokenp>	usersection_opt
+%token		_USERSECTION_OPT
+%type<tokenp>	ccode_opt
+%type<tokenp>	blocks
+
+%start grammar
+
+%%
+grammar		: sections
+			{
+			    filter( $1 );		/* filter parse tree */
+			    freeTree( $1 );		/* free parse-tree storage (optional: used with purify) */
+			}
+		;
+
+sections	: defsection_opt mark rulesection usersection_opt
+			{
+			    $$ = new Token( "sections", _SECTIONS );
+			    $1->left = $2;
+			    $2->left = $3;
+			    $3->left = $4;
+			    $$->down = $1;
+			}
+		;
+
+mark		: MARK
+		| error					/* missing %% */
+			{
+			    cerr << "no input grammar, missing %% mark" << endl;
+			    exit( -1 );
+			}
+		;
+
+defsection_opt	: /* empty */
+			{
+			    //cerr << "defsection_opt1: " << endl;
+			    $$ = new Token( "declaration_opt", _DEFSECTION_OPT );
+			}
+		| declarations
+			{
+			    //cerr << "defsection_opt2: " << $1->text << "(" << $1 << ")" << endl;
+			    $$ = new Token( "declaration_opt", _DEFSECTION_OPT );
+			    $$->down = declstart;
+			}
+		;
+
+declarations	: literalblock
+			{
+			    //cerr << "declarations1: " << $1->text << "(" << $1 << ")" << endl;
+			    $$ = declstart = $1;
+			}
+		| declaration
+			{
+			    //cerr << "declarations2: " << $1->text << "(" << $1 << ")" << endl;
+			    $$ = declstart = new Token( "declaration", _DECLARATION );
+			    $$->down = $1;
+			}
+		| declarations literalblock
+			{
+			    //cerr << "declarations3: "<< $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $1->left = $2;
+			    $$ = $2;
+			}
+		| declarations declaration
+			{
+			    //cerr << "declarations4: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $$ = new Token( "declaration", _DECLARATION );
+			    $1->left = $$;
+			    $$->down = $2;
+			}
+		;
+
+literalblock	: LCURL
+			{ lexC(); }
+		  ccode_opt
+			{ $<tokenp>$ = new Token( lexYacc(), CODE ); }
+		  RCURL
+			{
+			    //cerr << "literalblock: " << $1->text << "(" << $1 << ") " << $<tokenp>4->text << " " << $5->text << "(" << $5 << ")" << endl;
+			    $1->left = $<tokenp>4;
+			    $<tokenp>4->left = $5;
+			    $$ = new Token( "literalblock", _LITERALBLOCK );
+			    $$->down = $1;
+			}
+		;
+
+declaration	: union
+		| START IDENTIFIER
+			{
+			    $1->left = $2;
+			    $$ = $1;
+			}
+                | rword tag_opt namenolist
+			{
+			    Token *n = new Token( "namenolist", _NAMENOLIST );
+			    n->down = nameliststart;
+			    $1->left = $2;
+			    $2->left = n;
+			    $$ = $1;
+			}
+		| TYPE tag_opt namelist
+			{
+			    Token *n = new Token( "namelist", _NAMELIST );
+			    n->down = nameliststart;
+			    $1->left = $2;
+			    $2->left = n;
+			    $$ = $1;
+			}
+                | PURE_PARSER
+		| SEMANTIC_PARSER
+                | EXPECT INTEGER			/* bison */
+			{
+			    $1->left = $2;
+			    $$ = $1;
+			}
+                | THONG					/* bison */
+		;
+
+union		: UNION
+		  '{'
+			{ lexC(); }
+		  ccode_opt
+			{
+			    // Remove the trailing '}' which is added in lex.
+			    string temp( lexYacc() );
+			    $<tokenp>$ = new Token( temp.substr( 0, temp.length() - 1 ), CODE );
+			}
+		  '}'
+			{
+			    $1->left = $2;
+			    $2->left = $<tokenp>5;
+			    $<tokenp>5->left = $6;
+			    $$ = $1;
+			}
+		;
+
+rword		: TOKEN
+		| LEFT
+		| RIGHT
+		| NONASSOC
+		;
+
+tag_opt		: /* empty */
+			{
+			    //cerr << "tag_opt" << endl;
+			    $$ = new Token( "tag_opt", _TAG_OPT );
+			}
+		| '<' IDENTIFIER '>'
+			{
+			    $1->left = $2;
+			    $2->left = $3;
+			    $$ = new Token( "tag_opt", _TAG_OPT );
+			    $$->down = $1;
+			}
+		;
+
+namenolist	: nameno
+			{
+			    //cerr << "namenolist1: " << $1->text << "(" << $1 << ")" << endl;
+			    $$ = nameliststart = $1;
+			}
+		| namenolist nameno
+			{
+			    //cerr << "namenolist2: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $1->left = $2;
+			    $$ = $2;
+			}
+		| namenolist ',' nameno
+			{
+			    //cerr << "namenolist3: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ") " << $3->text << "(" << $3 << ")" << endl;
+			    $1->left = $2;
+			    $2->left = $3;
+			    $$ = $3;
+			}
+		;
+
+nameno		: name
+			{
+			    $$ = new Token( "nameno", _NAMENO );
+			    $$->down = $1;
+			}
+		| name INTEGER
+			{
+			    $$ = new Token( "nameno", _NAMENO );
+			    $1->left = $2;
+			    $$->down = $1;
+			}
+		;
+
+namelist	: name
+			{
+			    //cerr << "namelist1: " << $1->text << "(" << $1 << ")" << endl;
+			    $$ = nameliststart = $1;
+			}
+		| namelist name
+			{
+			    //cerr << "namelist2: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $1->left = $2;
+			    $$ = $2;
+			}
+		| namelist ',' name
+			{
+			    //cerr << "namelist3: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ") " << $3->text << "(" << $3 << ")" << endl;
+			    $1->left = $2;
+			    $2->left = $3;
+			    $$ = $3;
+			}
+		;
+
+name		: IDENTIFIER
+		| CHARACTER
+		;
+
+rulesection	: rules
+			{
+			    //cerr << "rulesection1: " << $1->text << "(" << $1 << ")" << endl;
+			    $$ = new Token( "rulesection", _RULESECTION );
+			    $$->down = $1;
+			}
+		| error					/* no rules */
+			{
+			    cerr << "no rules in the input grammar" << endl;
+			    exit( -1 );
+			}
+		;
+
+// These grammar rules are complex because the Yacc language is LR(2) due to the optional ';' at the end of
+// rules. The following rules convert the LR(2) grammar into LR(1) by lengthening the rules to allow
+// sufficient look ahead. Unfortunately, this change makes handling the semantic actions more complex because
+// there are two lists (rules, rhs) being built but only one list tail can be returned through $$ for
+// chaining.
+
+rules		: lhs rhs
+			{
+			    //cerr << "rules1: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $$ = rulestart;
+			}
+		| lhs rhs ';'
+			{
+			    //cerr << "rules2: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ") " << $3->text << "(" << $3 << ")" << endl;
+			    $2->addDownLeftTail( $3 );
+			    $$ = rulestart;
+			}
+		;
+
+lhs		: IDENTIFIER ':'
+			{
+			    //cerr << "lhs: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $$ = new Token( "lhs", _LHS );
+			    //cerr << " lhs: "  << $$->text << "(" << $$ << ")" << endl;
+			    $1->left = $2;
+			    $$->down = $1;
+			}
+		;
+
+rhs		: /* empty */
+			{
+			    //cerr << "rhs1: " << $<tokenp>0->text << "(" << $<tokenp>0 << ")"  << endl;
+			    rulestart = new Token( "rule", _RULE );
+			    rulestart->down = $<tokenp>0; // initial lhs is already on the stack from "rules"
+			    $$ = new Token( "rhs", _RHS );
+			    //cerr << "  rhs: " << $$->text << "(" << $$ << ")" << endl;
+			    $<tokenp>0->left = $$;
+			}
+		| rhs lhs
+			{
+			    //cerr << "rhs2: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    Token *temp = new Token( "rule", _RULE );
+			    rulestart->addLeftTail( temp );
+			    temp->down = $2;
+			    $$ = new Token( "rhs", _RHS );
+			    //cerr << "  rhs: "  << $$->text << "(" << $$ << ")" << endl;
+			    $2->left = $$;
+			}
+		| rhs ';' lhs
+			{
+			    //cerr << "rhs3: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ") " << $3->text << "(" << $3 << ")" << endl;
+			    $1->addDownLeftTail( $2 );
+			    Token *temp = new Token( "rule", _RULE );
+			    rulestart->addLeftTail( temp );
+			    temp->down = $3;
+			    $$ = new Token( "rhs", _RHS );
+			    //cerr << "  rhs: "  << $$->text << "(" << $$ << ")" << endl;
+			    $3->left = $$;
+			}
+		| rhs prod
+			{
+			    //cerr << "rhs4: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $1->addDownLeftTail( $2 );
+			    $$ = $1;
+			}
+		| rhs '|'
+			{
+			    //cerr << "rhs5: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $1->addDownLeftTail( $2 );
+			    $$ = new Token( "rhs", _RHS );
+			    $1->left = $$;
+			    //cerr << "  rhs: "  << $$->text << "(" << $$ << ")" << endl;
+			}
+		;
+
+prod		: action
+		| IDENTIFIER
+		| CHARACTER
+		| prec
+		;
+
+prec		: PREC name
+			{
+			    //cerr << "prec: " << $1->text << "(" << $1 << ") " << $2->text << "(" << $2 << ")" << endl;
+			    $1->left = $2;
+			    $$ = new Token( "prec", _PREC );
+			    $$->down = $1;
+			}
+		;
+
+action		: '{'
+			{ lexC(); }
+		  ccode_opt
+			{
+			    // Remove the trailing '}' added in lex.
+			    string temp( lexYacc() );
+			    $<tokenp>$ = new Token( temp.substr( 0, temp.length() - 1 ), CODE );
+			}
+		  '}'
+			{
+			    $1->left = $<tokenp>4;
+			    $<tokenp>4->left = $5;
+			    $$ = new Token( "action", _ACTION );
+			    $$->down = $1;
+			}
+		;
+
+usersection_opt	: /* empty */
+			{
+			    //cerr << "usersection_opt" << endl;
+			    // attach remaining WS to fictitious code
+			    Token *temp = new Token( "", ws_list, CODE );
+			    $$ = new Token( "usersection_opt", _USERSECTION_OPT );
+			    $$->down = temp;
+			}
+		| MARK
+			{ lexC(); }
+		  ccode_opt
+			{
+			    Token *temp = new Token( lexYacc(), CODE );
+			    //cerr << "usersection_opt: " << $1->text << " " << temp->text << endl;
+			    $1->left = temp;
+			    $$ = new Token( "usersection_opt", _USERSECTION_OPT );
+			    $$->down = $1;
+			}
+		;
+
+ccode_opt	: /* empty */			{}
+		| blocks
+		;
+
+// This rule matches internal braces "{}" in C code to the level of the braces of a union/action.  These
+// internal braces are returned as Tokens from the lexer but are unused because the braces are already
+// concatenated into the code string built by the lexer. Therefore, the tokens for the braces are immediately
+// deleted.
+
+blocks		: '{' { delete $1; } ccode_opt '}' { delete $4; }
+		| blocks '{' { delete $2; } ccode_opt '}' { delete $5; }
+		;
+%%
+
+/* Local Variables: */
+/* fill-column: 110 */
+/* compile-command: "gmake" */
+/* End: */
