anchor.diff:          expect(analyzer.isNullable(parsers[#Tp]!), isTrue);
           expect(analyzer.isNullable(parsers[#F]!), isFalse);
         });
  +      test('ambiguous grammar', () {
  +        final parsers = createAmbiguous();
  +        final analyzer = Analyzer(parsers[#S]!);
  +        expect(analyzer.isNullable(parsers[#S]!), isFalse);
  +        expect(analyzer.isNullable(parsers[#A]!), isFalse);
  +        expect(analyzer.isNullable(parsers[#B]!), isFalse);
  +        expect(analyzer.isNullable(parsers[#a]!), isFalse);
  +        expect(analyzer.isNullable(parsers[#b]!), isFalse);
  +      });
  +      test('recursive grammar', () {
  +        final parsers = createRecursive();
  +        final analyzer = Analyzer(parsers[#S]!);
  +        expect(analyzer.isNullable(parsers[#S]!), isFalse);
  +        expect(analyzer.isNullable(parsers[#P]!), isFalse);
  +        expect(analyzer.isNullable(parsers[#p]!), isFalse);
  +      });
       });
       group('first-set', () {
         test('plus', () {
  
positive.code:         expectTerminals(analyzer.firstSet(parsers[#Tp]!), ['*', '']);
          expectTerminals(analyzer.firstSet(parsers[#F]!), ['(', 'i']);
        });
      });
      group('follow-set', () {
        test('plus', () {
  
negative.code:   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 = {
  