-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTokens.cs
246 lines (204 loc) · 7.13 KB
/
Tokens.cs
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
namespace XpNet
{
/// <summary>
/// Tokens that might have been found
/// </summary>
public enum Tokens
{
/// <summary>
/// Represents one or more characters of data.
/// </summary>
DataChars,
/// <summary>
/// Represents a newline (CR, LF or CR followed by LF) in data.
/// </summary>
DataNewline,
/// <summary>
/// Represents a complete start-tag <code><name></code>,
/// that doesn't have any attribute specifications.
/// </summary>
StartTagNoAtts,
/// <summary>
/// Represents a complete start-tag <code><name
/// att = "val" & gt;</code>, that contains one or more
/// attribute specifications.
/// </summary>
StartTagWithAtts,
/// <summary>
/// Represents an empty element tag <code><name/></code>,
/// that doesn't have any attribute specifications.
/// </summary>
EmptyElementNoAtts,
/// <summary>
/// Represents an empty element tag <code><name
/// att = "val" / ></code>, that contains one or more
/// attribute specifications.
/// </summary>
EmptyElementWithAtts,
/// <summary>
/// Represents a complete end-tag <code></name></code>.
/// </summary>
EndTag,
/// <summary>
/// Represents the start of a CDATA section <code><![CDATA[</code>.
/// </summary>
CdataSectOpen,
/// <summary>
/// Represents the end of a CDATA section <code>]]></code>.
/// </summary>
CdataSectClose,
/// <summary>
/// Represents a general entity reference.
/// </summary>
EntityReference,
/// <summary>
/// Represents a general entity reference to a one of the 5
/// predefined entities <code>amp</code>, <code>lt</code>,
/// <code>gt</code>, <code>quot</code>, <code>apos</code>.
/// </summary>
MagicEntityReference,
/// <summary>
/// Represents a numeric character reference (decimal or
/// hexadecimal), when the referenced character is less
/// than or equal to 0xFFFF and so is represented by a
/// single char.
/// </summary>
CharReference,
/// <summary>
/// Represents a numeric character reference (decimal or
/// hexadecimal), when the referenced character is greater
/// than 0xFFFF and so is represented by a pair of chars.
/// </summary>
CharPairReference,
/// <summary>
/// Represents a processing instruction.
/// </summary>
ProcessingInstruction,
/// <summary>
/// Represents an XML declaration or text declaration (a processing instruction whose target is <code>xml</code>).
/// </summary>
XmlDeclaration,
/// <summary>
/// Represents a comment <code><!-- comment --></code>.
/// This can occur both in the prolog and in content.
/// </summary>
Comment,
/// <summary>
/// Represents a white space character in an attribute
/// value, excluding white space characters that are part
/// of line boundaries.
/// </summary>
AttributeValueS,
/// <summary>
/// Represents a parameter entity reference in the prolog.
/// </summary>
ParamEntityReference,
/// <summary>
/// Represents whitespace in the prolog. The token contains one or more whitespace characters.
/// </summary>
PrologS,
/// <summary>
/// Represents <code><!NAME</code> in the prolog.
/// </summary>
DeclOpen,
/// <summary>
/// Represents <code>></code> in the prolog.
/// </summary>
DeclClose,
/// <summary>
/// Represents a name in the prolog.
/// </summary>
Name,
/// <summary>
/// Represents a name token in the prolog that is not a name.
/// </summary>
Nmtoken,
/// <summary>
/// Represents <code>#NAME</code> in the prolog.
/// </summary>
PoundName,
/// <summary>
/// Represents <code>|</code> in the prolog.
/// </summary>
Or,
/// <summary>
/// Represents a <code>%</code> in the prolog that does not start
/// a parameter entity reference.
/// This can occur in an entity declaration.
/// </summary>
Percent,
/// <summary>
/// Represents a <code>(</code> in the prolog.
/// </summary>
OpenParen,
/// <summary>
/// Represents a <code>)</code> in the prolog that is not
/// followed immediately by any of
/// <code>*</code>, <code>+</code> or <code>?</code>.
/// </summary>
CloseParen,
/// <summary>
/// Represents <code>[</code> in the prolog.
/// </summary>
OpenBracket,
/// <summary>
/// Represents <code>]</code> in the prolog.
/// </summary>
CloseBracket,
/// <summary>
/// Represents a literal (EntityValue, AttValue, SystemLiteral or * PubidLiteral).
/// </summary>
Literal,
/// <summary>
/// Represents a name followed immediately by <code>?</code>.
/// </summary>
NameQuestion,
/// <summary>
/// Represents a name followed immediately by <code>*</code>.
/// </summary>
NameAsterisk,
/// <summary>
/// Represents a name followed immediately by <code>+</code>.
/// </summary>
NamePlus,
/// <summary>
/// Represents <code><![</code> in the prolog.
/// </summary>
CondSectOpen,
/// <summary>
/// Represents <code>]]></code> in the prolog.
/// </summary>
CondSectClose,
/// <summary>
/// Represents <code>)?</code> in the prolog.
/// </summary>
CloseParenQuestion,
/// <summary>
/// Represents <code>)*</code> in the prolog.
/// </summary>
CloseParenAsterisk,
/// <summary>
/// Represents <code>)+</code> in the prolog.
/// </summary>
CloseParenPlus,
/// <summary>
/// Represents <code>,</code> in the prolog.
/// </summary>
Comma,
/// <summary>
/// When we received a partial Xmp fragment and expect the rest of the Element with the next read.
/// </summary>
PartialToken,
/// <summary>
/// When received a partial char and expect the rest of the char in the next receive event.
/// </summary>
PartialChar,
/// <summary>
/// Indicates that the byte subarray being tokenized is a legal XML
/// token, but that subsequent bytes in the same entity could be part of
/// the token. For example, <code>Encoding.tokenizeProlog</code>
/// would return this if the byte subarray consists of a legal XML name.
/// </summary>
ExtensibleToken,
}
}