STACK STATUS
EX1: 7,8,+,2,3,-,*
Symbol Read Operation Op1 Op2 Evaluation Value Stack
7 Push(7) - - - 7
8 Push(8) - - - 8,7
+ Pop, Pop 8 7 7+8 15 Empty
NOP Push(15) - - - - 15
2 Push(2) 2,15
3 Push(3) 3,2,15
- Pop(),pop() 3 2 2-3 -1 15
NOP Push(-1) -1,15
* Pop(),pop() -1 15 -1*15 -15 Empty
NOP Push(-15) -15
NOP Pop() -15 - - - Empty
Result= -15
Ex2: 6,2,3,+,-,3,8,2,/,+,*,2,$,3,+
Symbol Read Operation Op1 Op2 Evaluation Value Stack
6 Push(6) - - - - 6
2 Push(2) - - - - 2,6
3 Push(3) - - - - 3,2,6
+ Pop(), pop() 3 2 2+3 5 6
NOP Push(5) - - - - 5,6
- Pop(),pop() 5 6 6-5 1 Empty
NOP Push(1) - - - - 1
3 Push(3) - - - - 3,1
8 Push(8) - - - - 8,3,1
2 Push(2) - - - - 2,8,3,1
/ Pop(), pop() 2 8 8/2 4 3,1
NOP Push(4) - - - - 4,3,1
+ Pop(),pop() 4 3 3+4 7 1
NOP Push(7) - - - - 7,1
* Pop(), pop() 7 1 1*7 7 Empty
NOP Push(7) - - - - 7
2 Push(2) - - - - 2,7
$ Pop(),pop() 2 7 7^2 49 Empty
NOP Push(49) - - - - 49
3 Push(3) - - - - 3,49
+ Pop(),pop() 3 49 49+3 52 Empty
NOP Push(52) - - - - 52
NOP Pop(52) 52 - - - Empty
Result =52