sjunges
9 years ago
5 changed files with 96 additions and 13 deletions
-
29src/parser/JaniParser.cpp
-
39src/parser/JaniParser.h
-
25src/storage/jani/Model.h
-
11src/utility/storm.cpp
-
5src/utility/storm.h
@ -1,4 +1,27 @@ |
|||
//
|
|||
// Created by Sebastian Junges on 20/05/16.
|
|||
//
|
|||
#include "JaniParser.h"
|
|||
#include "src/storage/jani/Model.h"
|
|||
#include "src/exceptions/FileIoException.h"
|
|||
|
|||
#include <iostream>
|
|||
#include <fstream>
|
|||
|
|||
namespace storm { |
|||
namespace parser { |
|||
void JaniParser::readFile(std::string const &path) { |
|||
std::ifstream file; |
|||
file.exceptions ( std::ifstream::failbit ); |
|||
try { |
|||
file.open(path); |
|||
} |
|||
catch (std::ifstream::failure e) { |
|||
STORM_LOG_THROW(false, storm::exceptions::FileIoException, "Exception during file opening on " << path << "."); |
|||
return; |
|||
} |
|||
file.exceptions( std::ifstream::goodbit ); |
|||
|
|||
parsedStructure << file; |
|||
file.close(); |
|||
|
|||
} |
|||
} |
|||
} |
@ -1,8 +1,39 @@ |
|||
// |
|||
// Created by Sebastian Junges on 18/05/16. |
|||
// |
|||
|
|||
#ifndef STORM_JANIPARSER_H |
|||
#define STORM_JANIPARSER_H |
|||
|
|||
#include <src/storage/jani/Model.h> |
|||
#include "src/exceptions/FileIoException.h" |
|||
|
|||
// JSON parser |
|||
#include "json.hpp" |
|||
|
|||
using json = nlohmann::json; |
|||
|
|||
namespace storm { |
|||
namespace jani { |
|||
class Model; |
|||
class Automaton; |
|||
} |
|||
|
|||
|
|||
namespace parser { |
|||
class JaniParser { |
|||
|
|||
json parsedStructure; |
|||
|
|||
static storm::jani::Model parse(std::string const& path); |
|||
|
|||
protected: |
|||
void readFile(std::string const& path); |
|||
storm::jani::Automaton parseAutomaton(json const& automatonStructure); |
|||
|
|||
|
|||
|
|||
|
|||
}; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
#endif //STORM_JANIPARSER_H |
Write
Preview
Loading…
Cancel
Save
Reference in new issue