76 Lexer(
const std::string& input)
noexcept;
100 long unsigned int _pos;
105 double read_number()
noexcept;
111 static std::string clean(
const std::string& input)
noexcept;
118 static constexpr inline bool is_digit(
const char& c)
noexcept {
return ((c >=
'0' && c <=
'9') || c ==
'.');}
131 Parser(
const std::string& input)
noexcept;
157 double parse_number()
noexcept;
Class for representing and operating monomials.
Class for representing and operating polynomials.
Class that works as a token supplier for the Parser class.
void back() noexcept
Backtrack function that moves the cursor's position one position backwards.
Lexer & operator=(const Lexer &ogn) noexcept
Assigment operator for when called with an lvalue.
Token next() noexcept
Function that returns the next Token in the input provided in the constructor.
Class that wraps a std::string and parses it as a Monomial or as a Polynomial.
emth::Monomial parse_monomial() noexcept
Function that parses the next Monomial in the input.
emth::Polynomial parse_polynomial() noexcept
Function that parses the input as a Polynomial.
Parser & operator=(const Parser &ogn) noexcept
Assigment operator for when called with an lvalue.
This is the main header file for the emath library.
Englobes all the classes and functions of the parser.
TokenType
Enum with all the possible Token types.
@ T_MINUS
Minus sign type.
@ T_EXPONENT
Exponent sign type.
Struct for representing a token as a type and a value.
double value
The token's numerical value as a double.
TokenType type
The token's type as a TokenType.