$treeview $search $mathjax
00001 #ifndef __SEVMGR_BAS_BASCOMPARSERTYPES_HPP 00002 #define __SEVMGR_BAS_BASCOMPARSERTYPES_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // STL 00008 #include <string> 00009 // Boost 00010 //#define BOOST_SPIRIT_DEBUG 00011 #include <boost/spirit/home/classic/core.hpp> 00012 //#include <boost/spirit/home/classic/attribute.hpp> 00013 //#include <boost/spirit/home/classic/utility/functor_parser.hpp> 00014 #include <boost/spirit/home/classic/utility/loops.hpp> 00015 #include <boost/spirit/home/classic/utility/chset.hpp> 00016 #include <boost/spirit/home/classic/utility/confix.hpp> 00017 #include <boost/spirit/home/classic/iterator/file_iterator.hpp> 00018 //#include <boost/spirit/home/classic/actor/push_back_actor.hpp> 00019 //#include <boost/spirit/home/classic/actor/assign_actor.hpp> 00020 00021 namespace SEVMGR { 00022 00023 // /////////////////////////////////////////////////////////////////////// 00024 // 00025 // Definition of Basic Types 00026 // 00027 // /////////////////////////////////////////////////////////////////////// 00028 // For a file, the parsing unit is the character (char). For a string, 00029 // it is a "char const *". 00030 // typedef char const* iterator_t; 00031 typedef char char_t; 00032 00033 // The types of iterator, scanner and rule are then derived from 00034 // the parsing unit. 00035 typedef boost::spirit::classic::file_iterator<char_t> iterator_t; 00036 typedef boost::spirit::classic::scanner<iterator_t> scanner_t; 00037 typedef boost::spirit::classic::rule<scanner_t> rule_t; 00038 00039 // /////////////////////////////////////////////////////////////////////// 00040 // 00041 // Parser related types 00042 // 00043 // /////////////////////////////////////////////////////////////////////// 00045 typedef boost::spirit::classic::int_parser<unsigned int, 10, 1, 1> int1_p_t; 00046 00048 typedef boost::spirit::classic::uint_parser<unsigned int, 10, 2, 2> uint2_p_t; 00049 00051 typedef boost::spirit::classic::uint_parser<unsigned int, 10, 1, 2> uint1_2_p_t; 00052 00054 typedef boost::spirit::classic::uint_parser<unsigned int, 10, 1, 3> uint1_3_p_t; 00055 00057 typedef boost::spirit::classic::uint_parser<unsigned int, 10, 4, 4> uint4_p_t; 00058 00060 typedef boost::spirit::classic::uint_parser<unsigned int, 10, 1, 4> uint1_4_p_t; 00061 00063 typedef boost::spirit::classic::chset<char_t> chset_t; 00064 00067 typedef boost::spirit::classic::impl::loop_traits<chset_t, 00068 unsigned int, 00069 unsigned int>::type repeat_p_t; 00070 00072 typedef boost::spirit::classic::bounded<uint2_p_t, unsigned int> bounded2_p_t; 00073 typedef boost::spirit::classic::bounded<uint1_2_p_t, unsigned int> bounded1_2_p_t; 00074 typedef boost::spirit::classic::bounded<uint1_3_p_t, unsigned int> bounded1_3_p_t; 00075 typedef boost::spirit::classic::bounded<uint4_p_t, unsigned int> bounded4_p_t; 00076 typedef boost::spirit::classic::bounded<uint1_4_p_t, unsigned int> bounded1_4_p_t; 00077 } 00078 #endif // __SEVMGR_BAS_BASCOMPARSERTYPES_HPP