From 10419d4bba6596587e6169e9f64221748aee0cf1 Mon Sep 17 00:00:00 2001 From: sjunges Date: Sun, 7 Aug 2016 18:18:39 +0200 Subject: [PATCH] improved error message for unsupported operations Former-commit-id: a5bba8670d8c4e02cf9a86f4cf6fc893f742380d [formerly 81693f6d7c0c2360a9b844578e0fbd10bb81fb86] Former-commit-id: c4c197d0eee7a8d05995eb67dd9ceead84733ce8 --- src/parser/JaniParser.cpp | 7 ++++++- src/parser/JaniParser.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parser/JaniParser.cpp b/src/parser/JaniParser.cpp index 2cb834742..d6481618e 100644 --- a/src/parser/JaniParser.cpp +++ b/src/parser/JaniParser.cpp @@ -20,6 +20,8 @@ namespace storm { // Defaults //////////// const bool JaniParser::defaultVariableTransient = false; + const std::set JaniParser::unsupportedOpstrings({"sin", "cos", "tan", "cot", "sec", "csc", "asin", "acos", "atan", "acot", "asec", "acsc", + "sinh", "cosh", "tanh", "coth", "sech", "csch", "asinh", "acosh", "atanh", "asinh", "acosh"}); std::string getString(json const& structure, std::string const& errorInfo) { @@ -475,7 +477,10 @@ namespace storm { ensureNumericalType(arguments[1], opstring, 1, scopeDescription); // TODO implement STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "log operation is not yet implemented"); - } else { + } else if (unsupportedOpstrings.count(opstring) > 0){ + STORM_LOG_THROW(false, storm::exceptions::InvalidJaniException, "Opstring " + opstring + " is not supported by storm"); + + } else { STORM_LOG_THROW(false, storm::exceptions::InvalidJaniException, "Unknown operator " << opstring << " in " << scopeDescription << "."); } } diff --git a/src/parser/JaniParser.h b/src/parser/JaniParser.h index 1e1d66d66..f86085b49 100644 --- a/src/parser/JaniParser.h +++ b/src/parser/JaniParser.h @@ -72,6 +72,8 @@ namespace storm { ////////// static const bool defaultVariableTransient; + static const std::set unsupportedOpstrings; + }; } }