source: other-projects/rsyntax-textarea/src/java/org/fife/ui/rsyntaxtextarea/modes/TclTokenMaker.java@ 25584

Last change on this file since 25584 was 25584, checked in by davidb, 12 years ago

Initial cut an a text edit area for GLI that supports color syntax highlighting

File size: 37.7 KB
Line 
1/* The following code was generated by JFlex 1.4.1 on 10/10/10 10:56 PM */
2
3/*
4 * 10/03/2007
5 *
6 * TclTokenMaker.java - Scanner for the Tcl programming language.
7 *
8 * This library is distributed under a modified BSD license. See the included
9 * RSyntaxTextArea.License.txt file for details.
10 */
11package org.fife.ui.rsyntaxtextarea.modes;
12
13import java.io.*;
14import javax.swing.text.Segment;
15
16import org.fife.ui.rsyntaxtextarea.*;
17
18
19/**
20 * Scanner for the Tcl programming language.<p>
21 *
22 * This implementation was created using
23 * <a href="http://www.jflex.de/">JFlex</a> 1.4.1; however, the generated file
24 * was modified for performance. Memory allocation needs to be almost
25 * completely removed to be competitive with the handwritten lexers (subclasses
26 * of <code>AbstractTokenMaker</code>, so this class has been modified so that
27 * Strings are never allocated (via yytext()), and the scanner never has to
28 * worry about refilling its buffer (needlessly copying chars around).
29 * We can achieve this because RText always scans exactly 1 line of tokens at a
30 * time, and hands the scanner this line as an array of characters (a Segment
31 * really). Since tokens contain pointers to char arrays instead of Strings
32 * holding their contents, there is no need for allocating new memory for
33 * Strings.<p>
34 *
35 * The actual algorithm generated for scanning has, of course, not been
36 * modified.<p>
37 *
38 * If you wish to regenerate this file yourself, keep in mind the following:
39 * <ul>
40 * <li>The generated TclTokenMaker.java</code> file will contain two
41 * definitions of both <code>zzRefill</code> and <code>yyreset</code>.
42 * You should hand-delete the second of each definition (the ones
43 * generated by the lexer), as these generated methods modify the input
44 * buffer, which we'll never have to do.</li>
45 * <li>You should also change the declaration/definition of zzBuffer to NOT
46 * be initialized. This is a needless memory allocation for us since we
47 * will be pointing the array somewhere else anyway.</li>
48 * <li>You should NOT call <code>yylex()</code> on the generated scanner
49 * directly; rather, you should use <code>getTokenList</code> as you would
50 * with any other <code>TokenMaker</code> instance.</li>
51 * </ul>
52 *
53 * @author Robert Futrell
54 * @version 0.5
55 *
56 */
57
58public class TclTokenMaker extends AbstractJFlexCTokenMaker {
59
60 /** This character denotes the end of file */
61 public static final int YYEOF = -1;
62
63 /** lexical states */
64 public static final int YYINITIAL = 0;
65
66 /**
67 * Translates characters to character classes
68 */
69 private static final String ZZ_CMAP_PACKED =
70 "\11\0\1\14\1\13\1\0\1\14\1\7\22\0\1\14\1\27\1\15"+
71 "\1\10\1\1\1\27\1\27\1\7\2\24\1\27\1\22\1\25\1\22"+
72 "\1\23\1\27\1\3\1\61\1\60\5\5\2\2\1\7\1\25\1\30"+
73 "\1\26\1\30\1\7\1\0\3\4\1\20\1\21\1\20\5\1\1\17"+
74 "\13\1\1\16\2\1\1\24\1\11\1\24\1\27\1\12\1\0\1\31"+
75 "\1\54\1\46\1\35\1\33\1\52\1\53\1\56\1\44\1\55\1\43"+
76 "\1\50\1\42\1\34\1\41\1\32\1\62\1\36\1\47\1\40\1\6"+
77 "\1\51\1\57\1\45\1\37\1\1\1\24\1\27\1\24\1\27\uff81\0";
78
79 /**
80 * Translates characters to character classes
81 */
82 private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
83
84 /**
85 * Translates DFA states to action switch labels.
86 */
87 private static final int [] ZZ_ACTION = zzUnpackAction();
88
89 private static final String ZZ_ACTION_PACKED_0 =
90 "\1\0\1\1\1\2\2\3\1\2\1\1\1\4\1\5"+
91 "\1\6\1\7\1\10\1\2\1\11\1\2\1\10\22\2"+
92 "\1\1\1\12\1\3\1\13\1\12\1\13\1\12\1\14"+
93 "\1\12\2\2\1\7\1\15\35\2\1\16\5\2\1\16"+
94 "\40\2\1\1\1\13\1\0\2\14\5\2\1\15\25\2"+
95 "\1\16\30\2\1\16\4\2\1\16\11\2\1\1\5\2"+
96 "\2\16\6\2\1\16\15\2\1\16\3\2\1\16\1\2"+
97 "\1\1\14\2\1\1\6\2";
98
99 private static int [] zzUnpackAction() {
100 int [] result = new int[241];
101 int offset = 0;
102 offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
103 return result;
104 }
105
106 private static int zzUnpackAction(String packed, int offset, int [] result) {
107 int i = 0; /* index in packed string */
108 int j = offset; /* index in unpacked array */
109 int l = packed.length();
110 while (i < l) {
111 int count = packed.charAt(i++);
112 int value = packed.charAt(i++);
113 do result[j++] = value; while (--count > 0);
114 }
115 return j;
116 }
117
118
119 /**
120 * Translates a state to a row index in the transition table
121 */
122 private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
123
124 private static final String ZZ_ROWMAP_PACKED_0 =
125 "\0\0\0\63\0\146\0\231\0\314\0\377\0\u0132\0\u0165"+
126 "\0\u0132\0\u0198\0\u01cb\0\u0132\0\u01fe\0\u0132\0\u0132\0\u0231"+
127 "\0\u0264\0\u0297\0\u02ca\0\u02fd\0\u0330\0\u0363\0\u0396\0\u03c9"+
128 "\0\u03fc\0\u042f\0\u0462\0\u0495\0\u04c8\0\u04fb\0\u052e\0\u0561"+
129 "\0\u0594\0\u05c7\0\u05fa\0\u062d\0\u062d\0\u062d\0\u0660\0\u0693"+
130 "\0\u06c6\0\u06f9\0\u072c\0\u075f\0\u0792\0\u07c5\0\u0132\0\u07f8"+
131 "\0\u082b\0\u085e\0\u0891\0\u08c4\0\u08f7\0\u092a\0\u095d\0\u0990"+
132 "\0\u09c3\0\u09f6\0\u0a29\0\u0a5c\0\u0a8f\0\u0ac2\0\u0af5\0\u0b28"+
133 "\0\u0b5b\0\u0b8e\0\u0bc1\0\u0bf4\0\u0c27\0\u0c5a\0\u0c8d\0\u0cc0"+
134 "\0\u0cf3\0\u0d26\0\u0d59\0\u0d8c\0\u0dbf\0\u0df2\0\u0e25\0\u0e58"+
135 "\0\u0e8b\0\u0ebe\0\146\0\u0ef1\0\u0f24\0\u0f57\0\u0f8a\0\u0fbd"+
136 "\0\u0ff0\0\u1023\0\u1056\0\u1089\0\u10bc\0\u10ef\0\u1122\0\u1155"+
137 "\0\u1188\0\u11bb\0\u11ee\0\u1221\0\u1254\0\u1287\0\u12ba\0\u12ed"+
138 "\0\u1320\0\u1353\0\u1386\0\u13b9\0\u13ec\0\u141f\0\u1452\0\u1485"+
139 "\0\u14b8\0\u14eb\0\u151e\0\u1551\0\u1584\0\u15b7\0\u062d\0\u15ea"+
140 "\0\u161d\0\u1650\0\u1683\0\u16b6\0\u16e9\0\u01cb\0\u171c\0\u174f"+
141 "\0\u1782\0\u17b5\0\u17e8\0\u181b\0\u184e\0\u1881\0\u18b4\0\u18e7"+
142 "\0\u191a\0\u194d\0\u1980\0\u19b3\0\u19e6\0\u1a19\0\u1a4c\0\u1a7f"+
143 "\0\u1ab2\0\u1ae5\0\u1b18\0\u1b4b\0\u1b7e\0\u1bb1\0\u1be4\0\u1c17"+
144 "\0\u1c4a\0\u1c7d\0\u1cb0\0\u1ce3\0\u1d16\0\u1d49\0\u1d7c\0\u1daf"+
145 "\0\u1de2\0\u1e15\0\u1e48\0\u1e7b\0\u1eae\0\u1ee1\0\u1f14\0\u1f47"+
146 "\0\u1f7a\0\u1fad\0\u1fe0\0\u2013\0\u2046\0\u2079\0\u20ac\0\u20df"+
147 "\0\u2112\0\u2145\0\u2178\0\u21ab\0\u21de\0\u2211\0\u2244\0\u2277"+
148 "\0\u22aa\0\u22dd\0\u2310\0\u2343\0\u2376\0\u23a9\0\u23dc\0\u240f"+
149 "\0\u2442\0\u2475\0\u24a8\0\u24db\0\u250e\0\u2541\0\u2574\0\u25a7"+
150 "\0\u25da\0\u260d\0\u2640\0\u1b4b\0\u2673\0\u26a6\0\u26d9\0\u270c"+
151 "\0\u273f\0\u2772\0\u27a5\0\u27d8\0\u280b\0\u283e\0\u2871\0\u28a4"+
152 "\0\u28d7\0\u290a\0\u293d\0\u0bc1\0\u2970\0\u29a3\0\u29d6\0\u2a09"+
153 "\0\u260d\0\u2a3c\0\u2a6f\0\u2aa2\0\u2ad5\0\u2b08\0\u2b3b\0\u2b6e"+
154 "\0\u2ba1\0\u2bd4\0\u2c07\0\u2c3a\0\u2c6d\0\u2ca0\0\u2cd3\0\u2d06"+
155 "\0\u2d39";
156
157 private static int [] zzUnpackRowMap() {
158 int [] result = new int[241];
159 int offset = 0;
160 offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
161 return result;
162 }
163
164 private static int zzUnpackRowMap(String packed, int offset, int [] result) {
165 int i = 0; /* index in packed string */
166 int j = offset; /* index in unpacked array */
167 int l = packed.length();
168 while (i < l) {
169 int high = packed.charAt(i++) << 16;
170 result[j++] = high | packed.charAt(i++);
171 }
172 return j;
173 }
174
175 /**
176 * The transition table of the DFA
177 */
178 private static final int [] ZZ_TRANS = zzUnpackTrans();
179
180 private static final String ZZ_TRANS_PACKED_0 =
181 "\1\2\1\3\1\4\1\5\1\3\1\4\1\6\1\7"+
182 "\1\10\1\2\1\3\1\11\1\12\1\13\4\3\1\14"+
183 "\1\15\1\16\1\17\2\14\1\20\1\21\1\22\1\23"+
184 "\1\3\1\24\1\25\1\3\1\26\1\27\1\30\1\3"+
185 "\1\31\1\3\1\32\1\33\1\34\1\3\1\35\1\36"+
186 "\1\37\1\40\1\41\1\42\2\4\1\3\7\2\1\0"+
187 "\3\2\3\0\4\2\7\0\33\2\6\3\1\0\1\2"+
188 "\1\43\1\3\3\0\4\3\7\0\32\3\2\44\2\4"+
189 "\1\44\1\4\1\44\1\0\3\44\3\0\1\44\1\45"+
190 "\1\46\1\47\1\0\1\50\5\0\2\44\1\47\1\44"+
191 "\1\46\12\44\1\45\1\44\1\46\5\44\2\4\3\44"+
192 "\1\51\1\52\1\44\1\52\1\44\1\0\3\44\3\0"+
193 "\1\53\1\45\1\46\1\47\1\0\1\50\5\0\2\44"+
194 "\1\47\1\44\1\46\7\44\1\53\2\44\1\45\1\44"+
195 "\1\46\5\44\2\52\1\44\1\2\6\3\1\0\1\2"+
196 "\1\43\1\3\3\0\4\3\7\0\1\3\1\54\1\3"+
197 "\1\55\26\3\63\0\13\10\1\0\47\10\14\0\1\12"+
198 "\46\0\11\13\1\56\3\13\1\57\45\13\2\0\2\50"+
199 "\1\0\1\50\52\0\2\50\27\0\1\14\34\0\1\2"+
200 "\5\3\1\60\1\0\1\2\1\43\1\3\3\0\4\3"+
201 "\7\0\1\3\1\61\3\3\1\62\1\3\1\63\5\3"+
202 "\1\64\1\65\2\3\1\66\1\3\1\67\6\3\1\2"+
203 "\5\3\1\70\1\0\1\2\1\43\1\3\3\0\4\3"+
204 "\7\0\1\71\4\3\1\72\2\3\1\73\2\3\1\74"+
205 "\3\3\1\75\6\3\1\74\3\3\1\2\6\3\1\0"+
206 "\1\2\1\43\1\3\3\0\4\3\7\0\3\3\1\76"+
207 "\1\3\1\77\2\3\1\100\3\3\1\101\2\3\1\102"+
208 "\1\103\11\3\1\2\6\3\1\0\1\2\1\43\1\3"+
209 "\3\0\4\3\7\0\2\3\1\104\5\3\1\105\21\3"+
210 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
211 "\7\0\1\106\1\3\1\107\5\3\1\110\21\3\1\2"+
212 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
213 "\1\111\1\3\1\112\2\3\1\113\2\3\1\114\1\3"+
214 "\1\115\1\116\16\3\1\2\6\3\1\0\1\2\1\43"+
215 "\1\3\3\0\4\3\7\0\1\3\1\117\30\3\1\2"+
216 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
217 "\2\3\1\120\27\3\1\2\6\3\1\0\1\2\1\43"+
218 "\1\3\3\0\4\3\7\0\3\3\1\121\5\3\1\122"+
219 "\7\3\1\123\10\3\1\2\6\3\1\0\1\2\1\43"+
220 "\1\3\3\0\4\3\7\0\1\124\1\3\1\125\1\3"+
221 "\1\123\3\3\1\126\6\3\1\127\5\3\1\130\4\3"+
222 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
223 "\7\0\1\3\1\131\1\132\4\3\1\133\1\134\2\3"+
224 "\1\111\1\3\1\135\10\3\1\136\2\3\1\137\1\2"+
225 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
226 "\1\140\4\3\1\141\2\3\1\142\2\3\1\143\2\3"+
227 "\1\144\1\145\12\3\1\2\6\3\1\0\1\2\1\43"+
228 "\1\3\3\0\4\3\7\0\5\3\1\146\2\3\1\147"+
229 "\1\150\1\3\1\151\3\3\1\152\12\3\1\2\6\3"+
230 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\2\3"+
231 "\1\70\2\3\1\153\11\3\1\154\12\3\1\2\5\3"+
232 "\1\155\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
233 "\5\3\1\156\5\3\1\157\16\3\1\2\6\3\1\0"+
234 "\1\2\1\43\1\3\3\0\4\3\7\0\10\3\1\65"+
235 "\21\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
236 "\4\3\7\0\6\3\1\160\4\3\1\161\16\3\1\2"+
237 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
238 "\11\3\1\123\1\3\1\162\11\3\1\163\4\3\6\2"+
239 "\1\164\1\0\3\2\3\0\4\2\7\0\32\2\7\44"+
240 "\1\0\3\44\3\0\4\44\7\0\34\44\2\165\1\44"+
241 "\1\165\1\44\1\0\3\44\3\0\4\44\1\166\6\0"+
242 "\27\44\2\165\3\44\2\50\1\44\1\50\1\44\1\0"+
243 "\3\44\3\0\2\44\1\46\1\47\7\0\2\44\1\47"+
244 "\1\44\1\46\14\44\1\46\5\44\2\50\3\44\2\51"+
245 "\1\44\1\51\1\44\1\0\3\44\3\0\2\44\1\46"+
246 "\1\47\1\0\1\50\5\0\2\44\1\47\1\44\1\46"+
247 "\14\44\1\46\5\44\2\51\3\44\1\51\1\52\1\44"+
248 "\1\52\1\44\1\0\3\44\3\0\1\44\1\167\1\46"+
249 "\1\47\1\0\1\50\5\0\2\44\1\47\1\44\1\46"+
250 "\12\44\1\167\1\44\1\46\5\44\2\52\3\44\4\170"+
251 "\1\44\1\0\3\44\3\0\2\44\2\170\7\0\1\170"+
252 "\1\44\1\170\1\44\1\170\10\44\1\170\3\44\1\170"+
253 "\1\44\1\170\3\44\2\170\1\44\1\2\6\3\1\0"+
254 "\1\2\1\43\1\3\3\0\4\3\7\0\4\3\1\171"+
255 "\12\3\1\172\1\173\11\3\1\2\6\3\1\0\1\2"+
256 "\1\43\1\3\3\0\4\3\7\0\12\3\1\174\3\3"+
257 "\1\175\13\3\13\13\1\0\1\13\1\176\45\13\1\2"+
258 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
259 "\7\3\1\177\22\3\1\2\6\3\1\0\1\2\1\43"+
260 "\1\3\3\0\4\3\7\0\1\3\1\200\30\3\1\2"+
261 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
262 "\5\3\1\201\24\3\1\2\6\3\1\0\1\2\1\43"+
263 "\1\3\3\0\4\3\7\0\1\202\31\3\1\2\6\3"+
264 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\10\3"+
265 "\1\67\21\3\1\2\6\3\1\0\1\2\1\43\1\3"+
266 "\3\0\4\3\7\0\13\3\1\203\16\3\1\2\6\3"+
267 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\7\3"+
268 "\1\204\22\3\1\2\6\3\1\0\1\2\1\43\1\3"+
269 "\3\0\4\3\7\0\16\3\1\123\13\3\1\2\6\3"+
270 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\7\3"+
271 "\1\67\22\3\1\2\6\3\1\0\1\2\1\43\1\3"+
272 "\3\0\4\3\7\0\15\3\1\205\14\3\1\2\6\3"+
273 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\10\3"+
274 "\1\206\21\3\1\2\6\3\1\0\1\2\1\43\1\3"+
275 "\3\0\4\3\7\0\26\3\1\123\3\3\1\2\6\3"+
276 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\4\3"+
277 "\1\123\25\3\1\2\6\3\1\0\1\2\1\43\1\3"+
278 "\3\0\4\3\7\0\1\207\31\3\1\2\6\3\1\0"+
279 "\1\2\1\43\1\3\3\0\4\3\7\0\7\3\1\210"+
280 "\22\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
281 "\4\3\7\0\5\3\1\211\24\3\1\2\6\3\1\0"+
282 "\1\2\1\43\1\3\3\0\4\3\7\0\21\3\1\123"+
283 "\10\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
284 "\4\3\7\0\1\3\1\212\1\206\10\3\1\213\16\3"+
285 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
286 "\7\0\16\3\1\214\13\3\1\2\6\3\1\0\1\2"+
287 "\1\43\1\3\3\0\4\3\7\0\1\215\31\3\1\2"+
288 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
289 "\16\3\1\216\13\3\1\2\5\3\1\217\1\0\1\2"+
290 "\1\43\1\3\3\0\4\3\7\0\32\3\1\2\6\3"+
291 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\4\3"+
292 "\1\220\6\3\1\221\16\3\1\2\6\3\1\0\1\2"+
293 "\1\43\1\3\3\0\4\3\7\0\1\74\2\3\1\146"+
294 "\3\3\1\222\12\3\1\223\7\3\1\2\5\3\1\157"+
295 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\32\3"+
296 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
297 "\7\0\3\3\1\224\26\3\1\2\6\3\1\0\1\2"+
298 "\1\43\1\3\3\0\4\3\7\0\14\3\1\213\2\3"+
299 "\1\215\12\3\1\2\6\3\1\0\1\2\1\43\1\3"+
300 "\3\0\4\3\7\0\1\225\31\3\1\2\6\3\1\0"+
301 "\1\2\1\43\1\3\3\0\4\3\7\0\1\3\1\226"+
302 "\30\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
303 "\4\3\7\0\2\3\1\227\23\3\1\230\3\3\1\2"+
304 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
305 "\11\3\1\231\20\3\1\2\6\3\1\0\1\2\1\43"+
306 "\1\3\3\0\4\3\7\0\2\3\1\203\4\3\1\232"+
307 "\22\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
308 "\4\3\7\0\3\3\1\233\12\3\1\234\13\3\1\2"+
309 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
310 "\7\3\1\123\5\3\1\212\3\3\1\235\10\3\1\2"+
311 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
312 "\1\236\31\3\1\2\6\3\1\0\1\2\1\43\1\3"+
313 "\3\0\4\3\7\0\3\3\1\237\3\3\1\240\22\3"+
314 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
315 "\7\0\13\3\1\215\16\3\1\2\6\3\1\0\1\2"+
316 "\1\43\1\3\3\0\4\3\7\0\3\3\1\241\12\3"+
317 "\1\224\13\3\1\2\6\3\1\0\1\2\1\43\1\3"+
318 "\3\0\4\3\7\0\10\3\1\221\21\3\1\2\6\3"+
319 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\2\3"+
320 "\1\242\27\3\1\2\6\3\1\0\1\2\1\43\1\3"+
321 "\3\0\4\3\7\0\17\3\1\243\12\3\1\2\6\3"+
322 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\2\3"+
323 "\1\205\1\74\3\3\1\123\7\3\1\244\12\3\1\2"+
324 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
325 "\5\3\1\245\24\3\1\2\5\3\1\246\1\0\1\2"+
326 "\1\43\1\3\3\0\4\3\7\0\32\3\1\2\6\3"+
327 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\1\247"+
328 "\4\3\1\250\24\3\1\2\6\3\1\0\1\2\1\43"+
329 "\1\3\3\0\4\3\7\0\13\3\1\251\16\3\1\2"+
330 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
331 "\5\3\1\213\24\3\1\2\6\3\1\0\1\2\1\43"+
332 "\1\3\3\0\4\3\7\0\1\3\1\61\21\3\1\252"+
333 "\6\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
334 "\4\3\7\0\1\253\1\3\1\254\27\3\1\2\6\3"+
335 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\22\3"+
336 "\1\255\3\3\1\204\3\3\1\2\6\3\1\0\1\2"+
337 "\1\43\1\3\3\0\4\3\7\0\3\3\1\256\12\3"+
338 "\1\257\13\3\1\2\6\3\1\0\1\2\1\43\1\3"+
339 "\3\0\4\3\7\0\2\3\1\260\5\3\1\137\21\3"+
340 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
341 "\7\0\2\3\1\261\27\3\1\2\6\3\1\0\1\2"+
342 "\1\43\1\3\3\0\4\3\7\0\1\116\31\3\1\2"+
343 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
344 "\5\3\1\262\7\3\1\263\14\3\1\2\6\3\1\0"+
345 "\1\2\1\43\1\3\3\0\4\3\7\0\10\3\1\74"+
346 "\21\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
347 "\4\3\7\0\17\3\1\231\12\3\1\2\5\3\1\264"+
348 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\10\3"+
349 "\1\211\21\3\1\2\6\3\1\0\1\2\1\43\1\3"+
350 "\3\0\4\3\7\0\1\265\31\3\1\2\6\3\1\0"+
351 "\1\2\1\43\1\3\3\0\4\3\7\0\10\3\1\266"+
352 "\21\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
353 "\4\3\7\0\7\3\1\267\22\3\1\2\6\3\1\0"+
354 "\1\2\1\43\1\3\3\0\4\3\7\0\2\3\1\270"+
355 "\27\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
356 "\4\3\7\0\3\3\1\74\26\3\1\2\6\3\1\0"+
357 "\1\2\1\43\1\3\3\0\4\3\7\0\1\3\1\271"+
358 "\30\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
359 "\4\3\7\0\16\3\1\272\13\3\1\2\6\3\1\0"+
360 "\1\2\1\43\1\3\3\0\4\3\7\0\3\3\1\273"+
361 "\26\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
362 "\4\3\7\0\13\3\1\151\16\3\2\2\4\274\1\2"+
363 "\1\0\3\2\3\0\2\2\2\274\7\0\1\274\1\2"+
364 "\1\274\1\2\1\274\10\2\1\274\3\2\1\274\1\2"+
365 "\1\274\3\2\2\274\1\2\2\44\2\165\1\44\1\165"+
366 "\1\44\1\0\3\44\3\0\2\44\1\46\1\44\7\0"+
367 "\4\44\1\46\14\44\1\46\5\44\2\165\1\44\2\0"+
368 "\2\165\1\0\1\165\52\0\2\165\1\0\2\44\4\170"+
369 "\1\44\1\0\3\44\3\0\1\44\1\167\2\170\7\0"+
370 "\1\170\1\44\1\170\1\44\1\170\10\44\1\170\1\44"+
371 "\1\167\1\44\1\170\1\44\1\170\3\44\2\170\1\44"+
372 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
373 "\7\0\1\275\31\3\1\2\6\3\1\0\1\2\1\43"+
374 "\1\3\3\0\4\3\7\0\2\3\1\276\27\3\1\2"+
375 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
376 "\1\212\31\3\1\2\6\3\1\0\1\2\1\43\1\3"+
377 "\3\0\4\3\7\0\10\3\1\277\21\3\1\2\6\3"+
378 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\2\3"+
379 "\1\213\27\3\1\2\6\3\1\0\1\2\1\43\1\3"+
380 "\3\0\4\3\7\0\10\3\1\300\21\3\1\2\6\3"+
381 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\2\3"+
382 "\1\157\27\3\1\2\6\3\1\0\1\2\1\43\1\3"+
383 "\3\0\4\3\7\0\1\301\31\3\1\2\6\3\1\0"+
384 "\1\2\1\43\1\3\3\0\4\3\7\0\3\3\1\302"+
385 "\26\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
386 "\4\3\7\0\3\3\1\123\26\3\1\2\6\3\1\0"+
387 "\1\2\1\43\1\3\3\0\4\3\7\0\2\3\1\212"+
388 "\27\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
389 "\4\3\7\0\12\3\1\123\17\3\1\2\6\3\1\0"+
390 "\1\2\1\43\1\3\3\0\4\3\7\0\15\3\1\123"+
391 "\14\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
392 "\4\3\7\0\15\3\1\204\14\3\1\2\6\3\1\0"+
393 "\1\2\1\43\1\3\3\0\4\3\7\0\5\3\1\301"+
394 "\24\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
395 "\4\3\7\0\10\3\1\212\21\3\1\2\6\3\1\0"+
396 "\1\2\1\43\1\3\3\0\4\3\7\0\5\3\1\123"+
397 "\24\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
398 "\4\3\7\0\7\3\1\123\22\3\1\2\6\3\1\0"+
399 "\1\2\1\43\1\3\3\0\4\3\7\0\2\3\1\303"+
400 "\27\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
401 "\4\3\7\0\17\3\1\123\12\3\1\2\6\3\1\0"+
402 "\1\2\1\43\1\3\3\0\4\3\7\0\7\3\1\304"+
403 "\22\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
404 "\4\3\7\0\23\3\1\151\6\3\1\2\6\3\1\0"+
405 "\1\2\1\43\1\3\3\0\4\3\7\0\13\3\1\305"+
406 "\16\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
407 "\4\3\7\0\16\3\1\231\13\3\1\2\5\3\1\306"+
408 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\32\3"+
409 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
410 "\7\0\2\3\1\307\13\3\1\310\13\3\1\2\6\3"+
411 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\25\3"+
412 "\1\123\4\3\1\2\6\3\1\0\1\2\1\43\1\3"+
413 "\3\0\4\3\7\0\15\3\1\231\14\3\1\2\6\3"+
414 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\17\3"+
415 "\1\172\12\3\1\2\6\3\1\0\1\2\1\43\1\3"+
416 "\3\0\4\3\7\0\5\3\1\77\24\3\1\2\6\3"+
417 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\1\243"+
418 "\31\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
419 "\4\3\7\0\2\3\1\123\27\3\1\2\6\3\1\0"+
420 "\1\2\1\43\1\3\3\0\4\3\7\0\13\3\1\311"+
421 "\16\3\1\2\5\3\1\312\1\0\1\2\1\43\1\3"+
422 "\3\0\4\3\7\0\32\3\1\2\6\3\1\0\1\2"+
423 "\1\43\1\3\3\0\4\3\7\0\16\3\1\122\13\3"+
424 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
425 "\7\0\10\3\1\123\21\3\1\2\6\3\1\0\1\2"+
426 "\1\43\1\3\3\0\4\3\7\0\22\3\1\231\7\3"+
427 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
428 "\7\0\20\3\1\313\11\3\1\2\6\3\1\0\1\2"+
429 "\1\43\1\3\3\0\4\3\7\0\15\3\1\314\14\3"+
430 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
431 "\7\0\7\3\1\315\5\3\1\316\1\317\13\3\1\2"+
432 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
433 "\15\3\1\320\14\3\1\2\6\3\1\0\1\2\1\43"+
434 "\1\3\3\0\4\3\7\0\13\3\1\213\16\3\1\2"+
435 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
436 "\2\3\1\321\27\3\1\2\6\3\1\0\1\2\1\43"+
437 "\1\3\3\0\4\3\7\0\13\3\1\322\16\3\1\2"+
438 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
439 "\5\3\1\225\24\3\1\2\6\3\1\0\1\2\1\43"+
440 "\1\3\3\0\4\3\7\0\3\3\1\123\13\3\1\231"+
441 "\12\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
442 "\4\3\7\0\10\3\1\323\21\3\1\2\6\3\1\0"+
443 "\1\2\1\43\1\3\3\0\4\3\7\0\7\3\1\240"+
444 "\22\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
445 "\4\3\7\0\2\3\1\215\27\3\1\2\6\3\1\0"+
446 "\1\2\1\43\1\3\3\0\4\3\7\0\3\3\1\236"+
447 "\26\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
448 "\4\3\7\0\1\3\1\324\30\3\1\2\6\3\1\0"+
449 "\1\2\1\43\1\3\3\0\4\3\7\0\30\3\1\325"+
450 "\1\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
451 "\4\3\7\0\4\3\1\326\11\3\1\327\13\3\1\2"+
452 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
453 "\7\3\1\330\22\3\1\2\6\3\1\0\1\2\1\43"+
454 "\1\3\3\0\4\3\7\0\1\331\31\3\1\2\6\3"+
455 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\3\3"+
456 "\1\332\26\3\1\2\6\3\1\0\1\2\1\43\1\3"+
457 "\3\0\4\3\7\0\2\3\1\333\6\3\1\316\20\3"+
458 "\1\2\5\3\1\67\1\0\1\2\1\43\1\3\3\0"+
459 "\4\3\7\0\32\3\1\2\6\3\1\0\1\2\1\43"+
460 "\1\3\3\0\4\3\7\0\16\3\1\314\13\3\1\2"+
461 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
462 "\23\3\1\123\6\3\1\2\6\3\1\0\1\2\1\43"+
463 "\1\3\3\0\4\3\7\0\23\3\1\334\6\3\1\2"+
464 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
465 "\7\3\1\311\22\3\1\2\6\3\1\0\1\2\1\43"+
466 "\1\3\3\0\4\3\7\0\1\205\31\3\1\2\6\3"+
467 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\10\3"+
468 "\1\213\21\3\1\2\6\3\1\0\1\2\1\43\1\3"+
469 "\3\0\4\3\7\0\7\3\1\335\22\3\1\2\6\3"+
470 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\21\3"+
471 "\1\235\10\3\2\2\4\336\1\2\1\0\3\2\3\0"+
472 "\2\2\2\336\7\0\1\336\1\2\1\336\1\2\1\336"+
473 "\10\2\1\336\3\2\1\336\1\2\1\336\3\2\2\336"+
474 "\2\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
475 "\7\0\7\3\1\231\22\3\1\2\6\3\1\0\1\2"+
476 "\1\43\1\3\3\0\4\3\7\0\20\3\1\252\11\3"+
477 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
478 "\7\0\26\3\1\203\3\3\1\2\6\3\1\0\1\2"+
479 "\1\43\1\337\3\0\4\3\7\0\32\3\1\2\6\3"+
480 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\6\3"+
481 "\1\123\23\3\1\2\6\3\1\0\1\2\1\43\1\3"+
482 "\3\0\4\3\7\0\27\3\1\123\2\3\1\2\6\3"+
483 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\13\3"+
484 "\1\100\16\3\1\2\6\3\1\0\1\2\1\43\1\3"+
485 "\3\0\4\3\7\0\5\3\1\340\24\3\1\2\6\3"+
486 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\10\3"+
487 "\1\341\21\3\1\2\6\3\1\0\1\2\1\43\1\3"+
488 "\3\0\4\3\7\0\5\3\1\203\24\3\1\2\6\3"+
489 "\1\0\1\2\1\43\1\3\3\0\4\3\7\0\14\3"+
490 "\1\342\15\3\1\2\5\3\1\265\1\0\1\2\1\43"+
491 "\1\3\3\0\4\3\7\0\32\3\1\2\6\3\1\0"+
492 "\1\2\1\43\1\3\3\0\4\3\7\0\10\3\1\203"+
493 "\21\3\1\2\6\3\1\0\1\2\1\43\1\3\3\0"+
494 "\4\3\7\0\23\3\1\343\6\3\1\2\6\3\1\0"+
495 "\1\2\1\43\1\3\3\0\4\3\7\0\1\67\31\3"+
496 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
497 "\7\0\13\3\1\344\16\3\1\2\6\3\1\0\1\2"+
498 "\1\43\1\3\3\0\4\3\7\0\1\213\31\3\1\2"+
499 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
500 "\10\3\1\151\21\3\1\2\6\3\1\0\1\2\1\43"+
501 "\1\3\3\0\4\3\7\0\12\3\1\341\17\3\1\2"+
502 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
503 "\15\3\1\345\14\3\1\2\6\3\1\0\1\2\1\43"+
504 "\1\3\3\0\4\3\7\0\3\3\1\346\26\3\1\2"+
505 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
506 "\17\3\1\347\12\3\1\2\6\3\1\0\1\2\1\43"+
507 "\1\3\3\0\4\3\7\0\17\3\1\113\12\3\1\2"+
508 "\2\3\1\123\3\3\1\0\1\2\1\43\1\3\3\0"+
509 "\4\3\7\0\32\3\1\2\6\3\1\0\1\2\1\43"+
510 "\1\3\3\0\4\3\7\0\2\3\1\350\27\3\1\2"+
511 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
512 "\2\3\1\137\27\3\1\2\6\3\1\0\1\2\1\43"+
513 "\1\3\3\0\4\3\7\0\23\3\1\351\6\3\1\2"+
514 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
515 "\5\3\1\240\24\3\1\2\6\3\1\0\1\2\1\43"+
516 "\1\3\3\0\4\3\7\0\22\3\1\352\7\3\1\2"+
517 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
518 "\1\240\31\3\1\2\6\3\1\0\1\2\1\43\1\3"+
519 "\3\0\4\3\7\0\10\3\1\210\21\3\2\2\4\353"+
520 "\1\2\1\0\3\2\3\0\2\2\2\353\7\0\1\353"+
521 "\1\2\1\353\1\2\1\353\10\2\1\353\3\2\1\353"+
522 "\1\2\1\353\3\2\2\353\2\2\6\3\1\0\1\2"+
523 "\1\43\1\3\3\0\4\3\7\0\11\3\1\354\20\3"+
524 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
525 "\7\0\10\3\1\301\21\3\1\2\6\3\1\0\1\2"+
526 "\1\43\1\3\3\0\4\3\7\0\1\3\1\123\30\3"+
527 "\1\2\5\3\1\155\1\0\1\2\1\43\1\3\3\0"+
528 "\4\3\7\0\32\3\1\2\6\3\1\0\1\2\1\43"+
529 "\1\3\3\0\4\3\7\0\3\3\1\355\26\3\1\2"+
530 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
531 "\7\3\1\232\22\3\1\2\6\3\1\0\1\2\1\43"+
532 "\1\3\3\0\4\3\7\0\22\3\1\123\7\3\1\2"+
533 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
534 "\17\3\1\356\12\3\1\2\6\3\1\0\1\2\1\43"+
535 "\1\3\3\0\4\3\7\0\14\3\1\123\15\3\1\2"+
536 "\6\3\1\0\1\2\1\43\1\3\3\0\4\3\7\0"+
537 "\10\3\1\350\21\3\1\2\6\3\1\0\1\2\1\43"+
538 "\1\3\3\0\4\3\7\0\7\3\1\314\22\3\2\2"+
539 "\4\3\1\2\1\0\3\2\3\0\2\2\2\3\7\0"+
540 "\1\3\1\2\1\3\1\2\1\3\10\2\1\3\3\2"+
541 "\1\3\1\2\1\3\3\2\2\3\2\2\6\3\1\0"+
542 "\1\2\1\43\1\3\3\0\4\3\7\0\12\3\1\357"+
543 "\17\3\1\2\5\3\1\231\1\0\1\2\1\43\1\3"+
544 "\3\0\4\3\7\0\32\3\1\2\6\3\1\0\1\2"+
545 "\1\43\1\3\3\0\4\3\7\0\23\3\1\173\6\3"+
546 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
547 "\7\0\13\3\1\360\16\3\1\2\6\3\1\0\1\2"+
548 "\1\43\1\3\3\0\4\3\7\0\3\3\1\361\26\3"+
549 "\1\2\6\3\1\0\1\2\1\43\1\3\3\0\4\3"+
550 "\7\0\4\3\1\326\25\3";
551
552 private static int [] zzUnpackTrans() {
553 int [] result = new int[11628];
554 int offset = 0;
555 offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
556 return result;
557 }
558
559 private static int zzUnpackTrans(String packed, int offset, int [] result) {
560 int i = 0; /* index in packed string */
561 int j = offset; /* index in unpacked array */
562 int l = packed.length();
563 while (i < l) {
564 int count = packed.charAt(i++);
565 int value = packed.charAt(i++);
566 value--;
567 do result[j++] = value; while (--count > 0);
568 }
569 return j;
570 }
571
572
573 /* error codes */
574 private static final int ZZ_UNKNOWN_ERROR = 0;
575 private static final int ZZ_NO_MATCH = 1;
576 private static final int ZZ_PUSHBACK_2BIG = 2;
577
578 /* error messages for the codes above */
579 private static final String ZZ_ERROR_MSG[] = {
580 "Unkown internal scanner error",
581 "Error: could not match input",
582 "Error: pushback value was too large"
583 };
584
585 /**
586 * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
587 */
588 private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
589
590 private static final String ZZ_ATTRIBUTE_PACKED_0 =
591 "\1\0\5\1\1\11\1\1\1\11\2\1\1\11\1\1"+
592 "\2\11\37\1\1\11\106\1\1\0\173\1";
593
594 private static int [] zzUnpackAttribute() {
595 int [] result = new int[241];
596 int offset = 0;
597 offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
598 return result;
599 }
600
601 private static int zzUnpackAttribute(String packed, int offset, int [] result) {
602 int i = 0; /* index in packed string */
603 int j = offset; /* index in unpacked array */
604 int l = packed.length();
605 while (i < l) {
606 int count = packed.charAt(i++);
607 int value = packed.charAt(i++);
608 do result[j++] = value; while (--count > 0);
609 }
610 return j;
611 }
612
613 /** the input device */
614 private java.io.Reader zzReader;
615
616 /** the current state of the DFA */
617 private int zzState;
618
619 /** the current lexical state */
620 private int zzLexicalState = YYINITIAL;
621
622 /** this buffer contains the current text to be matched and is
623 the source of the yytext() string */
624 private char zzBuffer[];
625
626 /** the textposition at the last accepting state */
627 private int zzMarkedPos;
628
629 /** the current text position in the buffer */
630 private int zzCurrentPos;
631
632 /** startRead marks the beginning of the yytext() string in the buffer */
633 private int zzStartRead;
634
635 /** endRead marks the last character in the buffer, that has been read
636 from input */
637 private int zzEndRead;
638
639 /** zzAtEOF == true <=> the scanner is at the EOF */
640 private boolean zzAtEOF;
641
642 /* user code: */
643
644
645 /**
646 * Constructor. This must be here because JFlex does not generate a
647 * no-parameter constructor.
648 */
649 public TclTokenMaker() {
650 }
651
652
653 /**
654 * Adds the token specified to the current linked list of tokens.
655 *
656 * @param tokenType The token's type.
657 */
658 private void addToken(int tokenType) {
659 addToken(zzStartRead, zzMarkedPos-1, tokenType);
660 }
661
662
663 /**
664 * Adds the token specified to the current linked list of tokens.
665 *
666 * @param tokenType The token's type.
667 */
668 private void addToken(int start, int end, int tokenType) {
669 int so = start + offsetShift;
670 addToken(zzBuffer, start,end, tokenType, so);
671 }
672
673
674 /**
675 * Adds the token specified to the current linked list of tokens.
676 *
677 * @param array The character array.
678 * @param start The starting offset in the array.
679 * @param end The ending offset in the array.
680 * @param tokenType The token's type.
681 * @param startOffset The offset in the document at which this token
682 * occurs.
683 */
684 public void addToken(char[] array, int start, int end, int tokenType, int startOffset) {
685 super.addToken(array, start,end, tokenType, startOffset);
686 zzStartRead = zzMarkedPos;
687 }
688
689
690 /**
691 * Returns the text to place at the beginning and end of a
692 * line to "comment" it in a this programming language.
693 *
694 * @return The start and end strings to add to a line to "comment"
695 * it out.
696 */
697 public String[] getLineCommentStartAndEnd() {
698 return new String[] { "//", null };
699 }
700
701
702 /**
703 * Returns the first token in the linked list of tokens generated
704 * from <code>text</code>. This method must be implemented by
705 * subclasses so they can correctly implement syntax highlighting.
706 *
707 * @param text The text from which to get tokens.
708 * @param initialTokenType The token type we should start with.
709 * @param startOffset The offset into the document at which
710 * <code>text</code> starts.
711 * @return The first <code>Token</code> in a linked list representing
712 * the syntax highlighted text.
713 */
714 public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
715
716 resetTokenList();
717 this.offsetShift = -text.offset + startOffset;
718
719 // Start off in the proper state.
720 int state = Token.NULL;
721
722 s = text;
723 try {
724 yyreset(zzReader);
725 yybegin(state);
726 return yylex();
727 } catch (IOException ioe) {
728 ioe.printStackTrace();
729 return new DefaultToken();
730 }
731
732 }
733
734
735 /**
736 * Refills the input buffer.
737 *
738 * @return <code>true</code> if EOF was reached, otherwise
739 * <code>false</code>.
740 * @exception IOException if any I/O-Error occurs.
741 */
742 private boolean zzRefill() throws java.io.IOException {
743 return zzCurrentPos>=s.offset+s.count;
744 }
745
746
747 /**
748 * Resets the scanner to read from a new input stream.
749 * Does not close the old reader.
750 *
751 * All internal variables are reset, the old input stream
752 * <b>cannot</b> be reused (internal buffer is discarded and lost).
753 * Lexical state is set to <tt>YY_INITIAL</tt>.
754 *
755 * @param reader the new input stream
756 */
757 public final void yyreset(java.io.Reader reader) throws java.io.IOException {
758 // 's' has been updated.
759 zzBuffer = s.array;
760 /*
761 * We replaced the line below with the two below it because zzRefill
762 * no longer "refills" the buffer (since the way we do it, it's always
763 * "full" the first time through, since it points to the segment's
764 * array). So, we assign zzEndRead here.
765 */
766 //zzStartRead = zzEndRead = s.offset;
767 zzStartRead = s.offset;
768 zzEndRead = zzStartRead + s.count - 1;
769 zzCurrentPos = zzMarkedPos = s.offset;
770 zzLexicalState = YYINITIAL;
771 zzReader = reader;
772 zzAtEOF = false;
773 }
774
775
776
777
778 /**
779 * Creates a new scanner
780 * There is also a java.io.InputStream version of this constructor.
781 *
782 * @param in the java.io.Reader to read input from.
783 */
784 public TclTokenMaker(java.io.Reader in) {
785 this.zzReader = in;
786 }
787
788 /**
789 * Creates a new scanner.
790 * There is also java.io.Reader version of this constructor.
791 *
792 * @param in the java.io.Inputstream to read input from.
793 */
794 public TclTokenMaker(java.io.InputStream in) {
795 this(new java.io.InputStreamReader(in));
796 }
797
798 /**
799 * Unpacks the compressed character translation table.
800 *
801 * @param packed the packed character translation table
802 * @return the unpacked character translation table
803 */
804 private static char [] zzUnpackCMap(String packed) {
805 char [] map = new char[0x10000];
806 int i = 0; /* index in packed string */
807 int j = 0; /* index in unpacked array */
808 while (i < 160) {
809 int count = packed.charAt(i++);
810 char value = packed.charAt(i++);
811 do map[j++] = value; while (--count > 0);
812 }
813 return map;
814 }
815
816
817 /**
818 * Closes the input stream.
819 */
820 public final void yyclose() throws java.io.IOException {
821 zzAtEOF = true; /* indicate end of file */
822 zzEndRead = zzStartRead; /* invalidate buffer */
823
824 if (zzReader != null)
825 zzReader.close();
826 }
827
828
829 /**
830 * Returns the current lexical state.
831 */
832 public final int yystate() {
833 return zzLexicalState;
834 }
835
836
837 /**
838 * Enters a new lexical state
839 *
840 * @param newState the new lexical state
841 */
842 public final void yybegin(int newState) {
843 zzLexicalState = newState;
844 }
845
846
847 /**
848 * Returns the text matched by the current regular expression.
849 */
850 public final String yytext() {
851 return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
852 }
853
854
855 /**
856 * Returns the character at position <tt>pos</tt> from the
857 * matched text.
858 *
859 * It is equivalent to yytext().charAt(pos), but faster
860 *
861 * @param pos the position of the character to fetch.
862 * A value from 0 to yylength()-1.
863 *
864 * @return the character at position pos
865 */
866 public final char yycharat(int pos) {
867 return zzBuffer[zzStartRead+pos];
868 }
869
870
871 /**
872 * Returns the length of the matched text region.
873 */
874 public final int yylength() {
875 return zzMarkedPos-zzStartRead;
876 }
877
878
879 /**
880 * Reports an error that occured while scanning.
881 *
882 * In a wellformed scanner (no or only correct usage of
883 * yypushback(int) and a match-all fallback rule) this method
884 * will only be called with things that "Can't Possibly Happen".
885 * If this method is called, something is seriously wrong
886 * (e.g. a JFlex bug producing a faulty scanner etc.).
887 *
888 * Usual syntax/scanner level error handling should be done
889 * in error fallback rules.
890 *
891 * @param errorCode the code of the errormessage to display
892 */
893 private void zzScanError(int errorCode) {
894 String message;
895 try {
896 message = ZZ_ERROR_MSG[errorCode];
897 }
898 catch (ArrayIndexOutOfBoundsException e) {
899 message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
900 }
901
902 throw new Error(message);
903 }
904
905
906 /**
907 * Pushes the specified amount of characters back into the input stream.
908 *
909 * They will be read again by then next call of the scanning method
910 *
911 * @param number the number of characters to be read again.
912 * This number must not be greater than yylength()!
913 */
914 public void yypushback(int number) {
915 if ( number > yylength() )
916 zzScanError(ZZ_PUSHBACK_2BIG);
917
918 zzMarkedPos -= number;
919 }
920
921
922 /**
923 * Resumes scanning until the next regular expression is matched,
924 * the end of input is encountered or an I/O-Error occurs.
925 *
926 * @return the next token
927 * @exception java.io.IOException if any I/O-Error occurs
928 */
929 public org.fife.ui.rsyntaxtextarea.Token yylex() throws java.io.IOException {
930 int zzInput;
931 int zzAction;
932
933 // cached fields:
934 int zzCurrentPosL;
935 int zzMarkedPosL;
936 int zzEndReadL = zzEndRead;
937 char [] zzBufferL = zzBuffer;
938 char [] zzCMapL = ZZ_CMAP;
939
940 int [] zzTransL = ZZ_TRANS;
941 int [] zzRowMapL = ZZ_ROWMAP;
942 int [] zzAttrL = ZZ_ATTRIBUTE;
943
944 while (true) {
945 zzMarkedPosL = zzMarkedPos;
946
947 zzAction = -1;
948
949 zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
950
951 zzState = zzLexicalState;
952
953
954 zzForAction: {
955 while (true) {
956
957 if (zzCurrentPosL < zzEndReadL)
958 zzInput = zzBufferL[zzCurrentPosL++];
959 else if (zzAtEOF) {
960 zzInput = YYEOF;
961 break zzForAction;
962 }
963 else {
964 // store back cached positions
965 zzCurrentPos = zzCurrentPosL;
966 zzMarkedPos = zzMarkedPosL;
967 boolean eof = zzRefill();
968 // get translated positions and possibly new buffer
969 zzCurrentPosL = zzCurrentPos;
970 zzMarkedPosL = zzMarkedPos;
971 zzBufferL = zzBuffer;
972 zzEndReadL = zzEndRead;
973 if (eof) {
974 zzInput = YYEOF;
975 break zzForAction;
976 }
977 else {
978 zzInput = zzBufferL[zzCurrentPosL++];
979 }
980 }
981 int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
982 if (zzNext == -1) break zzForAction;
983 zzState = zzNext;
984
985 int zzAttributes = zzAttrL[zzState];
986 if ( (zzAttributes & 1) == 1 ) {
987 zzAction = zzState;
988 zzMarkedPosL = zzCurrentPosL;
989 if ( (zzAttributes & 8) == 8 ) break zzForAction;
990 }
991
992 }
993 }
994
995 // store back cached position
996 zzMarkedPos = zzMarkedPosL;
997
998 switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
999 case 14:
1000 { addToken(Token.RESERVED_WORD);
1001 }
1002 case 15: break;
1003 case 2:
1004 { addToken(Token.IDENTIFIER);
1005 }
1006 case 16: break;
1007 case 13:
1008 { addToken(Token.LITERAL_STRING_DOUBLE_QUOTE);
1009 }
1010 case 17: break;
1011 case 11:
1012 { addToken(Token.LITERAL_NUMBER_FLOAT);
1013 }
1014 case 18: break;
1015 case 4:
1016 { addToken(Token.COMMENT_EOL); addNullToken(); return firstToken;
1017 }
1018 case 19: break;
1019 case 6:
1020 { addToken(Token.WHITESPACE);
1021 }
1022 case 20: break;
1023 case 10:
1024 { addToken(Token.ERROR_NUMBER_FORMAT);
1025 }
1026 case 21: break;
1027 case 1:
1028 { addToken(Token.ERROR_IDENTIFIER);
1029 }
1030 case 22: break;
1031 case 12:
1032 { addToken(Token.LITERAL_NUMBER_HEXADECIMAL);
1033 }
1034 case 23: break;
1035 case 8:
1036 { addToken(Token.OPERATOR);
1037 }
1038 case 24: break;
1039 case 3:
1040 { addToken(Token.LITERAL_NUMBER_DECIMAL_INT);
1041 }
1042 case 25: break;
1043 case 7:
1044 { addToken(Token.ERROR_STRING_DOUBLE); addNullToken(); return firstToken;
1045 }
1046 case 26: break;
1047 case 5:
1048 { addNullToken(); return firstToken;
1049 }
1050 case 27: break;
1051 case 9:
1052 { addToken(Token.SEPARATOR);
1053 }
1054 case 28: break;
1055 default:
1056 if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
1057 zzAtEOF = true;
1058 switch (zzLexicalState) {
1059 case YYINITIAL: {
1060 addNullToken(); return firstToken;
1061 }
1062 case 242: break;
1063 default:
1064 return null;
1065 }
1066 }
1067 else {
1068 zzScanError(ZZ_NO_MATCH);
1069 }
1070 }
1071 }
1072 }
1073
1074
1075}
Note: See TracBrowser for help on using the repository browser.