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

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

Scanner is complete.

RevLine 
[46]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):
[47]8    code = '<directive>'
[48]9    def __init__(self, name, value, start_marker, end_marker):
[46]10        self.name = name
[48]11        self.value = value
[46]12        self.start_marker = start_marker
13        self.end_marker = end_marker
14
15class DocumentStartToken(Token):
[47]16    code = '<document start>'
[46]17
18class DocumentEndToken(Token):
[47]19    code = '<document end>'
[46]20
[47]21class StreamEndToken(Token):
22    code = '<stream end>'
[46]23
24class BlockSequenceStartToken(Token):
[47]25    code = '<block sequence start>'
[46]26
27class BlockMappingStartToken(Token):
[47]28    code = '<block mapping end>'
[46]29
30class BlockEndToken(Token):
[47]31    code = '<block end>'
[46]32
33class FlowSequenceStartToken(Token):
[47]34    code = '['
[46]35
36class FlowMappingStartToken(Token):
[47]37    code = '{'
[46]38
39class FlowSequenceEndToken(Token):
[47]40    code = ']'
[46]41
42class FlowMappingEndToken(Token):
[47]43    code = '}'
[46]44
45class KeyToken(Token):
[47]46    code = '?'
[46]47
48class ValueToken(Token):
[47]49    code = ':'
[46]50
51class EntryToken(Token):
[47]52    code = '- or ,'
[46]53
54class AliasToken(Token):
[47]55    code = '<alias>'
[46]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):
[47]62    code = '<anchor>'
[46]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):
[47]69    code = '<tag>'
[46]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):
[47]76    code = '<scalar>'
[46]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.