All pastes #605643 Raw Edit

piromanas

public cpp v1 · immutable
·published 2007-07-06 10:43 UTC
rendered paste body
case state::binary :                                         if ( i != input.end() && ((*i)->type == state::value || (*i)->type == state::expression || (*i)->type == state::id ) ) {                                            i1 = i ;                                            ++i ;                                            if ( i != input.end() && ((*i)->type == state::operation || (*i)->type == state::expression) && (*i)->token == *str_i) {                                                node *o = *i ;                                                ++i ;                                                if ( i != input.end() && ((*i)->type == state::value  || (*i)->type == state::expression || (*i)->type == state::id ) ) {                                                    o->left = *i1 ;                                                    o->right = *i;                                                    o->type = state::expression ;                                                    input.erase(i1) ;                                                    input.erase( find(input.begin(), input.end(), o->right ) ) ;                                                    i = input.begin() ;                                                    state = state::binary ;                                                    ++count ;                                                }                                            }                                        }                                        else if ( i != input.end() ) {                                            state = state::binary ;                                            ++i ;                                        }                                        else if ( str_i != operators.end() ) {                                            state = state::binary ;                                            i = input.begin() ;                                            ++str_i ;                                        }                                            else {                                            state = state::quit ;                                                                                    }                                                                                break ;