source: branches/pyyaml3000/lib/yaml/tokens.py @ 48

Revision 48, 1.9 KB checked in by xi, 9 years ago (diff)

Scanner is complete.

Line 
1
2class Token:
3    def __init__(self, start_marker, end_marker):
4        self.start_marker = start_marker
5        self.end_marker = end_marker
6
7class DirectiveToken(Token):
8    code = '<directive>'
9    def __init__(self, name, value, start_marker, end_marker):
10        self.name = name
11        self.value = value
12        self.start_marker = start_marker
13        self.end_marker = end_marker
14
15class DocumentStartToken(Token):
16    code = '<document start>'
17
18class DocumentEndToken(Token):
19    code = '<document end>'
20
21class StreamEndToken(Token):
22    code = '<stream end>'
23
24class BlockSequenceStartToken(Token):
25    code = '<block sequence start>'
26
27class BlockMappingStartToken(Token):
28    code = '<block mapping end>'
29
30class BlockEndToken(Token):
31    code = '<block end>'
32
33class FlowSequenceStartToken(Token):
34    code = '['
35
36class FlowMappingStartToken(Token):
37    code = '{'
38
39class FlowSequenceEndToken(Token):
40    code = ']'
41
42class FlowMappingEndToken(Token):
43    code = '}'
44
45class KeyToken(Token):
46    code = '?'
47
48class ValueToken(Token):
49    code = ':'
50
51class EntryToken(Token):
52    code = '- or ,'
53
54class AliasToken(Token):
55    code = '<alias>'
56    def __init__(self, value, start_marker, end_marker):
57        self.value = value
58        self.start_marker = start_marker
59        self.end_marker = end_marker
60
61class AnchorToken(Token):
62    code = '<anchor>'
63    def __init__(self, value, start_marker, end_marker):
64        self.value = value
65        self.start_marker = start_marker
66        self.end_marker = end_marker
67
68class TagToken(Token):
69    code = '<tag>'
70    def __init__(self, value, start_marker, end_marker):
71        self.value = value
72        self.start_marker = start_marker
73        self.end_marker = end_marker
74
75class ScalarToken(Token):
76    code = '<scalar>'
77    def __init__(self, value, plain, start_marker, end_marker):
78        self.value = value
79        self.plain = plain
80        self.start_marker = start_marker
81        self.end_marker = end_marker
82
Note: See TracBrowser for help on using the repository browser.