diff -c -r1.1 LL1Analyzer.java
*** LL1Analyzer.java	21 Feb 2011 11:38:07 -0000	1.1
--- LL1Analyzer.java	21 Feb 2011 11:41:11 -0000
***************
*** 232,242 ****
  		// compute FIRST of transition 0
  		LookaheadSet tset = null;
  		// if transition 0 is a rule call and we don't want FOLLOW, check cache
!		if ( !chaseFollowTransitions && transition0 instanceof RuleClosureTransition ) {
! 			LookaheadSet prev = FIRSTCache.get((NFAState)transition0.target);
! 			if ( prev!=null ) {
! 				tset = new LookaheadSet(prev);
! 			}
  		}
  
  		// if not in cache, must compute
--- 232,239 ----
  		// compute FIRST of transition 0
  		LookaheadSet tset = null;
  		// if transition 0 is a rule call and we don't want FOLLOW, check cache
! 	        if ( !chaseFollowTransitions && transition0 instanceof RuleClosureTransition ) {
! 			tset = FIRSTCache.get((NFAState)transition0.target);
  		}
  
  		// if not in cache, must compute
***************
*** 248,253 ****
--- 245,252 ----
  			}
  		}
  
+ 		LookaheadSet tsetCached = tset; // tset is stored in cache. We can't return the same instance
+ 
  		// did we fall off the end?
  		if ( grammar.type!=Grammar.LEXER && tset.member(Label.EOR_TOKEN_TYPE) ) {
  			if ( transition0 instanceof RuleClosureTransition ) {
***************
*** 272,282 ****
  		if ( transition1!=null ) {
  			LookaheadSet tset1 =
  				_FIRST((NFAState)transition1.target, chaseFollowTransitions);
! 			tset1.orInPlace(tset); // tset cached; or into new set
! 			tset = tset1;
  		}
! 
! 		return tset;
  	}
  
  	/** Is there a non-syn-pred predicate visible from s that is not in
--- 271,280 ----
  		if ( transition1!=null ) {
  			LookaheadSet tset1 =
  				_FIRST((NFAState)transition1.target, chaseFollowTransitions);
! 			tset1.orInPlace(tset);
!			tset = tset1;
  		}
! 		return tset==tsetCached ? new LookaheadSet(tset) : tset;
  	}
  
  	/** Is there a non-syn-pred predicate visible from s that is not in
