20 template<
typename Pol>
28 template<
typename Result,
typename Parser>
29 bool parse(
const std::string& s,
const Parser& parser, Result& res) {
30 auto begin = s.begin();
31 return qi::phrase_parse(begin, s.end(), parser,
skipper, res);
45 CARL_LOG_ERROR(
"carl.parser",
"Parsing \"" << s <<
"\" to a polynomial failed.");
53 CARL_LOG_ERROR(
"carl.parser",
"Parsing \"" << s <<
"\" to a rational function failed.");
61 std::cout <<
"NOPE!" << std::endl;
62 CARL_LOG_ERROR(
"carl.parser",
"Parsing \"" << s <<
"\" to a formula failed.");
A small wrapper that configures logging for carl.
#define CARL_LOG_ERROR(channel, msg)
MultivariatePolynomial< Rational > Pol
boost::spirit::qi::space_type Skipper
A Variable represents an algebraic variable that can be used throughout carl.
constexpr VariableType type() const noexcept
Retrieves the type of the variable.
Represent an SMT formula, which can be an atom for some background theory or a boolean combination of...
bool parse(const std::string &s, const Parser &parser, Result &res)
Pol polynomial(const std::string &s)
Formula< Pol > formula(const std::string &s)
FormulaParser< Pol > formulaParser
void addVariable(Variable::Arg v)
RationalFunctionParser< Pol > ratfunParser
RatFun< Pol > rationalFunction(const std::string &s)
PolynomialParser< Pol > polynomialParser