// This line will never be reached as the parser would have thrown already.
throw;
break;
if(isMarkovianChoice&&stateHasMarkovianChoice){
LOG4CPLUS_ERROR(logger,"The state "<<source<<" has multiple Markovian choices.");
throwstorm::exceptions::WrongFormatException()<<"The state "<<source<<" has multiple Markovian choices.";
}
}
buf=trimWhitespaces(buf);
buf=forwardToNextLine(buf,lineEndings);
// Now that we have the source state and the information whether or not the current choice is probabilistic or Markovian, we need to read the list of successors and the probabilities/rates.
// Now that we have the source state and the information whether or not the current choice is probabilistic or Markovian, we need to read the list of successors and the probabilities/rates.
boolhasSuccessorState=false;
boolhasSuccessorState=false;
@ -132,24 +124,7 @@ namespace storm {
// As we found a new successor, we need to increase the number of nonzero entries.
// As we found a new successor, we need to increase the number of nonzero entries.
LOG4CPLUS_ERROR(logger,"Found deadlock states (e.g. "<<lastsource+1<<") during parsing. Please fix them or set the appropriate flag.");
throwstorm::exceptions::WrongFormatException()<<"Found deadlock states (e.g. "<<lastsource+1<<") during parsing. Please fix them or set the appropriate flag.";
}
}
if(source!=lastsource){
// If we skipped to a new state we need to record the beginning of the choices in the nondeterministic choice indices.
// If the action name was parsed successfully, we need to move by the corresponding number of characters.
buf+=strlen(actionNameBuffer);
}
// Depending on the action name, the choice is either a probabilitic one or a markovian one.
boolisMarkovianChoice=false;
if(strcmp(actionNameBuffer,"!")==0){
isMarkovianChoice=true;
// Mark the current choice as a Markovian one.
result.markovianChoices.set(currentChoice,true);
}else{
isMarkovianChoice=false;
}
buf=forwardToNextLine(buf,lineEndings);
// Now that we have the source state and the information whether or not the current choice is probabilistic or Markovian, we need to read the list of successors and the probabilities/rates.
boolhasSuccessorState=false;
boolencounteredNewDistribution=false;
// At this point, we need to check whether there is an additional successor or we have reached the next choice for the same or a different state.
do{
// Now parse the next symbol to see whether there is another target state for the current choice
// or not.
charstar[1];
#ifdef WINDOWS
length=sscanf_s(buf,"%1s\n",star,1);
#else
length=sscanf(buf,"%1s\n",star);
#endif
// If the number of arguments filled is not one, there was an error.
if(length==EOF){
if(!hasSuccessorState){
LOG4CPLUS_ERROR(logger,"Premature end-of-file. Expected at least one successor state for state "<<source<<" under action "<<actionNameBuffer<<".");
throwstorm::exceptions::WrongFormatException()<<"Premature end-of-file. Expected at least one successor state for state "<<source<<" under action "<<actionNameBuffer<<".";
}else{
// If there was at least one successor for the current choice, this is legal and we need to move on.