From e2324c92c08762bf62739165cfa73e2419986de7 Mon Sep 17 00:00:00 2001 From: sjunges Date: Fri, 11 Nov 2016 20:54:33 +0100 Subject: [PATCH] make storm compile again without xerces, also make storm-gspn target compile Former-commit-id: a88f362a0357f7317944a625f3e7d997aabeb8fb [formerly 8b11dd390cca63f5929d9f05654a382009f831c7] Former-commit-id: 874722dc9952c100c52e9fcfc2447a15344369e8 --- src/adapters/XercesAdapter.h | 4 +++- src/parser/GreatSpnEditorProjectParser.cpp | 5 ++--- src/parser/GreatSpnEditorProjectParser.h | 3 +++ src/parser/GspnParser.cpp | 6 +++++- src/parser/PnmlParser.cpp | 4 +++- src/parser/PnmlParser.h | 5 ++++- src/storm-gspn.cpp | 12 ++++++------ 7 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/adapters/XercesAdapter.h b/src/adapters/XercesAdapter.h index de05ece97..9e0523af1 100644 --- a/src/adapters/XercesAdapter.h +++ b/src/adapters/XercesAdapter.h @@ -1,6 +1,7 @@ #pragma once - +#include "storm-config.h" +#ifdef USE_XERCES #include #include @@ -40,3 +41,4 @@ namespace storm { } } } +#endif \ No newline at end of file diff --git a/src/parser/GreatSpnEditorProjectParser.cpp b/src/parser/GreatSpnEditorProjectParser.cpp index 2a55b4526..5398414f2 100644 --- a/src/parser/GreatSpnEditorProjectParser.cpp +++ b/src/parser/GreatSpnEditorProjectParser.cpp @@ -1,5 +1,5 @@ #include "GreatSpnEditorProjectParser.h" - +#ifdef USE_XERCES #include @@ -339,5 +339,4 @@ namespace storm { } } - - +#endif \ No newline at end of file diff --git a/src/parser/GreatSpnEditorProjectParser.h b/src/parser/GreatSpnEditorProjectParser.h index 90b8f4f04..a931f15d9 100644 --- a/src/parser/GreatSpnEditorProjectParser.h +++ b/src/parser/GreatSpnEditorProjectParser.h @@ -1,5 +1,7 @@ #pragma once +#include "storm-config.h" +#ifdef USE_XERCES #include #include @@ -40,3 +42,4 @@ namespace storm { }; } } +#endif \ No newline at end of file diff --git a/src/parser/GspnParser.cpp b/src/parser/GspnParser.cpp index bfd455356..fada33102 100644 --- a/src/parser/GspnParser.cpp +++ b/src/parser/GspnParser.cpp @@ -1,5 +1,5 @@ #include "GspnParser.h" - +#include "storm-config.h" #include "src/adapters/XercesAdapter.h" #include "src/exceptions/UnexpectedException.h" @@ -13,6 +13,7 @@ namespace storm { namespace parser { storm::gspn::GSPN* GspnParser::parse(std::string const& filename) { +#ifdef USE_XERCES // initialize xercesc try { xercesc::XMLPlatformUtils::Initialize(); @@ -79,6 +80,9 @@ namespace storm { delete parser; delete errHandler; xercesc::XMLPlatformUtils::Terminate(); +#else + STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Storm is not compiled with XML support"); +#endif } } } diff --git a/src/parser/PnmlParser.cpp b/src/parser/PnmlParser.cpp index 3748ac0bd..d39f0db55 100644 --- a/src/parser/PnmlParser.cpp +++ b/src/parser/PnmlParser.cpp @@ -1,5 +1,6 @@ -#include "src/parser/PnmlParser.h" +#include "src/parser/PnmlParser.h" +#ifdef USE_XERCES #include #include "src/adapters/XercesAdapter.h" @@ -442,3 +443,4 @@ namespace storm { } } +#endif \ No newline at end of file diff --git a/src/parser/PnmlParser.h b/src/parser/PnmlParser.h index 99a331fe4..750d28e3d 100644 --- a/src/parser/PnmlParser.h +++ b/src/parser/PnmlParser.h @@ -1,7 +1,8 @@ #pragma once +#include "storm-config.h" +#ifdef USE_XERCES #include - #include #include @@ -140,3 +141,5 @@ namespace storm { }; } } + +#endif \ No newline at end of file diff --git a/src/storm-gspn.cpp b/src/storm-gspn.cpp index bb48d150a..a34ad2973 100644 --- a/src/storm-gspn.cpp +++ b/src/storm-gspn.cpp @@ -12,7 +12,7 @@ #include "src/storage/expressions/ExpressionManager.h" #include "src/storage/jani/Model.h" -#include "src/storage/jani/JsonExporter.h" +#include "src/storage/jani/JSONExporter.h" #include "src/builder/JaniGSPNBuilder.h" #include #include @@ -67,7 +67,7 @@ void handleJani(storm::gspn::GSPN const& gspn) { std::shared_ptr exprManager(new storm::expressions::ExpressionManager()); storm::builder::JaniGSPNBuilder builder(gspn, exprManager); storm::jani::Model* model = builder.build(); - storm::jani::JsonExporter::toFile(*model, storm::settings::getModule().getJaniFilename()); + storm::jani::JsonExporter::toFile(*model, {}, storm::settings::getModule().getJaniFilename()); delete model; } @@ -90,24 +90,24 @@ int main(const int argc, const char **argv) { auto parser = storm::parser::GspnParser(); auto gspn = parser.parse(storm::settings::getModule().getGspnFilename()); - if (!gspn.isValid()) { + if (!gspn->isValid()) { STORM_LOG_ERROR("The gspn is not valid."); } if(storm::settings::getModule().isCapacitiesFileSet()) { auto capacities = parseCapacitiesList(storm::settings::getModule().getCapacitiesFilename()); - gspn.setCapacities(capacities); + gspn->setCapacities(capacities); } if(storm::settings::getModule().isWriteToDotSet()) { std::ofstream file; file.open(storm::settings::getModule().getWriteToDotFilename()); - gspn.writeDotToStream(file); + gspn->writeDotToStream(file); } if(storm::settings::getModule().isJaniFileSet()) { - handleJani(gspn); + handleJani(*gspn); }