Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
+++ src/Parser/parser.yy	(revision fdca7c6f6e2133e49dd472b83d9f1632cb90e0b4)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu May 25 15:21:59 2017
-// Update Count     : 2398
+// Last Modified On : Thu May 18 18:06:17 2017
+// Update Count     : 2338
 //
 
@@ -159,6 +159,6 @@
 }
 
-%type<tok> identifier  no_attr_identifier  zero_one
-%type<tok> identifier_or_type_name  no_attr_identifier_or_type_name  attr_name
+%type<tok> identifier  no_01_identifier  no_attr_identifier zero_one
+%type<tok> identifier_or_type_name  no_attr_identifier_or_type_name  no_01_identifier_or_type_name  attr_name
 %type<constant> string_literal
 %type<str> string_literal_list
@@ -207,5 +207,5 @@
 %type<en>   bit_subrange_size_opt bit_subrange_size
 
-%type<decl> basic_declaration_specifier basic_type_name basic_type_specifier direct_type indirect_type
+%type<decl> basic_declaration_specifier basic_type_name basic_type_specifier direct_type_name indirect_type_name
 
 %type<decl> trait_declaration trait_declaration_list trait_declaring_list trait_specifier
@@ -261,15 +261,15 @@
 %type<decl> type_declarator type_declarator_name type_declaring_list
 
-%type<decl> type_declaration_specifier type_type_specifier type_name typegen_name
-%type<decl> typedef typedef_declaration typedef_expression
+%type<decl> typedef typedef_type_specifier typedef_declaration typedef_declaration_specifier typedef_expression
 
 %type<decl> variable_type_redeclarator type_ptr type_array type_function
 
 %type<decl> type_parameter_redeclarator type_parameter_ptr type_parameter_array type_parameter_function
-
-%type<decl> type type_no_function
-%type<decl> type_parameter type_parameter_list type_initializer_opt
-
-%type<en> type_list
+%type<decl> typegen_declaration_specifier typegen_type_specifier typegen_name
+
+%type<decl> type_name type_name_no_function
+%type<decl> type_parameter type_parameter_list
+
+%type<en> type_name_list
 
 %type<decl> type_qualifier type_qualifier_name type_qualifier_list_opt type_qualifier_list
@@ -351,8 +351,15 @@
 	IDENTIFIER
 	| ATTR_IDENTIFIER									// CFA
+	| zero_one											// CFA
+	;
+
+no_01_identifier:
+	IDENTIFIER
+	| ATTR_IDENTIFIER									// CFA
 	;
 
 no_attr_identifier:
 	IDENTIFIER
+	| zero_one											// CFA
 	;
 
@@ -360,5 +367,5 @@
 	ZERO
 	| ONE
- 	;
+	;
 
 string_literal:
@@ -388,5 +395,5 @@
 	| '(' compound_statement ')'						// GCC, lambda expression
 		{ $$ = new ExpressionNode( build_valexpr( $2 ) ); }
-	| primary_expression '{' argument_expression_list '}' // CFA, constructor call
+	| primary_expression '{' argument_expression_list '}' // CFA
 		{
 			Token fn;
@@ -394,8 +401,4 @@
 			$$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
 		}
-	| type_name '.' no_attr_identifier					// CFA, nested type
-		{ $$ = nullptr; }								// FIX ME
-	| type_name '.' '[' push field_list pop ']'			// CFA, nested type / tuple field selector
-		{ $$ = nullptr; }								// FIX ME
 	;
 
@@ -428,5 +431,5 @@
 	| postfix_expression DECR
 	  	{ $$ = new ExpressionNode( build_unary_ptr( OperKinds::DecrPost, $1 ) ); }
-	| '(' type_no_function ')' '{' initializer_list comma_opt '}' // C99, compound-literal
+	| '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99, compound-literal
 		{ $$ = new ExpressionNode( build_compoundLiteral( $2, new InitializerNode( $5, true ) ) ); }
 	| '^' primary_expression '{' argument_expression_list '}' // CFA
@@ -480,9 +483,9 @@
 	| no_attr_identifier fraction_constants
 		{
-			$$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) );
-		}
-	| zero_one fraction_constants
-		{
-			$$ = new ExpressionNode( build_field_name_fraction_constants( build_constantZeroOne( *$1 ), $2 ) );
+			if( (*$1) == "0" || (*$1) == "1" ) {
+				$$ = new ExpressionNode( build_field_name_fraction_constants( build_constantZeroOne( *$1 ), $2 ) );
+			} else {
+				$$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) );
+			}
 		}
 	;
@@ -532,11 +535,11 @@
 	| SIZEOF unary_expression
 		{ $$ = new ExpressionNode( build_sizeOfexpr( $2 ) ); }
-	| SIZEOF '(' type_no_function ')'
+	| SIZEOF '(' type_name_no_function ')'
 		{ $$ = new ExpressionNode( build_sizeOftype( $3 ) ); }
 	| ALIGNOF unary_expression							// GCC, variable alignment
 		{ $$ = new ExpressionNode( build_alignOfexpr( $2 ) ); }
-	| ALIGNOF '(' type_no_function ')'				// GCC, type alignment
+	| ALIGNOF '(' type_name_no_function ')'				// GCC, type alignment
 		{ $$ = new ExpressionNode( build_alignOftype( $3 ) ); }
-	| OFFSETOF '(' type_no_function ',' no_attr_identifier ')'
+	| OFFSETOF '(' type_name_no_function ',' no_attr_identifier ')'
 		{ $$ = new ExpressionNode( build_offsetOf( $3, build_varref( $5 ) ) ); }
 	| ATTR_IDENTIFIER
@@ -544,5 +547,5 @@
 	| ATTR_IDENTIFIER '(' argument_expression ')'
 		{ $$ = new ExpressionNode( build_attrexpr( build_varref( $1 ), $3 ) ); }
-	| ATTR_IDENTIFIER '(' type ')'
+	| ATTR_IDENTIFIER '(' type_name ')'
 		{ $$ = new ExpressionNode( build_attrtype( build_varref( $1 ), $3 ) ); }
 //	| ANDAND IDENTIFIER									// GCC, address of label
@@ -566,7 +569,7 @@
 cast_expression:
 	unary_expression
-	| '(' type_no_function ')' cast_expression
+	| '(' type_name_no_function ')' cast_expression
 		{ $$ = new ExpressionNode( build_cast( $2, $4 ) ); }
-//	| '(' type_no_function ')' tuple
+//	| '(' type_name_no_function ')' tuple
 //		{ $$ = new ExpressionNode( build_cast( $2, $4 ) ); }
 	;
@@ -655,4 +658,6 @@
 	| logical_OR_expression '?' /* empty */ ':' conditional_expression // GCC, omitted first operand
 		{ $$ = new ExpressionNode( build_cond( $1, $1, $4 ) ); }
+//	| logical_OR_expression '?' comma_expression ':' tuple // CFA, tuple expression
+//		{ $$ = new ExpressionNode( build_cond( $1, $3, $5 ) ); }
 	;
 
@@ -666,4 +671,6 @@
 	| unary_expression assignment_operator assignment_expression
 		{ $$ = new ExpressionNode( build_binary_ptr( $2, $1, $3 ) ); }
+//	| tuple assignment_opt								// CFA, tuple expression
+//		{ $$ = ( $2 == 0 ) ? $1 : new ExpressionNode( build_binary_ptr( OperKinds::Assign, $1, $2 ) ); }
 	;
 
@@ -1345,5 +1352,6 @@
 	basic_declaration_specifier
 	| sue_declaration_specifier
-	| type_declaration_specifier
+	| typedef_declaration_specifier
+	| typegen_declaration_specifier
 	;
 
@@ -1356,5 +1364,6 @@
 	basic_declaration_specifier
 	| sue_declaration_specifier_nobody
-	| type_declaration_specifier
+	| typedef_declaration_specifier
+	| typegen_declaration_specifier
 	;
 
@@ -1362,5 +1371,6 @@
 	basic_type_specifier
 	| sue_type_specifier
-	| type_type_specifier
+	| typedef_type_specifier
+	| typegen_type_specifier
 	;
 
@@ -1373,5 +1383,6 @@
 	basic_type_specifier
 	| sue_type_specifier_nobody
-	| type_type_specifier
+	| typedef_type_specifier
+	| typegen_type_specifier
 	;
 
@@ -1508,26 +1519,26 @@
 
 basic_type_specifier:
-	direct_type
-	| type_qualifier_list_opt indirect_type type_qualifier_list_opt
+	direct_type_name
+	| type_qualifier_list_opt indirect_type_name type_qualifier_list_opt
 		{ $$ = $2->addQualifiers( $1 )->addQualifiers( $3 ); }
 	;
 
-direct_type:
+direct_type_name:
 		// A semantic check is necessary for conflicting type qualifiers.
 	basic_type_name
 	| type_qualifier_list basic_type_name
 		{ $$ = $2->addQualifiers( $1 ); }
-	| direct_type type_qualifier
-		{ $$ = $1->addQualifiers( $2 ); }
-	| direct_type basic_type_name
+	| direct_type_name type_qualifier
+		{ $$ = $1->addQualifiers( $2 ); }
+	| direct_type_name basic_type_name
 		{ $$ = $1->addType( $2 ); }
 	;
 
-indirect_type:
-	TYPEOF '(' type ')'									// GCC: typeof(x) y;
+indirect_type_name:
+	TYPEOF '(' type_name ')'							// GCC: typeof(x) y;
 		{ $$ = $3; }
 	| TYPEOF '(' comma_expression ')'					// GCC: typeof(a+b) y;
 		{ $$ = DeclarationNode::newTypeof( $3 ); }
-	| ATTR_TYPEGENname '(' type ')'						// CFA: e.g., @type(x) y;
+	| ATTR_TYPEGENname '(' type_name ')'				// CFA: e.g., @type(x) y;
 		{ $$ = DeclarationNode::newAttr( $1, $3 ); }
 	| ATTR_TYPEGENname '(' comma_expression ')'			// CFA: e.g., @type(a+b) y;
@@ -1573,41 +1584,21 @@
 	;
 
-type_declaration_specifier:
-	type_type_specifier
-	| declaration_qualifier_list type_type_specifier
+typedef_declaration_specifier:
+	typedef_type_specifier
+	| declaration_qualifier_list typedef_type_specifier
 		{ $$ = $2->addQualifiers( $1 ); }
-	| type_declaration_specifier storage_class			// remaining OBSOLESCENT (see 2)
-		{ $$ = $1->addQualifiers( $2 ); }
-	| type_declaration_specifier storage_class type_qualifier_list
+	| typedef_declaration_specifier storage_class		// remaining OBSOLESCENT (see 2)
+		{ $$ = $1->addQualifiers( $2 ); }
+	| typedef_declaration_specifier storage_class type_qualifier_list
 		{ $$ = $1->addQualifiers( $2 )->addQualifiers( $3 ); }
 	;
 
-type_type_specifier:									// typedef types
-	type_name
-	| type_qualifier_list type_name
-		{ $$ = $2->addQualifiers( $1 ); }
-	| type_type_specifier type_qualifier
-		{ $$ = $1->addQualifiers( $2 ); }
-	;
-
-type_name:
+typedef_type_specifier:									// typedef types
 	TYPEDEFname
 		{ $$ = DeclarationNode::newFromTypedef( $1 ); }
-	| '.' TYPEDEFname
-		{ $$ = DeclarationNode::newFromTypedef( $2 ); }	// FIX ME
-	| type_name '.' TYPEDEFname
-		{ $$ = DeclarationNode::newFromTypedef( $3 ); }	// FIX ME
-	| typegen_name
-	| '.' typegen_name
-		{ $$ = $2; }									// FIX ME
-	| type_name '.' typegen_name
-		{ $$ = $3; }									// FIX ME
-	;
-
-typegen_name:											// CFA
-	TYPEGENname '(' ')'
-		{ $$ = DeclarationNode::newFromTypeGen( $1, nullptr ); }
-	| TYPEGENname '(' type_list ')'
-		{ $$ = DeclarationNode::newFromTypeGen( $1, $3 ); }
+	| type_qualifier_list TYPEDEFname
+		{ $$ = DeclarationNode::newFromTypedef( $2 )->addQualifiers( $1 ); }
+	| typedef_type_specifier type_qualifier
+		{ $$ = $1->addQualifiers( $2 ); }
 	;
 
@@ -1633,5 +1624,5 @@
 	  '{' field_declaration_list '}'
 		{ $$ = DeclarationNode::newAggregate( $1, $3, nullptr, $6, true )->addQualifiers( $2 ); }
-	| aggregate_key attribute_list_opt '(' type_list ')' '{' field_declaration_list '}' // CFA
+	| aggregate_key attribute_list_opt '(' type_name_list ')' '{' field_declaration_list '}' // CFA
 		{ $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), $4, $7, false )->addQualifiers( $2 ); }
 	| aggregate_type_nobody
@@ -1639,15 +1630,10 @@
 
 aggregate_type_nobody:									// struct, union - {...}
-	aggregate_key attribute_list_opt no_attr_identifier
+	aggregate_key attribute_list_opt no_attr_identifier_or_type_name
 		{
 			typedefTable.makeTypedef( *$3 );
 			$$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 );
 		}
-	| aggregate_key attribute_list_opt TYPEDEFname
-		{
-			typedefTable.makeTypedef( *$3 );
-			$$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 );
-		}
-	| aggregate_key attribute_list_opt typegen_name		// CFA
+	| aggregate_key attribute_list_opt typegen_name		// CFA, S/R conflict
 		{ $$ = $3->addQualifiers( $2 ); }
 	;
@@ -1887,4 +1873,10 @@
 	;
 
+no_01_identifier_or_type_name:
+	no_01_identifier
+	| TYPEDEFname
+	| TYPEGENname
+	;
+
 no_attr_identifier_or_type_name:
 	no_attr_identifier
@@ -1893,5 +1885,5 @@
 	;
 
-type_no_function:										// sizeof, alignof, cast (constructor)
+type_name_no_function:									// sizeof, alignof, cast (constructor)
 	cfa_abstract_declarator_tuple						// CFA
 	| type_specifier
@@ -1900,6 +1892,6 @@
 	;
 
-type:													// typeof, assertion
-	type_no_function
+type_name:												// typeof, assertion
+	type_name_no_function
 	| cfa_abstract_function								// CFA
 	;
@@ -1941,5 +1933,5 @@
 designation:
 	designator_list ':'									// C99, CFA uses ":" instead of "="
-	| no_attr_identifier ':'							// GCC, field name
+	| no_attr_identifier_or_type_name ':'				// GCC, field name
 		{ $$ = new ExpressionNode( build_varref( $1 ) ); }
 	;
@@ -1953,5 +1945,5 @@
 
 designator:
-	'.' no_attr_identifier								// C99, field name
+	'.' no_attr_identifier_or_type_name					// C99, field name
 		{ $$ = new ExpressionNode( build_varref( $2 ) ); }
 	| '[' push assignment_expression pop ']'			// C99, single array element
@@ -1984,16 +1976,31 @@
 //     on type arguments of polymorphic functions.
 
+typegen_declaration_specifier:							// CFA
+	typegen_type_specifier
+	| declaration_qualifier_list typegen_type_specifier
+		{ $$ = $2->addQualifiers( $1 ); }
+	| typegen_declaration_specifier storage_class		// remaining OBSOLESCENT (see 2)
+		{ $$ = $1->addQualifiers( $2 ); }
+	| typegen_declaration_specifier storage_class type_qualifier_list
+		{ $$ = $1->addQualifiers( $2 )->addQualifiers( $3 ); }
+	;
+
+typegen_type_specifier:									// CFA
+	typegen_name
+	| type_qualifier_list typegen_name
+		{ $$ = $2->addQualifiers( $1 ); }
+	| typegen_type_specifier type_qualifier
+		{ $$ = $1->addQualifiers( $2 ); }
+	;
+
+typegen_name:											// CFA
+	TYPEGENname '(' type_name_list ')'
+		{ $$ = DeclarationNode::newFromTypeGen( $1, $3 ); }
+	;
+
 type_parameter_list:									// CFA
-	type_parameter
-		{ $$ = $1; }
-	| type_parameter_list ',' type_parameter
+	type_parameter assignment_opt
+	| type_parameter_list ',' type_parameter assignment_opt
 		{ $$ = $1->appendList( $3 ); }
-	;
-
-type_initializer_opt:									// CFA
-	// empty
-		{ $$ = nullptr; }
-	| '=' type
-		{ $$ = $2; }
 	;
 
@@ -2001,6 +2008,6 @@
 	type_class no_attr_identifier_or_type_name
 		{ typedefTable.addToEnclosingScope( *$2, TypedefTable::TD ); }
-	  type_initializer_opt assertion_list_opt
-		{ $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); }
+	  assertion_list_opt
+		{ $$ = DeclarationNode::newTypeParam( $1, $2 )->addAssertions( $4 ); }
 	| type_specifier identifier_parameter_declarator
 	;
@@ -2025,5 +2032,5 @@
 
 assertion:												// CFA
-	'|' no_attr_identifier_or_type_name '(' type_list ')'
+	'|' no_attr_identifier_or_type_name '(' type_name_list ')'
 		{
 			typedefTable.openTrait( *$2 );
@@ -2032,15 +2039,15 @@
 	| '|' '{' push trait_declaration_list '}'
 		{ $$ = $4; }
-	| '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list '}' '(' type_list ')'
+	| '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list '}' '(' type_name_list ')'
 		{ $$ = nullptr; }
 	;
 
-type_list:												// CFA
-	type
+type_name_list:											// CFA
+	type_name
 		{ $$ = new ExpressionNode( build_typevalue( $1 ) ); }
 	| assignment_expression
-	| type_list ',' type
+	| type_name_list ',' type_name
 		{ $$ = (ExpressionNode *)( $1->set_last( new ExpressionNode( build_typevalue( $3 ) ) ) ); }
-	| type_list ',' assignment_expression
+	| type_name_list ',' assignment_expression
 		{ $$ = (ExpressionNode *)( $1->set_last( $3 )); }
 	;
@@ -2058,5 +2065,5 @@
 	type_declarator_name assertion_list_opt
 		{ $$ = $1->addAssertions( $2 ); }
-	| type_declarator_name assertion_list_opt '=' type
+	| type_declarator_name assertion_list_opt '=' type_name
 		{ $$ = $1->addAssertions( $2 )->addType( $4 ); }
 	;
@@ -2068,5 +2075,5 @@
 			$$ = DeclarationNode::newTypeDecl( $1, 0 );
 		}
-	| no_attr_identifier_or_type_name '(' push type_parameter_list pop ')'
+	| no_01_identifier_or_type_name '(' push type_parameter_list pop ')'
 		{
 			typedefTable.addToEnclosingScope( *$1, TypedefTable::TG );
@@ -2094,5 +2101,5 @@
 	;
 
-trait_declaration_list:									// CFA
+trait_declaration_list:								// CFA
 	trait_declaration
 	| trait_declaration_list push trait_declaration
@@ -2100,5 +2107,5 @@
 	;
 
-trait_declaration:										// CFA
+trait_declaration:									// CFA
 	cfa_trait_declaring_list pop ';'
 	| trait_declaring_list pop ';'
