Browse Source

jani parser supports abscence of action declarations

tempestpy_adaptions
Sebastian Junges 7 years ago
parent
commit
324c0770dd
  1. 5
      src/storm/parser/JaniParser.cpp

5
src/storm/parser/JaniParser.cpp

@ -90,8 +90,11 @@ namespace storm {
storm::jani::ModelType type = storm::jani::getModelType(modeltypestring); storm::jani::ModelType type = storm::jani::getModelType(modeltypestring);
STORM_LOG_THROW(type != storm::jani::ModelType::UNDEFINED, storm::exceptions::InvalidJaniException, "model type " + modeltypestring + " not recognized"); STORM_LOG_THROW(type != storm::jani::ModelType::UNDEFINED, storm::exceptions::InvalidJaniException, "model type " + modeltypestring + " not recognized");
storm::jani::Model model(name, type, version, expressionManager); storm::jani::Model model(name, type, version, expressionManager);
STORM_LOG_THROW(parsedStructure.count("actions") < 2, storm::exceptions::InvalidJaniException, "Action-declarations can be given at most once.");
size_t actionCount = parsedStructure.count("actions");
STORM_LOG_THROW(actionCount < 2, storm::exceptions::InvalidJaniException, "Action-declarations can be given at most once.");
if (actionCount > 0) {
parseActions(parsedStructure.at("actions"), model); parseActions(parsedStructure.at("actions"), model);
}
size_t constantsCount = parsedStructure.count("constants"); size_t constantsCount = parsedStructure.count("constants");
std::unordered_map<std::string, std::shared_ptr<storm::jani::Constant>> constants; std::unordered_map<std::string, std::shared_ptr<storm::jani::Constant>> constants;
STORM_LOG_THROW(constantsCount < 2, storm::exceptions::InvalidJaniException, "Constant-declarations can be given at most once."); STORM_LOG_THROW(constantsCount < 2, storm::exceptions::InvalidJaniException, "Constant-declarations can be given at most once.");

Loading…
Cancel
Save