1
2
3 package DTDDoc;
4
5 import java.io.Reader;
6 import java.io.IOException;
7
8 import com.uwyn.jhighlight.highlighter.ExplicitStateHighlighter;
9
10
11 /**
12 * This class is a scanner generated by
13 * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
14 * on 25/12/06 20:51 from the specification file
15 * <tt>/home/herve/projet/workspace/DTDDoc/src/DTDDoc/DtdHighlighter.flex</tt>
16 */
17 public class DtdHighlighter implements ExplicitStateHighlighter {
18
19 /** This character denotes the end of file */
20 public static final int YYEOF = -1;
21
22 /** initial size of the lookahead buffer */
23 private static final int ZZ_BUFFERSIZE = 128;
24
25 /** lexical states */
26 public static final int IN_CDATA_SECTION = 7;
27 public static final int IN_PROCESSING_INSTRUCTION = 6;
28 public static final int TAG_START = 2;
29 public static final int YYINITIAL = 0;
30 public static final int IN_DOUBLE_QUOTE_STRING = 5;
31 public static final int IN_SINGLE_QUOTE_STRING = 4;
32 public static final int IN_COMMENT = 1;
33 public static final int IN_TAG = 3;
34
35 /**
36 * Translates characters to character classes
37 */
38 private static final String ZZ_CMAP_PACKED =
39 "\11\2\1\1\1\15\1\0\1\1\1\0\16\2\4\0\1\1\1\6"+
40 "\1\43\1\34\1\4\2\0\1\42\5\0\1\3\1\2\1\17\12\2"+
41 "\1\4\1\0\1\5\1\20\1\16\1\7\1\46\1\13\1\41\1\11"+
42 "\1\12\1\21\1\30\2\4\1\26\1\4\1\33\1\37\1\22\1\25"+
43 "\1\32\1\23\1\35\1\27\1\31\1\14\1\36\2\4\1\40\1\24"+
44 "\1\4\1\10\1\0\1\45\1\0\1\4\1\0\1\53\1\4\1\57"+
45 "\1\55\1\52\1\64\1\4\1\65\1\50\2\4\1\51\1\63\1\66"+
46 "\1\56\1\61\1\4\1\54\1\4\1\47\3\4\1\62\1\60\1\4"+
47 "\1\44\1\0\1\44\1\0\41\2\2\0\4\4\4\0\1\4\2\0"+
48 "\1\2\7\0\1\4\4\0\1\4\5\0\27\4\1\0\37\4\1\0"+
49 "\u013f\4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\2\4\4\4\0\10\2"+
94 "\1\0\44\2\11\0\1\2\71\0\42\4\1\0\5\4\1\0\2\4"+
95 "\1\0\7\2\3\0\4\2\6\0\12\2\6\0\6\4\4\2\106\0"+
96 "\46\4\12\0\51\4\7\0\132\4\5\0\104\4\5\0\122\4\6\0"+
97 "\7\4\1\0\77\4\1\0\1\4\1\0\4\4\2\0\7\4\1\0"+
98 "\1\4\1\0\4\4\2\0\47\4\1\0\1\4\1\0\4\4\2\0"+
99 "\37\4\1\0\1\4\1\0\4\4\2\0\7\4\1\0\1\4\1\0"+
100 "\4\4\2\0\7\4\1\0\7\4\1\0\27\4\1\0\37\4\1\0"+
101 "\1\4\1\0\4\4\2\0\7\4\1\0\47\4\1\0\23\4\16\0"+
102 "\11\2\56\0\125\4\14\0\u026c\4\2\0\10\4\12\0\32\4\5\0"+
103 "\113\4\3\0\3\4\17\0\15\4\1\0\4\4\3\2\13\0\22\4"+
104 "\3\2\13\0\22\4\2\2\14\0\15\4\1\0\3\4\1\0\2\2"+
105 "\14\0\64\4\40\2\3\0\1\4\3\0\2\4\1\2\2\0\12\2"+
106 "\41\0\3\2\2\0\12\2\6\0\130\4\10\0\51\4\1\2\126\0"+
107 "\35\4\3\0\14\2\4\0\14\2\12\0\12\2\36\4\2\0\5\4"+
108 "\u038b\0\154\4\224\0\234\4\4\0\132\4\6\0\26\4\2\0\6\4"+
109 "\2\0\46\4\2\0\6\4\2\0\10\4\1\0\1\4\1\0\1\4"+
110 "\1\0\1\4\1\0\37\4\2\0\65\4\1\0\7\4\1\0\1\4"+
111 "\3\0\3\4\1\0\7\4\3\0\4\4\2\0\6\4\4\0\15\4"+
112 "\5\0\3\4\1\0\7\4\17\0\4\2\32\0\5\2\20\0\2\4"+
113 "\23\0\1\4\13\0\4\2\6\0\6\2\1\0\1\4\15\0\1\4"+
114 "\40\0\22\4\36\0\15\2\4\0\1\2\3\0\6\2\27\0\1\4"+
115 "\4\0\1\4\2\0\12\4\1\0\1\4\3\0\5\4\6\0\1\4"+
116 "\1\0\1\4\1\0\1\4\1\0\4\4\1\0\3\4\1\0\7\4"+
117 "\3\0\3\4\5\0\5\4\26\0\44\4\u0e81\0\3\4\31\0\11\4"+
118 "\6\2\1\0\5\4\2\0\5\4\4\0\126\4\2\0\2\2\2\0"+
119 "\3\4\1\0\137\4\5\0\50\4\4\0\136\4\21\0\30\4\70\0"+
120 "\20\4\u0200\0\u19b6\4\112\0\u51a6\4\132\0\u048d\4\u0773\0\u2ba4\4\u215c\0"+
121 "\u012e\4\2\0\73\4\225\0\7\4\14\0\5\4\5\0\1\4\1\2"+
122 "\12\4\1\0\15\4\1\0\5\4\1\0\1\4\1\0\2\4\1\0"+
123 "\2\4\1\0\154\4\41\0\u016b\4\22\0\100\4\2\0\66\4\50\0"+
124 "\15\4\3\0\20\2\20\0\4\2\17\0\2\4\30\0\3\4\31\0"+
125 "\1\4\6\0\5\4\1\0\207\4\2\0\1\2\4\0\1\4\13\0"+
126 "\12\2\7\0\32\4\4\0\1\4\1\0\32\4\12\0\132\4\3\0"+
127 "\6\4\2\0\6\4\2\0\6\4\2\0\3\4\3\0\2\4\3\0"+
128 "\2\4\22\0\3\2\4\0";
129
130 /**
131 * Translates characters to character classes
132 */
133 private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
134
135 /**
136 * Translates DFA states to action switch labels.
137 */
138 private static final int [] ZZ_ACTION = zzUnpackAction();
139
140 private static final String ZZ_ACTION_PACKED_0 =
141 "\1\1\3\0\2\2\1\0\1\3\3\1\3\4\1\5"+
142 "\1\6\1\7\3\10\1\1\1\11\5\10\1\1\1\12"+
143 "\1\13\1\2\1\14\1\2\1\15\1\2\2\1\1\16"+
144 "\2\3\1\17\1\20\10\0\7\10\1\21\1\10\7\0"+
145 "\1\22\3\0\1\23\7\0\1\10\1\21\7\10\4\0"+
146 "\1\24\1\25\10\0\7\10\10\0\1\26\2\0\4\10"+
147 "\1\21\1\10\5\0\1\26\2\0\3\10\2\0\1\21"+
148 "\1\0\2\10\1\0\1\27";
149
150 private static int [] zzUnpackAction() {
151 int [] result = new int[144];
152 int offset = 0;
153 offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
154 return result;
155 }
156
157 private static int zzUnpackAction(String packed, int offset, int [] result) {
158 int i = 0;
159 int j = offset;
160 int l = packed.length();
161 while (i < l) {
162 int count = packed.charAt(i++);
163 int value = packed.charAt(i++);
164 do result[j++] = value; while (--count > 0);
165 }
166 return j;
167 }
168
169
170 /**
171 * Translates a state to a row index in the transition table
172 */
173 private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
174
175 private static final String ZZ_ROWMAP_PACKED_0 =
176 "\0\0\0\67\0\156\0\245\0\334\0\u0113\0\u014a\0\u0181"+
177 "\0\u01b8\0\u01ef\0\u0226\0\u01b8\0\u025d\0\u0294\0\u01b8\0\u02cb"+
178 "\0\u01b8\0\u0302\0\u0339\0\u0370\0\u03a7\0\u01b8\0\u03de\0\u0415"+
179 "\0\u044c\0\u0483\0\u04ba\0\u04f1\0\u01b8\0\u01b8\0\u0528\0\u01b8"+
180 "\0\u01b8\0\u01b8\0\u055f\0\u0596\0\u05cd\0\u01b8\0\u0604\0\u063b"+
181 "\0\u0672\0\u01b8\0\u06a9\0\u06e0\0\u0717\0\u074e\0\u0785\0\u07bc"+
182 "\0\u07f3\0\u082a\0\u0861\0\u0898\0\u08cf\0\u0906\0\u093d\0\u0974"+
183 "\0\u09ab\0\u09e2\0\u0a19\0\u0a50\0\u0a87\0\u0abe\0\u0af5\0\u0596"+
184 "\0\u05cd\0\u0b2c\0\u01b8\0\u0b63\0\u0b9a\0\u0bd1\0\u01b8\0\u0c08"+
185 "\0\u0c3f\0\u0c76\0\u0cad\0\u0ce4\0\u0d1b\0\u0d52\0\u0d89\0\u0302"+
186 "\0\u0dc0\0\u0df7\0\u0e2e\0\u0e65\0\u0e9c\0\u0ed3\0\u0f0a\0\u0f41"+
187 "\0\u0f78\0\u0faf\0\u0fe6\0\u01b8\0\u01b8\0\u101d\0\u1054\0\u108b"+
188 "\0\u10c2\0\u10f9\0\u1130\0\u1167\0\u119e\0\u11d5\0\u120c\0\u1243"+
189 "\0\u127a\0\u12b1\0\u12e8\0\u131f\0\u1356\0\u138d\0\u13c4\0\u13fb"+
190 "\0\u1432\0\u1469\0\u14a0\0\u14d7\0\u01b8\0\u150e\0\u1545\0\u157c"+
191 "\0\u15b3\0\u15ea\0\u1621\0\u1658\0\u168f\0\u16c6\0\u16fd\0\u1734"+
192 "\0\u176b\0\u17a2\0\u17d9\0\u1810\0\u1847\0\u187e\0\u18b5\0\u18ec"+
193 "\0\u1923\0\u195a\0\u01b8\0\u1991\0\u1658\0\u19c8\0\u19ff\0\u01b8";
194
195 private static int [] zzUnpackRowMap() {
196 int [] result = new int[144];
197 int offset = 0;
198 offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
199 return result;
200 }
201
202 private static int zzUnpackRowMap(String packed, int offset, int [] result) {
203 int i = 0;
204 int j = offset;
205 int l = packed.length();
206 while (i < l) {
207 int high = packed.charAt(i++) << 16;
208 result[j++] = high | packed.charAt(i++);
209 }
210 return j;
211 }
212
213 /**
214 * The transition table of the DFA
215 */
216 private static final int [] ZZ_TRANS = zzUnpackTrans();
217
218 private static final String ZZ_TRANS_PACKED_0 =
219 "\1\11\1\12\3\11\1\13\61\11\3\14\1\15\11\14"+
220 "\1\11\30\14\1\16\20\14\4\17\1\20\4\17\4\20"+
221 "\1\11\1\21\2\17\13\20\1\17\5\20\5\17\20\20"+
222 "\4\11\1\22\4\11\1\23\1\22\1\24\1\22\1\11"+
223 "\1\21\1\25\1\26\1\27\1\22\1\30\1\22\1\31"+
224 "\1\32\2\22\1\33\2\22\1\34\5\22\1\35\1\36"+
225 "\3\11\20\22\5\37\1\40\2\37\1\41\4\37\1\41"+
226 "\1\40\23\37\1\42\1\37\2\41\21\37\5\43\1\40"+
227 "\2\43\1\41\4\43\1\41\1\40\24\43\1\42\2\41"+
228 "\21\43\7\44\1\45\5\44\1\46\51\44\15\47\1\11"+
229 "\27\47\1\50\21\47\70\0\1\12\73\0\1\51\1\52"+
230 "\62\0\1\53\132\0\1\54\2\0\1\55\1\56\1\57"+
231 "\1\60\6\0\1\61\1\62\3\0\3\20\4\0\4\20"+
232 "\4\0\13\20\1\0\5\20\5\0\20\20\2\0\3\22"+
233 "\4\0\4\22\4\0\13\22\1\0\5\22\5\0\20\22"+
234 "\2\0\3\22\4\0\1\22\1\63\2\22\4\0\13\22"+
235 "\1\0\5\22\5\0\20\22\2\0\3\22\4\0\4\22"+
236 "\4\0\4\22\1\64\6\22\1\0\5\22\5\0\20\22"+
237 "\16\0\1\21\52\0\3\22\4\0\4\22\4\0\1\22"+
238 "\1\65\2\22\1\66\6\22\1\0\5\22\5\0\20\22"+
239 "\2\0\3\22\4\0\4\22\4\0\13\22\1\0\1\22"+
240 "\1\67\3\22\5\0\20\22\2\0\3\22\4\0\4\22"+
241 "\4\0\1\22\1\70\7\22\1\71\1\22\1\0\5\22"+
242 "\5\0\20\22\2\0\3\22\4\0\1\22\1\72\2\22"+
243 "\4\0\13\22\1\0\5\22\5\0\20\22\2\0\3\22"+
244 "\4\0\4\22\4\0\3\22\1\73\7\22\1\0\5\22"+
245 "\5\0\20\22\23\0\1\74\2\0\1\75\1\76\1\77"+
246 "\36\0\5\37\1\0\2\37\1\0\4\37\2\0\23\37"+
247 "\1\0\1\37\2\0\21\37\5\43\1\0\2\43\1\0"+
248 "\4\43\2\0\24\43\3\0\21\43\7\100\1\101\5\100"+
249 "\1\46\60\100\1\102\5\100\1\46\1\103\50\100\15\47"+
250 "\1\0\27\47\1\0\21\47\45\0\1\104\24\0\1\105"+
251 "\4\0\1\106\74\0\1\107\120\0\1\110\100\0\1\111"+
252 "\53\0\1\112\75\0\1\113\66\0\1\114\60\0\1\115"+
253 "\66\0\1\116\20\0\3\22\4\0\2\22\1\117\1\22"+
254 "\4\0\13\22\1\0\5\22\5\0\20\22\2\0\3\22"+
255 "\4\0\4\22\4\0\3\22\1\120\7\22\1\0\5\22"+
256 "\5\0\20\22\2\0\3\22\4\0\4\22\4\0\2\22"+
257 "\1\121\10\22\1\0\5\22\5\0\20\22\2\0\3\22"+
258 "\4\0\3\22\1\122\4\0\13\22\1\0\5\22\5\0"+
259 "\20\22\2\0\3\22\4\0\4\22\4\0\13\22\1\0"+
260 "\4\22\1\123\5\0\20\22\2\0\3\22\4\0\3\22"+
261 "\1\124\4\0\13\22\1\0\5\22\5\0\20\22\2\0"+
262 "\3\22\4\0\3\22\1\125\4\0\13\22\1\0\5\22"+
263 "\5\0\20\22\2\0\3\22\4\0\4\22\4\0\6\22"+
264 "\1\126\4\22\1\0\5\22\5\0\20\22\2\0\3\22"+
265 "\4\0\4\22\4\0\10\22\1\127\2\22\1\0\5\22"+
266 "\5\0\20\22\11\0\1\130\77\0\1\131\65\0\1\132"+
267 "\73\0\1\133\40\0\7\100\1\102\5\100\1\0\1\103"+
268 "\50\100\16\0\1\134\53\0\1\135\74\0\1\136\124\0"+
269 "\1\137\72\0\1\140\62\0\1\141\75\0\1\142\67\0"+
270 "\1\143\71\0\1\144\61\0\1\145\13\0\3\22\4\0"+
271 "\3\22\1\146\4\0\13\22\1\0\5\22\5\0\20\22"+
272 "\2\0\3\22\4\0\3\22\1\64\4\0\13\22\1\0"+
273 "\5\22\5\0\20\22\2\0\3\22\4\0\4\22\4\0"+
274 "\5\22\1\147\5\22\1\0\5\22\5\0\20\22\2\0"+
275 "\3\22\4\0\4\22\4\0\13\22\1\0\2\22\1\150"+
276 "\2\22\5\0\20\22\2\0\3\22\4\0\4\22\4\0"+
277 "\11\22\1\151\1\22\1\0\5\22\5\0\20\22\2\0"+
278 "\3\22\4\0\2\22\1\152\1\22\4\0\13\22\1\0"+
279 "\5\22\5\0\20\22\2\0\3\22\4\0\4\22\4\0"+
280 "\1\153\12\22\1\0\5\22\5\0\20\22\2\0\3\22"+
281 "\4\0\3\22\1\154\4\0\13\22\1\0\5\22\5\0"+
282 "\20\22\12\0\1\155\77\0\1\156\100\0\1\157\71\0"+
283 "\1\160\40\0\1\161\125\0\1\162\100\0\1\163\57\0"+
284 "\1\164\61\0\1\165\66\0\1\166\102\0\1\162\60\0"+
285 "\1\167\13\0\3\22\4\0\2\22\1\120\1\22\4\0"+
286 "\13\22\1\0\5\22\5\0\20\22\2\0\3\22\4\0"+
287 "\3\22\1\170\4\0\13\22\1\0\5\22\5\0\20\22"+
288 "\2\0\3\22\4\0\4\22\4\0\5\22\1\171\5\22"+
289 "\1\0\5\22\5\0\20\22\2\0\3\22\4\0\4\22"+
290 "\4\0\12\22\1\172\1\0\5\22\5\0\20\22\2\0"+
291 "\3\22\4\0\3\22\1\173\4\0\13\22\1\0\5\22"+
292 "\5\0\20\22\2\0\3\22\4\0\4\22\4\0\7\22"+
293 "\1\174\3\22\1\0\5\22\5\0\20\22\2\0\3\22"+
294 "\4\0\4\22\4\0\1\175\12\22\1\0\5\22\5\0"+
295 "\20\22\13\0\1\176\112\0\1\177\65\0\1\200\51\0"+
296 "\1\201\60\0\1\202\125\0\1\165\75\0\1\137\6\0"+
297 "\1\164\2\0\1\203\4\0\4\203\4\0\13\203\1\0"+
298 "\5\203\5\0\20\203\60\0\1\204\60\0\1\205\16\0"+
299 "\3\22\4\0\4\22\4\0\3\22\1\120\1\22\1\206"+
300 "\5\22\1\0\5\22\5\0\20\22\2\0\3\22\4\0"+
301 "\1\120\3\22\4\0\13\22\1\0\5\22\5\0\20\22"+
302 "\2\0\3\22\4\0\4\22\4\0\1\207\12\22\1\0"+
303 "\5\22\5\0\20\22\2\0\3\22\4\0\4\22\4\0"+
304 "\5\22\1\210\5\22\1\0\5\22\5\0\20\22\2\0"+
305 "\3\22\4\0\4\22\4\0\10\22\1\120\2\22\1\0"+
306 "\5\22\5\0\20\22\2\0\3\22\4\0\4\22\4\0"+
307 "\1\22\1\120\11\22\1\0\5\22\5\0\20\22\14\0"+
308 "\1\211\100\0\1\160\66\0\1\212\52\0\1\213\70\0"+
309 "\1\214\54\0\3\203\4\0\4\203\4\0\13\203\1\0"+
310 "\5\203\5\0\20\203\61\0\1\162\73\0\1\165\2\0"+
311 "\3\22\4\0\4\22\4\0\1\215\12\22\1\0\5\22"+
312 "\5\0\20\22\2\0\3\22\4\0\4\22\4\0\4\22"+
313 "\1\174\6\22\1\0\5\22\5\0\20\22\2\0\3\22"+
314 "\4\0\4\22\4\0\11\22\1\216\1\22\1\0\5\22"+
315 "\5\0\20\22\13\0\1\213\102\0\1\160\52\0\1\217"+
316 "\55\0\3\22\4\0\4\22\4\0\4\22\1\120\6\22"+
317 "\1\0\5\22\5\0\20\22\10\0\1\220\56\0";
318
319 private static int [] zzUnpackTrans() {
320 int [] result = new int[6710];
321 int offset = 0;
322 offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
323 return result;
324 }
325
326 private static int zzUnpackTrans(String packed, int offset, int [] result) {
327 int i = 0;
328 int j = offset;
329 int l = packed.length();
330 while (i < l) {
331 int count = packed.charAt(i++);
332 int value = packed.charAt(i++);
333 value--;
334 do result[j++] = value; while (--count > 0);
335 }
336 return j;
337 }
338
339
340
341 private static final int ZZ_UNKNOWN_ERROR = 0;
342 private static final int ZZ_NO_MATCH = 1;
343 private static final int ZZ_PUSHBACK_2BIG = 2;
344
345
346 private static final String ZZ_ERROR_MSG[] = {
347 "Unkown internal scanner error",
348 "Error: could not match input",
349 "Error: pushback value was too large"
350 };
351
352 /**
353 * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
354 */
355 private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
356
357 private static final String ZZ_ATTRIBUTE_PACKED_0 =
358 "\1\1\3\0\2\1\1\0\1\1\1\11\2\1\1\11"+
359 "\2\1\1\11\1\1\1\11\4\1\1\11\6\1\2\11"+
360 "\1\1\3\11\3\1\1\11\3\1\1\11\10\0\11\1"+
361 "\7\0\1\11\3\0\1\11\7\0\11\1\4\0\2\11"+
362 "\10\0\7\1\10\0\1\11\2\0\6\1\5\0\1\1"+
363 "\2\0\3\1\2\0\1\11\1\0\2\1\1\0\1\11";
364
365 private static int [] zzUnpackAttribute() {
366 int [] result = new int[144];
367 int offset = 0;
368 offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
369 return result;
370 }
371
372 private static int zzUnpackAttribute(String packed, int offset, int [] result) {
373 int i = 0;
374 int j = offset;
375 int l = packed.length();
376 while (i < l) {
377 int count = packed.charAt(i++);
378 int value = packed.charAt(i++);
379 do result[j++] = value; while (--count > 0);
380 }
381 return j;
382 }
383
384 /** the input device */
385 private java.io.Reader zzReader;
386
387 /** the current state of the DFA */
388 private int zzState;
389
390 /** the current lexical state */
391 private int zzLexicalState = YYINITIAL;
392
393 /** this buffer contains the current text to be matched and is
394 the source of the yytext() string */
395 private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
396
397 /** the textposition at the last accepting state */
398 private int zzMarkedPos;
399
400 /** the textposition at the last state to be included in yytext */
401 private int zzPushbackPos;
402
403 /** the current text position in the buffer */
404 private int zzCurrentPos;
405
406 /** startRead marks the beginning of the yytext() string in the buffer */
407 private int zzStartRead;
408
409 /** endRead marks the last character in the buffer, that has been read
410 from input */
411 private int zzEndRead;
412
413 /** number of newlines encountered up to the start of the matched text */
414 private int yyline;
415
416 /** the number of characters up to the start of the matched text */
417 private int yychar;
418
419 /**
420 * the number of characters from the last newline up to the start of the
421 * matched text
422 */
423 private int yycolumn;
424
425 /**
426 * zzAtBOL == true <=> the scanner is currently at the beginning of a line
427 */
428 private boolean zzAtBOL = true;
429
430 /** zzAtEOF == true <=> the scanner is at the EOF */
431 private boolean zzAtEOF;
432
433
434
435
436 public static final byte PLAIN_STYLE = 1;
437 public static final byte CHAR_DATA = 2;
438 public static final byte TAG_SYMBOLS = 3;
439 public static final byte COMMENT = 4;
440 public static final byte ATTRIBUTE_VALUE = 5;
441 public static final byte ATTRIBUTE_NAME = 6;
442 public static final byte PROCESSING_INSTRUCTION = 7;
443 public static final byte TAG_NAME = 8;
444 public static final byte DTDDOC_TAG_STYLE = 9;
445 public static final byte KEYWORD = 10;
446
447
448
449 public int getStyleCount() {
450 return 10;
451 }
452
453 public byte getStartState() {
454 return YYINITIAL+1;
455 }
456
457 public byte getCurrentState() {
458 return (byte) (yystate()+1);
459 }
460
461 public void setState(byte newState) {
462 yybegin(newState-1);
463 }
464
465 public byte getNextToken() {
466 try {
467 return (byte) yylex();
468 } catch (IOException e) {
469 throw new InternalError();
470 }
471 }
472
473 public int getTokenLength() {
474 return yylength();
475 }
476
477 public void setReader(Reader r) {
478 this.zzReader = r;
479 }
480
481 public DtdHighlighter() {
482 }
483
484 private int mReturningState;
485 private int mReturningStateTag;
486
487
488 /**
489 * Creates a new scanner
490 * There is also a java.io.InputStream version of this constructor.
491 *
492 * @param in the java.io.Reader to read input from.
493 */
494 public DtdHighlighter(java.io.Reader in) {
495 this.zzReader = in;
496 }
497
498 /**
499 * Creates a new scanner.
500 * There is also java.io.Reader version of this constructor.
501 *
502 * @param in the java.io.Inputstream to read input from.
503 */
504 public DtdHighlighter(java.io.InputStream in) {
505 this(new java.io.InputStreamReader(in));
506 }
507
508 /**
509 * Unpacks the compressed character translation table.
510 *
511 * @param packed the packed character translation table
512 * @return the unpacked character translation table
513 */
514 private static char [] zzUnpackCMap(String packed) {
515 char [] map = new char[0x10000];
516 int i = 0;
517 int j = 0;
518 while (i < 1788) {
519 int count = packed.charAt(i++);
520 char value = packed.charAt(i++);
521 do map[j++] = value; while (--count > 0);
522 }
523 return map;
524 }
525
526
527 /**
528 * Refills the input buffer.
529 *
530 * @return <code>false</code>, iff there was new input.
531 *
532 * @exception java.io.IOException if any I/O-Error occurs
533 */
534 private boolean zzRefill() throws java.io.IOException {
535
536
537 if (zzStartRead > 0) {
538 System.arraycopy(zzBuffer, zzStartRead,
539 zzBuffer, 0,
540 zzEndRead-zzStartRead);
541
542
543 zzEndRead-= zzStartRead;
544 zzCurrentPos-= zzStartRead;
545 zzMarkedPos-= zzStartRead;
546 zzPushbackPos-= zzStartRead;
547 zzStartRead = 0;
548 }
549
550
551 if (zzCurrentPos >= zzBuffer.length) {
552
553 char newBuffer[] = new char[zzCurrentPos*2];
554 System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
555 zzBuffer = newBuffer;
556 }
557
558
559 int numRead = zzReader.read(zzBuffer, zzEndRead,
560 zzBuffer.length-zzEndRead);
561
562 if (numRead < 0) {
563 return true;
564 }
565 else {
566 zzEndRead+= numRead;
567 return false;
568 }
569 }
570
571
572 /**
573 * Closes the input stream.
574 */
575 public final void yyclose() throws java.io.IOException {
576 zzAtEOF = true;
577 zzEndRead = zzStartRead;
578
579 if (zzReader != null)
580 zzReader.close();
581 }
582
583
584 /**
585 * Resets the scanner to read from a new input stream.
586 * Does not close the old reader.
587 *
588 * All internal variables are reset, the old input stream
589 * <b>cannot</b> be reused (internal buffer is discarded and lost).
590 * Lexical state is set to <tt>ZZ_INITIAL</tt>.
591 *
592 * @param reader the new input stream
593 */
594 public final void yyreset(java.io.Reader reader) {
595 zzReader = reader;
596 zzAtBOL = true;
597 zzAtEOF = false;
598 zzEndRead = zzStartRead = 0;
599 zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
600 yyline = yychar = yycolumn = 0;
601 zzLexicalState = YYINITIAL;
602 }
603
604
605 /**
606 * Returns the current lexical state.
607 */
608 public final int yystate() {
609 return zzLexicalState;
610 }
611
612
613 /**
614 * Enters a new lexical state
615 *
616 * @param newState the new lexical state
617 */
618 public final void yybegin(int newState) {
619 zzLexicalState = newState;
620 }
621
622
623 /**
624 * Returns the text matched by the current regular expression.
625 */
626 public final String yytext() {
627 return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
628 }
629
630
631 /**
632 * Returns the character at position <tt>pos</tt> from the
633 * matched text.
634 *
635 * It is equivalent to yytext().charAt(pos), but faster
636 *
637 * @param pos the position of the character to fetch.
638 * A value from 0 to yylength()-1.
639 *
640 * @return the character at position pos
641 */
642 public final char yycharat(int pos) {
643 return zzBuffer[zzStartRead+pos];
644 }
645
646
647 /**
648 * Returns the length of the matched text region.
649 */
650 public final int yylength() {
651 return zzMarkedPos-zzStartRead;
652 }
653
654
655 /**
656 * Reports an error that occured while scanning.
657 *
658 * In a wellformed scanner (no or only correct usage of
659 * yypushback(int) and a match-all fallback rule) this method
660 * will only be called with things that "Can't Possibly Happen".
661 * If this method is called, something is seriously wrong
662 * (e.g. a JFlex bug producing a faulty scanner etc.).
663 *
664 * Usual syntax/scanner level error handling should be done
665 * in error fallback rules.
666 *
667 * @param errorCode the code of the errormessage to display
668 */
669 private void zzScanError(int errorCode) {
670 String message;
671 try {
672 message = ZZ_ERROR_MSG[errorCode];
673 }
674 catch (ArrayIndexOutOfBoundsException e) {
675 message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
676 }
677
678 throw new Error(message);
679 }
680
681
682 /**
683 * Pushes the specified amount of characters back into the input stream.
684 *
685 * They will be read again by then next call of the scanning method
686 *
687 * @param number the number of characters to be read again.
688 * This number must not be greater than yylength()!
689 */
690 public void yypushback(int number) {
691 if ( number > yylength() )
692 zzScanError(ZZ_PUSHBACK_2BIG);
693
694 zzMarkedPos -= number;
695 }
696
697
698 /**
699 * Resumes scanning until the next regular expression is matched,
700 * the end of input is encountered or an I/O-Error occurs.
701 *
702 * @return the next token
703 * @exception java.io.IOException if any I/O-Error occurs
704 */
705 public int yylex() throws java.io.IOException {
706 int zzInput;
707 int zzAction;
708
709
710 int zzCurrentPosL;
711 int zzMarkedPosL;
712 int zzEndReadL = zzEndRead;
713 char [] zzBufferL = zzBuffer;
714 char [] zzCMapL = ZZ_CMAP;
715
716 int [] zzTransL = ZZ_TRANS;
717 int [] zzRowMapL = ZZ_ROWMAP;
718 int [] zzAttrL = ZZ_ATTRIBUTE;
719
720 while (true) {
721 zzMarkedPosL = zzMarkedPos;
722
723 zzAction = -1;
724
725 zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
726
727 zzState = zzLexicalState;
728
729
730 zzForAction: {
731 while (true) {
732
733 if (zzCurrentPosL < zzEndReadL)
734 zzInput = zzBufferL[zzCurrentPosL++];
735 else if (zzAtEOF) {
736 zzInput = YYEOF;
737 break zzForAction;
738 }
739 else {
740
741 zzCurrentPos = zzCurrentPosL;
742 zzMarkedPos = zzMarkedPosL;
743 boolean eof = zzRefill();
744
745 zzCurrentPosL = zzCurrentPos;
746 zzMarkedPosL = zzMarkedPos;
747 zzBufferL = zzBuffer;
748 zzEndReadL = zzEndRead;
749 if (eof) {
750 zzInput = YYEOF;
751 break zzForAction;
752 }
753 else {
754 zzInput = zzBufferL[zzCurrentPosL++];
755 }
756 }
757 int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
758 if (zzNext == -1) break zzForAction;
759 zzState = zzNext;
760
761 int zzAttributes = zzAttrL[zzState];
762 if ( (zzAttributes & 1) == 1 ) {
763 zzAction = zzState;
764 zzMarkedPosL = zzCurrentPosL;
765 if ( (zzAttributes & 8) == 8 ) break zzForAction;
766 }
767
768 }
769 }
770
771
772 zzMarkedPos = zzMarkedPosL;
773
774 switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
775 case 21:
776 { yybegin(IN_COMMENT); return COMMENT;
777 }
778 case 24: break;
779 case 2:
780 { return ATTRIBUTE_VALUE;
781 }
782 case 25: break;
783 case 4:
784 { return COMMENT;
785 }
786 case 26: break;
787 case 13:
788 { yybegin(IN_TAG); return ATTRIBUTE_VALUE;
789 }
790 case 27: break;
791 case 12:
792 { yybegin(IN_TAG); return TAG_SYMBOLS;
793 }
794 case 28: break;
795 case 5:
796 { yybegin(IN_TAG); return PLAIN_STYLE;
797 }
798 case 29: break;
799 case 6:
800 { yybegin(IN_TAG); return TAG_NAME;
801 }
802 case 30: break;
803 case 22:
804 { return DTDDOC_TAG_STYLE;
805 }
806 case 31: break;
807 case 18:
808 { yybegin(YYINITIAL); return PROCESSING_INSTRUCTION;
809 }
810 case 32: break;
811 case 14:
812 { return PROCESSING_INSTRUCTION;
813 }
814 case 33: break;
815 case 7:
816 { yybegin(YYINITIAL); return TAG_SYMBOLS;
817 }
818 case 34: break;
819 case 16:
820 { yybegin(IN_PROCESSING_INSTRUCTION); return PROCESSING_INSTRUCTION;
821 }
822 case 35: break;
823 case 9:
824 { return TAG_SYMBOLS;
825 }
826 case 36: break;
827 case 1:
828 { return PLAIN_STYLE;
829 }
830 case 37: break;
831 case 10:
832 { yybegin(IN_SINGLE_QUOTE_STRING); return ATTRIBUTE_VALUE;
833 }
834 case 38: break;
835 case 17:
836 { return KEYWORD;
837 }
838 case 39: break;
839 case 20:
840 { yybegin(YYINITIAL); return CHAR_DATA;
841 }
842 case 40: break;
843 case 19:
844 { yybegin(YYINITIAL); return COMMENT;
845 }
846 case 41: break;
847 case 11:
848 { yybegin(IN_DOUBLE_QUOTE_STRING); return ATTRIBUTE_VALUE;
849 }
850 case 42: break;
851 case 23:
852 { yybegin(IN_CDATA_SECTION); return CHAR_DATA;
853 }
854 case 43: break;
855 case 8:
856 { return ATTRIBUTE_NAME;
857 }
858 case 44: break;
859 case 3:
860 { return CHAR_DATA;
861 }
862 case 45: break;
863 case 15:
864 { yybegin(TAG_START); return TAG_SYMBOLS;
865 }
866 case 46: break;
867 default:
868 if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
869 zzAtEOF = true;
870 return YYEOF;
871 }
872 else {
873 zzScanError(ZZ_NO_MATCH);
874 }
875 }
876 }
877 }
878
879
880 }