Browse Source
PrismParser: Making module renaming a LocatedInformation so we can properly store the line number of it. Also silenced a warning related to virtual destructors
tempestpy_adaptions
PrismParser: Making module renaming a LocatedInformation so we can properly store the line number of it. Also silenced a warning related to virtual destructors
tempestpy_adaptions
Tim Quatmann
5 years ago
7 changed files with 125 additions and 57 deletions
-
37src/storm-parsers/parser/PrismParser.cpp
-
9src/storm-parsers/parser/PrismParser.h
-
2src/storm/storage/prism/LocatedInformation.h
-
29src/storm/storage/prism/Module.cpp
-
13src/storm/storage/prism/Module.h
-
32src/storm/storage/prism/ModuleRenaming.cpp
-
60src/storm/storage/prism/ModuleRenaming.h
@ -0,0 +1,32 @@ |
|||
#include "storm/storage/prism/ModuleRenaming.h"
|
|||
|
|||
namespace storm { |
|||
namespace prism { |
|||
ModuleRenaming::ModuleRenaming(std::map<std::string,std::string> const& renaming) : renaming(renaming) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
ModuleRenaming::ModuleRenaming(std::map<std::string,std::string>&& renaming) : renaming(std::move(renaming)) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
std::map<std::string, std::string> const& ModuleRenaming::getRenaming() const { |
|||
return this->renaming; |
|||
} |
|||
|
|||
std::ostream& operator<<(std::ostream& stream, ModuleRenaming const& renaming) { |
|||
stream << "[ "; |
|||
bool first = true; |
|||
for (auto const& renamingPair : renaming.getRenaming()) { |
|||
stream << renamingPair.first << "=" << renamingPair.second; |
|||
if (first) { |
|||
first = false; |
|||
} else { |
|||
stream << ","; |
|||
} |
|||
} |
|||
stream << "]"; |
|||
} |
|||
|
|||
} // namespace prism
|
|||
} // namespace storm
|
@ -0,0 +1,60 @@ |
|||
#pragma once |
|||
|
|||
#include <set> |
|||
#include <map> |
|||
#include <string> |
|||
#include <vector> |
|||
#include <memory> |
|||
|
|||
#include "storm/storage/prism/BooleanVariable.h" |
|||
#include "storm/storage/prism/IntegerVariable.h" |
|||
#include "storm/storage/prism/ClockVariable.h" |
|||
#include "storm/storage/prism/Command.h" |
|||
#include "storm/storage/BoostTypes.h" |
|||
#include "storm/utility/OsDetection.h" |
|||
|
|||
namespace storm { |
|||
namespace prism { |
|||
class ModuleRenaming : public LocatedInformation { |
|||
public: |
|||
/*! |
|||
* Creates a module renaming. |
|||
* |
|||
* @param renaming The renaming of identifiers. |
|||
*/ |
|||
ModuleRenaming(std::map<std::string,std::string> const& renaming); |
|||
|
|||
/*! |
|||
* Creates a module renaming. |
|||
* |
|||
* @param renaming The renaming of identifiers. |
|||
*/ |
|||
ModuleRenaming(std::map<std::string,std::string>&& renaming); |
|||
|
|||
// Create default implementations of constructors/assignment. |
|||
ModuleRenaming() = default; |
|||
ModuleRenaming(ModuleRenaming const& other) = default; |
|||
ModuleRenaming& operator=(ModuleRenaming const& other)= default; |
|||
ModuleRenaming(ModuleRenaming&& other) = default; |
|||
ModuleRenaming& operator=(ModuleRenaming&& other) = default; |
|||
|
|||
|
|||
|
|||
/*! |
|||
* If the module was created via renaming, this method returns the applied renaming of identifiers used for |
|||
* the renaming process. |
|||
* |
|||
* @return A mapping of identifiers to new identifiers that was used in the renaming process. |
|||
*/ |
|||
std::map<std::string, std::string> const& getRenaming() const; |
|||
|
|||
friend std::ostream& operator<<(std::ostream& stream, ModuleRenaming const& module); |
|||
|
|||
private: |
|||
// contains the provided renaming of identifiers. |
|||
std::map<std::string, std::string> renaming; |
|||
}; |
|||
|
|||
} // namespace prism |
|||
} // namespace storm |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue