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
__init__()[source]

Methods

__init__()
evaluate() Evaluates the postfix form of a production function and returns the computed value.
evaluate()[source]

Evaluates the postfix form of a production function and returns the computed value. During the evaluation, Pobject references are replaced with their value. :returns: the computed value of the production function, as a numeric value