Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision f238fcc2eafd0e0a792e3db3f23ab47e63d45c2b)
+++ src/Parser/parser.yy	(revision e88c2fb9d35f0413c5318518ead8880e8cdc3d45)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Feb  1 11:06:13 2022
-// Update Count     : 5167
+// Last Modified On : Mon Mar 14 16:35:29 2022
+// Update Count     : 5276
 //
 
@@ -610,4 +610,18 @@
 	// | RESUME '(' comma_expression ')' compound_statement
 	//   	{ SemanticError( yylloc, "Resume expression is currently unimplemented." ); $$ = nullptr; }
+	| IDENTIFIER IDENTIFIER								// syntax error
+		{
+			SemanticError( yylloc, ::toString( "Adjacent identifiers are not meaningful in an expression. "
+											   "Possible problem is identifier \"", *$1.str,
+											   "\" is a misspelled typename or an incorrectly specified type name, "
+											   "e.g., missing generic parameter or missing struct/union/enum before typename." ) );
+			$$ = nullptr;
+ 		}
+	| IDENTIFIER direct_type							// syntax error
+		{
+			SemanticError( yylloc, ::toString( "Identifier \"", *$1.str, "\" cannot appear before a type. "
+											   "Possible problem is misspelled storage or CV qualifier." ) );
+			$$ = nullptr;
+		}
 	;
 
@@ -638,5 +652,4 @@
 			// Historic, transitional: Disallow commas in subscripts.
 			// Switching to this behaviour may help check if a C compatibilty case uses comma-exprs in subscripts.
-		// { SemanticError( yylloc, "New array subscript is currently unimplemented." ); $$ = nullptr; }
 			// Current: Commas in subscripts make tuples.
 		{ $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, new ExpressionNode( build_tuple( (ExpressionNode *)($3->set_last( $5 ) ) )) ) ); }
@@ -647,4 +660,8 @@
 		// equivalent to the old x[i,j].
 		{ $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $3 ) ); }
+	| constant '[' assignment_expression ']'			// 3[a], 'a'[a], 3.5[a]
+		{ $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $3 ) ); }
+	| string_literal '[' assignment_expression ']'		// "abc"[3], 3["abc"]
+		{ $$ = new ExpressionNode( build_binary_val( OperKinds::Index, new ExpressionNode( $1 ), $3 ) ); }
 	| postfix_expression '{' argument_expression_list_opt '}' // CFA, constructor call
 		{
@@ -1052,4 +1069,11 @@
 	identifier_or_type_name ':' attribute_list_opt statement
 		{ $$ = $4->add_label( $1, $3 ); }
+	| identifier_or_type_name ':' attribute_list_opt error // syntax error
+		{
+			SemanticError( yylloc, ::toString( "Label \"", *$1.str, "\" must be associated with a statement, "
+											   "where a declaration, case, or default is not a statement. "
+											   "Move the label or terminate with a semi-colon." ) );
+			$$ = nullptr;
+		}
 	;
 
@@ -1086,4 +1110,6 @@
 	| statement_list_nodecl statement
 		{ assert( $1 ); $1->set_last( $2 ); $$ = $1; }
+	| statement_list_nodecl error						// syntax error
+		{ SemanticError( yylloc, "Declarations only allowed at the start of the switch body, i.e., after the '{'." ); $$ = nullptr; }
 	;
 
@@ -1093,5 +1119,4 @@
 	| MUTEX '(' ')' comma_expression ';'
 		{ $$ = new StatementNode( build_mutex( nullptr, new StatementNode( build_expr( $4 ) ) ) ); }
-		// { SemanticError( yylloc, "Mutex expression is currently unimplemented." ); $$ = nullptr; }
 	;
 
@@ -1113,4 +1138,6 @@
 			$$ = $7 ? new StatementNode( build_compound( (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw;
 		}
+	| SWITCH '(' comma_expression ')' '{' error '}'		// CFA, syntax error
+		{ SemanticError( yylloc, "Only declarations can appear before the list of case clauses." ); $$ = nullptr; }
 	| CHOOSE '(' comma_expression ')' case_clause		// CFA
 		{ $$ = new StatementNode( build_switch( false, $3, $5 ) ); }
@@ -1120,4 +1147,6 @@
 			$$ = $7 ? new StatementNode( build_compound( (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw;
 		}
+	| CHOOSE '(' comma_expression ')' '{' error '}'		// CFA, syntax error
+		{ SemanticError( yylloc, "Only declarations can appear before the list of case clauses." ); $$ = nullptr; }
 	;
 
@@ -1158,14 +1187,14 @@
 
 case_label:												// CFA
-	CASE case_value_list ':'					{ $$ = $2; }
+	CASE error											// syntax error
+		{ SemanticError( yylloc, "Missing case list after case." ); $$ = nullptr; }
+	| CASE case_value_list ':'					{ $$ = $2; }
+	| CASE case_value_list error						// syntax error
+		{ SemanticError( yylloc, "Missing colon after case list." ); $$ = nullptr; }
 	| DEFAULT ':'								{ $$ = new StatementNode( build_default() ); }
 		// A semantic check is required to ensure only one default clause per switch/choose statement.
-	;
-
-//label_list_opt:
-//	// empty
-//	| identifier_or_type_name ':'
-//	| label_list_opt identifier_or_type_name ':'
-//	;
+	| DEFAULT error										//  syntax error
+		{ SemanticError( yylloc, "Missing colon after default." ); $$ = nullptr; }
+	;
 
 case_label_list:										// CFA
@@ -1197,5 +1226,4 @@
 		{ $$ = new StatementNode( build_while( $3, maybe_build_compound( $5 ) ) ); }
 	| WHILE '(' conditional_declaration ')' statement ELSE statement // CFA
-		// { SemanticError( yylloc, "Loop default block is currently unimplemented." ); $$ = nullptr; }
 		{ $$ = new StatementNode( build_while( $3, maybe_build_compound( $5 ), $7 ) ); }
 	| DO statement WHILE '(' ')' ';'					// CFA => do while( 1 )
@@ -1204,5 +1232,4 @@
 		{ $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ) ) ); }
 	| DO statement WHILE '(' comma_expression ')' ELSE statement // CFA
-		// { SemanticError( yylloc, "Loop default block is currently unimplemented." ); $$ = nullptr; }
 		{ $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ), $8 ) ); }
 	| FOR '(' ')' statement								// CFA => for ( ;; )
@@ -1211,5 +1238,4 @@
 	  	{ $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ) ) ); }
 	| FOR '(' for_control_expression_list ')' statement ELSE statement // CFA
-		// { SemanticError( yylloc, "Loop default block is currently unimplemented." ); $$ = nullptr; }
 		{ $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ), $7 ) ); }
 	;
@@ -1406,6 +1432,6 @@
 	| when_clause_opt ELSE statement
 		{ $$ = build_waitfor_timeout( nullptr, maybe_build_compound( $3 ), $1 ); }
-		// "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless)
-	| when_clause_opt timeout statement WOR ELSE statement
+	// "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless)
+	| when_clause_opt timeout statement WOR ELSE statement // syntax error
 		{ SemanticError( yylloc, "else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; }
 	| when_clause_opt timeout statement WOR when_clause ELSE statement
@@ -2735,4 +2761,15 @@
 	| ASM '(' string_literal ')' ';'					// GCC, global assembler statement
 		{ $$ = DeclarationNode::newAsmStmt( new StatementNode( build_asm( false, $3, 0 ) ) ); }
+	| EXTERN STRINGliteral
+		{
+			linkageStack.push( linkage );				// handle nested extern "C"/"Cforall"
+			linkage = LinkageSpec::update( yylloc, linkage, $2 );
+		}
+	  up external_definition down 
+		{
+			linkage = linkageStack.top();
+			linkageStack.pop();
+			$$ = $5;
+		}
 	| EXTERN STRINGliteral								// C++-style linkage specifier
 		{
