Package ewa :: Module ruleparser :: Class RuleParser
[show private | hide private]
[frames | no frames]

Type RuleParser

object --+
         |
        RuleParser


Method Summary
  p_cond(self, p)
cond : cond_expr | simple_cond
  p_cond_expr_1(self, p)
cond_expr : cond_op LPAREN cond_list RPAREN
  p_cond_expr_2(self, p)
cond_expr : NOT LPAREN cond RPAREN
  p_cond_list(self, p)
cond_list : cond | cond COMMA cond_list
  p_cond_op(self, p)
cond_op : AND | OR
  p_cond_rule(self, p)
cond_rule : cond COLON rule | rule
  p_cond_rule_list(self, p)
cond_rule_list : cond_rule | cond_rule COMMA cond_rule_list | cond_rule cond_rule_list
  p_condopt_1(self, p)
condopt : BAREWORD OP BAREWORD
  p_condopt_2(self, p)
condopt : BAREWORD
  p_condopt_list(self, p)
condopt_list : condopt | condopt COMMA condopt_list
  p_condopts(self, p)
condopts : LBRACK condopt_list RBRACK
  p_date(self, p)
date : DATE
  p_datecompare(self, p)
datecompare : OP
  p_datespec_1(self, p)
datespec : datetime DASH datetime | date DASH date | datetime DASH date | date DASH datetime
  p_datespec_2(self, p)
datespec : datetime DASH datetime condopts | date DASH date condopts | datetime DASH date condopts | date DASH datetime condopts
  p_datespec_3(self, p)
datespec : datecompare datetime | datecompare date
  p_datespec_4(self, p)
datespec : datecompare datetime condopts | datecompare date condopts
  p_datetime(self, p)
datetime : DATETIME
  p_error(self, p)
  p_glob_1(self, p)
glob : string
  p_glob_2(self, p)
glob : string condopts
  p_grammar(self, p)
grammar : cond_rule_list
  p_postlist(self, p)
postlist : POST COLON speclist
  p_prelist(self, p)
prelist : PRE COLON speclist
  p_regex_1(self, p)
regex : BAREREGEX | QREGEX
  p_regex_2(self, p)
regex : BAREREGEX condopts | QREGEX condopts
  p_rule(self, p)
rule : simplerule | rulelist
  p_rulelist_1(self, p)
rulelist : LBRACK cond_rule_list RBRACK
  p_rulelist_2(self, p)
rulelist : LBRACK RBRACK
  p_simple_cond(self, p)
simple_cond : regex | glob | datespec
  p_simplerule_1(self, p)
simplerule : prelist COMMA postlist
  p_simplerule_2(self, p)
simplerule : prelist postlist
  p_simplerule_3(self, p)
simplerule : postlist COMMA prelist
  p_simplerule_4(self, p)
simplerule : postlist prelist
  p_simplerule_5(self, p)
simplerule : DEFAULT
  p_specifier(self, p)
specifier : string
  p_specifier_list(self, p)
specifier_list : specifier | specifier COMMA specifier_list
  p_speclist_1(self, p)
speclist : LBRACK specifier_list RBRACK
  p_speclist_2(self, p)
speclist : LBRACK RBRACK
  p_string(self, p)
string : BAREWORD | QWORD
  t_BAREREGEX(self, t)
regex:[^ ,:]+
  t_BAREWORD(self, t)
[\w\d/\*\\\?_\.]+
  t_COMMENT(self, t)
\#.*
  t_DATE(self, t)
(?P<month>0[1-9]|1[012])(?P<sep>-|/|\.)(?P<day>0[1-9]|[12]\d|3[01])(?P=sep)(?P<year>\d{4})
  t_DATETIME(self, t)
(?P<month>0[1-9]|1[012])(?P<sep>-|/|\.)(?P<day>0[1-9]|[12]\d|3[01])(?P=sep)(?P<year>\d{4})(?: |(?P=sep))(?P<hour>[01][0-9]|2[0-3])(?P<minute>[0-5]{2})
  t_error(self, t)
  t_newline(self, t)
\n+
  t_QREGEX(self, t)
regex:(?:\'(?:[^\']|\\\')*\'|"(?:[^"]|\\")*")
  t_QWORD(self, t)
\'(?:[^\']|\\\')*\'|"(?:[^"]|\\")*"
  _expand_datefmt(self, fmt)
  _gen_datematcher(self, start, end, opts, lineno)
  _gen_rule(self, cond, data)
  _resolve_datecompare(self, op, date)
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
tuple reserved = ('default', 'pre', 'post', 'and', 'or', 'not'...
str t_COLON = ':'
str t_COMMA = ','
str t_DASH = '-'
str t_ignore = ' \t'
str t_LBRACK = '\\['
str t_LPAREN = '\\('
str t_OP = '<=|>=|<|>|='
str t_RBRACK = '\\]'
str t_RPAREN = '\\)'
tuple tokens = ('OP', 'BAREWORD', 'QWORD', 'BAREREGEX', 'QREGE...

Method Details

p_cond(self, p)

cond : cond_expr | simple_cond

p_cond_expr_1(self, p)

cond_expr : cond_op LPAREN cond_list RPAREN

p_cond_expr_2(self, p)

cond_expr : NOT LPAREN cond RPAREN

p_cond_list(self, p)

cond_list : cond | cond COMMA cond_list

p_cond_op(self, p)

cond_op : AND | OR

p_cond_rule(self, p)

cond_rule : cond COLON rule | rule

p_cond_rule_list(self, p)

cond_rule_list : cond_rule | cond_rule COMMA cond_rule_list | cond_rule cond_rule_list

p_condopt_1(self, p)

condopt : BAREWORD OP BAREWORD

p_condopt_2(self, p)

condopt : BAREWORD

p_condopt_list(self, p)

condopt_list : condopt | condopt COMMA condopt_list

p_condopts(self, p)

condopts : LBRACK condopt_list RBRACK

p_date(self, p)

date : DATE

p_datecompare(self, p)

datecompare : OP

p_datespec_1(self, p)

datespec : datetime DASH datetime | date DASH date | datetime DASH date | date DASH datetime

p_datespec_2(self, p)

datespec : datetime DASH datetime condopts | date DASH date condopts | datetime DASH date condopts | date DASH datetime condopts

p_datespec_3(self, p)

datespec : datecompare datetime | datecompare date

p_datespec_4(self, p)

datespec : datecompare datetime condopts | datecompare date condopts

p_datetime(self, p)

datetime : DATETIME

p_glob_1(self, p)

glob : string

p_glob_2(self, p)

glob : string condopts

p_grammar(self, p)

grammar : cond_rule_list

p_postlist(self, p)

postlist : POST COLON speclist

p_prelist(self, p)

prelist : PRE COLON speclist

p_regex_1(self, p)

regex : BAREREGEX | QREGEX

p_regex_2(self, p)

regex : BAREREGEX condopts | QREGEX condopts

p_rule(self, p)

rule : simplerule | rulelist

p_rulelist_1(self, p)

rulelist : LBRACK cond_rule_list RBRACK

p_rulelist_2(self, p)

rulelist : LBRACK RBRACK

p_simple_cond(self, p)

simple_cond : regex | glob | datespec

p_simplerule_1(self, p)

simplerule : prelist COMMA postlist

p_simplerule_2(self, p)

simplerule : prelist postlist

p_simplerule_3(self, p)

simplerule : postlist COMMA prelist

p_simplerule_4(self, p)

simplerule : postlist prelist

p_simplerule_5(self, p)

simplerule : DEFAULT

p_specifier(self, p)

specifier : string

p_specifier_list(self, p)

specifier_list : specifier | specifier COMMA specifier_list

p_speclist_1(self, p)

speclist : LBRACK specifier_list RBRACK

p_speclist_2(self, p)

speclist : LBRACK RBRACK

p_string(self, p)

string : BAREWORD | QWORD

t_BAREREGEX(self, t)

regex:[^ ,:]+

t_BAREWORD(self, t)

[\w\d/\*\\\?_\.]+

t_COMMENT(self, t)

\#.*

t_DATE(self, t)

(?P<month>0[1-9]|1[012])(?P<sep>-|/|\.)(?P<day>0[1-9]|[12]\d|3[01])(?P=sep)(?P<year>\d{4})

t_DATETIME(self, t)

(?P<month>0[1-9]|1[012])(?P<sep>-|/|\.)(?P<day>0[1-9]|[12]\d|3[01])(?P=sep)(?P<year>\d{4})(?: |(?P=sep))(?P<hour>[01][0-9]|2[0-3])(?P<minute>[0-5]{2})

t_newline(self, t)

\n+

t_QREGEX(self, t)

regex:(?:\'(?:[^\']|\\\')*\'|"(?:[^"]|\\")*")

t_QWORD(self, t)

\'(?:[^\']|\\\')*\'|"(?:[^"]|\\")*"

Class Variable Details

reserved

Type:
tuple
Value:
('default', 'pre', 'post', 'and', 'or', 'not')                         

t_COLON

Type:
str
Value:
':'                                                                    

t_COMMA

Type:
str
Value:
','                                                                    

t_DASH

Type:
str
Value:
'-'                                                                    

t_ignore

Type:
str
Value:
' \t'                                                                  

t_LBRACK

Type:
str
Value:
'\\['                                                                  

t_LPAREN

Type:
str
Value:
'\\('                                                                  

t_OP

Type:
str
Value:
'<=|>=|<|>|='                                                          

t_RBRACK

Type:
str
Value:
'\\]'                                                                  

t_RPAREN

Type:
str
Value:
'\\)'                                                                  

tokens

Type:
tuple
Value:
('OP',
 'BAREWORD',
 'QWORD',
 'BAREREGEX',
 'QREGEX',
 'DATE',
 'DATETIME',
 'DEFAULT',
...                                                                    

Generated by Epydoc 2.1 on Wed Jan 3 10:13:56 2007 http://epydoc.sf.net