Package lepl :: Package core :: Module rewriters :: Class AutoMemoize
[hide private]
[frames] | no frames]

Class AutoMemoize

source code


Apply two different memoizers, one to left recursive loops and the other elsewhere (either can be omitted).

conservative refers to the algorithm used to detect loops:
None will use the left memoizer on all nodes except the initial tree True will detect all possible loops (should be very similar to None) False detects only left-most loops and may miss some loops.

d is a parameter that controls the depth to which repeated left-recursion may occur. If None then the length of the remaining input is used. If set, parsers are more efficient, but less likely to match input correctly.

Instance Methods [hide private]
 
__init__(self, conservative=None, left=None, right=None, d=0)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__call__(self, graph) source code

Inherited from Rewriter: __eq__, __ge__, __gt__, __hash__, __le__, __lt__, __ne__, __str__

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, conservative=None, left=None, right=None, d=0)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

__call__(self, graph)
(Call operator)

source code 
Overrides: Rewriter.__call__