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

Class MatchWhite

Rule --+
       |
      MatchWhite


A pseudo-rule to tell the parser to temporary match whitespaces. This rule is the counterpart of the IgnoreWhite rule. It sets the input reader into 'match whitespace' mode and matches the given subrule.
Method Summary
  __init__(self, rule)
Initialize this rule with a subrule.
  __str__(self)
Return a human-readable description of the rule.
  match(self, input_reader)
Match this 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 this rule with a subrule.
Parameters:
rule - The rule to match as a subrule.
           (type=Rule)

__str__(self)
(Informal representation operator)

Return a human-readable description of the rule.
Returns:
A human-readable description of this rule.

match(self, input_reader)

Match this rule against the input. The rule sets the input reader into 'match whitespace' mode, matches the subrule, resets the ignore state and returns the results of the subrule.
Parameters:
input_reader - The input reader to read input 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