Package Martel :: Module Expression :: Class Alt
[show private | hide private]
[frames | no frames]

Class Alt

Expression --+    
             |    
ExpressionList --+
                 |
                Alt


An Expression tree with a list of alternate matches.
Method Summary
  __init__(self, expressions)
(expressions)
  __or__(self, other)
returns an Expression matching this Expression or (if that fails) the other one
  __str__(self)
the corresponding pattern string
    Inherited from ExpressionList
  copy(self)
do a deep copy on this Expression tree
  features(self)
return a list of all features
  group_names(self)
the list of group names used by this Expression or its children
  _find_groups(self, tag)
return a list of all groups matching the given tag
  _modify_leaves(self, func)
internal function for manipulating the leaves of an expression
  _select_names(self, names)
internal function.
    Inherited from Expression
  __add__(self, other)
returns an Expression to match this Expression then the other one
  make_iterator(self, tag, debug_level)
create an iterator for this regexp; the 'tag' defines a record
  make_parser(self, debug_level)
create a SAX compliant parser for this regexp

Method Details

__init__(self, expressions)
(Constructor)

(expressions)

Match one of a list of alternate expressions. The expressions are tested in their input order.

For example, Alt( (exp1, exp2, exp3) ) means try to match exp1, and if that fails try to match exp2, and if that fails, try to match exp3. If *that* fails, the match failed.

__or__(self, other)
(Or operator)

returns an Expression matching this Expression or (if that fails) the other one
Overrides:
Martel.Expression.Expression.__or__ (inherited documentation)

__str__(self)
(Informal representation operator)

the corresponding pattern string
Overrides:
Martel.Expression.Expression.__str__

Generated by Epydoc 2.1 on Thu Mar 31 20:15:49 2005 http://epydoc.sf.net