metaSMT 2
metaSMT/support/SMT2_result_grammar.hpp
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "../result_wrapper.hpp"
00004 
00005 #include <boost/spirit/include/qi.hpp>
00006 #include <boost/tuple/tuple.hpp>
00007 #include <boost/tuple/tuple_io.hpp>
00008 #include <boost/fusion/adapted/boost_tuple.hpp>
00009 #include <string>
00010 
00011 namespace metaSMT {
00012   namespace smt2 {
00013     
00014     template< typename Iterator >
00015     struct smt2_result_grammar : boost::spirit::qi::grammar<Iterator, result_wrapper()>
00016     {
00017       smt2_result_grammar() : smt2_result_grammar::base_type(start)
00018       {
00019         using boost::spirit::qi::lit;
00020         using boost::spirit::qi::uint_;
00021         using boost::spirit::qi::eol;
00022         using boost::spirit::qi::attr;
00023         using boost::spirit::qi::labels::_1;
00024         using boost::spirit::qi::labels::_2;
00025         using boost::spirit::qi::labels::_val;
00026 
00027         start = boolean ;// | bitvector;
00028           ;
00029         
00030         boolean = 
00031             lit("(true)") >> attr(result_wrapper(true))
00032           | lit("(false)") >> attr(result_wrapper(false))
00033           ;
00034         //bitvector =
00035           //(lit("((_ bv") << uint_ << " " << uint_ << "))")//[_val = construct<result_wrapper>(_1, _2)]
00036           ;
00037           
00038           
00039   
00040         //start.name("start");
00041         //boolean.name("boolean");
00042         //bitvector.name("bitvector");
00043 
00044         //debug(start);
00045         //debug(boolean);
00046         //debug(bitvector);
00047       }
00048 
00049       boost::spirit::qi::rule<Iterator, result_wrapper()> start
00050         , boolean
00051         , bitvector
00052         ;
00053       boost::spirit::qi::rule<Iterator, boost::tuple<unsigned, unsigned>()> bvint;
00054 
00055     };
00056   } /* SMT2 */
00057 } /* metaSMT */
00058 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines