2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 /* The following code was generated by JFlex 1.4.1 on 9/1/07 12:05 PM */
19 /* It's an automatically generated code. Do not modify it. */
20 package com
.intellij
.lexer
;
22 import com
.intellij
.psi
.tree
.IElementType
;
23 import com
.intellij
.psi
.xml
.XmlElementType
;
24 import com
.intellij
.psi
.xml
.XmlTokenType
;
28 * This class is a scanner generated by
29 * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
30 * on 9/1/07 12:05 PM from the specification file
31 * <tt>C:/work/Irida/tools/lexer/_XmlLexer.flex</tt>
33 public class __XmlLexer
implements FlexLexer
{
34 /** initial size of the lookahead buffer */
35 private static final int ZZ_BUFFERSIZE
= 16384;
38 public static final int PROCESSING_INSTRUCTION
= 2;
39 public static final int ATTR_LIST
= 6;
40 public static final int END_TAG
= 4;
41 public static final int ATTR_VALUE_DQ
= 9;
42 public static final int DTD_MARKUP
= 8;
43 public static final int CDATA
= 12;
44 public static final int ATTR
= 7;
45 public static final int TAG
= 1;
46 public static final int PI_ANY
= 3;
47 public static final int ATTR_VALUE_START
= 8;
48 public static final int YYINITIAL
= 0;
49 public static final int COMMENT
= 5;
50 public static final int DOCTYPE
= 11;
51 public static final int ATTR_VALUE_SQ
= 10;
54 * Translates characters to character classes
56 private static final String ZZ_CMAP_PACKED
=
57 "\11\0\2\3\1\0\2\3\22\0\1\3\1\13\1\55\1\6\1\4"+
58 "\1\63\1\23\1\56\5\0\1\10\1\7\1\61\12\2\1\11\1\26"+
59 "\1\12\1\62\1\22\1\57\1\0\1\17\1\52\1\15\1\16\1\46"+
60 "\1\42\2\1\1\54\2\1\1\53\1\50\1\1\1\43\1\45\2\1"+
61 "\1\47\1\20\1\51\3\1\1\44\1\1\1\14\1\64\1\21\1\0"+
62 "\1\1\1\0\1\30\1\37\4\42\1\27\4\1\1\24\1\40\1\36"+
63 "\1\32\1\31\1\34\1\1\1\33\1\25\1\35\2\1\1\41\2\1"+
64 "\1\5\1\0\1\60\54\0\1\1\12\0\1\1\4\0\1\1\5\0"+
65 "\27\1\1\0\37\1\1\0\u013f\1\31\0\162\1\4\0\14\1\16\0"+
66 "\5\1\11\0\1\1\213\0\1\1\13\0\1\1\1\0\3\1\1\0"+
67 "\1\1\1\0\24\1\1\0\54\1\1\0\46\1\1\0\5\1\4\0"+
68 "\202\1\10\0\105\1\1\0\46\1\2\0\2\1\6\0\20\1\41\0"+
69 "\46\1\2\0\1\1\7\0\47\1\110\0\33\1\5\0\3\1\56\0"+
70 "\32\1\5\0\13\1\43\0\2\1\1\0\143\1\1\0\1\1\17\0"+
71 "\2\1\7\0\2\1\12\0\3\1\2\0\1\1\20\0\1\1\1\0"+
72 "\36\1\35\0\3\1\60\0\46\1\13\0\1\1\u0152\0\66\1\3\0"+
73 "\1\1\22\0\1\1\7\0\12\1\43\0\10\1\2\0\2\1\2\0"+
74 "\26\1\1\0\7\1\1\0\1\1\3\0\4\1\3\0\1\1\36\0"+
75 "\2\1\1\0\3\1\16\0\2\1\23\0\6\1\4\0\2\1\2\0"+
76 "\26\1\1\0\7\1\1\0\2\1\1\0\2\1\1\0\2\1\37\0"+
77 "\4\1\1\0\1\1\23\0\3\1\20\0\11\1\1\0\3\1\1\0"+
78 "\26\1\1\0\7\1\1\0\2\1\1\0\5\1\3\0\1\1\22\0"+
79 "\1\1\17\0\2\1\43\0\10\1\2\0\2\1\2\0\26\1\1\0"+
80 "\7\1\1\0\2\1\1\0\5\1\3\0\1\1\36\0\2\1\1\0"+
81 "\3\1\17\0\1\1\21\0\1\1\1\0\6\1\3\0\3\1\1\0"+
82 "\4\1\3\0\2\1\1\0\1\1\1\0\2\1\3\0\2\1\3\0"+
83 "\3\1\3\0\10\1\1\0\3\1\113\0\10\1\1\0\3\1\1\0"+
84 "\27\1\1\0\12\1\1\0\5\1\46\0\2\1\43\0\10\1\1\0"+
85 "\3\1\1\0\27\1\1\0\12\1\1\0\5\1\3\0\1\1\40\0"+
86 "\1\1\1\0\2\1\43\0\10\1\1\0\3\1\1\0\27\1\1\0"+
87 "\20\1\46\0\2\1\43\0\22\1\3\0\30\1\1\0\11\1\1\0"+
88 "\1\1\2\0\7\1\72\0\60\1\1\0\2\1\14\0\7\1\72\0"+
89 "\2\1\1\0\1\1\2\0\2\1\1\0\1\1\2\0\1\1\6\0"+
90 "\4\1\1\0\7\1\1\0\3\1\1\0\1\1\1\0\1\1\2\0"+
91 "\2\1\1\0\4\1\1\0\2\1\11\0\1\1\2\0\5\1\1\0"+
92 "\1\1\25\0\2\1\42\0\1\1\77\0\10\1\1\0\42\1\35\0"+
93 "\4\1\164\0\42\1\1\0\5\1\1\0\2\1\45\0\6\1\112\0"+
94 "\46\1\12\0\51\1\7\0\132\1\5\0\104\1\5\0\122\1\6\0"+
95 "\7\1\1\0\77\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0"+
96 "\1\1\1\0\4\1\2\0\47\1\1\0\1\1\1\0\4\1\2\0"+
97 "\37\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0\1\1\1\0"+
98 "\4\1\2\0\7\1\1\0\7\1\1\0\27\1\1\0\37\1\1\0"+
99 "\1\1\1\0\4\1\2\0\7\1\1\0\47\1\1\0\23\1\105\0"+
100 "\125\1\14\0\u026c\1\2\0\10\1\12\0\32\1\5\0\113\1\25\0"+
101 "\15\1\1\0\4\1\16\0\22\1\16\0\22\1\16\0\15\1\1\0"+
102 "\3\1\17\0\64\1\43\0\1\1\4\0\1\1\103\0\130\1\10\0"+
103 "\51\1\127\0\35\1\63\0\36\1\2\0\5\1\u038b\0\154\1\224\0"+
104 "\234\1\4\0\132\1\6\0\26\1\2\0\6\1\2\0\46\1\2\0"+
105 "\6\1\2\0\10\1\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+
106 "\37\1\2\0\65\1\1\0\7\1\1\0\1\1\3\0\3\1\1\0"+
107 "\7\1\3\0\4\1\2\0\6\1\4\0\15\1\5\0\3\1\1\0"+
108 "\7\1\164\0\1\1\15\0\1\1\202\0\1\1\4\0\1\1\2\0"+
109 "\12\1\1\0\1\1\3\0\5\1\6\0\1\1\1\0\1\1\1\0"+
110 "\1\1\1\0\4\1\1\0\3\1\1\0\7\1\3\0\3\1\5\0"+
111 "\5\1\u0ebb\0\2\1\52\0\5\1\5\0\2\1\4\0\126\1\6\0"+
112 "\3\1\1\0\132\1\1\0\4\1\5\0\50\1\4\0\136\1\21\0"+
113 "\30\1\70\0\20\1\u0200\0\u19b6\1\112\0\u51a6\1\132\0\u048d\1\u0773\0"+
114 "\u2ba4\1\u215c\0\u012e\1\2\0\73\1\225\0\7\1\14\0\5\1\5\0"+
115 "\1\1\1\0\12\1\1\0\15\1\1\0\5\1\1\0\1\1\1\0"+
116 "\2\1\1\0\2\1\1\0\154\1\41\0\u016b\1\22\0\100\1\2\0"+
117 "\66\1\50\0\14\1\164\0\5\1\1\0\207\1\44\0\32\1\6\0"+
118 "\32\1\13\0\131\1\3\0\6\1\2\0\6\1\2\0\6\1\2\0"+
122 * Translates characters to character classes
124 private static final char [] ZZ_CMAP
= zzUnpackCMap(ZZ_CMAP_PACKED
);
127 * Translates DFA states to action switch labels.
129 private static final int [] ZZ_ACTION
= zzUnpackAction();
131 private static final String ZZ_ACTION_PACKED_0
=
132 "\1\1\4\0\1\2\7\0\1\1\1\3\1\1\1\4"+
133 "\1\5\1\1\1\5\1\6\1\7\1\5\1\10\1\5"+
134 "\2\11\1\5\4\12\1\13\1\2\1\14\1\15\3\16"+
135 "\1\17\1\20\1\21\3\22\1\14\1\23\3\22\1\5"+
136 "\1\24\2\13\2\5\2\1\2\0\1\25\1\26\6\0"+
137 "\1\6\1\0\1\27\2\11\1\30\1\13\2\0\1\15"+
138 "\5\0\1\31\1\0\2\13\3\0\1\32\4\0\1\33"+
139 "\7\0\1\34\1\35\1\36\1\37\2\13\1\40\1\41"+
140 "\2\0\1\42\2\0\2\13\2\0\2\13\2\0\1\43"+
141 "\1\44\4\0\1\45\1\46";
143 private static int [] zzUnpackAction() {
144 int [] result
= new int[132];
146 offset
= zzUnpackAction(ZZ_ACTION_PACKED_0
, offset
, result
);
150 private static int zzUnpackAction(String packed
, int offset
, int [] result
) {
151 int i
= 0; /* index in packed string */
152 int j
= offset
; /* index in unpacked array */
153 int l
= packed
.length();
155 int count
= packed
.charAt(i
++);
156 int value
= packed
.charAt(i
++);
157 do result
[j
++] = value
; while (--count
> 0);
164 * Translates a state to a row index in the transition table
166 private static final int [] ZZ_ROWMAP
= zzUnpackRowMap();
168 private static final String ZZ_ROWMAP_PACKED_0
=
169 "\0\0\0\65\0\152\0\237\0\324\0\u0109\0\u013e\0\u0173"+
170 "\0\u01a8\0\u01dd\0\u0212\0\u0247\0\u027c\0\u02b1\0\u02e6\0\u031b"+
171 "\0\u0350\0\u0385\0\u03ba\0\u03ef\0\u0424\0\u0459\0\u048e\0\u03ef"+
172 "\0\u04c3\0\u04f8\0\u052d\0\u0562\0\u03ef\0\u048e\0\u0385\0\u0562"+
173 "\0\u0597\0\u05cc\0\u0601\0\u0636\0\u03ef\0\u048e\0\u0385\0\u03ef"+
174 "\0\u03ef\0\u03ef\0\u03ef\0\u066b\0\u048e\0\u0385\0\u03ef\0\u06a0"+
175 "\0\u06d5\0\u070a\0\u073f\0\u03ef\0\u0774\0\u07a9\0\u07de\0\u0813"+
176 "\0\u03ef\0\u0848\0\u087d\0\u08b2\0\u03ef\0\u03ef\0\u08e7\0\u091c"+
177 "\0\u0951\0\u0986\0\u09bb\0\u09f0\0\u0a25\0\u0a5a\0\u03ef\0\u0a8f"+
178 "\0\u0ac4\0\u03ef\0\u0af9\0\u0b2e\0\u0b63\0\u0b98\0\u0bcd\0\u0c02"+
179 "\0\u0c37\0\u0c6c\0\u073f\0\u03ef\0\u0ca1\0\u0cd6\0\u0d0b\0\u07de"+
180 "\0\u0813\0\u0d40\0\u03ef\0\u0d75\0\u0daa\0\u0ddf\0\u0e14\0\u03ef"+
181 "\0\u0e49\0\u0e7e\0\u0eb3\0\u0ee8\0\u0f1d\0\u0f52\0\u0f87\0\u04f8"+
182 "\0\u03ef\0\u03ef\0\u03ef\0\u0fbc\0\u0ff1\0\u03ef\0\u03ef\0\u1026"+
183 "\0\u105b\0\u03ef\0\u1090\0\u10c5\0\u10fa\0\u112f\0\u1164\0\u1199"+
184 "\0\u11ce\0\u1203\0\u1238\0\u126d\0\u0597\0\u0597\0\u12a2\0\u12d7"+
185 "\0\u130c\0\u1341\0\u03ef\0\u03ef";
187 private static int [] zzUnpackRowMap() {
188 int [] result
= new int[132];
190 offset
= zzUnpackRowMap(ZZ_ROWMAP_PACKED_0
, offset
, result
);
194 private static int zzUnpackRowMap(String packed
, int offset
, int [] result
) {
195 int i
= 0; /* index in packed string */
196 int j
= offset
; /* index in unpacked array */
197 int l
= packed
.length();
199 int high
= packed
.charAt(i
++) << 16;
200 result
[j
++] = high
| packed
.charAt(i
++);
206 * The transition table of the DFA
208 private static final int [] ZZ_TRANS
= zzUnpackTrans();
210 private static final String ZZ_TRANS_PACKED_0
=
211 "\3\16\1\17\1\20\1\16\1\20\3\16\1\21\10\16"+
212 "\1\22\40\16\1\23\1\24\1\25\1\24\1\26\6\24"+
213 "\1\27\2\24\4\25\1\24\1\30\1\22\2\25\1\24"+
214 "\26\25\4\24\1\31\4\24\1\32\10\24\1\27\2\24"+
215 "\4\32\2\24\1\22\2\32\1\24\12\32\1\33\13\32"+
216 "\2\24\1\34\5\24\3\35\1\26\6\35\1\36\10\35"+
217 "\1\37\33\35\1\40\5\35\1\24\1\41\1\24\1\26"+
218 "\6\24\1\27\2\24\4\41\1\24\1\30\1\22\2\41"+
219 "\1\24\26\41\10\24\10\42\1\43\54\42\1\24\1\44"+
220 "\1\24\1\26\6\24\1\27\2\24\4\44\2\24\1\22"+
221 "\2\44\1\24\26\44\10\24\3\45\1\26\6\45\1\46"+
222 "\10\45\1\47\31\45\1\50\1\51\3\45\1\52\2\45"+
223 "\12\24\1\27\10\24\1\22\41\24\4\53\1\54\1\53"+
224 "\1\54\3\53\1\55\10\53\1\56\31\53\1\57\5\53"+
225 "\1\60\5\53\1\61\1\53\1\61\3\53\1\55\10\53"+
226 "\1\56\32\53\1\57\4\53\1\62\1\53\1\24\1\41"+
227 "\1\24\1\26\6\24\1\27\1\24\1\63\4\41\1\24"+
228 "\1\64\1\22\2\41\1\24\16\41\1\65\1\41\1\66"+
229 "\5\41\1\67\1\70\6\24\21\71\1\72\43\71\3\16"+
230 "\2\0\1\16\1\0\3\16\1\0\10\16\1\0\40\16"+
231 "\1\23\3\0\1\17\66\0\1\73\72\0\1\74\43\0"+
232 "\1\75\1\0\1\76\4\0\1\77\4\0\1\100\6\0"+
233 "\4\77\3\0\1\101\1\77\1\0\1\101\1\102\3\77"+
234 "\1\103\1\77\1\104\16\77\10\0\3\16\1\0\6\16"+
235 "\1\0\10\16\1\0\40\16\1\23\66\0\2\25\4\0"+
236 "\2\25\1\105\3\0\4\25\3\0\2\25\1\0\26\25"+
237 "\13\0\1\26\74\0\1\106\73\0\1\107\43\0\2\32"+
238 "\4\0\2\32\1\110\3\0\4\32\3\0\2\32\1\0"+
239 "\26\32\11\0\2\32\4\0\2\32\1\110\3\0\4\32"+
240 "\3\0\2\32\1\0\11\32\1\111\14\32\32\0\1\112"+
241 "\43\0\2\41\4\0\2\41\1\113\3\0\4\41\3\0"+
242 "\2\41\1\0\26\41\10\0\10\42\1\114\64\42\1\115"+
243 "\54\42\1\0\2\44\4\0\2\44\1\116\3\0\4\44"+
244 "\3\0\2\44\1\0\26\44\15\0\1\117\141\0\1\120"+
245 "\7\0\1\121\141\0\1\122\2\0\21\123\1\124\33\123"+
246 "\1\125\7\123\1\0\2\41\4\0\2\41\1\113\3\0"+
247 "\4\41\3\0\2\41\1\0\22\41\1\126\3\41\11\0"+
248 "\2\41\4\0\2\41\1\113\3\0\4\41\3\0\2\41"+
249 "\1\0\15\41\1\127\10\41\10\0\55\130\1\53\7\130"+
250 "\56\131\1\53\6\131\21\0\1\132\43\0\12\73\1\0"+
251 "\45\73\1\133\4\73\10\0\1\134\3\0\1\135\1\0"+
252 "\1\136\47\0\2\77\4\0\2\77\1\137\3\0\4\77"+
253 "\3\0\2\77\1\140\26\77\12\0\1\141\36\0\1\142"+
254 "\24\0\2\77\4\0\2\77\1\137\3\0\4\77\3\0"+
255 "\1\77\1\143\1\140\26\77\11\0\2\77\4\0\2\77"+
256 "\1\137\3\0\4\77\3\0\2\77\1\140\2\77\1\144"+
257 "\6\77\1\145\14\77\11\0\2\77\4\0\2\77\1\137"+
258 "\3\0\4\77\3\0\2\77\1\140\6\77\1\146\17\77"+
259 "\11\0\2\77\4\0\2\77\1\137\3\0\4\77\3\0"+
260 "\2\77\1\140\10\77\1\147\15\77\11\0\2\105\4\0"+
261 "\2\105\4\0\4\105\3\0\2\105\1\0\26\105\20\0"+
262 "\1\134\3\0\1\135\51\0\2\110\4\0\2\110\4\0"+
263 "\4\110\3\0\2\110\1\0\26\110\11\0\2\32\4\0"+
264 "\2\32\1\110\3\0\4\32\3\0\1\150\1\32\1\0"+
265 "\26\32\11\0\2\113\4\0\2\113\4\0\4\113\3\0"+
266 "\2\113\1\0\26\113\10\0\10\42\1\0\54\42\22\0"+
267 "\1\151\43\0\2\116\4\0\2\116\4\0\4\116\3\0"+
268 "\2\116\1\0\26\116\10\0\55\117\1\0\2\117\1\152"+
269 "\4\117\55\120\1\0\5\120\1\153\1\120\56\121\1\0"+
270 "\1\121\1\152\4\121\56\122\1\0\4\122\1\153\1\122"+
271 "\55\125\1\123\7\125\1\0\2\41\4\0\2\41\1\113"+
272 "\3\0\4\41\3\0\2\41\1\0\23\41\1\154\2\41"+
273 "\11\0\2\41\4\0\2\41\1\113\3\0\4\41\3\0"+
274 "\2\41\1\0\20\41\1\155\5\41\32\0\1\156\52\0"+
275 "\1\157\71\0\1\160\112\0\1\161\22\0\2\137\4\0"+
276 "\2\137\4\0\4\137\3\0\2\137\1\140\26\137\12\0"+
277 "\1\141\23\0\1\162\40\0\1\163\12\0\3\163\10\0"+
278 "\1\163\6\0\1\163\2\0\1\163\3\0\1\163\3\0"+
279 "\1\163\13\0\2\77\4\0\2\77\1\137\3\0\4\77"+
280 "\3\0\2\77\1\162\26\77\11\0\2\77\4\0\2\77"+
281 "\1\137\3\0\4\77\3\0\2\77\1\140\3\77\1\164"+
282 "\22\77\11\0\2\77\4\0\2\77\1\137\3\0\4\77"+
283 "\3\0\2\77\1\140\2\77\1\143\23\77\11\0\2\77"+
284 "\4\0\2\77\1\137\3\0\4\77\3\0\2\77\1\140"+
285 "\3\77\1\101\22\77\11\0\2\77\4\0\2\77\1\137"+
286 "\3\0\4\77\3\0\2\77\1\140\4\77\1\145\21\77"+
287 "\11\0\2\41\4\0\2\41\1\113\3\0\4\41\3\0"+
288 "\2\41\1\0\24\41\1\165\1\41\11\0\2\41\4\0"+
289 "\2\41\1\113\3\0\3\41\1\166\3\0\2\41\1\0"+
290 "\26\41\26\0\1\167\63\0\1\170\51\0\1\163\12\0"+
291 "\3\163\6\0\1\162\1\0\1\163\6\0\1\163\2\0"+
292 "\1\163\3\0\1\163\3\0\1\163\13\0\2\77\4\0"+
293 "\2\77\1\137\3\0\4\77\3\0\2\77\1\140\4\77"+
294 "\1\143\21\77\11\0\2\41\4\0\2\41\1\113\3\0"+
295 "\4\41\3\0\2\41\1\0\25\41\1\171\11\0\2\41"+
296 "\4\0\2\41\1\113\3\0\4\41\3\0\2\41\1\0"+
297 "\17\41\1\172\6\41\27\0\1\173\65\0\1\174\45\0"+
298 "\2\41\4\0\2\41\1\113\3\0\1\175\3\41\3\0"+
299 "\2\41\1\0\26\41\11\0\2\41\4\0\2\41\1\113"+
300 "\3\0\4\41\3\0\2\41\1\0\21\41\1\176\4\41"+
301 "\30\0\1\177\110\0\1\200\37\0\1\201\112\0\1\202"+
302 "\33\0\1\203\116\0\1\204\16\0";
304 private static int [] zzUnpackTrans() {
305 int [] result
= new int[4982];
307 offset
= zzUnpackTrans(ZZ_TRANS_PACKED_0
, offset
, result
);
311 private static int zzUnpackTrans(String packed
, int offset
, int [] result
) {
312 int i
= 0; /* index in packed string */
313 int j
= offset
; /* index in unpacked array */
314 int l
= packed
.length();
316 int count
= packed
.charAt(i
++);
317 int value
= packed
.charAt(i
++);
319 do result
[j
++] = value
; while (--count
> 0);
326 private static final int ZZ_UNKNOWN_ERROR
= 0;
327 private static final int ZZ_NO_MATCH
= 1;
328 private static final int ZZ_PUSHBACK_2BIG
= 2;
329 private static final char[] EMPTY_BUFFER
= new char[0];
330 private static final int YYEOF
= -1;
331 private static java
.io
.Reader zzReader
= null; // Fake
333 /* error messages for the codes above */
334 private static final String ZZ_ERROR_MSG
[] = {
335 "Unkown internal scanner error",
336 "Error: could not match input",
337 "Error: pushback value was too large"
341 * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
343 private static final int [] ZZ_ATTRIBUTE
= zzUnpackAttribute();
345 private static final String ZZ_ATTRIBUTE_PACKED_0
=
346 "\1\1\4\0\1\1\7\0\6\1\1\11\3\1\1\11"+
347 "\4\1\1\11\7\1\1\11\2\1\4\11\3\1\1\11"+
348 "\4\1\1\11\4\1\1\11\1\1\2\0\2\11\6\0"+
349 "\1\1\1\0\1\11\2\1\1\11\1\1\2\0\1\1"+
350 "\5\0\1\11\1\0\2\1\3\0\1\11\4\0\1\11"+
351 "\7\0\1\1\3\11\2\1\2\11\2\0\1\11\2\0"+
352 "\2\1\2\0\2\1\2\0\2\1\4\0\2\11";
354 private static int [] zzUnpackAttribute() {
355 int [] result
= new int[132];
357 offset
= zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0
, offset
, result
);
361 private static int zzUnpackAttribute(String packed
, int offset
, int [] result
) {
362 int i
= 0; /* index in packed string */
363 int j
= offset
; /* index in unpacked array */
364 int l
= packed
.length();
366 int count
= packed
.charAt(i
++);
367 int value
= packed
.charAt(i
++);
368 do result
[j
++] = value
; while (--count
> 0);
373 /** the current state of the DFA */
376 /** the current lexical state */
377 private int zzLexicalState
= YYINITIAL
;
379 /** this buffer contains the current text to be matched and is
380 the source of the yytext() string */
381 private CharSequence zzBuffer
= "";
383 /** this buffer may contains the current text array to be matched when it is cheap to acquire it */
384 private char[] zzBufferArray
;
386 /** the textposition at the last accepting state */
387 private int zzMarkedPos
;
389 /** the textposition at the last state to be included in yytext */
390 private int zzPushbackPos
;
392 /** the current text position in the buffer */
393 private int zzCurrentPos
;
395 /** startRead marks the beginning of the yytext() string in the buffer */
396 private int zzStartRead
;
398 /** endRead marks the last character in the buffer, that has been read
400 private int zzEndRead
;
403 * zzAtBOL == true <=> the scanner is currently at the beginning of a line
405 private boolean zzAtBOL
= true;
407 /** zzAtEOF == true <=> the scanner is at the EOF */
408 private boolean zzAtEOF
;
410 /** denotes if the user-EOF-code has already been executed */
411 private boolean zzEOFDone
;
414 protected IElementType elTokenType
= XmlTokenType
.XML_DATA_CHARACTERS
;
415 protected IElementType elTokenType2
= XmlTokenType
.XML_ATTRIBUTE_VALUE_TOKEN
;
416 protected IElementType javaEmbeddedTokenType
= XmlTokenType
.XML_ATTRIBUTE_VALUE_TOKEN
;
418 private int myPrevState
= YYINITIAL
;
420 public int yyprevstate() {
424 private int popState(){
425 final int prev
= myPrevState
;
426 myPrevState
= YYINITIAL
;
430 protected void pushState(int state
){
435 public __XmlLexer(java
.io
.Reader in
) {
440 * Creates a new scanner.
441 * There is also java.io.Reader version of this constructor.
443 * @param in the java.io.Inputstream to read input from.
445 public __XmlLexer(java
.io
.InputStream in
) {
446 this(new java
.io
.InputStreamReader(in
));
450 * Unpacks the compressed character translation table.
452 * @param packed the packed character translation table
453 * @return the unpacked character translation table
455 private static char [] zzUnpackCMap(String packed
) {
456 char [] map
= new char[0x10000];
457 int i
= 0; /* index in packed string */
458 int j
= 0; /* index in unpacked array */
460 int count
= packed
.charAt(i
++);
461 char value
= packed
.charAt(i
++);
462 do map
[j
++] = value
; while (--count
> 0);
467 public final int getTokenStart(){
471 public final int getTokenEnd(){
472 return getTokenStart() + yylength();
475 public void reset(CharSequence buffer
, int start
, int end
,int initialState
){
477 zzBufferArray
= com
.intellij
.util
.text
.CharArrayUtil
.fromSequenceWithoutCopying(buffer
);
478 zzCurrentPos
= zzMarkedPos
= zzStartRead
= start
;
483 yybegin(initialState
);
486 // For Demetra compatibility
487 public void reset(CharSequence buffer
, int initialState
){
488 reset(buffer
, 0, buffer
.length(), initialState
);
492 * Refills the input buffer.
494 * @return <code>false</code>, iff there was new input.
496 * @exception java.io.IOException if any I/O-Error occurs
498 private boolean zzRefill() throws java
.io
.IOException
{
504 * Returns the current lexical state.
506 public final int yystate() {
507 return zzLexicalState
;
512 * Enters a new lexical state
514 * @param newState the new lexical state
516 public final void yybegin(int newState
) {
517 zzLexicalState
= newState
;
522 * Returns the text matched by the current regular expression.
524 public final CharSequence
yytext() {
525 return zzBuffer
.subSequence(zzStartRead
, zzMarkedPos
);
530 * Returns the character at position <tt>pos</tt> from the
533 * It is equivalent to yytext().charAt(pos), but faster
535 * @param pos the position of the character to fetch.
536 * A value from 0 to yylength()-1.
538 * @return the character at position pos
540 public final char yycharat(int pos
) {
541 return zzBufferArray
!= null ? zzBufferArray
[zzStartRead
+pos
]:zzBuffer
.charAt(zzStartRead
+pos
);
546 * Returns the length of the matched text region.
548 public final int yylength() {
549 return zzMarkedPos
-zzStartRead
;
554 * Reports an error that occured while scanning.
556 * In a wellformed scanner (no or only correct usage of
557 * yypushback(int) and a match-all fallback rule) this method
558 * will only be called with things that "Can't Possibly Happen".
559 * If this method is called, something is seriously wrong
560 * (e.g. a JFlex bug producing a faulty scanner etc.).
562 * Usual syntax/scanner level error handling should be done
563 * in error fallback rules.
565 * @param errorCode the code of the errormessage to display
567 private void zzScanError(int errorCode
) {
570 message
= ZZ_ERROR_MSG
[errorCode
];
572 catch (ArrayIndexOutOfBoundsException e
) {
573 message
= ZZ_ERROR_MSG
[ZZ_UNKNOWN_ERROR
];
576 throw new Error(message
);
581 * Pushes the specified amount of characters back into the input stream.
583 * They will be read again by then next call of the scanning method
585 * @param number the number of characters to be read again.
586 * This number must not be greater than yylength()!
588 public void yypushback(int number
) {
589 if ( number
> yylength() )
590 zzScanError(ZZ_PUSHBACK_2BIG
);
592 zzMarkedPos
-= number
;
597 * Contains user EOF-code, which will be executed exactly once,
598 * when the end of file is reached
600 private void zzDoEOF() {
609 * Resumes scanning until the next regular expression is matched,
610 * the end of input is encountered or an I/O-Error occurs.
612 * @return the next token
613 * @exception java.io.IOException if any I/O-Error occurs
615 public IElementType
advance() throws java
.io
.IOException
{
622 int zzEndReadL
= zzEndRead
;
623 CharSequence zzBufferL
= zzBuffer
;
624 char[] zzBufferArrayL
= zzBufferArray
;
625 char [] zzCMapL
= ZZ_CMAP
;
627 int [] zzTransL
= ZZ_TRANS
;
628 int [] zzRowMapL
= ZZ_ROWMAP
;
629 int [] zzAttrL
= ZZ_ATTRIBUTE
;
632 zzMarkedPosL
= zzMarkedPos
;
636 zzCurrentPosL
= zzCurrentPos
= zzStartRead
= zzMarkedPosL
;
638 zzState
= zzLexicalState
;
644 if (zzCurrentPosL
< zzEndReadL
)
645 zzInput
= zzBufferArrayL
!= null ? zzBufferArrayL
[zzCurrentPosL
++]:zzBufferL
.charAt(zzCurrentPosL
++);
651 // store back cached positions
652 zzCurrentPos
= zzCurrentPosL
;
653 zzMarkedPos
= zzMarkedPosL
;
654 boolean eof
= zzRefill();
655 // get translated positions and possibly new buffer
656 zzCurrentPosL
= zzCurrentPos
;
657 zzMarkedPosL
= zzMarkedPos
;
658 zzBufferL
= zzBuffer
;
659 zzEndReadL
= zzEndRead
;
665 zzInput
= zzBufferArrayL
!= null ? zzBufferArrayL
[zzCurrentPosL
++]:zzBufferL
.charAt(zzCurrentPosL
++);
668 int zzNext
= zzTransL
[ zzRowMapL
[zzState
] + zzCMapL
[zzInput
] ];
669 if (zzNext
== -1) break zzForAction
;
672 int zzAttributes
= zzAttrL
[zzState
];
673 if ( (zzAttributes
& 1) == 1 ) {
675 zzMarkedPosL
= zzCurrentPosL
;
676 if ( (zzAttributes
& 8) == 8 ) break zzForAction
;
682 // store back cached position
683 zzMarkedPos
= zzMarkedPosL
;
685 switch (zzAction
< 0 ? zzAction
: ZZ_ACTION
[zzAction
]) {
687 { yybegin(ATTR_LIST
); return XmlTokenType
.XML_ATTRIBUTE_VALUE_END_DELIMITER
;
691 { return XmlTokenType
.XML_ATTRIBUTE_VALUE_TOKEN
;
695 { return XmlTokenType
.XML_DOCTYPE_SYSTEM
;
699 { return XmlTokenType
.XML_EQ
;
703 { return XmlTokenType
.XML_TAG_CHARACTERS
;
707 { yybegin(CDATA
); return XmlTokenType
.XML_CDATA_START
;
711 { yybegin(ATTR_LIST
); pushState(TAG
); return XmlTokenType
.XML_NAME
;
715 { yybegin(END_TAG
); return XmlTokenType
.XML_END_TAG_START
;
719 { return elTokenType
;
723 { return XmlTokenType
.XML_NAME
;
727 { return XmlTokenType
.XML_DOCTYPE_PUBLIC
;
731 { yybegin(COMMENT
); return XmlTokenType
.XML_COMMENT_START
;
735 { return javaEmbeddedTokenType
;
739 { return XmlElementType
.XML_MARKUP
;
743 { yybegin(ATTR_LIST
); pushState(PROCESSING_INSTRUCTION
); return XmlTokenType
.XML_NAME
;
747 { return XmlTokenType
.XML_REAL_WHITE_SPACE
;
751 { return XmlTokenType
.XML_DATA_CHARACTERS
;
755 { return XmlTokenType
.XML_BAD_CHARACTER
;
759 { yybegin(YYINITIAL
); return XmlTokenType
.XML_TAG_END
;
763 { if(yystate() == YYINITIAL
){
764 return XmlTokenType
.XML_BAD_CHARACTER
;
766 else yybegin(popState()); yypushback(yylength());
770 { yybegin(YYINITIAL
); return XmlTokenType
.XML_COMMENT_END
;
774 { yybegin(TAG
); return XmlTokenType
.XML_START_TAG_START
;
778 { yybegin(YYINITIAL
); return XmlTokenType
.XML_EMPTY_ELEMENT_END
;
782 { yybegin(PROCESSING_INSTRUCTION
); return XmlTokenType
.XML_PI_START
;
786 { yybegin(PI_ANY
); return XmlTokenType
.XML_NAME
;
790 { yybegin(ATTR
); return XmlTokenType
.XML_NAME
;
794 { yybegin(ATTR_LIST
); yypushback(yylength());
798 { yybegin(YYINITIAL
); return XmlTokenType
.XML_DOCTYPE_END
;
802 { return XmlTokenType
.XML_CHAR_ENTITY_REF
;
806 { return XmlTokenType
.XML_WHITE_SPACE
;
810 { return XmlTokenType
.XML_ENTITY_REF_TOKEN
;
814 { yybegin(ATTR_VALUE_DQ
); return XmlTokenType
.XML_ATTRIBUTE_VALUE_START_DELIMITER
;
818 { yybegin(ATTR_VALUE_SQ
); return XmlTokenType
.XML_ATTRIBUTE_VALUE_START_DELIMITER
;
822 { yybegin(YYINITIAL
); return XmlTokenType
.XML_CDATA_END
;
826 { return elTokenType2
;
830 { yybegin(YYINITIAL
); return XmlTokenType
.XML_PI_END
;
834 { yybegin(DOCTYPE
); return XmlTokenType
.XML_DOCTYPE_START
;
838 { return XmlTokenType
.XML_COMMENT_CHARACTERS
;
842 if (zzInput
== YYEOF
&& zzStartRead
== zzCurrentPos
) {
848 zzScanError(ZZ_NO_MATCH
);