Browse Source

fix bug in argument parser

Former-commit-id: 6e6b56c749
tempestpy_adaptions
ThomasH 8 years ago
parent
commit
c9d961c479
  1. 23
      src/storm-gspn.cpp

23
src/storm-gspn.cpp

@ -34,10 +34,10 @@ bool parseArguments(const int argc, const char **argv, std::string &inputFile, s
if (currentArg == "--input_file" || currentArg == "-i") { if (currentArg == "--input_file" || currentArg == "-i") {
auto next = it + 1; auto next = it + 1;
if (next != end) { if (next != end) {
return -1;
} else {
inputFile = *next; inputFile = *next;
result = true; result = true;
} else {
return -1;
} }
break; break;
} }
@ -46,9 +46,9 @@ bool parseArguments(const int argc, const char **argv, std::string &inputFile, s
if (currentArg == "--formula" || currentArg == "-f") { if (currentArg == "--formula" || currentArg == "-f") {
auto next = it + 1; auto next = it + 1;
if (next != end) { if (next != end) {
return -1;
} else {
formula = *next; formula = *next;
} else {
return -1;
} }
break; break;
} }
@ -57,9 +57,9 @@ bool parseArguments(const int argc, const char **argv, std::string &inputFile, s
if (currentArg == "--output_file" || currentArg == "-o") { if (currentArg == "--output_file" || currentArg == "-o") {
auto next = it + 1; auto next = it + 1;
if (next != end) { if (next != end) {
return -1;
} else {
outputFile = *next; outputFile = *next;
} else {
return -1;
} }
break; break;
} }
@ -68,9 +68,9 @@ bool parseArguments(const int argc, const char **argv, std::string &inputFile, s
if (currentArg == "--output_type" || currentArg == "-ot") { if (currentArg == "--output_type" || currentArg == "-ot") {
auto next = it + 1; auto next = it + 1;
if (next != end) { if (next != end) {
return -1;
} else {
outputType = *next; outputType = *next;
} else {
return -1;
} }
break; break;
} }
@ -109,11 +109,12 @@ int main(const int argc, const char **argv) {
// parse GSPN from file // parse GSPN from file
auto parser = storm::parser::GspnParser(); auto parser = storm::parser::GspnParser();
std::cout << "input_file: " << inputFile << std::endl;
auto gspn = parser.parse(inputFile); auto gspn = parser.parse(inputFile);
// todo ------[marker] // todo ------[marker]
gspn.isValid();
std::cout << "valid? = " << gspn.isValid() << std::endl;
/*
storm::gspn::GspnBuilder builder2; storm::gspn::GspnBuilder builder2;
builder2.addPlace(2); builder2.addPlace(2);
@ -138,7 +139,7 @@ int main(const int argc, const char **argv) {
std::cout << "number of states: " << ma.getNumberOfStates() << std::endl; std::cout << "number of states: " << ma.getNumberOfStates() << std::endl;
std::cout << "number of transitions: " << ma.getNumberOfTransitions() << std::endl << std::endl; std::cout << "number of transitions: " << ma.getNumberOfTransitions() << std::endl << std::endl;
*/

Loading…
Cancel
Save