private void setupLR ( String production , final LR l ) throws ParserException { /* * If the lr object does not contain a head, we found a new recursion * production. Otherwise we already know the production, but we found another * production which is involved in the recursion. */ if ( l . getHead ( ) == null ) l . setHead ( new Head ( production ) ) ; /* * Go over all heads and...!? */ RuleInvocation s = ruleInvocationStack ; while ( ! l . getHead ( ) . getProduction ( ) . equals ( s . getProduction ( ) ) ) { s . setHead ( l . getHead ( ) ) ; l . getHead ( ) . addInvolved ( s . getProduction ( ) ) ; s = s . getNext ( ) ; if ( s == null ) throw new RuntimeException ( "We should find the head again, when we search the stack.\n" + "We found a recursion and the rule should be there again." ) ; } }
After finding a recursion or a seed grow in process this method puts all information in place for seed grow . This might be the start information for the growth or the current result in the growing which means the current result .