Minsky
anonymous_namespace{flowCoef.cc} Namespace Reference

Functions

bool parseLine (std::string const &line, std::string &pref)
 

Function Documentation

◆ parseLine()

bool anonymous_namespace{flowCoef.cc}::parseLine ( std::string const &  line,
std::string &  pref 
)

Definition at line 33 of file flowCoef.cc.

Referenced by minsky::FlowCoef::FlowCoef().

33  {
34  using it = std::string::const_iterator;
35 
36  // Construct grammar to treat inf and nan separately in input formula. See https://www.boost.org/doc/libs/1_68_0/libs/spirit/doc/html/spirit/qi/reference/numeric/real.html
37  qi::rule<it, std::string()> nan = -qi::lit("1.0#") >> qi::no_case["nan"] >> -('(' >> *(qi::char_ - ')') >> ')');
38  qi::rule<it, std::string()> inf = qi::no_case[qi::lit("inf") >> -qi::lit("inity")];
39  qi::rule<it, std::string()> sign = qi::lit('+') | '-';
40 
41 
42  it first = line.begin(), last = line.end();
43  return (qi::phrase_parse(first, last, -sign >> ( inf | nan) ,qi::blank, pref));
44  }
Here is the caller graph for this function: