Browse Source

made stuff compile with new CMakeLists

started a parser built with boost::spirit.
It compiles, but does not do anything useful yet...
tempestpy_adaptions
gereon 12 years ago
parent
commit
2eb08a603a
  1. 3
      CMakeLists.txt
  2. 32
      src/parser/readPctlFile.cpp
  3. 15
      src/parser/readPctlFile.h

3
CMakeLists.txt

@ -7,6 +7,9 @@ set (MRMC_CPP_VERSION_MAJOR 1)
set (MRMC_CPP_VERSION_MINOR 0)
option(DEFINE_UNIX "Defines the UNIX flag for compilation." OFF)
set (GTEST_INCLUDE_DIR resources/3rdparty/gtest-1.6.0/include)
set (GTEST_LIBRARY ${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.6.0/libgtest.a)
set (GTEST_MAIN_LIBRARY ${PROJECT_SOURCE_DIR}/resources/3rdparty/gtest-1.6.0/libgtest_main.a)
#Configurations for GCC
if(CMAKE_COMPILER_IS_GNUCC)

32
src/parser/readPctlFile.cpp

@ -0,0 +1,32 @@
#include "src/parser/readPctlFile.h"
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_char_class.hpp>
namespace bs = boost::spirit;
namespace bsq = bs::qi;
namespace
{
using namespace bsq;
struct Parser : public bsq::grammar< char const* >
{
typedef rule< char const* > rule_t;
rule_t atom, term, formula;
Parser() : Parser::base_type(formula, "PCTL parser")
{
atom = double_ | (char_('(') >> formula >> char_(')') );
term = atom >> *( char_('*') >> atom );
formula = term >> *( char_('+') >> term );
}
};
}
void readPctlFile(const char* filename)
{
Parser p;
}

15
src/parser/readPctlFile.h

@ -0,0 +1,15 @@
#ifndef READPCTLFILE_H_
#define READPCTLFILE_H_
namespace mrmc {
namespace parser {
/*!
* @brief Load PCTL file
*/
void readPctlFile(const char * filename);
} // namespace parser
} // namespace mrmc
#endif /* READPCTLFILE_H_ */
Loading…
Cancel
Save