Index: tools/prettyprinter/lex.ll
===================================================================
--- tools/prettyprinter/lex.ll	(revision c65a80bfadaa2fa630e8fe7dee0f6608fc45efb1)
+++ tools/prettyprinter/lex.ll	(revision 70d826cd91250522cc2c47b0fdb237bd3ca2fde5)
@@ -7,13 +7,14 @@
  * lex.ll --
  * 
- * Author           : Rodolfo Gabriel Esteves
+ * Author           : Peter A. Buhr
  * Created On       : Sat Dec 15 11:45:59 2001
  * Last Modified By : Peter A. Buhr
- * Last Modified On : Fri Jul 21 23:06:16 2017
- * Update Count     : 254
+ * Last Modified On : Tue Aug 29 17:33:36 2017
+ * Update Count     : 268
  */
 
 %option stack
 %option yylineno
+%option nounput
 
 %{
@@ -30,4 +31,7 @@
 string comment_str;
 string code_str;
+
+// Stop warning due to incorrectly generated flex code.
+#pragma GCC diagnostic ignored "-Wsign-compare"
 %}
 
@@ -44,111 +48,114 @@
 /* ---------------------------- 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 = "";
-			    }
-			}
+<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();
+}
 
-";"			{ RETURN_TOKEN( ';' ) }
-":"			{ RETURN_TOKEN( ':' ) }
-"|"			{ RETURN_TOKEN( '|' ) }
-","			{ RETURN_TOKEN( ',' ) }
-"<"			{ RETURN_TOKEN( '<' ) }
-">"			{ RETURN_TOKEN( '>' ) }
+<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 = "";
+	}
+}
 
-[[:space:]]+		{				/* [ \t\n]+ */
-			    ws_list.push_back( yytext );
-			    //cerr << "WS : " << "\"" << yytext << "\"" << endl;
-			}
+";"				{ RETURN_TOKEN( ';' ) }
+":"				{ RETURN_TOKEN( ':' ) }
+"|"				{ RETURN_TOKEN( '|' ) }
+","				{ RETURN_TOKEN( ',' ) }
+"<"				{ RETURN_TOKEN( '<' ) }
+">"				{ RETURN_TOKEN( '>' ) }
 
-<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( '}' )
-			}
+[[: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 ) }
+<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 ) }
+^"%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 ) }
+^"%precedence"  { RETURN_TOKEN( PRECEDENCE ) }
+^"%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 ); }
+{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>["]{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;
-			}
+<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 */
+				/* unknown characters */
+.				{ printf("unknown character(s):\"%s\" on line %d\n", yytext, yylineno); }
 %%
 void lexC(void) {
Index: tools/prettyprinter/parser.hh
===================================================================
--- tools/prettyprinter/parser.hh	(revision c65a80bfadaa2fa630e8fe7dee0f6608fc45efb1)
+++ tools/prettyprinter/parser.hh	(revision 70d826cd91250522cc2c47b0fdb237bd3ca2fde5)
@@ -59,26 +59,27 @@
     RIGHT = 269,
     NONASSOC = 270,
-    TYPE = 271,
-    PURE_PARSER = 272,
-    SEMANTIC_PARSER = 273,
-    EXPECT = 274,
-    THONG = 275,
-    PREC = 276,
-    END_TERMINALS = 277,
-    _SECTIONS = 278,
-    _DEFSECTION_OPT = 279,
-    _LITERALBLOCK = 280,
-    _DECLARATION = 281,
-    _TAG_OPT = 282,
-    _NAMENOLIST = 283,
-    _NAMENO = 284,
-    _NAMELIST = 285,
-    _RULESECTION = 286,
-    _RULE = 287,
-    _LHS = 288,
-    _RHS = 289,
-    _PREC = 290,
-    _ACTION = 291,
-    _USERSECTION_OPT = 292
+    PRECEDENCE = 271,
+    TYPE = 272,
+    PURE_PARSER = 273,
+    SEMANTIC_PARSER = 274,
+    EXPECT = 275,
+    THONG = 276,
+    PREC = 277,
+    END_TERMINALS = 278,
+    _SECTIONS = 279,
+    _DEFSECTION_OPT = 280,
+    _LITERALBLOCK = 281,
+    _DECLARATION = 282,
+    _TAG_OPT = 283,
+    _NAMENOLIST = 284,
+    _NAMENO = 285,
+    _NAMELIST = 286,
+    _RULESECTION = 287,
+    _RULE = 288,
+    _LHS = 289,
+    _RHS = 290,
+    _PREC = 291,
+    _ACTION = 292,
+    _USERSECTION_OPT = 293
   };
 #endif
@@ -97,26 +98,27 @@
 #define RIGHT 269
 #define NONASSOC 270
-#define TYPE 271
-#define PURE_PARSER 272
-#define SEMANTIC_PARSER 273
-#define EXPECT 274
-#define THONG 275
-#define PREC 276
-#define END_TERMINALS 277
-#define _SECTIONS 278
-#define _DEFSECTION_OPT 279
-#define _LITERALBLOCK 280
-#define _DECLARATION 281
-#define _TAG_OPT 282
-#define _NAMENOLIST 283
-#define _NAMENO 284
-#define _NAMELIST 285
-#define _RULESECTION 286
-#define _RULE 287
-#define _LHS 288
-#define _RHS 289
-#define _PREC 290
-#define _ACTION 291
-#define _USERSECTION_OPT 292
+#define PRECEDENCE 271
+#define TYPE 272
+#define PURE_PARSER 273
+#define SEMANTIC_PARSER 274
+#define EXPECT 275
+#define THONG 276
+#define PREC 277
+#define END_TERMINALS 278
+#define _SECTIONS 279
+#define _DEFSECTION_OPT 280
+#define _LITERALBLOCK 281
+#define _DECLARATION 282
+#define _TAG_OPT 283
+#define _NAMENOLIST 284
+#define _NAMENO 285
+#define _NAMELIST 286
+#define _RULESECTION 287
+#define _RULE 288
+#define _LHS 289
+#define _RHS 290
+#define _PREC 291
+#define _ACTION 292
+#define _USERSECTION_OPT 293
 
 /* Value type.  */
@@ -129,5 +131,5 @@
 	Token *tokenp;
 
-#line 132 "parser.hh" /* yacc.c:1909  */
+#line 134 "parser.hh" /* yacc.c:1909  */
 };
 
Index: tools/prettyprinter/parser.yy
===================================================================
--- tools/prettyprinter/parser.yy	(revision c65a80bfadaa2fa630e8fe7dee0f6608fc45efb1)
+++ tools/prettyprinter/parser.yy	(revision 70d826cd91250522cc2c47b0fdb237bd3ca2fde5)
@@ -10,6 +10,6 @@
 // Created On       : Sat Dec 15 13:44:21 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Jun 29 09:26:47 2017
-// Update Count     : 1045
+// Last Modified On : Tue Aug 29 16:34:10 2017
+// Update Count     : 1047
 // 
 
@@ -67,4 +67,5 @@
 %token<tokenp>	RIGHT									// %right
 %token<tokenp>	NONASSOC								// %nonassoc
+%token<tokenp>	PRECEDENCE								// %precedence
 %token<tokenp>	TYPE									// %type
 %token<tokenp>	PURE_PARSER								// %pure_parser
@@ -259,4 +260,5 @@
 	| RIGHT
 	| NONASSOC
+	| PRECEDENCE
 	;
 
