Martel :: Expression :: Expression :: Class Expression
[hide private]
[frames] | no frames]

Class Expression

source code

Base class for nodes in the Expression tree

Instance Methods [hide private]
 
__add__(self, other)
returns an Expression to match this Expression then the other one
source code
 
__or__(self, other)
returns an Expression matching this Expression or (if that fails) the other one
source code
 
group_names(self)
the list of group names used by this Expression and its children
source code
 
_find_groups(self, tag)
return a list of all groups matching the given tag
source code
 
features(self)
return a list of all features
source code
 
_select_names(self, names)
internal function used by 'select_names'.
source code
 
copy(self)
do a deep copy on this Expression tree
source code
 
__str__(self)
the corresponding pattern string
source code
 
make_parser(self, debug_level=0)
create a SAX compliant parser for this regexp
source code
 
make_iterator(self, tag="record", debug_level=0)
create an iterator for this regexp; the 'tag' defines a record
source code
 
_modify_leaves(self, func)
internal function for manipulating the leaves of an expression
source code
Method Details [hide private]

_select_names(self, names)

source code 

internal function used by 'select_names'.

Don't call this function. Will likely be removed in future versions.

_modify_leaves(self, func)

source code 

internal function for manipulating the leaves of an expression

This really needs to be some sort of visit pattern, but I'm not sure the best way to do it. THIS METHOD MAY CHANGE.