104105106107108109110111112113114
visitor.visitNode(sa[leaf ? -(top_i + 1) : top_i], top_h, leaf); } if (top_h < h) { stack.push(i, h); } if (i < sequenceLength) { // Mark leaf nodes in the stack.
110111112113114115116117118119120
} if (i < sequenceLength) { // Mark leaf nodes in the stack. stack.push(-(i + 1), sequenceLength - sa[i]); } } } /**
142143144145146147148149150151152
final IntStack stack = new IntStack(); final ArrayList<E> values = new ArrayList<E>(); // Push the stack bottom marker (sentinel). stack.push(-1, -1); values.add(epsilon); // Process every leaf. int top_h; E top_c;
172173174175176177178179180181182
top_c = values.get(values.size() - 1); } if (top_h < h) { stack.push(i, h); values.add(ci); } else { assert top_h == h;
185186187188189190191192193194195
} if (i < sequenceLength) { // Mark leaf nodes in the stack. stack.push(-(i + 1), sequenceLength - sa[i]); values.add(visitor.leafValue(i, sa[i], sequenceLength - sa[i])); } } } }