37 #ifndef NEKTAR_LIBUTILITIES_PARSEUTILS_HPP
38 #define NEKTAR_LIBUTILITIES_PARSEUTILS_HPP
43 #include <boost/version.hpp>
45 #if( BOOST_VERSION / 100 % 1000 >= 36 )
46 #include <boost/spirit/include/classic_core.hpp>
47 #include <boost/spirit/include/classic_push_back_actor.hpp>
49 using namespace boost::spirit::classic;
51 #include <boost/spirit/core.hpp>
52 #include <boost/spirit/actor/push_back_actor.hpp>
70 lexeme_d[alpha_p >> *alnum_p][symbolFunctor] >>
"=" >> real_p[valueFunctor]
87 uint_p[functor1] >> !(
'-' >> uint_p[functor2]) >>
88 *(
',' >> uint_p[functor1] >> !(
'-' >> uint_p[functor2]))
104 uint_p[functor1] >> *(
',' >> uint_p[functor1])
120 real_p[functor4] >> *(
',' >> real_p[functor4])
135 real_p[functor5] >> *(
',' >> real_p[functor5])
150 (+(print_p -
','))[functor3] >> *(
',' >> (+(print_p -
','))[functor3])
169 m_symbol->assign(beg, end-beg);
201 #ifdef NOTREQUIRED //SJS: I do not think we need this check
202 if (!m_vector->empty())
204 unsigned int prevElem = m_vector->back();
208 m_vector->push_back(n);
214 m_vector->push_back(n);
232 unsigned int prevElem = m_vector->back();
234 for (
unsigned int i=prevElem+1; i<=n; ++i)
236 m_vector->push_back(i);
253 m_vector->push_back(std::string(first, last));
270 if (!m_vector->empty())
276 m_vector->push_back(n);
281 m_vector->push_back(n);
299 m_vector->push_back(n);
310 #endif //NEKTAR_LIBUTILITIES_PARSEUTILS_HPP
static bool GenerateOrderedStringVector(const char *const str, std::vector< std::string > &vec)
fctor5(std::vector< NekDouble > *vec)
static bool GenerateOrderedVector(const char *const str, std::vector< unsigned int > &vec)
fctor1(std::vector< unsigned int > *vec)
std::vector< unsigned int > * m_vector
static bool GenerateSeqVector(const char *const str, std::vector< unsigned int > &vec)
ValueFunctor(NekDouble *value)
void operator()(const char *beg, const char *end) const
void operator()(NekDouble n) const
std::vector< std::string > * m_vector
void operator()(unsigned int n) const
static bool ParseRealAssignment(const char *const str, std::string &symbol, NekDouble &value)
fctor3(std::vector< std::string > *vec)
void operator()(char const *first, char const *last) const
void operator()(NekDouble n) const
fctor2(std::vector< unsigned int > *vec)
SymbolFunctor(std::string *symbol)
std::vector< unsigned int > * m_vector
static bool GenerateOrderedVector(const char *const str, std::vector< NekDouble > &vec)
std::vector< NekDouble > * m_vector
static bool GenerateUnOrderedVector(const char *const str, std::vector< NekDouble > &vec)
void operator()(unsigned int n) const
void operator()(NekDouble val) const
fctor4(std::vector< NekDouble > *vec)
std::vector< NekDouble > * m_vector