Examples of Transition


Examples of ket.display.Transition

  public Vector<Transition> getTransitions(Box beforeRootBox, Box afterRootBox) {
    // Ensure that beforeRootBox and afterRootBox have been set.
    Vector<Transition> transitions = new Vector<Transition>();
    for (Step step : steps) {
      Transition t = step.getTransition(beforeRootBox, afterRootBox);
      if (t!=null) {
        transitions.add(t);
      }
    }
    return transitions;
View Full Code Here

Examples of no.hal.jex.jextest.jexTest.Transition

      _builder.append(_asSourceText, "");
      _builder.append(" failed");
      String message = _builder.toString();
      boolean _not_3 = (!(owner instanceof TransitionAction));
      if (_not_3) {
        final Transition transition = this._util.<Transition>ancestor(expr, Transition.class);
        boolean _and_3 = false;
        boolean _notEquals_1 = (!Objects.equal(transition, null));
        if (!_notEquals_1) {
          _and_3 = false;
        } else {
          EList<TransitionAction> _actions = transition.getActions();
          boolean _isEmpty = _actions.isEmpty();
          boolean _not_4 = (!_isEmpty);
          _and_3 = (_notEquals_1 && _not_4);
        }
        if (_and_3) {
          String _plus = (message + " after ");
          EList<TransitionAction> _actions_1 = transition.getActions();
          String _asSourceText_1 = this._util.asSourceText(_actions_1, " ,");
          String _plus_1 = (_plus + _asSourceText_1);
          message = _plus_1;
        }
      }
View Full Code Here

Examples of nz.ac.waikato.modeljunit.Transition

          + " when only time changed.  "
          + "Use Timeouts to control time dependant states.";
      throw new FsmException(failmsg);
    }

    Transition done = new TimedTransition(startTime, fsmState_, m.getName(),
        newState);
    fsmSequence_.add(done);
    fsmState_ = newState;
    Assert.assertNotNull("Model Error: getState() must be non-null", fsmState_);
View Full Code Here

Examples of org.antlr.analysis.Transition

        if(processedStates.contains(state))
            return;
        processedStates.add(state);

        for(int t=0; t<state.getNumberOfTransitions(); t++) {
            Transition transition = state.transition(t);
            addIncomingTransitionToState((NFAState)transition.target);
            recursiveAnalysis((NFAState)transition.target);
        }
    }
View Full Code Here

Examples of org.antlr.analysis.Transition

        }

        for(int t=0; t<state.getNumberOfTransitions(); t++) {
            FAState parentState = js;

            Transition transition = state.transition(t);
            NFAState target = (NFAState)transition.target;
            if(targetStateIsInAnotherRule(transition)) {
                target = targetStateOfTransition(transition);
                parentState = createRuleReferenceState(parentState, transition, null);
            }

            if(transition.isEpsilon()) {
                buildRecursiveSkipState(parentState, target, new HashSet<NFAState>(currentPath), new ArrayList<Integer>());
            } else {
                FAState targetState = buildRecursiveState(target, new HashSet<NFAState>(currentPath));
                if(targetState.loop) {
                    // Handle "loop" transition by creating a "normal" transition and assigning a flag
View Full Code Here

Examples of org.antlr.analysis.Transition

            Integer skippedState = state.stateNumber;
            skippedStates.add(skippedState);
            skippedStatesMap.put(skippedState, parentState);

            for(int t=0; t<state.getNumberOfTransitions(); t++) {
                Transition transition = state.transition(t);
                if(targetStateIsInAnotherRule(transition)) {
                    NFAState target = targetStateOfTransition(transition);
                    FAState ruleRefState = createRuleReferenceState(parentState, transition, skippedStates);
                    buildRecursiveSkipState(ruleRefState, target, currentPath, new ArrayList<Integer>(skippedStates));
                } else
View Full Code Here

Examples of org.antlr.analysis.Transition

        return state.getNumberOfTransitions() == 1 && state.transition(0).isEpsilon();
    }

    public boolean hasOneOrMoreEpsilonTransitionOnly(NFAState state) {
        for(int t=0; t<state.getNumberOfTransitions(); t++) {
            Transition transition = state.transition(t);
            if(!transition.isEpsilon())
                return false;
        }
        return state.getNumberOfTransitions()>0;
    }
View Full Code Here

Examples of org.antlr.analysis.Transition

        return state.getNumberOfTransitions()>0;
    }

    public boolean hasMoreThanOneEpsilonTransitionOnly(NFAState state) {
        for(int t=0; t<state.getNumberOfTransitions(); t++) {
            Transition transition = state.transition(t);
            if(!transition.isEpsilon())
                return false;
        }
        return state.getNumberOfTransitions()>1;
    }
View Full Code Here

Examples of org.antlr.analysis.Transition

    public boolean isAlternativeTransitionEndingAtSameState(NFAState state) {
        NFAState endState = endStateOfAlternative((NFAState)state.transition(0).target);

        for(int t=1; t<state.getNumberOfTransitions(); t++) {
            Transition transition = state.transition(t);
            NFAState newEndState = endStateOfAlternative((NFAState)transition.target);
            if(!endState.equals(newEndState))
                return false;
        }
        return true;
View Full Code Here

Examples of org.antlr.analysis.Transition

        state = invokingTransition.followState;
        continue;
      }
      if ( state.getNumberOfTransitions()==1 ) {
        // no branching, just take this path
        Transition t0 = state.transition[0];
        if ( t0 instanceof RuleClosureTransition ) {
          ruleInvocationStack.push(state);
          if ( debug ) System.out.println("push state "+state);
          //System.out.println("call "+((RuleClosureTransition)t0).rule.name);
          //System.out.println("stack depth="+ruleInvocationStack.size());
        }
        else if ( t0.label.isSet() || t0.label.isAtom() ) {
          tokenTypes.add( getTokenType(t0.label) );
        }
        state = (NFAState)t0.target;
        continue;
      }

      int decisionNumber = state.getDecisionNumber();
      if ( decisionNumber==0 ) {
        System.out.println("weird: no decision number but a choice node");
        continue;
      }
      // decision point, pick ith alternative randomly
      int n = g.getNumberOfAltsForDecisionNFA(state);
      int randomAlt = random.nextInt(n) + 1;
      if ( debug ) System.out.println("randomAlt="+randomAlt);
      NFAState altStartState =
        g.getNFAStateForAltOfDecision(state, randomAlt);
      Transition t = altStartState.transition[0];
      state = (NFAState)t.target;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.