Index: src/Parser/ExpressionNode.cc
===================================================================
--- src/Parser/ExpressionNode.cc	(revision 87b5bf0c846782d88723cd4784006befc064183c)
+++ src/Parser/ExpressionNode.cc	(revision ca35c51743c5aa90ec6fd8bc56f12cfc866101ff)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:17:07 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jun 13 14:46:17 2016
-// Update Count     : 307
+// Last Modified On : Thu Jun 30 13:33:16 2016
+// Update Count     : 319
 //
 
@@ -19,5 +19,4 @@
 #include <sstream>
 #include <cstdio>
-#include <climits>
 
 #include "ParseNode.h"
@@ -90,142 +89,10 @@
 //##############################################################################
 
-static inline bool checkU( char c ) { return c == 'u' || c == 'U'; }
-static inline bool checkL( char c ) { return c == 'l' || c == 'L'; }
-static inline bool checkF( char c ) { return c == 'f' || c == 'F'; }
-static inline bool checkD( char c ) { return c == 'd' || c == 'D'; }
-static inline bool checkI( char c ) { return c == 'i' || c == 'I'; }
-static inline bool checkX( char c ) { return c == 'x' || c == 'X'; }
-
-// Difficult to separate extra parts of constants during lexing because actions are not allow in the middle of patterns:
-//
-//		prefix action constant action suffix
-//
-// Alternatively, breaking a pattern using BEGIN does not work if the following pattern can be empty:
-//
-//		constant BEGIN CONT ...
-//		<CONT>(...)? BEGIN 0 ... // possible empty suffix
-//
-// because the CONT rule is NOT triggered if the pattern is empty. Hence, constants are reparsed here to determine their
-// type.
-
-ConstantNode::ConstantNode( Type t, string *inVal ) : type( t ), value( *inVal ) {
-	// lexing divides constants into 4 kinds
-	switch ( type ) {
-	  case Integer:
-		{
-			static const BasicType::Kind kind[2][3] = {
-				{ BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt },
-				{ BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt },
-			};
-			bool dec = true, Unsigned = false;			// decimal, unsigned constant
-			int size;									// 0 => int, 1 => long, 2 => long long
-			unsigned long long v;						// converted integral value
-			size_t last = value.length() - 1;			// last character of constant
-
-			if ( value[0] == '0' ) {					// octal constant ?
-				dec = false;
-				if ( last != 0 && checkX( value[1] ) ) { // hex constant ?
-					sscanf( (char *)value.c_str(), "%llx", &v );
-					//printf( "%llx %llu\n", v, v );
-				} else {
-					sscanf( (char *)value.c_str(), "%llo", &v );
-					//printf( "%llo %llu\n", v, v );
-				} // if
-			} else {									// decimal constant ?
-				sscanf( (char *)value.c_str(), "%llu", &v );
-				//printf( "%llu %llu\n", v, v );
-			} // if
-
-			if ( v <= INT_MAX ) {						// signed int
-				size = 0;
-			} else if ( v <= UINT_MAX && ! dec ) {		// unsigned int
-				size = 0;
-				Unsigned = true;						// unsigned
-			} else if ( v <= LONG_MAX ) {				// signed long int
-				size = 1;
-			} else if ( v <= ULONG_MAX && ( ! dec || LONG_MAX == LLONG_MAX ) ) { // signed long int
-				size = 1;
-				Unsigned = true;						// unsigned long int
-			} else if ( v <= LLONG_MAX ) {				// signed long long int
-				size = 2;
-			} else {									// unsigned long long int
-				size = 2;
-				Unsigned = true;						// unsigned long long int
-			} // if
-
-			if ( checkU( value[last] ) ) {				// suffix 'u' ?
-				Unsigned = true;
-				if ( last > 0 && checkL( value[ last - 1 ] ) ) { // suffix 'l' ?
-					size = 1;
-					if ( last > 1 && checkL( value[ last - 2 ] ) ) { // suffix 'll' ?
-						size = 2;
-					} // if
-				} // if
-			} else if ( checkL( value[ last ] ) ) {		// suffix 'l' ?
-				size = 1;
-				if ( last > 0 && checkL( value[ last - 1 ] ) ) { // suffix 'll' ?
-					size = 2;
-					if ( last > 1 && checkU( value[ last - 2 ] ) ) { // suffix 'u' ?
-						Unsigned = true;
-					} // if
-				} else {
-					if ( last > 0 && checkU( value[ last - 1 ] ) ) { // suffix 'u' ?
-						Unsigned = true;
-					} // if
-				} // if
-			} // if
-			btype = kind[Unsigned][size];				// lookup constant type
-			break;
-		}
-	  case Float:
-		{
-			static const BasicType::Kind kind[2][3] = {
-				{ BasicType::Float, BasicType::Double, BasicType::LongDouble },
-				{ BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex },
-			};
-			bool complx = false;						// real, complex
-			int size = 1;								// 0 => float, 1 => double (default), 2 => long double
-			// floating-point constant has minimum of 2 characters: 1. or .1
-			size_t last = value.length() - 1;
-
-			if ( checkI( value[last] ) ) {				// imaginary ?
-				complx = true;
-				last -= 1;								// backup one character
-			} // if
-			if ( checkF( value[last] ) ) {				// float ?
-				size = 0;
-			} else if ( checkD( value[last] ) ) {		// double ?
-				size = 1;
-			} else if ( checkL( value[last] ) ) {		// long double ?
-				size = 2;
-			} // if
-			if ( ! complx && checkI( value[last - 1] ) ) { // imaginary ?
-				complx = true;
-			} // if
-			btype = kind[complx][size];					// lookup constant type
-			break;
-		}
-	  case Character:
-		btype = BasicType::Char;						// default
-		if ( string( "LUu" ).find( value[0] ) != string::npos ) {
-			// ???
-		} // if
-		break;
-	  case String:
-		// array of char
-		if ( string( "LUu" ).find( value[0] ) != string::npos ) {
-			if ( value[0] == 'u' && value[1] == '8' ) {
-				// ???
-			} else {
-				// ???
-			} // if
-		} // if
-		break;
-	} // switch
+ConstantNode::ConstantNode( ConstantExpr *expr ) : expr( expr ) {
 } // ConstantNode::ConstantNode
 
 ConstantNode *ConstantNode::appendstr( const std::string *newValue ) {
 	assert( newValue != 0 );
-	assert( type == String );
+	string value = expr->get_constant()->get_value();
 
 	// "abc" "def" "ghi" => "abcdefghi", remove new text from quotes and insert before last quote in old string.
@@ -237,21 +104,21 @@
 
 void ConstantNode::printOneLine( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' );
-	printDesignation( os );
-
-	switch ( type ) {
-	  case Integer:
-	  case Float:
-		os << value ;
-		break;
-	  case Character:
-		os << "'" << value << "'";
-		break;
-	  case String:
-		os << '"' << value << '"';
-		break;
-	} // switch
-
-	os << ' ';
+	// os << string( indent, ' ' );
+	// printDesignation( os );
+
+	// switch ( type ) {
+	//   case Integer:
+	//   case Float:
+	// 	os << value ;
+	// 	break;
+	//   case Character:
+	// 	os << "'" << value << "'";
+	// 	break;
+	//   case String:
+	// 	os << '"' << value << '"';
+	// 	break;
+	// } // switch
+
+	// os << ' ';
 }
 
@@ -262,20 +129,5 @@
 
 Expression *ConstantNode::build() const {
-	::Type::Qualifiers q;								// no qualifiers on constants
-
-	switch ( get_type() ) {
-	  case String:
-		{
-			// string should probably be a primitive type
-			ArrayType *at = new ArrayType( q, new BasicType( q, BasicType::Char ),
-										   new ConstantExpr(
-											   Constant( new BasicType( q, BasicType::UnsignedInt ),
-														 toString( value.size()+1-2 ) ) ),  // +1 for '\0' and -2 for '"'
-										   false, false );
-			return new ConstantExpr( Constant( at, value ), maybeBuild< Expression >( get_argName() ) );
-		}
-	  default:
-		return new ConstantExpr( Constant( new BasicType( q, btype ), get_value() ), maybeBuild< Expression >( get_argName() ) );
-	}
+	return expr->clone();
 }
 
Index: src/Parser/ParseNode.cc
===================================================================
--- src/Parser/ParseNode.cc	(revision 87b5bf0c846782d88723cd4784006befc064183c)
+++ src/Parser/ParseNode.cc	(revision ca35c51743c5aa90ec6fd8bc56f12cfc866101ff)
@@ -9,11 +9,168 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Sat May 16 13:26:29 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Wed Aug 12 13:26:00 2015
-// Update Count     : 36
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Jun 30 13:30:43 2016
+// Update Count     : 50
 // 
 
+#include <climits>
 #include "ParseNode.h"
 using namespace std;
+
+// Difficult to separate extra parts of constants during lexing because actions are not allow in the middle of patterns:
+//
+//		prefix action constant action suffix
+//
+// Alternatively, breaking a pattern using BEGIN does not work if the following pattern can be empty:
+//
+//		constant BEGIN CONT ...
+//		<CONT>(...)? BEGIN 0 ... // possible empty suffix
+//
+// because the CONT rule is NOT triggered if the pattern is empty. Hence, constants are reparsed here to determine their
+// type.
+
+static inline bool checkU( char c ) { return c == 'u' || c == 'U'; }
+static inline bool checkL( char c ) { return c == 'l' || c == 'L'; }
+static inline bool checkF( char c ) { return c == 'f' || c == 'F'; }
+static inline bool checkD( char c ) { return c == 'd' || c == 'D'; }
+static inline bool checkI( char c ) { return c == 'i' || c == 'I'; }
+static inline bool checkX( char c ) { return c == 'x' || c == 'X'; }
+
+BasicType::Kind literalType( ConstantNode::Type type, string &value ) {
+	BasicType::Kind btype;
+
+	// lexing divides constants into 4 kinds
+	switch ( type ) {
+	  case ConstantNode::Integer:
+		{
+			static const BasicType::Kind kind[2][3] = {
+				{ BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt },
+				{ BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt },
+			};
+			bool dec = true, Unsigned = false;			// decimal, unsigned constant
+			int size;									// 0 => int, 1 => long, 2 => long long
+			unsigned long long v;						// converted integral value
+			size_t last = value.length() - 1;			// last character of constant
+
+			if ( value[0] == '0' ) {					// octal constant ?
+				dec = false;
+				if ( last != 0 && checkX( value[1] ) ) { // hex constant ?
+					sscanf( (char *)value.c_str(), "%llx", &v );
+					//printf( "%llx %llu\n", v, v );
+				} else {
+					sscanf( (char *)value.c_str(), "%llo", &v );
+					//printf( "%llo %llu\n", v, v );
+				} // if
+			} else {									// decimal constant ?
+				sscanf( (char *)value.c_str(), "%llu", &v );
+				//printf( "%llu %llu\n", v, v );
+			} // if
+
+			if ( v <= INT_MAX ) {						// signed int
+				size = 0;
+			} else if ( v <= UINT_MAX && ! dec ) {		// unsigned int
+				size = 0;
+				Unsigned = true;						// unsigned
+			} else if ( v <= LONG_MAX ) {				// signed long int
+				size = 1;
+			} else if ( v <= ULONG_MAX && ( ! dec || LONG_MAX == LLONG_MAX ) ) { // signed long int
+				size = 1;
+				Unsigned = true;						// unsigned long int
+			} else if ( v <= LLONG_MAX ) {				// signed long long int
+				size = 2;
+			} else {									// unsigned long long int
+				size = 2;
+				Unsigned = true;						// unsigned long long int
+			} // if
+
+			if ( checkU( value[last] ) ) {				// suffix 'u' ?
+				Unsigned = true;
+				if ( last > 0 && checkL( value[ last - 1 ] ) ) { // suffix 'l' ?
+					size = 1;
+					if ( last > 1 && checkL( value[ last - 2 ] ) ) { // suffix 'll' ?
+						size = 2;
+					} // if
+				} // if
+			} else if ( checkL( value[ last ] ) ) {		// suffix 'l' ?
+				size = 1;
+				if ( last > 0 && checkL( value[ last - 1 ] ) ) { // suffix 'll' ?
+					size = 2;
+					if ( last > 1 && checkU( value[ last - 2 ] ) ) { // suffix 'u' ?
+						Unsigned = true;
+					} // if
+				} else {
+					if ( last > 0 && checkU( value[ last - 1 ] ) ) { // suffix 'u' ?
+						Unsigned = true;
+					} // if
+				} // if
+			} // if
+			btype = kind[Unsigned][size];				// lookup constant type
+			break;
+		}
+	  case ConstantNode::Float:
+		{
+			static const BasicType::Kind kind[2][3] = {
+				{ BasicType::Float, BasicType::Double, BasicType::LongDouble },
+				{ BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex },
+			};
+			bool complx = false;						// real, complex
+			int size = 1;								// 0 => float, 1 => double (default), 2 => long double
+			// floating-point constant has minimum of 2 characters: 1. or .1
+			size_t last = value.length() - 1;
+
+			if ( checkI( value[last] ) ) {				// imaginary ?
+				complx = true;
+				last -= 1;								// backup one character
+			} // if
+			if ( checkF( value[last] ) ) {				// float ?
+				size = 0;
+			} else if ( checkD( value[last] ) ) {		// double ?
+				size = 1;
+			} else if ( checkL( value[last] ) ) {		// long double ?
+				size = 2;
+			} // if
+			if ( ! complx && checkI( value[last - 1] ) ) { // imaginary ?
+				complx = true;
+			} // if
+			btype = kind[complx][size];					// lookup constant type
+			break;
+		}
+	  case ConstantNode::Character:
+		btype = BasicType::Char;						// default
+		if ( string( "LUu" ).find( value[0] ) != string::npos ) {
+			// ???
+		} // if
+		break;
+	  case ConstantNode::String:
+		assert( false );
+		// array of char
+		if ( string( "LUu" ).find( value[0] ) != string::npos ) {
+			if ( value[0] == 'u' && value[1] == '8' ) {
+				// ???
+			} else {
+				// ???
+			} // if
+		} // if
+		break;
+	} // switch
+	return btype;
+} // literalType
+
+ConstantNode *makeConstant( ConstantNode::Type type, std::string *str ) {
+	::Type::Qualifiers emptyQualifiers;					// no qualifiers on constants
+	return new ConstantNode( new ConstantExpr( Constant( new BasicType( emptyQualifiers, literalType( type, *str ) ), *str ), nullptr ) );
+}
+
+ConstantNode *makeConstantStr( ConstantNode::Type type, std::string *str ) {
+	::Type::Qualifiers emptyQualifiers;					// no qualifiers on constants
+	// string should probably be a primitive type
+	ArrayType *at = new ArrayType( emptyQualifiers, new BasicType( emptyQualifiers, BasicType::Char ),
+								   new ConstantExpr(
+									   Constant( new BasicType( emptyQualifiers, BasicType::UnsignedInt ),
+												 toString( str->size()+1-2 ) ) ),  // +1 for '\0' and -2 for '"'
+								   false, false );
+	return new ConstantNode( new ConstantExpr( Constant( at, *str ), nullptr ) );
+}
+
 
 // Builder
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 87b5bf0c846782d88723cd4784006befc064183c)
+++ src/Parser/ParseNode.h	(revision ca35c51743c5aa90ec6fd8bc56f12cfc866101ff)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:28:16 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jun 27 23:28:10 2016
-// Update Count     : 242
+// Last Modified On : Thu Jun 30 11:48:28 2016
+// Update Count     : 252
 //
 
@@ -126,22 +126,21 @@
 	enum Type { Integer, Float, Character, String };
 
-	ConstantNode( Type, std::string * );
-	ConstantNode( const ConstantNode &other ) : type( other.type ), btype( other.btype), value( *new std::string( other.value ) ) {};
-	~ConstantNode() { delete &value; }
+	ConstantNode( ConstantExpr * );
+	ConstantNode( const ConstantNode &other ) : expr( other.expr->clone() ) {};
+	~ConstantNode() { delete expr; }
 
 	virtual ConstantNode *clone() const { return new ConstantNode( *this ); }
-	Type get_type( void ) const { return type; }
 	virtual void print( std::ostream &, int indent = 0) const;
 	virtual void printOneLine( std::ostream &, int indent = 0) const;
 
-	const std::string &get_value() const { return value; }
 	ConstantNode *appendstr( const std::string *newValue );
 
 	Expression *build() const;
   private:
-	Type type;
-	BasicType::Kind btype;
-	std::string &value;
-};
+	ConstantExpr *expr;
+};
+
+ConstantNode *makeConstant( ConstantNode::Type, std::string * );
+ConstantNode *makeConstantStr( ConstantNode::Type type, std::string *str );
 
 class VarRefNode : public ExpressionNode {
Index: src/Parser/parser.cc
===================================================================
--- src/Parser/parser.cc	(revision 87b5bf0c846782d88723cd4784006befc064183c)
+++ src/Parser/parser.cc	(revision ca35c51743c5aa90ec6fd8bc56f12cfc866101ff)
@@ -5237,5 +5237,5 @@
 /* Line 1806 of yacc.c  */
 #line 305 "parser.yy"
-    { (yyval.constant) = new ConstantNode( ConstantNode::Integer, (yyvsp[(1) - (1)].tok) ); }
+    { (yyval.constant) = makeConstant( ConstantNode::Integer, (yyvsp[(1) - (1)].tok) ); }
     break;
 
@@ -5244,5 +5244,5 @@
 /* Line 1806 of yacc.c  */
 #line 306 "parser.yy"
-    { (yyval.constant) = new ConstantNode( ConstantNode::Float, (yyvsp[(1) - (1)].tok) ); }
+    { (yyval.constant) = makeConstant( ConstantNode::Float, (yyvsp[(1) - (1)].tok) ); }
     break;
 
@@ -5251,5 +5251,5 @@
 /* Line 1806 of yacc.c  */
 #line 307 "parser.yy"
-    { (yyval.constant) = new ConstantNode( ConstantNode::Character, (yyvsp[(1) - (1)].tok) ); }
+    { (yyval.constant) = makeConstant( ConstantNode::Character, (yyvsp[(1) - (1)].tok) ); }
     break;
 
@@ -5258,5 +5258,5 @@
 /* Line 1806 of yacc.c  */
 #line 332 "parser.yy"
-    { (yyval.constant) = new ConstantNode( ConstantNode::String, (yyvsp[(1) - (1)].tok) ); }
+    { (yyval.constant) = makeConstantStr( ConstantNode::String, (yyvsp[(1) - (1)].tok) ); }
     break;
 
@@ -5953,5 +5953,5 @@
 /* Line 1806 of yacc.c  */
 #line 684 "parser.yy"
-    { (yyval.sn) = new StatementNode( (yyvsp[(2) - (2)].decl) )/*->set_extension( true )*/; }
+    { (yyval.sn) = (new StatementNode( (yyvsp[(2) - (2)].decl) ))->set_extension( true ); }
     break;
 
@@ -7266,5 +7266,5 @@
 /* Line 1806 of yacc.c  */
 #line 1474 "parser.yy"
-    { (yyval.decl) = (yyvsp[(2) - (3)].decl)/*->set_extension( true )*/; }
+    { (yyval.decl) = (yyvsp[(2) - (3)].decl)->set_extension( true ); }
     break;
 
@@ -7273,5 +7273,5 @@
 /* Line 1806 of yacc.c  */
 #line 1477 "parser.yy"
-    { (yyval.decl) = (yyvsp[(2) - (3)].decl)/*->set_extension( true )*/; }
+    { (yyval.decl) = (yyvsp[(2) - (3)].decl)->set_extension( true ); }
     break;
 
@@ -8057,5 +8057,5 @@
 /* Line 1806 of yacc.c  */
 #line 1993 "parser.yy"
-    { (yyval.decl) = (yyvsp[(2) - (2)].decl)/*->set_extension( true )*/; }
+    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->set_extension( true ); }
     break;
 
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 87b5bf0c846782d88723cd4784006befc064183c)
+++ src/Parser/parser.yy	(revision ca35c51743c5aa90ec6fd8bc56f12cfc866101ff)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jun 27 17:47:56 2016
-// Update Count     : 1627
+// Last Modified On : Thu Jun 30 13:26:01 2016
+// Update Count     : 1639
 //
 
@@ -303,7 +303,7 @@
 constant:
 		// ENUMERATIONconstant is not included here; it is treated as a variable with type "enumeration constant".
-	INTEGERconstant								{ $$ = new ConstantNode( ConstantNode::Integer, $1 ); }
-	| FLOATINGconstant							{ $$ = new ConstantNode( ConstantNode::Float, $1 ); }
-	| CHARACTERconstant							{ $$ = new ConstantNode( ConstantNode::Character, $1 ); }
+INTEGERconstant									{ $$ = makeConstant( ConstantNode::Integer, $1 ); }
+	| FLOATINGconstant							{ $$ = makeConstant( ConstantNode::Float, $1 ); }
+	| CHARACTERconstant							{ $$ = makeConstant( ConstantNode::Character, $1 ); }
 	;
 
@@ -330,5 +330,5 @@
 
 string_literal_list:									// juxtaposed strings are concatenated
-	STRINGliteral								{ $$ = new ConstantNode( ConstantNode::String, $1 ); }
+	STRINGliteral								{ $$ = makeConstantStr( ConstantNode::String, $1 ); }
 	| string_literal_list STRINGliteral			{ $$ = $1->appendstr( $2 ); }
 	;
@@ -682,5 +682,5 @@
 		{ $$ = new StatementNode( $1 ); }
 	| EXTENSION declaration								// GCC
-		{ $$ = new StatementNode( $2 )/*->set_extension( true )*/; }
+	{ $$ = (new StatementNode( $2 ))->set_extension( true ); }
 	| function_definition
 		{ $$ = new StatementNode( $1 ); }
@@ -1472,8 +1472,8 @@
 	new_field_declaring_list ';'						// CFA, new style field declaration
 	| EXTENSION new_field_declaring_list ';'			// GCC
-		{ $$ = $2/*->set_extension( true )*/; }
+		{ $$ = $2->set_extension( true ); }
 	| field_declaring_list ';'
 	| EXTENSION field_declaring_list ';'				// GCC
-		{ $$ = $2/*->set_extension( true )*/; }
+		{ $$ = $2->set_extension( true ); }
 	;
 
@@ -1991,5 +1991,5 @@
 		}
 	| EXTENSION external_definition
-		{ $$ = $2/*->set_extension( true )*/; }
+		{ $$ = $2->set_extension( true ); }
 	;
 
