pyre.algebraic.AbstractNode

Module Contents

class pyre.algebraic.AbstractNode.AbstractNode

The base class for hierarchies that implement the algebraic protocol

The mix-in classes {Arithmetic}, {Ordering} and {Boolean} overload the methods that are invoked by the evaluation of expressions involving python operators. The implementation of these methods expect {AbstractNode} subclasses to provide access to two subclasses, {Literal} and {Operator}, that are used to build a representation of the python expression. {Literal} is used to encapsulate objects that are foreign to the {Node} class hierarchy, e.g. integers, and {Operation} encodes the operator encountered and its operands. This access must be provided through two {Node} properties, {literal} and {operation}, which provide an extra layer of abstraction by hiding the actual {Node} subclasses.

leaf
composite
literal
variable
operator
_pyre_hasAlgebra = False
cyclic(self)

Determine whether my subgraph has any cycles

replace(self, obsolete)

Take ownership of any information held by the {obsolete} node, which is about to be destroyed

dump(self, name, indent)