From f485974187a4f740195849616ce7e218d4efc752 Mon Sep 17 00:00:00 2001 From: dehnert Date: Thu, 7 Aug 2014 17:22:08 +0200 Subject: [PATCH] Fixed (asynch) leader election to comply with our grammar. Added LOG_DEBUG macro. Former-commit-id: 7b22ecba8e02651eb87ee709f8aa808c2290269d --- examples/mdp/asynchronous_leader/leader4.nm | 2 +- examples/mdp/asynchronous_leader/leader5.nm | 2 +- examples/mdp/asynchronous_leader/leader6.nm | 2 +- examples/mdp/asynchronous_leader/leader7.nm | 2 +- src/exceptions/ExceptionMacros.h | 5 +++++ src/parser/PrismParser.cpp | 1 + 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/mdp/asynchronous_leader/leader4.nm b/examples/mdp/asynchronous_leader/leader4.nm index 81ade2ea7..ce7ef878c 100644 --- a/examples/mdp/asynchronous_leader/leader4.nm +++ b/examples/mdp/asynchronous_leader/leader4.nm @@ -4,7 +4,7 @@ mdp -const N= 4; // number of processes +const int N= 4; // number of processes //---------------------------------------------------------------------------------------------------------------------------- module process1 diff --git a/examples/mdp/asynchronous_leader/leader5.nm b/examples/mdp/asynchronous_leader/leader5.nm index 558bab560..8b5c477b8 100644 --- a/examples/mdp/asynchronous_leader/leader5.nm +++ b/examples/mdp/asynchronous_leader/leader5.nm @@ -4,7 +4,7 @@ mdp -const N= 5; // number of processes +const int N= 5; // number of processes //---------------------------------------------------------------------------------------------------------------------------- module process1 diff --git a/examples/mdp/asynchronous_leader/leader6.nm b/examples/mdp/asynchronous_leader/leader6.nm index 84b3283ad..c1c909baf 100644 --- a/examples/mdp/asynchronous_leader/leader6.nm +++ b/examples/mdp/asynchronous_leader/leader6.nm @@ -4,7 +4,7 @@ mdp -const N= 6; // number of processes +const int N= 6; // number of processes //---------------------------------------------------------------------------------------------------------------------------- module process1 diff --git a/examples/mdp/asynchronous_leader/leader7.nm b/examples/mdp/asynchronous_leader/leader7.nm index fd1a84bed..11eaba4a7 100644 --- a/examples/mdp/asynchronous_leader/leader7.nm +++ b/examples/mdp/asynchronous_leader/leader7.nm @@ -4,7 +4,7 @@ mdp -const N= 7; // number of processes +const int N= 7; // number of processes //---------------------------------------------------------------------------------------------------------------------------- module process1 diff --git a/src/exceptions/ExceptionMacros.h b/src/exceptions/ExceptionMacros.h index 3840928fe..bbf2f4f36 100644 --- a/src/exceptions/ExceptionMacros.h +++ b/src/exceptions/ExceptionMacros.h @@ -16,8 +16,13 @@ extern log4cplus::Logger logger; assert(cond); \ } \ } while (false) +#define LOG_DEBUG(message) \ +{ \ + LOG4CPLUS_DEBUG(logger, message); \ +} while (false) #else #define LOG_ASSERT(cond, message) /* empty */ +#define LOG_DEBUG(message) /* empty */ #endif #define LOG_THROW(cond, exception, message) \ diff --git a/src/parser/PrismParser.cpp b/src/parser/PrismParser.cpp index 5d73e9d2a..cb4ccbe69 100644 --- a/src/parser/PrismParser.cpp +++ b/src/parser/PrismParser.cpp @@ -41,6 +41,7 @@ namespace storm { // Start first run. bool succeeded = qi::phrase_parse(iter, last, grammar, boost::spirit::ascii::space | qi::lit("//") >> *(qi::char_ - qi::eol) >> qi::eol, result); LOG_THROW(succeeded, storm::exceptions::WrongFormatException, "Parsing failed in first pass."); + LOG_DEBUG("First pass of parsing PRISM input finished."); // Start second run. first = PositionIteratorType(input.begin());