EMath++
Classes for mathematical concepts
|
Class that wraps a std::string and parses it as a Monomial or as a Polynomial. More...
#include <eparser.h>
Public Member Functions | |
Parser (const std::string &input) noexcept | |
Standalone constructor for the Parser class. | |
Parser & | operator= (const Parser &ogn) noexcept |
Assigment operator for when called with an lvalue. | |
emth::Polynomial | parse_polynomial () noexcept |
Function that parses the input as a Polynomial. | |
emth::Monomial | parse_monomial () noexcept |
Function that parses the next Monomial in the input. | |
Class that wraps a std::string and parses it as a Monomial or as a Polynomial.
The class consists of two public functions, one for parsing the entire input as a Polynomial and the other for parsing only the next Monomial.
|
noexcept |
Standalone constructor for the Parser class.
input | A const reference to the std::string to parse when needed. |
Definition at line 94 of file eparser.cpp.
|
noexcept |
Assigment operator for when called with an lvalue.
ogn | The lvalue Parser object. |
Definition at line 100 of file eparser.cpp.
|
noexcept |
Function that parses the next Monomial in the input.
Definition at line 113 of file eparser.cpp.
References emth::Monomial::set_coeff(), emth::Monomial::set_degree(), emthp::T_EOF, emthp::T_EXPONENT, emthp::T_MINUS, emthp::T_NUMBER, emthp::T_PLUS, emthp::T_VARIABLE, and emthp::Token::type.
|
noexcept |
Function that parses the input as a Polynomial.
Definition at line 105 of file eparser.cpp.
References emth::Polynomial::push_monomial().