3 def __init__(self
, start_mark
, end_mark
):
4 self
.start_mark
= start_mark
5 self
.end_mark
= end_mark
7 attributes
= [key
for key
in self
.__dict
__
8 if not key
.endswith('_mark')]
10 arguments
= ', '.join(['%s=%r' % (key
, getattr(self
, key
))
11 for key
in attributes
])
12 return '%s(%s)' % (self
.__class
__.__name
__, arguments
)
14 #class BOMToken(Token):
15 # id = '<byte order mark>'
17 class DirectiveToken(Token
):
19 def __init__(self
, name
, value
, start_mark
, end_mark
):
22 self
.start_mark
= start_mark
23 self
.end_mark
= end_mark
25 class DocumentStartToken(Token
):
26 id = '<document start>'
28 class DocumentEndToken(Token
):
31 class StreamEndToken(Token
):
34 class BlockSequenceStartToken(Token
):
35 id = '<block sequence start>'
37 class BlockMappingStartToken(Token
):
38 id = '<block mapping start>'
40 class BlockEndToken(Token
):
43 class FlowSequenceStartToken(Token
):
46 class FlowMappingStartToken(Token
):
49 class FlowSequenceEndToken(Token
):
52 class FlowMappingEndToken(Token
):
55 class KeyToken(Token
):
58 class ValueToken(Token
):
61 class BlockEntryToken(Token
):
64 class FlowEntryToken(Token
):
67 class AliasToken(Token
):
69 def __init__(self
, value
, start_mark
, end_mark
):
71 self
.start_mark
= start_mark
72 self
.end_mark
= end_mark
74 class AnchorToken(Token
):
76 def __init__(self
, value
, start_mark
, end_mark
):
78 self
.start_mark
= start_mark
79 self
.end_mark
= end_mark
81 class TagToken(Token
):
83 def __init__(self
, value
, start_mark
, end_mark
):
85 self
.start_mark
= start_mark
86 self
.end_mark
= end_mark
88 class ScalarToken(Token
):
90 def __init__(self
, value
, plain
, start_mark
, end_mark
):
93 self
.start_mark
= start_mark
94 self
.end_mark
= end_mark