From 64784d4e922fdff8819c8c6c5638b443bdd6c301 Mon Sep 17 00:00:00 2001 From: Lanchid Date: Wed, 19 Dec 2012 18:42:46 +0100 Subject: [PATCH] Renamed LabParser to AtomicPropositionLabelingParser --- src/mrmc.cpp | 4 ++-- ...ser.cpp => AtomicPropositionLabelingParser.cpp} | 4 ++-- ...bParser.h => AtomicPropositionLabelingParser.h} | 4 ++-- src/utility/IoUtility.cpp | 4 ++-- test/parser/ReadLabFileTest.cpp | 14 +++++++------- 5 files changed, 15 insertions(+), 15 deletions(-) rename src/parser/{LabParser.cpp => AtomicPropositionLabelingParser.cpp} (96%) rename src/parser/{LabParser.h => AtomicPropositionLabelingParser.h} (85%) diff --git a/src/mrmc.cpp b/src/mrmc.cpp index 478b6425a..d9b938e2d 100644 --- a/src/mrmc.cpp +++ b/src/mrmc.cpp @@ -24,7 +24,7 @@ #include "src/models/AtomicPropositionsLabeling.h" #include "src/modelChecker/EigenDtmcPrctlModelChecker.h" #include "src/modelChecker/GmmxxDtmcPrctlModelChecker.h" -#include "src/parser/LabParser.h" +#include "src/parser/AtomicPropositionLabelingParser.h" #include "src/parser/DeterministicSparseTransitionParser.h" #include "src/parser/PrctlParser.h" #include "src/solver/GraphAnalyzer.h" @@ -102,7 +102,7 @@ int main(const int argc, const char* argv[]) { } mrmc::parser::DeterministicSparseTransitionParser traparser(s->getString("trafile")); - mrmc::parser::LabParser labparser(traparser.getMatrix()->getRowCount(), s->getString("labfile").c_str()); + mrmc::parser::AtomicPropositionLabelingParser labparser(traparser.getMatrix()->getRowCount(), s->getString("labfile").c_str()); mrmc::models::Dtmc dtmc(traparser.getMatrix(), labparser.getLabeling()); dtmc.printModelInformationToStream(std::cout); diff --git a/src/parser/LabParser.cpp b/src/parser/AtomicPropositionLabelingParser.cpp similarity index 96% rename from src/parser/LabParser.cpp rename to src/parser/AtomicPropositionLabelingParser.cpp index 45274347d..8c4d7b5a5 100644 --- a/src/parser/LabParser.cpp +++ b/src/parser/AtomicPropositionLabelingParser.cpp @@ -5,7 +5,7 @@ * Author: Gereon Kremer */ -#include "src/parser/LabParser.h" +#include "src/parser/AtomicPropositionLabelingParser.h" #include "src/exceptions/WrongFileFormatException.h" #include "src/exceptions/FileIoException.h" @@ -38,7 +38,7 @@ namespace parser { * @param filename input .lab file's name. * @return The pointer to the created labeling object. */ -LabParser::LabParser(uint_fast64_t node_count, const char * filename) +AtomicPropositionLabelingParser::AtomicPropositionLabelingParser(uint_fast64_t node_count, const char * filename) : labeling(nullptr) { /* diff --git a/src/parser/LabParser.h b/src/parser/AtomicPropositionLabelingParser.h similarity index 85% rename from src/parser/LabParser.h rename to src/parser/AtomicPropositionLabelingParser.h index bb1e2d992..e1b5c4211 100644 --- a/src/parser/LabParser.h +++ b/src/parser/AtomicPropositionLabelingParser.h @@ -17,9 +17,9 @@ namespace parser { * Note that this class creates a new AtomicPropositionsLabeling object that can * be accessed via getLabeling(). However, it will not delete this object! */ -class LabParser : Parser { +class AtomicPropositionLabelingParser : Parser { public: - LabParser(uint_fast64_t node_count, const char* filename); + AtomicPropositionLabelingParser(uint_fast64_t node_count, const char* filename); std::shared_ptr getLabeling() { return this->labeling; diff --git a/src/utility/IoUtility.cpp b/src/utility/IoUtility.cpp index 9667a3ff8..a8d61d32c 100644 --- a/src/utility/IoUtility.cpp +++ b/src/utility/IoUtility.cpp @@ -7,7 +7,7 @@ #include "src/utility/IoUtility.h" #include "src/parser/DeterministicSparseTransitionParser.h" -#include "src/parser/LabParser.h" +#include "src/parser/AtomicPropositionLabelingParser.h" #include @@ -64,7 +64,7 @@ mrmc::models::Dtmc* parseDTMC(std::string const &tra_file, const char* l mrmc::parser::DeterministicSparseTransitionParser tp(tra_file); uint_fast64_t node_count = tp.getMatrix()->getRowCount(); - mrmc::parser::LabParser lp(node_count, lab_file); + mrmc::parser::AtomicPropositionLabelingParser lp(node_count, lab_file); mrmc::models::Dtmc* result = new mrmc::models::Dtmc(tp.getMatrix(), lp.getLabeling()); return result; diff --git a/test/parser/ReadLabFileTest.cpp b/test/parser/ReadLabFileTest.cpp index 97e201151..d019bc986 100644 --- a/test/parser/ReadLabFileTest.cpp +++ b/test/parser/ReadLabFileTest.cpp @@ -8,7 +8,7 @@ #include "gtest/gtest.h" #include "mrmc-config.h" #include "src/models/AtomicPropositionsLabeling.h" -#include "src/parser/LabParser.h" +#include "src/parser/AtomicPropositionLabelingParser.h" #include "src/exceptions/FileIoException.h" #include "src/exceptions/WrongFileFormatException.h" @@ -16,16 +16,16 @@ TEST(ReadLabFileTest, NonExistingFileTest) { //No matter what happens, please don't create a file with the name "nonExistingFile.not"! :-) - ASSERT_THROW(mrmc::parser::LabParser(0,MRMC_CPP_TESTS_BASE_PATH "/nonExistingFile.not"), mrmc::exceptions::FileIoException); + ASSERT_THROW(mrmc::parser::AtomicPropositionLabelingParser(0,MRMC_CPP_TESTS_BASE_PATH "/nonExistingFile.not"), mrmc::exceptions::FileIoException); } TEST(ReadLabFileTest, ParseTest) { //This test is based on a test case from the original MRMC. - mrmc::parser::LabParser* parser; + mrmc::parser::AtomicPropositionLabelingParser* parser; //Parsing the file - ASSERT_NO_THROW(parser = new mrmc::parser::LabParser(12, MRMC_CPP_TESTS_BASE_PATH "/parser/lab_files/pctl_general_input_01.lab")); + ASSERT_NO_THROW(parser = new mrmc::parser::AtomicPropositionLabelingParser(12, MRMC_CPP_TESTS_BASE_PATH "/parser/lab_files/pctl_general_input_01.lab")); std::shared_ptr labeling(parser->getLabeling()); //Checking whether all propositions are in the labelling @@ -86,14 +86,14 @@ TEST(ReadLabFileTest, ParseTest) { } TEST(ReadLabFileTest, WrongHeaderTest1) { - ASSERT_THROW(mrmc::parser::LabParser(3, MRMC_CPP_TESTS_BASE_PATH "/parser/lab_files/wrong_format_header1.lab"), mrmc::exceptions::WrongFileFormatException); + ASSERT_THROW(mrmc::parser::AtomicPropositionLabelingParser(3, MRMC_CPP_TESTS_BASE_PATH "/parser/lab_files/wrong_format_header1.lab"), mrmc::exceptions::WrongFileFormatException); } TEST(ReadLabFileTest, WrongHeaderTest2) { - ASSERT_THROW(mrmc::parser::LabParser(3, MRMC_CPP_TESTS_BASE_PATH "/parser/lab_files/wrong_format_header2.lab"), mrmc::exceptions::WrongFileFormatException); + ASSERT_THROW(mrmc::parser::AtomicPropositionLabelingParser(3, MRMC_CPP_TESTS_BASE_PATH "/parser/lab_files/wrong_format_header2.lab"), mrmc::exceptions::WrongFileFormatException); } TEST(ReadLabFileTest, WrongPropositionTest) { - ASSERT_THROW(mrmc::parser::LabParser(3, MRMC_CPP_TESTS_BASE_PATH "/parser/lab_files/wrong_format_proposition.lab"), mrmc::exceptions::WrongFileFormatException); + ASSERT_THROW(mrmc::parser::AtomicPropositionLabelingParser(3, MRMC_CPP_TESTS_BASE_PATH "/parser/lab_files/wrong_format_proposition.lab"), mrmc::exceptions::WrongFileFormatException); }