37 #ifndef NEKTAR_LIBUTILITIES_PARSEUTILS_HPP
38 #define NEKTAR_LIBUTILITIES_PARSEUTILS_HPP
44 #include <boost/version.hpp>
46 #if( BOOST_VERSION / 100 % 1000 >= 36 )
47 #include <boost/spirit/include/classic_core.hpp>
48 #include <boost/spirit/include/classic_push_back_actor.hpp>
50 using namespace boost::spirit::classic;
52 #include <boost/spirit/core.hpp>
53 #include <boost/spirit/actor/push_back_actor.hpp>
71 lexeme_d[alpha_p >> *alnum_p][symbolFunctor] >>
"=" >> real_p[valueFunctor]
88 uint_p[functor1] >> !(
'-' >> uint_p[functor2]) >>
89 *(
',' >> uint_p[functor1] >> !(
'-' >> uint_p[functor2]))
105 uint_p[functor1] >> *(
',' >> uint_p[functor1])
121 real_p[functor4] >> *(
',' >> real_p[functor4])
136 real_p[functor5] >> *(
',' >> real_p[functor5])
151 (+(print_p -
','))[functor3] >> *(
',' >> (+(print_p -
','))[functor3])
161 std::stringstream idStringStream;
165 if (elmtids.size() == 0)
167 return std::string(
"");
170 idStringStream << elmtids[0];
171 for (
int i = 1; i < elmtids.size(); ++i)
173 if (elmtids[i] == elmtids[i - 1] + 1)
177 idStringStream <<
"-";
181 if (i == elmtids.size() - 1)
183 idStringStream << elmtids[i];
192 if (setdash ==
false)
194 idStringStream << endval;
198 idStringStream <<
"," << elmtids[i];
202 return idStringStream.str();
216 m_symbol->assign(beg, end-beg);
248 #ifdef NOTREQUIRED //SJS: I do not think we need this check
249 if (!m_vector->empty())
251 unsigned int prevElem = m_vector->back();
255 m_vector->push_back(n);
261 m_vector->push_back(n);
279 unsigned int prevElem = m_vector->back();
281 for (
unsigned int i=prevElem+1; i<=n; ++i)
283 m_vector->push_back(i);
300 m_vector->push_back(std::string(first, last));
317 if (!m_vector->empty())
323 m_vector->push_back(n);
328 m_vector->push_back(n);
346 m_vector->push_back(n);
357 #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)
static std::string GenerateSeqString(const std::vector< unsigned int > &elmtids)
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