Resetting the Expression Stack

When expression evaluation is finished, the Expression Stack will always have 1 element: an empty stack. The Values Stack will contain the computed value.

Next, LW Python will simply pop the Expression Stack to reset it. More precisely,

if Expression Stack at time t = [ [ ], [ ] ], then Expression Stack at time (t + 1) = [ ]

An empty Expression Stack indicates that LWPS is no longer evaluating an expression (thus it is ready to begin another expression).

For example,

if Expression Stack at time 5 = [ [ ], [ ] ], then Expression Stack at time 6 = [ ]


Comments

Please log in to add comments