Browse Source

Removed std:: from uint type specifier (illegal in VS2012)

Removed parsing of STATES and TRANSITIONS from Parsers
tempestpy_adaptions
PBerger 12 years ago
parent
commit
4fe071033b
  1. 24
      src/parser/DeterministicSparseTransitionParser.cpp
  2. 13
      src/parser/NondeterministicSparseTransitionParser.cpp
  3. 2
      src/storage/SparseMatrix.h

24
src/parser/DeterministicSparseTransitionParser.cpp

@ -46,24 +46,10 @@ namespace parser {
*/ */
uint_fast64_t DeterministicSparseTransitionParser::firstPass(char* buf, int_fast64_t& maxnode) { uint_fast64_t DeterministicSparseTransitionParser::firstPass(char* buf, int_fast64_t& maxnode) {
uint_fast64_t nonZeroEntryCount = 0; uint_fast64_t nonZeroEntryCount = 0;
uint_fast64_t inputFileNonZeroEntryCount = 0;
/* /*
* Check file header and extract number of transitions. * Check file header and extract number of transitions.
*/ */
buf = strchr(buf, '\n') + 1; // skip format hint buf = strchr(buf, '\n') + 1; // skip format hint
if (strncmp(buf, "STATES ", 7) != 0) {
LOG4CPLUS_ERROR(logger, "Expected \"STATES\" but got \"" << std::string(buf, 0, 16) << "\".");
return 0;
}
buf += 7; // skip "STATES "
if (strtol(buf, &buf, 10) == 0) return 0;
buf = trimWhitespaces(buf);
if (strncmp(buf, "TRANSITIONS ", 12) != 0) {
LOG4CPLUS_ERROR(logger, "Expected \"TRANSITIONS\" but got \"" << std::string(buf, 0, 16) << "\".");
return 0;
}
buf += 12; // skip "TRANSITIONS "
if ((inputFileNonZeroEntryCount = strtol(buf, &buf, 10)) == 0) return 0;
/* /*
* Check all transitions for non-zero diagonal entries and deadlock states. * Check all transitions for non-zero diagonal entries and deadlock states.
@ -123,11 +109,6 @@ uint_fast64_t DeterministicSparseTransitionParser::firstPass(char* buf, int_fast
++nonZeroEntryCount; ++nonZeroEntryCount;
} }
if (inputFileNonZeroEntryCount != readTransitionCount) {
LOG4CPLUS_ERROR(logger, "Input File TRANSITIONS line stated " << inputFileNonZeroEntryCount << " but there were " << readTransitionCount << " transitions afterwards.");
return 0;
}
return nonZeroEntryCount; return nonZeroEntryCount;
} }
@ -180,11 +161,6 @@ DeterministicSparseTransitionParser::DeterministicSparseTransitionParser(std::st
* Read file header, extract number of states. * Read file header, extract number of states.
*/ */
buf = strchr(buf, '\n') + 1; // skip format hint buf = strchr(buf, '\n') + 1; // skip format hint
buf += 7; // skip "STATES "
checked_strtol(buf, &buf);
buf = trimWhitespaces(buf);
buf += 12; // skip "TRANSITIONS "
checked_strtol(buf, &buf);
/* /*
* Creating matrix here. * Creating matrix here.

13
src/parser/NondeterministicSparseTransitionParser.cpp

@ -54,18 +54,7 @@ uint_fast64_t NondeterministicSparseTransitionParser::firstPass(char* buf, uint_
* Check file header and extract number of transitions. * Check file header and extract number of transitions.
*/ */
buf = strchr(buf, '\n') + 1; // skip format hint buf = strchr(buf, '\n') + 1; // skip format hint
if (strncmp(buf, "STATES ", 7) != 0) {
LOG4CPLUS_ERROR(logger, "Expected \"STATES\" but got \"" << std::string(buf, 0, 16) << "\".");
return 0;
}
buf += 7; // skip "STATES "
if (strtol(buf, &buf, 10) == 0) return 0;
buf = trimWhitespaces(buf);
if (strncmp(buf, "TRANSITIONS ", 12) != 0) {
LOG4CPLUS_ERROR(logger, "Expected \"TRANSITIONS\" but got \"" << std::string(buf, 0, 16) << "\".");
return 0;
}
buf += 12; // skip "TRANSITIONS "
/* /*
* Parse number of transitions. * Parse number of transitions.
* We will not actually use this value, but we will compare it to the * We will not actually use this value, but we will compare it to the

2
src/storage/SparseMatrix.h

@ -1110,7 +1110,7 @@ public:
* to separate groups will be separated by a dashed line. * to separate groups will be separated by a dashed line.
* @return a (non-compressed) string representation of the matrix. * @return a (non-compressed) string representation of the matrix.
*/ */
std::string toString(std::shared_ptr<std::vector<std::uint_fast64_t>> nondeterministicChoiceIndices) const {
std::string toString(std::shared_ptr<std::vector<uint_fast64_t>> nondeterministicChoiceIndices) const {
std::stringstream result; std::stringstream result;
uint_fast64_t currentNondeterministicChoiceIndex = 0; uint_fast64_t currentNondeterministicChoiceIndex = 0;

Loading…
Cancel
Save