rules.py
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
'''
Created on 24 sty 2014
@author: mlenart
'''
class SegmentRule(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
class TagRule(SegmentRule):
def __init__(self, tagType, line):
self.tagType = tagType
self.line = line
class UnaryRule(SegmentRule):
def __init__(self, child, line):
self.child = child
self.line = line
class ComplexRule(SegmentRule):
def __init__(self, children, line):
self.children = children
self.line = line
class ConcatRule(ComplexRule):
def __init__(self, children, line):
super(ConcatRule, self).__init__(children, line)
class OrRule(ComplexRule):
def __init__(self, children, line):
super(OrRule, self).__init__(children, line)
class ZeroOrMoreRule(UnaryRule):
def __init__(self, child, line):
super(ZeroOrMoreRule, self).__init__(child, line)
class OneOrMoreRule(UnaryRule):
def __init__(self, child, line):
super(OneOrMoreRule, self).__init__(child, line)
class IgnoreOrthRule(UnaryRule):
def __init__(self, child, line):
super(IgnoreOrthRule, self).__init__(child, line)