![]() |
Cadabra
Computer algebra system for field theory problems
|
Preprocessing class which takes infix mathematical notation with all sorts of maths shortcuts and transforms it into a string which is properly formatted in prefix notation.
Use the Parser class to turn this string into an Ex expression tree.
#include <PreProcessor.hh>
Classes | |
| class | accu_t |
Public Types | |
| enum | order_labels { order_factorial =0, order_pow, order_frac, order_prod, order_wedge, order_minus, order_plus, order_dot, order_equals, order_unequals, order_less_than, order_greater_than, order_conditions, order_arrow, order_set_option, order_colon, order_comma, order_tilde } |
Public Member Functions | |
| preprocessor () | |
| void | erase () |
| void | strip_outer_brackets () const |
Static Public Attributes | |
| static const unsigned char | orders [] |
| static const char *const | order_names [] |
Private Member Functions | |
| void | parse_ (const std::string &) |
| void | parse_internal_ () |
| bool | unwind_ (unsigned int tolevel, unsigned int bracketgoal=0, bool usebracket=true) const |
| unsigned char | get_token_ (unsigned char prev_token) |
| void | show_and_throw_ (const std::string &str) const |
| void | bracket_strings_ (unsigned int cb, std::string &obrack, std::string &cbrack) const |
| bool | is_infix_operator_ (unsigned char c) const |
| bool | is_link_ (unsigned char c) const |
| unsigned int | is_opening_bracket_ (unsigned char c) const |
| unsigned int | is_closing_bracket_ (unsigned char c) const |
| unsigned int | is_bracket_ (unsigned char c) const |
| bool | is_already_bracketed_ (const std::string &str) const |
| bool | is_digits_ (const std::string &str) const |
| unsigned int | current_bracket_ (bool deep=false) const |
| void | print_stack () const |
| bool | default_is_product_ () const |
Private Attributes | |
| bool | verbatim_ |
| bool | next_is_product_ |
| bool | eat_initial_whitespace_ |
| unsigned int | cur_pos |
| std::string | cur_str |
| accu_t | cur |
| std::vector< accu_t > | accus |
Static Private Attributes | |
| static const unsigned char | open_brackets [] ={ '{', '(', '[' } |
| static const unsigned char | close_brackets [] ={ '}', ')', ']' } |
Friends | |
| std::istream & | operator>> (std::istream &, preprocessor &) |
| std::ostream & | operator<< (std::ostream &, const preprocessor &) |
| preprocessor::preprocessor | ( | ) |
|
private |
|
private |
|
private |
| void preprocessor::erase | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| void preprocessor::strip_outer_brackets | ( | ) | const |
|
private |
|
friend |
|
friend |
|
mutableprivate |
|
staticprivate |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
static |
|
static |
|
private |
1.8.6