All pastes #511925 Raw Edit

piromanas

public cpp v1 · immutable
#511925 ·published 2007-05-26 16:55 UTC
rendered paste body
void parse (iterator begin,iterator end,list<node *> & output) {    string::iterator i = begin, i1 ;    node* n;    while (i != end) {        if (*i >= '0' && i* <= '9') {            i1 = i;            while (*i >= '0' && i* <= '9') {                ++i;            }            string str1 (i1,i-1) ;            istringstream stream (str1) ;            float f ;            stream >> f ;            n->value = f ;            output.push_back(n);        }        if ( isalpha(*i) ) {            i1 = i;            _reset(n) ;            while ( isalpha(*i) ) {                ++i;            }            string str1 (i1,i-1) ;            n->operation->name = str1 ;            output.push_back(n) ;        }        if ( (*i == '+') || (*i == '-') || (*i == '*') || (*i == '/') || (*i == '^') ) {            _reset(n) ;            n->operation = find_op(*i) ;            output.push_back(n) ;             ++i;        }            }