Adjust Dart.g to allow constructor tearoffs

This CL updates the grammar Dart.g such that it
supports constructor tearoffs, as well as explicit
instantiations of generic functions and methods,
and parameterized types as type literals.

Change-Id: I2e30d0eb185b84fc2103c21ba962f4cbff40905a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197161
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
diff --git a/tools/spec_parser/Dart.g b/tools/spec_parser/Dart.g
index f166720..5f79d24 100644
--- a/tools/spec_parser/Dart.g
+++ b/tools/spec_parser/Dart.g
@@ -420,11 +420,11 @@
     ;
 
 constructorName
-    :    typeIdentifier ('.' identifier)?
+    :    typeIdentifier ('.' (identifier | NEW))?
     ;
 
 redirection
-    :    ':' THIS ('.' identifier)? arguments
+    :    ':' THIS ('.' (identifier | NEW))? arguments
     ;
 
 initializers
@@ -433,7 +433,7 @@
 
 initializerListEntry
     :    SUPER arguments
-    |    SUPER '.' identifier arguments
+    |    SUPER '.' (identifier | NEW) arguments
     |    fieldInitializer
     |    assertion
     ;
@@ -519,10 +519,12 @@
     |    '(' expression ')'
     |    literal
     |    identifier
+    |    constructorTearoff
     ;
 
 constructorInvocation
-    :    typeName typeArguments '.' identifier arguments
+    :    typeName typeArguments '.' NEW arguments
+    |    typeName '.' NEW arguments
     ;
 
 literal
@@ -598,6 +600,10 @@
     : AWAIT? FOR '(' forLoopParts ')' element
     ;
 
+constructorTearoff
+    :    typeName typeArguments? '.' NEW
+    ;
+
 throwExpression
     :    THROW expression
     ;
@@ -850,6 +856,7 @@
     :    '!'
     |    assignableSelector
     |    argumentPart
+    |    typeArguments
     ;
 
 argumentPart
@@ -900,8 +907,8 @@
     ;
 
 qualifiedName
-    :    typeIdentifier '.' identifier
-    |    typeIdentifier '.' typeIdentifier '.' identifier
+    :    typeIdentifier '.' (identifier | NEW)
+    |    typeIdentifier '.' typeIdentifier '.' (identifier | NEW)
     ;
 
 typeIdentifier
@@ -1249,7 +1256,7 @@
 constructorDesignation
     :    typeIdentifier
     |    qualifiedName
-    |    typeName typeArguments ('.' identifier)?
+    |    typeName typeArguments ('.' (identifier | NEW))?
     ;
 
 symbolLiteral