Esempio n. 1
0
 @Override
 protected Boolean visitFState(FState state) {
   if (initialState == null) {
     initialState = new FState(state.getName());
     result = new FLTS();
     result.setInitialState(initialState);
     final Set<FState> states = new HashSet<FState>();
     states.add(initialState);
     statesStack.push(states);
   }
   return true;
 }
Esempio n. 2
0
 private FTransition getEvaluator(FGuard originalGuard, FState preEvaluation) {
   if (originalGuard == null || originalGuard.getEvaluator() == null) {
     return null;
   }
   FState pastState = preEvaluation;
   while (pastState != null) {
     final List<Transition> outgoings = pastState.getOutgoings();
     for (final Transition t : outgoings) {
       final FTransition transition = (FTransition) t;
       final FAction pastAction = transition.getFAction();
       if (pastAction != null) {
         if (originalGuard.getEvaluator().getFAction().equals(pastAction)) {
           return transition;
         }
       }
     }
     if (pastState.getIncoming() != null) {
       pastState = (FState) pastState.getIncoming().getSource();
     } else {
       pastState = null;
     }
   }
   throw new FatalFwitterException("evaluator transition not found");
 }