diff --git a/src/storm-dft/parser/DFTGalileoParser.cpp b/src/storm-dft/parser/DFTGalileoParser.cpp index 776eb64d9..ec0b446d9 100644 --- a/src/storm-dft/parser/DFTGalileoParser.cpp +++ b/src/storm-dft/parser/DFTGalileoParser.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "storm/storage/expressions/ExpressionManager.h" #include "storm/exceptions/NotImplementedException.h" #include "storm/exceptions/FileIoException.h" @@ -34,6 +35,11 @@ namespace storm { return name.substr(firstQuots+1,secondQuots-1); } } + + template + std::string DFTGalileoParser::parseNodeIdentifier(std::string const& name) { + return boost::replace_all_copy(name, "'", "__prime__"); + } template void DFTGalileoParser::readFile(const std::string& filename) { @@ -84,11 +90,11 @@ namespace storm { } else { std::vector tokens; boost::split(tokens, line, boost::is_any_of(" ")); - std::string name(stripQuotsFromName(tokens[0])); + std::string name(parseNodeIdentifier(stripQuotsFromName(tokens[0]))); std::vector childNames; for(unsigned i = 2; i < tokens.size(); ++i) { - childNames.push_back(stripQuotsFromName(tokens[i])); + childNames.push_back(parseNodeIdentifier(stripQuotsFromName(tokens[i]))); } if(tokens[1] == "and") { success = builder.addAndElement(name, childNames); diff --git a/src/storm-dft/parser/DFTGalileoParser.h b/src/storm-dft/parser/DFTGalileoParser.h index 3f19683ff..bb79be089 100644 --- a/src/storm-dft/parser/DFTGalileoParser.h +++ b/src/storm-dft/parser/DFTGalileoParser.h @@ -35,6 +35,7 @@ namespace storm { void readFile(std::string const& filename); std::string stripQuotsFromName(std::string const& name); + std::string parseNodeIdentifier(std::string const& name); ValueType parseRationalExpression(std::string const& expr); };