EMath++
Classes for mathematical concepts
Loading...
Searching...
No Matches
efc::Parser Class Reference

Class that wraps a std::string and parses it as a number or as a operation. More...

Public Member Functions

 Parser (const std::string &input) noexcept
 Standalone constructor for the Parser class.
 
const int parse_number () noexcept
 Function for parsing a plus, minus and number Tokens as a positive or negative int.
 
const emth::Polynomial parse_operation (const ::std::vector< emth::Polynomial > &ps)
 Function for parsing std::string as a mathematical operation consisting of Polynomials represented as integers.
 
 ~Parser () noexcept=default
 Default destructor.
 

Detailed Description

Class that wraps a std::string and parses it as a number or as a operation.

The class consists of two public functions, one for parsing the entire input as a number and the other for it as a operation.

Definition at line 753 of file interface.cpp.

Constructor & Destructor Documentation

◆ Parser()

efc::Parser::Parser ( const std::string &  input)
inlinenoexcept

Standalone constructor for the Parser class.

Parameters
inputA const reference to the std::string to parse when needed.

Definition at line 764 of file interface.cpp.

Member Function Documentation

◆ parse_number()

const int efc::Parser::parse_number ( )
inlinenoexcept

Function for parsing a plus, minus and number Tokens as a positive or negative int.

Returns
(int) The parsed number

Definition at line 769 of file interface.cpp.

References efc::Lexer::next(), efc::Token::type, and efc::Token::value.

◆ parse_operation()

const emth::Polynomial efc::Parser::parse_operation ( const ::std::vector< emth::Polynomial > &  ps)
inline

Function for parsing std::string as a mathematical operation consisting of Polynomials represented as integers.

Parameters
psA std::vector of Polynomials, the integers representing the Polynomials map to this std::vector indexes
Returns
(emth::Polynomial) The parsed polynomial resulting of the operation

Definition at line 786 of file interface.cpp.

References efc::Lexer::next(), efc::Token::type, and efc::Token::value.


The documentation for this class was generated from the following file: