transfer infix pattern to postfix patternstack.h add function top to tell what's the top item of stack