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

Class IgnoreWhite

Rule --+
       |
      IgnoreWhite


A pseudo-rule to tell the parser to temporary ignore whitespaces. This rule itself does not match anything. It merely sets the input reader into 'ignore whitespace' mode and returns the token produced by its subrule. After executing the subrule, the ignore state of the input reader is reset (i.e. if it was 'ignore' before, it will be afterwards, if it was 'match', it will be that).
Method Summary
  __init__(self, rule)
Initialize the rule with a subrule.
  __str__(self)
Return a human-readable representation of this rule.
  match(self, input_reader)
Match the input against this rule.
    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 a subrule.
Parameters:
rule - The subrule to match.
           (type=Rule)

__str__(self)
(Informal representation operator)

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

match(self, input_reader)

Match the input against this rule. The input reader is set to 'ignore whitespace' mode, the subrule is matched, the ignore state of the input reader is reset and the result of the subrule is returned.
Parameters:
input_reader - The input reader to read any input from.
           (type=InputReader)
Returns:
The results of the subrule.
Overrides:
yeanpypa.Rule.match

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