Browse Source

Merge branch 'parser' of https://sselab.de/lab9/private/git/MRMC into parser

tempestpy_adaptions
gereon 12 years ago
parent
commit
98d18f5ddc
  1. 4
      src/formula/BoundedUntil.h
  2. 9
      src/parser/parser.h
  3. 4
      src/parser/readLabFile.cpp
  4. 3
      src/parser/readTraFile.cpp

4
src/formula/BoundedUntil.h

@ -9,6 +9,8 @@
#define BOUNDEDUNTIL_H_ #define BOUNDEDUNTIL_H_
#include "PCTLPathFormula.h" #include "PCTLPathFormula.h"
#include "PCTLStateFormula.h"
#include "boost/integer/integer_mask.hpp"
namespace mrmc { namespace mrmc {
@ -62,7 +64,7 @@ class BoundedUntil : public PCTLPathFormula {
std::string result = "("; std::string result = "(";
result += left->toString(); result += left->toString();
result += " U<="; result += " U<=";
result += bound;
result += std::to_string(bound);
result += " "; result += " ";
result += right->toString(); result += right->toString();
result += ")"; result += ")";

9
src/parser/parser.h

@ -49,7 +49,7 @@ namespace parser {
#if defined LINUX || defined MACOSX #if defined LINUX || defined MACOSX
int file; int file;
#elif defined WINDOWS #elif defined WINDOWS
HFILE file;
HANDLE file;
HANDLE mapping; HANDLE mapping;
#endif #endif
@ -110,7 +110,6 @@ namespace parser {
} }
this->dataend = this->data + this->st.st_size; this->dataend = this->data + this->st.st_size;
#elif defined WINDOWS #elif defined WINDOWS
#warning Windows support is implemented but has not been compiled yet...
/* /*
* Do file mapping for windows. * Do file mapping for windows.
* _stat64(), CreateFile(), CreateFileMapping(), MapViewOfFile() * _stat64(), CreateFile(), CreateFileMapping(), MapViewOfFile()
@ -121,14 +120,14 @@ namespace parser {
throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in stat()"); throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in stat()");
} }
this->file = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
this->file = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (this->file == INVALID_HANDLE_VALUE) if (this->file == INVALID_HANDLE_VALUE)
{ {
pantheios::log_ERROR("Could not open ", filename, ". Does it exist? Is it readable?"); pantheios::log_ERROR("Could not open ", filename, ". Does it exist? Is it readable?");
throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in CreateFile()"); throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in CreateFile()");
} }
this->mapping = CreateFileMapping(this->file, NULL, PAGE_READONLY, (DWORD)(st.st_size >> 32), (DWORD)st.st_size, NULL);
this->mapping = CreateFileMappingA(this->file, NULL, PAGE_READONLY, (DWORD)(st.st_size >> 32), (DWORD)st.st_size, NULL);
if (this->mapping == NULL) if (this->mapping == NULL)
{ {
CloseHandle(this->file); CloseHandle(this->file);
@ -136,7 +135,7 @@ namespace parser {
throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in CreateFileMapping()"); throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in CreateFileMapping()");
} }
this->data = MapViewOfFile(this->mapping, FILE_MAP_READ, 0, 0, this->st.st_size);
this->data = static_cast<char*>(MapViewOfFile(this->mapping, FILE_MAP_READ, 0, 0, this->st.st_size));
if (this->data == NULL) if (this->data == NULL)
{ {
CloseHandle(this->mapping); CloseHandle(this->mapping);

4
src/parser/readLabFile.cpp

@ -20,7 +20,11 @@
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#include <sys/stat.h> #include <sys/stat.h>
#if defined LINUX || defined MACOSX
#include <sys/mman.h> #include <sys/mman.h>
#elif defined WINDOWS
#define strncpy strncpy_s
#endif
#include <fcntl.h> #include <fcntl.h>
#include <locale.h> #include <locale.h>

3
src/parser/readTraFile.cpp

@ -19,7 +19,10 @@
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#include <sys/stat.h> #include <sys/stat.h>
#if defined LINUX || defined MACOSX
#include <sys/mman.h> #include <sys/mman.h>
#elif defined WINDOWS
#endif
#include <fcntl.h> #include <fcntl.h>
#include <locale.h> #include <locale.h>

Loading…
Cancel
Save