anchor.diff:    return grammar;
   }
   
  +// A highly ambiguous grammar by Saichaitanya Jampana. Exploring the problem of
  +// ambiguity in context-free grammars.
  +Map<Symbol, Parser> createAmbiguous() {
  +  final grammar = <Symbol, SettableParser>{
  +    for (final symbol in [#S, #A, #a, #B, #b]) symbol: undefined(),
  +  };
  +  grammar[#S]!.set((grammar[#A]! & grammar[#B]!) | grammar[#a]!);
  +  grammar[#A]!.set((grammar[#S]! & grammar[#B]!) | grammar[#b]!);
  +  grammar[#a]!.set(char('a'));
  +  grammar[#B]!.set((grammar[#B]! & grammar[#A]!) | grammar[#a]!);
  +  grammar[#b]!.set(char('b'));
  +  return grammar;
  +}
  +
  +// A highly recursive parser.
  +Map<Symbol, Parser> createRecursive() {
  +  final grammar = <Symbol, SettableParser>{
  +    for (final symbol in [#S, #P, #p]) symbol: undefined(),
  +  };
  +  grammar[#S]!.set(grammar[#P]! | grammar[#p]!);
  +  grammar[#P]!.set(grammar[#S]! & char('+') & grammar[#S]!);
  +  grammar[#p]!.set(char('p'));
  +  return grammar;
  +}
  +
   void expectTerminals(Iterable<Parser> parsers, Iterable<String> inputs) {
     final expectedInputs = {...inputs};
     final actualInputs = {
  
positive.code:         expectTerminals(analyzer.firstSet(parsers[#Tp]!), ['*', '']);
          expectTerminals(analyzer.firstSet(parsers[#F]!), ['(', 'i']);
        });
      });
      group('follow-set', () {
        test('plus', () {
  
negative.code:         expectTerminals(analyzer.followSet(parsers[#T]!), [')', '+', '']);
          expectTerminals(analyzer.followSet(parsers[#Tp]!), [')', '+', '']);
          expectTerminals(analyzer.followSet(parsers[#F]!), [')', '+', '*', '']);
        });
        test('ambiguous grammar', () {
          final parsers = createAmbiguous();
          final analyzer = Analyzer(parsers[#S]!);
          expectTerminals(analyzer.followSet(parsers[#S]!), ['a', '']);
          expectTerminals(analyzer.followSet(parsers[#A]!), ['a', 'b', '']);
          expectTerminals(analyzer.followSet(parsers[#B]!), ['a', 'b', '']);
          expectTerminals(analyzer.followSet(parsers[#a]!), ['a', 'b', '']);
          expectTerminals(analyzer.followSet(parsers[#b]!), ['a', 'b', '']);
        });
        test('recursive grammar', () {
          final parsers = createRecursive();
          final analyzer = Analyzer(parsers[#S]!);
          expectTerminals(analyzer.followSet(parsers[#S]!), ['+', '']);
          expectTerminals(analyzer.followSet(parsers[#P]!), ['+', '']);
          expectTerminals(analyzer.followSet(parsers[#p]!), ['+', '']);
        });
      });
    });
  