
Untitled
By: a guest on
Jul 29th, 2012 | syntax:
None | size: 0.45 KB | hits: 12 | expires: Never
Constructor for postfix string expression
arithmetic_expression::arithmetic_expression(RPNstring input)
{
}
Tree::Tree(std::string input,Tree *leftSubTree,Tree *rightSubTree){
Op = input;
leftPtr = leftSubTree;
rightPtr = rightSubTree;
int num;
if (input == "+"|input == "-"|input == "*"|input == "/")
NodeType = TYPE_OPERATOR;
else if(std::istringstream(Op)>>num)
NodeType = TYPE_NUMBER;
else
NodeType = TYPE_VARIABLE;
}