addStopStateToLooping(lastSink); addStopStateToLooping(lastSink);
addStopStateToLooping(loopingState); loopingState.addIgnore(ignoreState, ignoreCondition); addStopStateToLooping(ignoreState);
addStopStateToLooping(lastSink); addStopStateToLooping(lastSink);
addStopStateToLooping(loopingState); loopingState.addIgnore(ignoreState, ignoreCondition); addStopStateToLooping(ignoreState);
addStopStateToLooping(loopingState); loopingState.addIgnore(ignoreState, ignoreCondition); addStopStateToLooping(ignoreState);
addStopStateToLooping(lastSink); addStopStateToLooping(lastSink);
for (int i = 0; i < times - 1; i++) { lastSink = createSingletonState(lastSink, getInnerIgnoreCondition(currentPattern), false); addStopStateToLooping(lastSink);
/** * Creates the given state as a looping one. Looping state is one with TAKE edge to itself and * PROCEED edge to the sinkState. It also consists of a similar state without the PROCEED edge, so that * for each PROCEED transition branches in computation state graph can be created only once. * * @param sinkState the state that the converted state should point to * @return the first state of the created complex state */ @SuppressWarnings("unchecked") private State<T> createLooping(final State<T> sinkState) { final IterativeCondition<T> currentCondition = (IterativeCondition<T>) currentPattern.getCondition(); final IterativeCondition<T> ignoreCondition = getInnerIgnoreCondition(currentPattern); final IterativeCondition<T> trueFunction = BooleanConditions.trueFunction(); final State<T> loopingState = createState(currentPattern.getName(), State.StateType.Normal); loopingState.addProceed(sinkState, trueFunction); loopingState.addTake(currentCondition); addStopStateToLooping(loopingState); if (ignoreCondition != null) { final State<T> ignoreState = createState(currentPattern.getName(), State.StateType.Normal); ignoreState.addTake(loopingState, currentCondition); ignoreState.addIgnore(ignoreCondition); loopingState.addIgnore(ignoreState, ignoreCondition); addStopStateToLooping(ignoreState); } return loopingState; }