37 : manager(program.getManager().getSharedPointer()), grammar(new
FormulaParserGrammar(program.getManager().getSharedPointer())) {}
40 : manager(program.getManager().getSharedPointer()), grammar(new
FormulaParserGrammar(program.getManager().getSharedPointer())) {}
43 other.grammar->getIdentifiers().for_each(
48 this->manager = other.manager;
50 other.grammar->getIdentifiers().for_each(
56 std::vector<storm::jani::Property>
property =
parseFromString(formulaString);
57 STORM_LOG_THROW(property.size() == 1, storm::exceptions::WrongFormatException,
58 "Expected exactly one formula, but found " << property.size() <<
" instead.");
59 return property.front().getRawFormula();
64 std::ifstream inputFileStream;
67 std::vector<storm::jani::Property> properties;
71 std::string fileContent((std::istreambuf_iterator<char>(inputFileStream)), (std::istreambuf_iterator<char>()));
73 }
catch (std::exception& e) {
90 std::vector<storm::jani::Property> result;
95 bool succeeded = qi::phrase_parse(
96 iter, last, *grammar, storm::spirit_encoding::space_type() | qi::lit(
"//") >> *(qi::char_ - (qi::eol | qi::eoi)) >> (qi::eol | qi::eoi), result);
97 STORM_LOG_THROW(succeeded, storm::exceptions::WrongFormatException,
"Could not parse formula: " << formulaString);
99 }
catch (qi::expectation_failure<PositionIteratorType>
const& e) {
100 STORM_LOG_THROW(
false, storm::exceptions::WrongFormatException, e.what_);
108 grammar->addIdentifierExpression(identifier, expression);
boost::spirit::line_pos_iterator< BaseIteratorType > PositionIteratorType
#define STORM_LOG_DEBUG(message)
#define STORM_LOG_THROW(cond, exception, message)
void closeFile(std::ofstream &stream)
Close the given file after writing.
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.