outcome = ParserME.CONT + type;
}
//System.err.println("parserEventStream.addParseEvents: chunks["+ci+"]="+c+" label="+outcome);
c.setLabel(outcome);
if (etype == EventTypeEnum.BUILD) {
parseEvents.add(new Event(outcome, bcg.getContext(chunks, ci)));
}
int start = ci - 1;
while (start >= 0 && chunks[start].getParent() == parent) {
start--;
}
if (lastChild(c, parent)) {
if (etype == EventTypeEnum.CHECK) {
parseEvents.add(new Event(ParserME.COMPLETE, kcg.getContext( chunks, type, start + 1, ci)));
}
//perform reduce
int reduceStart = ci;
while (reduceStart >=0 && chunks[reduceStart].getParent() == parent) {
reduceStart--;
}
reduceStart++;
chunks = reduceChunks(chunks,ci,parent);
ci=reduceStart-1; //ci will be incremented at end of loop
}
else {
if (etype == EventTypeEnum.CHECK) {
parseEvents.add(new Event(ParserME.INCOMPLETE, kcg.getContext(chunks, type, start + 1, ci)));
}
}
}
ci++;
}