Module yeanpypa :: Class OneOrMore
[show private | hide private]
[frames | no frames]

Class OneOrMore

Rule --+
       |
      OneOrMore


Match a rule once or more. This rule matches its subrule at least once or as often as possible.
Method Summary
  __init__(self, rule)
Initialize the rule with the appropriate subrule.
  __str__(self)
Return a human-readable representation of the rule.
  match(self, input_reader)
Match the rule against the input.
    Inherited from Rule
  __add__(self, second_rule)
Define an operator to concat two rules.
  __or__(self, second_rule)
Define an operator to concat two rules via OR.
  callAction(self, param)
Call the action attached to this rule.
  hide(self)
Tell this rule to not produce any token output.
  returnToken(self, token)
Helper function encapsulating the hide()-functionality.
  setAction(self, action)
Set the action to execute on a rule match.

Class Variable Summary
    Inherited from Rule
NoneType action = None                                                                  
bool hide_token = False

Method Details

__init__(self, rule)
(Constructor)

Initialize the rule with the appropriate subrule.
Parameters:
rule - The subrule to match.
           (type=Rule)

__str__(self)
(Informal representation operator)

Return a human-readable representation of the rule.
Returns:
A string describing this rule.

match(self, input_reader)

Match the rule against the input. The rule will try to match as many bytes as possible from the input against the subrule. It matches successfully, if the subrule matches at least once.
Parameters:
input_reader - The input reader to read from.
           (type=InputReader)
Returns:
A list of token generated by the subrule.
Overrides:
yeanpypa.Rule.match

Generated by Epydoc 2.1 on Sat Feb 10 16:11:43 2007 http://epydoc.sf.net