| Home | Trees | Index | Help |
|---|
| Module yeanpypa :: Class Rule |
|
AndRule,
AnyOf,
CallbackParser,
Combine,
IgnoreWhite,
Literal,
MatchWhite,
NoneOf,
OneOrMore,
Optional,
OrRule,
ZeroOrMore| Method Summary | |
|---|---|
Define an operator to concat two rules. | |
Define an operator to concat two rules via OR. | |
Call the action attached to this rule. | |
Tell this rule to not produce any token output. | |
Match the given rule in the string from the given position on. | |
Helper function encapsulating the hide()-functionality. | |
Set the action to execute on a rule match. | |
| Class Variable Summary | |
|---|---|
NoneType |
action = None |
bool |
hide_token = False
|
| Method Details |
|---|
__add__(self,
second_rule)
Define an operator to concat two rules. The expressivness of the
'pseudo-language' defined by the framework heavily relies on operator
overloading. The +-operator serves as a 'followed by' expression.
|
__or__(self,
second_rule)
Define an operator to concat two rules via OR. The expressivness of
the 'pseudo-language' defined by the framework heavily relies on
operator overloading. The |-operator serves as a 'OR' expression,
defining two alternative matches.
|
callAction(self, param)Call the action attached to this rule. The given parameter is passed to the action.
|
hide(self)Tell this rule to not produce any token output. The rule matches its token as normal but does not return any of them @return self |
match(input_reader)Match the given rule in the string from the given position on.
|
returnToken(self, token)Helper function encapsulating the hide()-functionality. This method returns the token if self.hide is False and None otherwise.
|
setAction(self, action)Set the action to execute on a rule match. Action may be any callable that takes a one parameter. The parameter is a list of token the rule matched. The action may manipulate the token returned by returning a different token list.
|
| Class Variable Details |
|---|
action
|
hide_token
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Sat Feb 10 16:11:43 2007 | http://epydoc.sf.net |