Package lepl :: Package regexp :: Module rewriters :: Class CompileRegexp
[hide private]
[frames] | no frames]

Class CompileRegexp

source code


A rewriter that uses the given alphabet and matcher to compile simple matchers.

The "use" parameter controls when regular expressions are substituted. If true, they are always used. If false, they are used only if they are part of a tree that includes repetition. The latter case generally gives more efficient parsers because it avoids converting already efficient literal matchers to regular expressions.

Instance Methods [hide private]
 
__init__(self, alphabet=None, use=True, matcher=NfaRegexp)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__call__(self, graph) source code

Inherited from core.rewriters.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, alphabet=None, use=True, matcher=NfaRegexp)
(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: core.rewriters.Rewriter.__call__