OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Private Attributes | List of all members
matheval::Parser< real_t > Class Template Reference

Class interface. More...

#include <matheval.hpp>

Public Member Functions

template<typename Iterator >
void parse (Iterator first, Iterator last)
 Parse an expression. More...
 
void parse (std::string const &str)
 
void optimize ()
 
real_t evaluate (typename detail::eval_ast< real_t >::symbol_table_t const &st)
 Evaluate the AST with a given symbol table. More...
 

Private Attributes

detail::expr_ast< real_t > ast
 

Detailed Description

template<typename real_t>
class matheval::Parser< real_t >

Class interface.

This class hides the grammar, AST, and AST traversal behind some member functions.

Template Parameters
real_tdatatype of the result

Definition at line 588 of file matheval.hpp.

Member Function Documentation

template<typename real_t>
real_t matheval::Parser< real_t >::evaluate ( typename detail::eval_ast< real_t >::symbol_table_t const &  st)
inline

Evaluate the AST with a given symbol table.

Parameters
[in]stthe symbol table for variables

Definition at line 620 of file matheval.hpp.

References matheval::Parser< real_t >::ast.

Referenced by matheval::parse().

template<typename real_t>
void matheval::Parser< real_t >::optimize ( )
inline

Definition at line 612 of file matheval.hpp.

References matheval::Parser< real_t >::ast.

template<typename real_t>
template<typename Iterator >
void matheval::Parser< real_t >::parse ( Iterator  first,
Iterator  last 
)
inline

Parse an expression.

This function builds the grammar and parses the iterator into an AST.

Parameters
[in]firstiterator to the start of the input sequence
[in]lastiterator to the end of the input sequence

Definition at line 601 of file matheval.hpp.

References matheval::Parser< real_t >::ast.

Referenced by matheval::Parser< real_t >::parse(), and matheval::parse().

template<typename real_t>
void matheval::Parser< real_t >::parse ( std::string const &  str)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 607 of file matheval.hpp.

References matheval::Parser< real_t >::parse().

Here is the call graph for this function:

Member Data Documentation

template<typename real_t>
detail::expr_ast<real_t> matheval::Parser< real_t >::ast
private

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