templatevoid parse (iterator begin,iterator end,list & output) { string::iterator i = begin, i1 ; while (i != end) { if (*i >= '0' && i* <= '9' && i != end) { i1 = i ; while (*i >= '0' && i* <= '9' && i != end) { ++i ; } node* n = new node ; string str1 (i1,i-1) ; istringstream stream (str1) ; float f ; stream >> f ; n->value = f ; output.push_back(n) ; } else if ( isalpha(*i) && i != end ) { i1 = i ; while ( isalpha(*i) && i != end ) { ++i ; } node* n = new node ; string str1 (i1,i-1) ; n->operation = find_op(str1.c_str()) ; output.push_back(n) ; } else if ( (*i == '+') || (*i == '-') || (*i == '*') || (*i == '/') || (*i == '^') && i != end ) { node* n = new node ; n->operation = find_op(*i) ; output.push_back(n) ; ++i ; } } }