From 99c5f4799eda3c295c4d5d00d69456fb0d169f0f Mon Sep 17 00:00:00 2001 From: gereon Date: Mon, 7 Jan 2013 12:34:16 +0100 Subject: [PATCH] checking file format hint --- src/parser/AutoTransitionParser.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/parser/AutoTransitionParser.cpp b/src/parser/AutoTransitionParser.cpp index 82243ee9f..d65318a76 100644 --- a/src/parser/AutoTransitionParser.cpp +++ b/src/parser/AutoTransitionParser.cpp @@ -5,6 +5,8 @@ #include "DeterministicSparseTransitionParser.h" #include "NonDeterministicSparseTransitionParser.h" +#include + namespace storm { namespace parser { @@ -78,8 +80,15 @@ std::pair AutoTransitionParser::analyzeContent(co TransitionType hintType = Unknown, transType = Unknown; // Open file MappedFile file(filename.c_str()); - //char* buf = file.data; + char* buf = file.data; + + // parse hint + char hint[128]; + sscanf(buf, "%s\n", hint); + // check hint + if (strncmp(hint, "dtmc", sizeof(hint)) == 0) hintType = DTMC; + else if (strncmp(hint, "ndtmc", sizeof(hint)) == 0) hintType = NDTMC; return std::pair(hintType, transType); }