Symbol lastMod = (Symbol)((CKYItem)modChildren.data()).label(); prevMods.add(lastMod); int lenMinus1 = numPrevMods - 1; for (int i = 0; i < lenMinus1; i++) prevMods.add(itemPrevMods.get(i));
int i = 0;   for (SLNode curr = modChildren; curr != null && i < numPrevMods; ) { Symbol currMod = (curr.data() == null ? stopSym : (Symbol)((CKYItem)curr.data()).label()); Symbol prevMod = (curr.next() == null ? startSym : (Symbol)((CKYItem)curr.next().data()).label()); if (!Shifter.skip(item, prevMod, currMod)) { prevMods.add(prevMod); i++; } curr = curr.next(); }   if (i == 0) return startList; for (; i < numPrevMods; i++) prevMods.add(startSym);
  private final SexpList getPrevMods(SexpList itemPrevMods,                                     SLNode modChildren) {    if (modChildren == null)      return startList;    prevModLookupList.clear();    SexpList prevMods = prevModLookupList;    Symbol lastMod = (Symbol)((CKYItem)modChildren.data()).label();    prevMods.add(lastMod);    int lenMinus1 = numPrevMods - 1;    for (int i = 0; i < lenMinus1; i++)      prevMods.add(itemPrevMods.get(i));    SexpList canonical = (SexpList)canonicalPrevModLists.get(prevMods);    if (canonical == null) {      prevMods = (SexpList)prevMods.deepCopy();      canonicalPrevModLists.put(prevMods, prevMods);      canonical = prevMods;    }    return canonical;  }