From f9d2df0b0a2e896547d6eb70dc83571cdd2369e3 Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Sun, 25 Jul 2021 15:28:14 +0200 Subject: [PATCH] move ConstantDataType and added ostream --- src/storm-parsers/parser/ConstantDataType.cpp | 14 ++++++++++++++ src/storm-parsers/parser/ConstantDataType.h | 14 ++++++++++++++ src/storm-parsers/parser/FormulaParserGrammar.h | 5 +---- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 src/storm-parsers/parser/ConstantDataType.cpp create mode 100644 src/storm-parsers/parser/ConstantDataType.h diff --git a/src/storm-parsers/parser/ConstantDataType.cpp b/src/storm-parsers/parser/ConstantDataType.cpp new file mode 100644 index 000000000..52ab7c9d9 --- /dev/null +++ b/src/storm-parsers/parser/ConstantDataType.cpp @@ -0,0 +1,14 @@ +#include "ConstantDataType.h" + +namespace storm { + namespace parser { + std::ostream& operator<<(std::ostream& out, ConstantDataType const& constantDataType) { + switch(constantDataType) { + case storm::parser::ConstantDataType::Bool: out << "Bool"; break; + case storm::parser::ConstantDataType::Integer: out << "Integer"; break; + case storm::parser::ConstantDataType::Rational: out << "Rational"; break; + } + return out; + } + } +} diff --git a/src/storm-parsers/parser/ConstantDataType.h b/src/storm-parsers/parser/ConstantDataType.h new file mode 100644 index 000000000..b8e7aa975 --- /dev/null +++ b/src/storm-parsers/parser/ConstantDataType.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace storm { + namespace parser { + + enum class ConstantDataType { + Bool, Integer, Rational + }; + + std::ostream& operator<<(std::ostream& out, ConstantDataType const& constantDataType); + } +} diff --git a/src/storm-parsers/parser/FormulaParserGrammar.h b/src/storm-parsers/parser/FormulaParserGrammar.h index 75903d04a..9ea0e5355 100644 --- a/src/storm-parsers/parser/FormulaParserGrammar.h +++ b/src/storm-parsers/parser/FormulaParserGrammar.h @@ -10,6 +10,7 @@ #include "storm/storage/jani/Property.h" #include "storm/logic/Formulas.h" #include "storm-parsers/parser/ExpressionParser.h" +#include "storm-parsers/parser/ConstantDataType.h" #include "storm/modelchecker/results/FilterType.h" @@ -148,10 +149,6 @@ namespace storm { qi::rule(), Skipper> start; - enum class ConstantDataType { - Bool, Integer, Rational - }; - qi::rule, Skipper> constantDefinition; qi::rule identifier; qi::rule formulaName;