anchor.diff:      expect(unreferenced, isEmpty, reason: 'Translated but not referenced');
     }
   }
  +
  +/**
  + * A visitor that gathers the names of all the message codes that are generated
  + * in the visited AST. This assumes that the codes are accessed via the prefix
  + * 'fasta'.
  + */
  +class GeneratedCodesVisitor extends RecursiveAstVisitor {
  +  /**
  +   * The names of the message codes that are generated in the visited AST.
  +   */
  +  Set<String> generatedNames = new Set<String>();
  +
  +  @override
  +  visitPrefixedIdentifier(PrefixedIdentifier node) {
  +    if (node.prefix.name == 'fasta') {
  +      String name = node.identifier.name;
  +      if (name.startsWith('message')) {
  +        name = name.substring(7);
  +      } else if (name.startsWith('template')) {
  +        name = name.substring(8);
  +      } else {
  +        return;
  +      }
  +      generatedNames.add(name);
  +    }
  +  }
  +}
  
positive.code:     return codes.toList();
    }
  
    List<String> getTranslatedCodes(String astBuilderPath) {
      String content = new io.File(astBuilderPath).readAsStringSync();
      CompilationUnit unit = parseCompilationUnit(content);
  
negative.code: import 'dart:io' as io;
  
  import 'package:analyzer/dart/ast/ast.dart';
  import 'package:analyzer/dart/ast/visitor.dart';
  import 'package:front_end/src/testing/package_root.dart' as package_root;
  import 'package:path/path.dart' as path;
  import 'package:test/test.dart';
  