#include <parser.hpp>
Public Member Functions | |
DynamicPhysical< SI > | parse (std::string formula) |
Definition at line 32 of file parser.hpp.
DynamicPhysical< SI > physical::parser::Parser::parse | ( | std::string | formula | ) |
Definition at line 168 of file parser.cpp.
References physical::unitsymbol_si_float::g.
Referenced by try_to_parse().
00168 { 00169 00170 #ifdef BOOST_HAS_THREADS 00171 // FIXME: if you move the parser object into the class, define some scoped lock here 00172 // (additional mutex in class) to protect grammar (closure!) from concurrent access. 00173 #endif 00174 physical::parser::detail::unit_parser g; 00175 physical::DynamicPhysical<SI> q; 00176 00177 boost::spirit::parse_info<> info = boost::spirit::parse(formula.c_str(), g[phoenix::var(q) = phoenix::arg1], boost::spirit::space_p); 00178 00179 if (info.full) 00180 return q; 00181 else 00182 throw parser_exception(formula, info.length); 00183 };
Generated on Mon Apr 2 22:25:08 2007 for physical_svn by 1.5.1-p1 | hosted on |