pep.pep.ProductionFunction¶
-
class
pep.pep.
ProductionFunction
[source]¶ Production function class that stores expressions using the postfix (reversed polish) form
Variables: - infixExpression (str) – string representation of the original expression from the input file (written in infix form)
- postfixStack (list) – stack of operands and operators (auxiliary for postfix form)
- items (list) – list of operands and operators written in postfix (reverse polish) form
Methods
__init__
()evaluate
()Evaluates the postfix form of a production function and returns the computed value.