Browse Source
			
			
			Merge branch 'jani_support' into jani_gspn_support
			
				
		Merge branch 'jani_support' into jani_gspn_support
	
		
	
			
				Former-commit-id:main2221f51043[formerly82544c8cf2] Former-commit-id:752f4c234d
				 8 changed files with 128 additions and 45 deletions
			
			
		- 
					48src/builder/JaniProgramGraphBuilder.cpp
 - 
					59src/builder/JaniProgramGraphBuilder.h
 - 
					2src/parser/JaniParser.cpp
 - 
					2src/settings/modules/PGCLSettings.cpp
 - 
					28src/storage/IntegerInterval.cpp
 - 
					1src/storage/IntegerInterval.h
 - 
					28src/storage/ppg/ProgramGraph.h
 - 
					5src/storm-pgcl.cpp
 
@ -1,2 +1,30 @@ | 
				
			|||
#include "IntegerInterval.h"
 | 
				
			|||
 | 
				
			|||
#include <iostream>
 | 
				
			|||
#include <string>
 | 
				
			|||
 | 
				
			|||
#include "src/utility/macros.h"
 | 
				
			|||
#include "src/exceptions/InvalidArgumentException.h"
 | 
				
			|||
 | 
				
			|||
bool starts_with(const std::string& s1, const std::string& s2) { | 
				
			|||
    return s2.size() <= s1.size() && s1.compare(0, s2.size(), s2) == 0; | 
				
			|||
} | 
				
			|||
 | 
				
			|||
namespace storm { | 
				
			|||
    namespace storage { | 
				
			|||
        IntegerInterval parseIntegerInterval(std::string const& stringRepr) { | 
				
			|||
             | 
				
			|||
             | 
				
			|||
            if(starts_with(stringRepr, "[") && stringRepr.at(stringRepr.size()-1) == ']') { | 
				
			|||
                auto split = stringRepr.find(","); | 
				
			|||
                std::string first = stringRepr.substr(1,split-1); | 
				
			|||
                 | 
				
			|||
                std::string second = stringRepr.substr(split+1, stringRepr.size() - split - 2); | 
				
			|||
                return IntegerInterval(stoi(first), stoi(second)); | 
				
			|||
                 | 
				
			|||
            } else { | 
				
			|||
                STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "Cannot parse " << stringRepr << " as integer interval"); | 
				
			|||
            } | 
				
			|||
        } | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue