lastSink = createSingletonState(lastSink, proceedState, takeCondition, innerIgnoreCondition, true); addStopStateToLooping(lastSink); lastSink = createSingletonState(lastSink, null, takeCondition, innerIgnoreCondition, false); addStopStateToLooping(lastSink); return createSingletonState( lastSink, proceedState,
lastSink = createSingletonState(lastSink, proceedState, takeCondition, innerIgnoreCondition, true); addStopStateToLooping(lastSink); lastSink = createSingletonState(lastSink, null, takeCondition, innerIgnoreCondition, false); addStopStateToLooping(lastSink); return createSingletonState( lastSink, proceedState,
lastSink = createSingletonState(lastSink, proceedState, takeCondition, innerIgnoreCondition, true); addStopStateToLooping(lastSink); lastSink = createSingletonState(lastSink, null, takeCondition, innerIgnoreCondition, false); addStopStateToLooping(lastSink); return createSingletonState( lastSink, proceedState,
State<T> lastSink = copyWithoutTransitiveNots(sinkState); for (int i = 0; i < times - 1; i++) { lastSink = createSingletonState(lastSink, getInnerIgnoreCondition(currentPattern), false); addStopStateToLooping(lastSink); return createSingletonState(lastSink, ignoreCondition, false);
private State<T> convertPattern(final State<T> sinkState) { final State<T> lastSink; final Quantifier quantifier = currentPattern.getQuantifier(); if (quantifier.hasProperty(Quantifier.QuantifierProperty.LOOPING)) { // if loop has started then all notPatterns previous to the optional states are no longer valid setCurrentGroupPatternFirstOfLoop(false); final State<T> sink = copyWithoutTransitiveNots(sinkState); final State<T> looping = createLooping(sink); setCurrentGroupPatternFirstOfLoop(true); lastSink = createTimesState(looping, sinkState, currentPattern.getTimes()); } else if (quantifier.hasProperty(Quantifier.QuantifierProperty.TIMES)) { lastSink = createTimesState(sinkState, sinkState, currentPattern.getTimes()); } else { lastSink = createSingletonState(sinkState); } addStopStates(lastSink); return lastSink; }
/** * Creates a simple single state. For an OPTIONAL state 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 state that the state being converted should point to * @return the created state */ @SuppressWarnings("unchecked") private State<T> createSingletonState(final State<T> sinkState) { return createSingletonState( sinkState, sinkState, getTakeCondition(currentPattern), getIgnoreCondition(currentPattern), isPatternOptional(currentPattern)); }
/** * Creates a simple single state. For an OPTIONAL state 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 state that the state being converted should point to * @return the created state */ @SuppressWarnings("unchecked") private State<T> createSingletonState(final State<T> sinkState) { return createSingletonState( sinkState, sinkState, getTakeCondition(currentPattern), getIgnoreCondition(currentPattern), isPatternOptional(currentPattern)); }
private State<T> convertPattern(final State<T> sinkState) { final State<T> lastSink; final Quantifier quantifier = currentPattern.getQuantifier(); if (quantifier.hasProperty(Quantifier.QuantifierProperty.LOOPING)) { // if loop has started then all notPatterns previous to the optional states are no longer valid final State<T> sink = copyWithoutTransitiveNots(sinkState); final State<T> looping = createLooping(sink); if (!quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) { lastSink = createInitMandatoryStateOfOneOrMore(looping); } else { lastSink = createInitOptionalStateOfZeroOrMore(looping, sinkState); } } else if (quantifier.hasProperty(Quantifier.QuantifierProperty.TIMES)) { lastSink = createTimesState(sinkState, currentPattern.getTimes()); } else { lastSink = createSingletonState(sinkState); } addStopStates(lastSink); return lastSink; }
/** * Creates a simple single state. For an OPTIONAL state 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 state that the state being converted should point to * @return the created state */ @SuppressWarnings("unchecked") private State<T> createSingletonState(final State<T> sinkState) { return createSingletonState( sinkState, getIgnoreCondition(currentPattern), currentPattern.getQuantifier().hasProperty(Quantifier.QuantifierProperty.OPTIONAL)); }
private State<T> convertPattern(final State<T> sinkState) { final State<T> lastSink; final Quantifier quantifier = currentPattern.getQuantifier(); if (quantifier.hasProperty(Quantifier.QuantifierProperty.LOOPING)) { // if loop has started then all notPatterns previous to the optional states are no longer valid setCurrentGroupPatternFirstOfLoop(false); final State<T> sink = copyWithoutTransitiveNots(sinkState); final State<T> looping = createLooping(sink); setCurrentGroupPatternFirstOfLoop(true); lastSink = createTimesState(looping, sinkState, currentPattern.getTimes()); } else if (quantifier.hasProperty(Quantifier.QuantifierProperty.TIMES)) { lastSink = createTimesState(sinkState, sinkState, currentPattern.getTimes()); } else { lastSink = createSingletonState(sinkState); } addStopStates(lastSink); return lastSink; }
private State<T> convertPattern(final State<T> sinkState) { final State<T> lastSink; final Quantifier quantifier = currentPattern.getQuantifier(); if (quantifier.hasProperty(Quantifier.QuantifierProperty.LOOPING)) { // if loop has started then all notPatterns previous to the optional states are no longer valid setCurrentGroupPatternFirstOfLoop(false); final State<T> sink = copyWithoutTransitiveNots(sinkState); final State<T> looping = createLooping(sink); setCurrentGroupPatternFirstOfLoop(true); lastSink = createTimesState(looping, sinkState, currentPattern.getTimes()); } else if (quantifier.hasProperty(Quantifier.QuantifierProperty.TIMES)) { lastSink = createTimesState(sinkState, sinkState, currentPattern.getTimes()); } else { lastSink = createSingletonState(sinkState); } addStopStates(lastSink); return lastSink; }
/** * Creates a simple single state. For an OPTIONAL state 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 state that the state being converted should point to * @return the created state */ @SuppressWarnings("unchecked") private State<T> createSingletonState(final State<T> sinkState) { return createSingletonState( sinkState, sinkState, getTakeCondition(currentPattern), getIgnoreCondition(currentPattern), isPatternOptional(currentPattern)); }