anchor.diff:      push(forLoopParts);
     }
   
  -  @override
  -  void endForControlFlow(Token token) {
  -    debugEvent("endForControlFlow");
  -    var entry = pop();
  -    ForParts forLoopParts = pop();
  -    Token leftParen = pop();
  -    Token forToken = pop();
  -
  -    pushForControlFlowInfo(null, forToken, leftParen, forLoopParts, entry);
  -  }
  -
  -  void pushForControlFlowInfo(Token awaitToken, Token forToken,
  -      Token leftParenthesis, ForLoopParts forLoopParts, Object entry) {
  -    if (entry == _invalidCollectionElement) {
  -      push(_invalidCollectionElement);
  -    } else if (enableControlFlowCollections) {
  -      push(ast.forElement(
  -        awaitKeyword: awaitToken,
  -        forKeyword: forToken,
  -        leftParenthesis: leftParenthesis,
  -        forLoopParts: forLoopParts,
  -        rightParenthesis: leftParenthesis.endGroup,
  -        body: entry as CollectionElement,
  -      ));
  -    } else {
  -      handleRecoverableError(
  -          templateExperimentNotEnabled
  -              .withArguments(EnableString.control_flow_collections),
  -          forToken,
  -          forToken);
  -      push(_invalidCollectionElement);
  -    }
  -  }
  -
  -  @override
  -  void endForStatement(Token endToken) {
  -    debugEvent("ForStatement");
  -    Statement body = pop();
  -    ForParts forLoopParts = pop();
  -    Token leftParen = pop();
  -    Token forToken = pop();
  -
  -    if (enableControlFlowCollections || enableSpreadCollections) {
  -      push(ast.forStatement2(
  -        forKeyword: forToken,
  -        leftParenthesis: leftParen,
  -        forLoopParts: forLoopParts,
  -        rightParenthesis: leftParen.endGroup,
  -        body: body,
  -      ));
  -    } else {
  -      VariableDeclarationList variableList;
  -      Expression initializer;
  -      if (forLoopParts is ForPartsWithDeclarations) {
  -        variableList = forLoopParts.variables;
  +  void handleFormalParameterWithoutValue(Token token) {
  +    debugEvent("FormalParameterWithoutValue");
  +
  +    push(NullValue.ParameterDefaultValue);
  +  }
  +
  +  void handleIdentifier(Token token, IdentifierContext context) {
  +    assert(token.isKeywordOrIdentifier);
  +    debugEvent("handleIdentifier");
  +
  +    if (context.inSymbol) {
  +      push(token);
  +      return;
  +    }
  +
  +    SimpleIdentifier identifier =
  +        ast.simpleIdentifier(token, isDeclaration: context.inDeclaration);
  +    if (context.inLibraryOrPartOfDeclaration) {
  +      if (!context.isContinuation) {
  +        push([identifier]);
         } else {
  -        initializer = (forLoopParts as ForPartsWithExpression).initialization;
  -      }
  -      push(ast.forStatement(
  -          forToken,
  -          leftParen,
  -          variableList,
  -          initializer,
  -          forLoopParts.leftSeparator,
  -          forLoopParts.condition,
  -          forLoopParts.rightSeparator,
  -          forLoopParts.updaters,
  -          leftParen?.endGroup,
  -          body));
  -    }
  +        push(identifier);
  +      }
  +    } else if (context == IdentifierContext.enumValueDeclaration) {
  +      List<Annotation> metadata = pop();
  +      Comment comment = _findComment(null, token);
  +      push(ast.enumConstantDeclaration(comment, metadata, identifier));
  +    } else {
  +      push(identifier);
  +    }
  +  }
  +
  +  @override
  +  void handleIdentifierList(int count) {
  +    debugEvent("IdentifierList");
  +
  +    push(popTypedList<SimpleIdentifier>(count) ?? NullValue.IdentifierList);
  +  }
  +
  +  @override
  +  void handleImportPrefix(Token deferredKeyword, Token asKeyword) {
  +    assert(optionalOrNull('deferred', deferredKeyword));
  +    assert(optionalOrNull('as', asKeyword));
  +    debugEvent("ImportPrefix");
  +
  +    if (asKeyword == null) {
  +      // If asKeyword is null, then no prefix has been pushed on the stack.
  +      // Push a placeholder indicating that there is no prefix.
  +      push(NullValue.Prefix);
  +      push(NullValue.As);
  +    } else {
  +      push(asKeyword);
  +    }
  +    push(deferredKeyword ?? NullValue.Deferred);
  +  }
  +
  +  void handleIndexedExpression(Token leftBracket, Token rightBracket) {
  +    assert(optional('[', leftBracket));
  +    assert(optional(']', rightBracket));
  +    debugEvent("IndexedExpression");
  +
  +    Expression index = pop();
  +    Expression target = pop();
  +    if (target == null) {
  +      CascadeExpression receiver = pop();
  +      Token token = peek();
  +      push(receiver);
  +      IndexExpression expression = ast.indexExpressionForCascade(
  +          token, leftBracket, index, rightBracket);
  +      assert(expression.isCascaded);
  +      push(expression);
  +    } else {
  +      push(ast.indexExpressionForTarget(
  +          target, leftBracket, index, rightBracket));
  +    }
  +  }
  +
  +  @override
  +  void handleInterpolationExpression(Token leftBracket, Token rightBracket) {
  +    Expression expression = pop();
  +    push(ast.interpolationExpression(leftBracket, expression, rightBracket));
  +  }
  +
  +  @override
  +  void handleInvalidExpression(Token token) {
  +    debugEvent("InvalidExpression");
  +  }
  +
  +  @override
  +  void handleInvalidFunctionBody(Token leftBracket) {
  +    assert(optional('{', leftBracket));
  +    assert(optional('}', leftBracket.endGroup));
  +    debugEvent("InvalidFunctionBody");
  +    Block block = ast.block(leftBracket, [], leftBracket.endGroup);
  +    Token star = pop();
  +    Token asyncKeyword = pop();
  +    push(ast.blockFunctionBody(asyncKeyword, star, block));
  +  }
  +
  +  @override
  +  void handleInvalidMember(Token endToken) {
  +    debugEvent("InvalidMember");
  +    pop(); // metadata star
  +  }
  +
  +  @override
  +  void handleInvalidOperatorName(Token operatorKeyword, Token token) {
  +    assert(optional('operator', operatorKeyword));
  +    debugEvent("InvalidOperatorName");
  +
  +    push(new _OperatorName(
  +        operatorKeyword, ast.simpleIdentifier(token, isDeclaration: true)));
  +  }
  +
  +  void handleInvalidTopLevelBlock(Token token) {
  +    // TODO(danrubel): Consider improved recovery by adding this block
  +    // as part of a synthetic top level function.
  +    pop(); // block
  +  }
  +
  +  @override
  +  void handleInvalidTopLevelDeclaration(Token endToken) {
  +    debugEvent("InvalidTopLevelDeclaration");
  +
  +    pop(); // metadata star
  +    // TODO(danrubel): consider creating a AST node
  +    // representing the invalid declaration to better support code completion,
  +    // quick fixes, etc, rather than discarding the metadata and token
  +  }
  +
  +  @override
  +  void handleInvalidTypeArguments(Token token) {
  +    TypeArgumentList invalidTypeArgs = pop();
  +    var node = pop();
  +    if (node is ConstructorName) {
  +      push(new _ConstructorNameWithInvalidTypeArgs(node, invalidTypeArgs));
  +    } else {
  +      throw new UnimplementedError();
  +    }
  +  }
  +
  +  void handleIsOperator(Token isOperator, Token not) {
  +    assert(optional('is', isOperator));
  +    assert(optionalOrNull('!', not));
  +    debugEvent("IsOperator");
  +
  +    TypeAnnotation type = pop();
  +    Expression expression = pop();
  +    push(ast.isExpression(expression, isOperator, not, type));
  +  }
  +
  +  @override
  +  void handleLabel(Token colon) {
  +    assert(optionalOrNull(':', colon));
  +    debugEvent("Label");
  +
  +    SimpleIdentifier name = pop();
  +    push(ast.label(name, colon));
  +  }
  +
  +  void handleLiteralBool(Token token) {
  +    bool value = identical(token.stringValue, "true");
  +    assert(value || identical(token.stringValue, "false"));
  +    debugEvent("LiteralBool");
  +
  +    push(ast.booleanLiteral(token, value));
  +  }
  +
  +  void handleLiteralDouble(Token token) {
  +    assert(token.type == TokenType.DOUBLE);
  +    debugEvent("LiteralDouble");
  +
  +    push(ast.doubleLiteral(token, double.parse(token.lexeme)));
  +  }
  +
  +  void handleLiteralInt(Token token) {
  +    assert(identical(token.kind, INT_TOKEN) ||
  +        identical(token.kind, HEXADECIMAL_TOKEN));
  +    debugEvent("LiteralInt");
  +
  +    push(ast.integerLiteral(token, int.tryParse(token.lexeme)));
     }
   
     void handleLiteralList(
  
positive.code:     push(popTypedList(count, new List<TypeParameter>(count)));
    }
  
    @override
    void endTypeVariable(Token token, int index, Token extendsOrSuper) {
      debugEvent("TypeVariable");
      assert(extendsOrSuper == null ||
          optional('extends', extendsOrSuper) ||
          optional('super', extendsOrSuper));
      TypeAnnotation bound = pop();
  
      // Peek to leave type parameters on top of stack.
      List<TypeParameter> typeParameters = peek();
      typeParameters[index]
        ..extendsKeyword = extendsOrSuper
        ..bound = bound;
    }
  
    @override
    void endTypeVariables(Token beginToken, Token endToken) {
      assert(optional('<', beginToken));
      assert(optional('>', endToken));
      debugEvent("TypeVariables");
  
      List<TypeParameter> typeParameters = pop();
      push(ast.typeParameterList(beginToken, typeParameters, endToken));
    }
  
    @override
    void beginMethod(Token externalToken, Token staticToken, Token covariantToken,
        Token varFinalOrConst, Token getOrSet, Token name) {
      _Modifiers modifiers = new _Modifiers();
      if (externalToken != null) {
        assert(externalToken.isModifier);
        modifiers.externalKeyword = externalToken;
      }
      if (staticToken != null) {
        assert(staticToken.isModifier);
        String className = classDeclaration != null
            ? classDeclaration.name.name
            : mixinDeclaration.name.name;
        if (name?.lexeme == className && getOrSet == null) {
          // This error is also reported in OutlineBuilder.beginMethod
          handleRecoverableError(
              messageStaticConstructor, staticToken, staticToken);
        } else {
          modifiers.staticKeyword = staticToken;
        }
      }
      if (covariantToken != null) {
        assert(covariantToken.isModifier);
        modifiers.covariantKeyword = covariantToken;
      }
      if (varFinalOrConst != null) {
        assert(varFinalOrConst.isModifier);
        modifiers.finalConstOrVarKeyword = varFinalOrConst;
      }
      push(modifiers);
    }
  
    @override
    void endMethod(
        Token getOrSet, Token beginToken, Token beginParam, Token endToken) {
      assert(getOrSet == null ||
          optional('get', getOrSet) ||
          optional('set', getOrSet));
      debugEvent("Method");
  
      var bodyObject = pop();
      List<ConstructorInitializer> initializers = pop() ?? const [];
      Token separator = pop();
      FormalParameterList parameters = pop();
      TypeParameterList typeParameters = pop();
      var name = pop();
      TypeAnnotation returnType = pop();
      _Modifiers modifiers = pop();
      List<Annotation> metadata = pop();
      Comment comment = _findComment(metadata, beginToken);
  
      assert(parameters != null || optional('get', getOrSet));
  
      ConstructorName redirectedConstructor;
      FunctionBody body;
      if (bodyObject is FunctionBody) {
        body = bodyObject;
      } else if (bodyObject is _RedirectingFactoryBody) {
        separator = bodyObject.equalToken;
        redirectedConstructor = bodyObject.constructorName;
        body = ast.emptyFunctionBody(endToken);
      } else {
        unhandled("${bodyObject.runtimeType}", "bodyObject",
            beginToken.charOffset, uri);
      }
  
      ClassOrMixinDeclarationImpl declaration =
          classDeclaration ?? mixinDeclaration;
  
      void constructor(
          SimpleIdentifier prefixOrName, Token period, SimpleIdentifier name) {
        if (typeParameters != null) {
          // Outline builder also reports this error message.
          handleRecoverableError(messageConstructorWithTypeParameters,
              typeParameters.beginToken, typeParameters.endToken);
        }
        if (modifiers?.constKeyword != null &&
            body != null &&
            (body.length > 1 || body.beginToken?.lexeme != ';')) {
          // This error is also reported in BodyBuilder.finishFunction
          Token bodyToken = body.beginToken ?? modifiers.constKeyword;
          handleRecoverableError(
              messageConstConstructorWithBody, bodyToken, bodyToken);
        }
        if (returnType != null) {
          // This error is also reported in OutlineBuilder.endMethod
          handleRecoverableError(messageConstructorWithReturnType,
              returnType.beginToken, returnType.beginToken);
        }
        ConstructorDeclaration constructor = ast.constructorDeclaration(
            comment,
            metadata,
            modifiers?.externalKeyword,
            modifiers?.finalConstOrVarKeyword,
            null, // TODO(paulberry): factoryKeyword
            ast.simpleIdentifier(prefixOrName.token),
            period,
            name,
            parameters,
            separator,
            initializers,
            redirectedConstructor,
            body);
        declaration.members.add(constructor);
        if (mixinDeclaration != null) {
          // TODO (danrubel): Report an error if this is a mixin declaration.
        }
      }
  
      void method(Token operatorKeyword, SimpleIdentifier name) {
        if (modifiers?.constKeyword != null &&
            body != null &&
            (body.length > 1 || body.beginToken?.lexeme != ';')) {
          // This error is also reported in OutlineBuilder.endMethod
          handleRecoverableError(
              messageConstMethod, modifiers.constKeyword, modifiers.constKeyword);
        }
        checkFieldFormalParameters(parameters);
        declaration.members.add(ast.methodDeclaration(
            comment,
            metadata,
            modifiers?.externalKeyword,
            modifiers?.abstractKeyword ?? modifiers?.staticKeyword,
            returnType,
            getOrSet,
            operatorKeyword,
            name,
            typeParameters,
            parameters,
            body));
      }
  
      if (name is SimpleIdentifier) {
        if (name.name == declaration.name.name && getOrSet == null) {
          constructor(name, null, null);
        } else if (initializers.isNotEmpty) {
          constructor(name, null, null);
        } else {
          method(null, name);
        }
      } else if (name is _OperatorName) {
        method(name.operatorKeyword, name.name);
      } else if (name is PrefixedIdentifier) {
        constructor(name.prefix, name.period, name.identifier);
      } else {
        throw new UnimplementedError();
      }
    }
  
    void checkFieldFormalParameters(FormalParameterList parameters) {
      if (parameters?.parameters != null) {
        parameters.parameters.forEach((FormalParameter param) {
          if (param is FieldFormalParameter) {
            // This error is reported in the BodyBuilder.endFormalParameter.
            handleRecoverableError(messageFieldInitializerOutsideConstructor,
                param.thisKeyword, param.thisKeyword);
          }
        });
      }
    }
  
    @override
    void handleInvalidMember(Token endToken) {
      debugEvent("InvalidMember");
      pop(); // metadata star
    }
  
    @override
    void endMember() {
      debugEvent("Member");
    }
  
    @override
  
negative.code:     return references;
    }
  
    List<CollectionElement> popCollectionElements(int count) {
      final elements = new List<CollectionElement>()..length = count;
      for (int index = count - 1; index >= 0; --index) {
        var element = pop();
        elements[index] = element as CollectionElement;
      }
      return elements;
    }
  
    List popList(int n, List list) {
      if (n == 0) return null;
      return stack.popList(n, list, null);
    }
  
    List<T> popTypedList<T>(int count, [List<T> list]) {
  