kernel/src/main/java/org/kframework/parser/inner/kernel/EarleyParser.java
/**
   * Construct the new parse tree for a state during the "complete" step, or after a nullable non-terminal in the
   * "predict" step.
   *
   * @param sort The sort that was just parsed.
   * @param start The start-index of the state being processed.
   * @param nextState The {@link EarleyState} to add the parse tree derivations to.
   * @param completed The {@link EarleyState} containing the parse tree prior to processing this non-terminal.
   * @param end The {@link EarleySet} representing the end-index being processed by the parser.
   */
Construct the new parse tree for a state during the "complete" step, or after a nullable non-terminal in the
"predict" step.

@param sort The sort that was just parsed.
@param start The start-index of the state being processed.
@param nextState The  EarleyState to add the parse tree derivations to.
@param completed The  EarleyState containing the parse tree prior to processing this non-terminal.
@param end The  EarleySet representing the end-index being processed by the parser.
Construct the new parse tree for a state during the " complete " step or after a nullable non - terminal in the " predict " step . @param sort The sort that was just parsed . @param start The start - index of the state being processed . @param nextState The EarleyState to add the parse tree derivations to . @param completed The EarleyState containing the parse tree prior to processing this non - terminal . @param end The EarleySet representing the end - index being processed by the parser .
private void wrapAndAppend(int sort, int start, EarleyState nextState, EarleyState completed, EarleySet end) {
    Term newTerm = Ambiguity.apply(end.completedParses(sort, start));
    for (PStack<Term> terms : completed.parseTree()) {
      nextState.parseTree.add(terms.plus(newTerm));
    }
  }
private void wrapAndAppend ( int sort , int start , EarleyState nextState , EarleyState completed , EarleySet end ) { Term newTerm = Ambiguity . apply ( end . completedParses ( sort , start ) ) ; for ( PStack < Term > terms : completed . parseTree ( ) ) { nextState . parseTree . add ( terms . plus ( newTerm ) ) ; } }
Construct the new parse tree for a state during the "complete" step, or after a nullable non-terminal in the
 "predict" step.
Construct the new parse tree for a state during the " complete " step or after a nullable non - terminal in the " predict " step .