source: other-projects/rsyntax-textarea/src/java/org/fife/ui/rsyntaxtextarea/modes/FortranTokenMaker.flex@ 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: 19.3 KB
Line 
1/*
2 * 03/23/2005
3 *
4 * FortranTokenMaker.java - Scanner for the Fortran programming language.
5 *
6 * This library is distributed under a modified BSD license. See the included
7 * RSyntaxTextArea.License.txt file for details.
8 */
9package org.fife.ui.rsyntaxtextarea.modes;
10
11import java.io.*;
12import javax.swing.text.Segment;
13
14import org.fife.ui.rsyntaxtextarea.*;
15
16
17/**
18 * Scanner for the Fortran programming language.
19 *
20 * This implementation was created using
21 * <a href="http://www.jflex.de/">JFlex</a> 1.4.1; however, the generated file
22 * was modified for performance. Memory allocation needs to be almost
23 * completely removed to be competitive with the handwritten lexers (subclasses
24 * of <code>AbstractTokenMaker</code>, so this class has been modified so that
25 * Strings are never allocated (via yytext()), and the scanner never has to
26 * worry about refilling its buffer (needlessly copying chars around).
27 * We can achieve this because RText always scans exactly 1 line of tokens at a
28 * time, and hands the scanner this line as an array of characters (a Segment
29 * really). Since tokens contain pointers to char arrays instead of Strings
30 * holding their contents, there is no need for allocating new memory for
31 * Strings.<p>
32 *
33 * The actual algorithm generated for scanning has, of course, not been
34 * modified.<p>
35 *
36 * If you wish to regenerate this file yourself, keep in mind the following:
37 * <ul>
38 * <li>The generated FortranTokenMaker.java</code> file will contain two
39 * definitions of both <code>zzRefill</code> and <code>yyreset</code>.
40 * You should hand-delete the second of each definition (the ones
41 * generated by the lexer), as these generated methods modify the input
42 * buffer, which we'll never have to do.</li>
43 * <li>You should also change the declaration/definition of zzBuffer to NOT
44 * be initialized. This is a needless memory allocation for us since we
45 * will be pointing the array somewhere else anyway.</li>
46 * <li>You should NOT call <code>yylex()</code> on the generated scanner
47 * directly; rather, you should use <code>getTokenList</code> as you would
48 * with any other <code>TokenMaker</code> instance.</li>
49 * </ul>
50 *
51 * @author Robert Futrell
52 * @version 0.4
53 *
54 */
55%%
56
57%public
58%class FortranTokenMaker
59%extends AbstractJFlexTokenMaker
60%implements TokenMaker
61%unicode
62%ignorecase
63%type org.fife.ui.rsyntaxtextarea.Token
64
65
66%{
67
68
69 /**
70 * Constructor. We must have this here as there is no default,
71 * no-parameter constructor generated by JFlex.
72 */
73 public FortranTokenMaker() {
74 super();
75 }
76
77
78 /**
79 * Adds the token specified to the current linked list of tokens.
80 *
81 * @param tokenType The token's type.
82 */
83 private void addToken(int tokenType) {
84 addToken(zzStartRead, zzMarkedPos-1, tokenType);
85 }
86
87
88 /**
89 * Adds the token specified to the current linked list of tokens.
90 *
91 * @param tokenType The token's type.
92 */
93 private void addToken(int start, int end, int tokenType) {
94 int so = start + offsetShift;
95 addToken(zzBuffer, start,end, tokenType, so);
96 }
97
98
99 /**
100 * Adds the token specified to the current linked list of tokens.
101 *
102 * @param array The character array.
103 * @param start The starting offset in the array.
104 * @param end The ending offset in the array.
105 * @param tokenType The token's type.
106 * @param startOffset The offset in the document at which this token
107 * occurs.
108 */
109 public void addToken(char[] array, int start, int end, int tokenType, int startOffset) {
110 super.addToken(array, start,end, tokenType, startOffset);
111 zzStartRead = zzMarkedPos;
112 }
113
114
115 /**
116 * Returns the text to place at the beginning and end of a
117 * line to "comment" it in a this programming language.
118 *
119 * @return The start and end strings to add to a line to "comment"
120 * it out.
121 */
122 public String[] getLineCommentStartAndEnd() {
123 return new String[] { "!", null };
124 }
125
126
127 /**
128 * Returns the first token in the linked list of tokens generated
129 * from <code>text</code>. This method must be implemented by
130 * subclasses so they can correctly implement syntax highlighting.
131 *
132 * @param text The text from which to get tokens.
133 * @param initialTokenType The token type we should start with.
134 * @param startOffset The offset into the document at which
135 * <code>text</code> starts.
136 * @return The first <code>Token</code> in a linked list representing
137 * the syntax highlighted text.
138 */
139 public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
140
141 resetTokenList();
142 this.offsetShift = -text.offset + startOffset;
143
144 // Start off in the proper state.
145 int state = Token.NULL;
146 switch (initialTokenType) {
147 case Token.LITERAL_STRING_DOUBLE_QUOTE:
148 state = STRING;
149 start = text.offset;
150 break;
151 case Token.LITERAL_CHAR:
152 state = CHAR;
153 start = text.offset;
154 break;
155 default:
156 state = Token.NULL;
157 }
158
159 s = text;
160 try {
161 yyreset(zzReader);
162 yybegin(state);
163 return yylex();
164 } catch (IOException ioe) {
165 ioe.printStackTrace();
166 return new DefaultToken();
167 }
168
169 }
170
171
172 /**
173 * Refills the input buffer.
174 *
175 * @return <code>true</code> if EOF was reached, otherwise
176 * <code>false</code>.
177 * @exception IOException if any I/O-Error occurs.
178 */
179 private boolean zzRefill() throws java.io.IOException {
180 return zzCurrentPos>=s.offset+s.count;
181 }
182
183
184 /**
185 * Resets the scanner to read from a new input stream.
186 * Does not close the old reader.
187 *
188 * All internal variables are reset, the old input stream
189 * <b>cannot</b> be reused (internal buffer is discarded and lost).
190 * Lexical state is set to <tt>YY_INITIAL</tt>.
191 *
192 * @param reader the new input stream
193 */
194 public final void yyreset(java.io.Reader reader) throws java.io.IOException {
195 // 's' has been updated.
196 zzBuffer = s.array;
197 /*
198 * We replaced the line below with the two below it because zzRefill
199 * no longer "refills" the buffer (since the way we do it, it's always
200 * "full" the first time through, since it points to the segment's
201 * array). So, we assign zzEndRead here.
202 */
203 //zzStartRead = zzEndRead = s.offset;
204 zzStartRead = s.offset;
205 zzEndRead = zzStartRead + s.count - 1;
206 zzCurrentPos = zzMarkedPos = zzPushbackPos = s.offset;
207 zzLexicalState = YYINITIAL;
208 zzReader = reader;
209 zzAtBOL = true;
210 zzAtEOF = false;
211 }
212
213
214%}
215
216LineTerminator = (\n)
217WhiteSpace = ([ \t\f])
218
219Column1CommentBegin = ([C\*])
220Column1Comment2Begin = (D)
221AnywhereCommentBegin = (\!)
222
223Identifier = ([A-Za-z0-9_$]+)
224
225StringDelimiter = (\")
226CharDelimiter = (\')
227
228Operators1 = ("<"|">"|"<="|">="|"&"|"/="|"==")
229Operators2 = (\.(lt|gt|eq|ne|le|ge|and|or)\.)
230Operator = ({Operators1}|{Operators2})
231
232Boolean = (\.(true|false)\.)
233
234%state STRING
235%state CHAR
236
237%%
238
239/* Keywords */
240<YYINITIAL> "INCLUDE" { addToken(Token.RESERVED_WORD); }
241<YYINITIAL> "PROGRAM" { addToken(Token.RESERVED_WORD); }
242<YYINITIAL> "MODULE" { addToken(Token.RESERVED_WORD); }
243<YYINITIAL> "SUBROUTINE" { addToken(Token.RESERVED_WORD); }
244<YYINITIAL> "FUNCTION" { addToken(Token.RESERVED_WORD); }
245<YYINITIAL> "CONTAINS" { addToken(Token.RESERVED_WORD); }
246<YYINITIAL> "USE" { addToken(Token.RESERVED_WORD); }
247<YYINITIAL> "CALL" { addToken(Token.RESERVED_WORD); }
248<YYINITIAL> "RETURN" { addToken(Token.RESERVED_WORD); }
249<YYINITIAL> "IMPLICIT" { addToken(Token.RESERVED_WORD); }
250<YYINITIAL> "EXPLICIT" { addToken(Token.RESERVED_WORD); }
251<YYINITIAL> "NONE" { addToken(Token.RESERVED_WORD); }
252<YYINITIAL> "DATA" { addToken(Token.RESERVED_WORD); }
253<YYINITIAL> "PARAMETER" { addToken(Token.RESERVED_WORD); }
254<YYINITIAL> "ALLOCATE" { addToken(Token.RESERVED_WORD); }
255<YYINITIAL> "ALLOCATABLE" { addToken(Token.RESERVED_WORD); }
256<YYINITIAL> "ALLOCATED" { addToken(Token.RESERVED_WORD); }
257<YYINITIAL> "DEALLOCATE" { addToken(Token.RESERVED_WORD); }
258<YYINITIAL> "INTEGER" { addToken(Token.RESERVED_WORD); }
259<YYINITIAL> "REAL" { addToken(Token.RESERVED_WORD); }
260<YYINITIAL> "DOUBLE" { addToken(Token.RESERVED_WORD); }
261<YYINITIAL> "PRECISION" { addToken(Token.RESERVED_WORD); }
262<YYINITIAL> "COMPLEX" { addToken(Token.RESERVED_WORD); }
263<YYINITIAL> "LOGICAL" { addToken(Token.RESERVED_WORD); }
264<YYINITIAL> "CHARACTER" { addToken(Token.RESERVED_WORD); }
265<YYINITIAL> "DIMENSION" { addToken(Token.RESERVED_WORD); }
266<YYINITIAL> "KIND" { addToken(Token.RESERVED_WORD); }
267<YYINITIAL> "CASE" { addToken(Token.RESERVED_WORD); }
268<YYINITIAL> "SELECT" { addToken(Token.RESERVED_WORD); }
269<YYINITIAL> "DEFAULT" { addToken(Token.RESERVED_WORD); }
270<YYINITIAL> "CONTINUE" { addToken(Token.RESERVED_WORD); }
271<YYINITIAL> "CYCLE" { addToken(Token.RESERVED_WORD); }
272<YYINITIAL> "DO" { addToken(Token.RESERVED_WORD); }
273<YYINITIAL> "WHILE" { addToken(Token.RESERVED_WORD); }
274<YYINITIAL> "ELSE" { addToken(Token.RESERVED_WORD); }
275<YYINITIAL> "IF" { addToken(Token.RESERVED_WORD); }
276<YYINITIAL> "ELSEIF" { addToken(Token.RESERVED_WORD); }
277<YYINITIAL> "THEN" { addToken(Token.RESERVED_WORD); }
278<YYINITIAL> "ELSEWHERE" { addToken(Token.RESERVED_WORD); }
279<YYINITIAL> "END" { addToken(Token.RESERVED_WORD); }
280<YYINITIAL> "ENDIF" { addToken(Token.RESERVED_WORD); }
281<YYINITIAL> "ENDDO" { addToken(Token.RESERVED_WORD); }
282<YYINITIAL> "FORALL" { addToken(Token.RESERVED_WORD); }
283<YYINITIAL> "WHERE" { addToken(Token.RESERVED_WORD); }
284<YYINITIAL> "EXIT" { addToken(Token.RESERVED_WORD); }
285<YYINITIAL> "GOTO" { addToken(Token.RESERVED_WORD); }
286<YYINITIAL> "PAUSE" { addToken(Token.RESERVED_WORD); }
287<YYINITIAL> "STOP" { addToken(Token.RESERVED_WORD); }
288<YYINITIAL> "BACKSPACE" { addToken(Token.RESERVED_WORD); }
289<YYINITIAL> "CLOSE" { addToken(Token.RESERVED_WORD); }
290<YYINITIAL> "ENDFILE" { addToken(Token.RESERVED_WORD); }
291<YYINITIAL> "INQUIRE" { addToken(Token.RESERVED_WORD); }
292<YYINITIAL> "OPEN" { addToken(Token.RESERVED_WORD); }
293<YYINITIAL> "PRINT" { addToken(Token.RESERVED_WORD); }
294<YYINITIAL> "READ" { addToken(Token.RESERVED_WORD); }
295<YYINITIAL> "REWIND" { addToken(Token.RESERVED_WORD); }
296<YYINITIAL> "WRITE" { addToken(Token.RESERVED_WORD); }
297<YYINITIAL> "FORMAT" { addToken(Token.RESERVED_WORD); }
298<YYINITIAL> "AIMAG" { addToken(Token.RESERVED_WORD); }
299<YYINITIAL> "AINT" { addToken(Token.RESERVED_WORD); }
300<YYINITIAL> "AMAX0" { addToken(Token.RESERVED_WORD); }
301<YYINITIAL> "AMIN0" { addToken(Token.RESERVED_WORD); }
302<YYINITIAL> "ANINT" { addToken(Token.RESERVED_WORD); }
303<YYINITIAL> "CEILING" { addToken(Token.RESERVED_WORD); }
304<YYINITIAL> "CMPLX" { addToken(Token.RESERVED_WORD); }
305<YYINITIAL> "CONJG" { addToken(Token.RESERVED_WORD); }
306<YYINITIAL> "DBLE" { addToken(Token.RESERVED_WORD); }
307<YYINITIAL> "DCMPLX" { addToken(Token.RESERVED_WORD); }
308<YYINITIAL> "DFLOAT" { addToken(Token.RESERVED_WORD); }
309<YYINITIAL> "DIM" { addToken(Token.RESERVED_WORD); }
310<YYINITIAL> "DPROD" { addToken(Token.RESERVED_WORD); }
311<YYINITIAL> "FLOAT" { addToken(Token.RESERVED_WORD); }
312<YYINITIAL> "FLOOR" { addToken(Token.RESERVED_WORD); }
313<YYINITIAL> "IFIX" { addToken(Token.RESERVED_WORD); }
314<YYINITIAL> "IMAG" { addToken(Token.RESERVED_WORD); }
315<YYINITIAL> "INT" { addToken(Token.RESERVED_WORD); }
316<YYINITIAL> "LOGICAL" { addToken(Token.RESERVED_WORD); }
317<YYINITIAL> "MODULO" { addToken(Token.RESERVED_WORD); }
318<YYINITIAL> "NINT" { addToken(Token.RESERVED_WORD); }
319<YYINITIAL> "REAL" { addToken(Token.RESERVED_WORD); }
320<YYINITIAL> "SIGN" { addToken(Token.RESERVED_WORD); }
321<YYINITIAL> "SNGL" { addToken(Token.RESERVED_WORD); }
322<YYINITIAL> "TRANSFER" { addToken(Token.RESERVED_WORD); }
323<YYINITIAL> "ZEXT" { addToken(Token.RESERVED_WORD); }
324<YYINITIAL> "ABS" { addToken(Token.RESERVED_WORD); }
325<YYINITIAL> "ACOS" { addToken(Token.RESERVED_WORD); }
326<YYINITIAL> "AIMAG" { addToken(Token.RESERVED_WORD); }
327<YYINITIAL> "AINT" { addToken(Token.RESERVED_WORD); }
328<YYINITIAL> "ALOG" { addToken(Token.RESERVED_WORD); }
329<YYINITIAL> "ALOG10" { addToken(Token.RESERVED_WORD); }
330<YYINITIAL> "AMAX0" { addToken(Token.RESERVED_WORD); }
331<YYINITIAL> "AMAX1" { addToken(Token.RESERVED_WORD); }
332<YYINITIAL> "AMIN0" { addToken(Token.RESERVED_WORD); }
333<YYINITIAL> "AMIN1" { addToken(Token.RESERVED_WORD); }
334<YYINITIAL> "AMOD" { addToken(Token.RESERVED_WORD); }
335<YYINITIAL> "ANINT" { addToken(Token.RESERVED_WORD); }
336<YYINITIAL> "ASIN" { addToken(Token.RESERVED_WORD); }
337<YYINITIAL> "ATAN" { addToken(Token.RESERVED_WORD); }
338<YYINITIAL> "ATAN2" { addToken(Token.RESERVED_WORD); }
339<YYINITIAL> "CABS" { addToken(Token.RESERVED_WORD); }
340<YYINITIAL> "CCOS" { addToken(Token.RESERVED_WORD); }
341<YYINITIAL> "CHAR" { addToken(Token.RESERVED_WORD); }
342<YYINITIAL> "CLOG" { addToken(Token.RESERVED_WORD); }
343<YYINITIAL> "CMPLX" { addToken(Token.RESERVED_WORD); }
344<YYINITIAL> "CONJG" { addToken(Token.RESERVED_WORD); }
345<YYINITIAL> "COS" { addToken(Token.RESERVED_WORD); }
346<YYINITIAL> "COSH" { addToken(Token.RESERVED_WORD); }
347<YYINITIAL> "CSIN" { addToken(Token.RESERVED_WORD); }
348<YYINITIAL> "CSQRT" { addToken(Token.RESERVED_WORD); }
349<YYINITIAL> "DABS" { addToken(Token.RESERVED_WORD); }
350<YYINITIAL> "DACOS" { addToken(Token.RESERVED_WORD); }
351<YYINITIAL> "DASIN" { addToken(Token.RESERVED_WORD); }
352<YYINITIAL> "DATAN" { addToken(Token.RESERVED_WORD); }
353<YYINITIAL> "DATAN2" { addToken(Token.RESERVED_WORD); }
354<YYINITIAL> "DBLE" { addToken(Token.RESERVED_WORD); }
355<YYINITIAL> "DCOS" { addToken(Token.RESERVED_WORD); }
356<YYINITIAL> "DCOSH" { addToken(Token.RESERVED_WORD); }
357<YYINITIAL> "DDIM" { addToken(Token.RESERVED_WORD); }
358<YYINITIAL> "DEXP" { addToken(Token.RESERVED_WORD); }
359<YYINITIAL> "DIM" { addToken(Token.RESERVED_WORD); }
360<YYINITIAL> "DINT" { addToken(Token.RESERVED_WORD); }
361<YYINITIAL> "DLOG" { addToken(Token.RESERVED_WORD); }
362<YYINITIAL> "DLOG10" { addToken(Token.RESERVED_WORD); }
363<YYINITIAL> "DMAX1" { addToken(Token.RESERVED_WORD); }
364<YYINITIAL> "DMIN1" { addToken(Token.RESERVED_WORD); }
365<YYINITIAL> "DMOD" { addToken(Token.RESERVED_WORD); }
366<YYINITIAL> "DNINT" { addToken(Token.RESERVED_WORD); }
367<YYINITIAL> "DPROD" { addToken(Token.RESERVED_WORD); }
368<YYINITIAL> "DREAL" { addToken(Token.RESERVED_WORD); }
369<YYINITIAL> "DSIGN" { addToken(Token.RESERVED_WORD); }
370<YYINITIAL> "DSIN" { addToken(Token.RESERVED_WORD); }
371<YYINITIAL> "DSINH" { addToken(Token.RESERVED_WORD); }
372<YYINITIAL> "DSQRT" { addToken(Token.RESERVED_WORD); }
373<YYINITIAL> "DTAN" { addToken(Token.RESERVED_WORD); }
374<YYINITIAL> "DTANH" { addToken(Token.RESERVED_WORD); }
375<YYINITIAL> "EXP" { addToken(Token.RESERVED_WORD); }
376<YYINITIAL> "FLOAT" { addToken(Token.RESERVED_WORD); }
377<YYINITIAL> "IABS" { addToken(Token.RESERVED_WORD); }
378<YYINITIAL> "ICHAR" { addToken(Token.RESERVED_WORD); }
379<YYINITIAL> "IDIM" { addToken(Token.RESERVED_WORD); }
380<YYINITIAL> "IDINT" { addToken(Token.RESERVED_WORD); }
381<YYINITIAL> "IDNINT" { addToken(Token.RESERVED_WORD); }
382<YYINITIAL> "IFIX" { addToken(Token.RESERVED_WORD); }
383<YYINITIAL> "INDEX" { addToken(Token.RESERVED_WORD); }
384<YYINITIAL> "INT" { addToken(Token.RESERVED_WORD); }
385<YYINITIAL> "ISIGN" { addToken(Token.RESERVED_WORD); }
386<YYINITIAL> "LEN" { addToken(Token.RESERVED_WORD); }
387<YYINITIAL> "LGE" { addToken(Token.RESERVED_WORD); }
388<YYINITIAL> "LGT" { addToken(Token.RESERVED_WORD); }
389<YYINITIAL> "LLE" { addToken(Token.RESERVED_WORD); }
390<YYINITIAL> "LLT" { addToken(Token.RESERVED_WORD); }
391<YYINITIAL> "LOG" { addToken(Token.RESERVED_WORD); }
392<YYINITIAL> "LOG10" { addToken(Token.RESERVED_WORD); }
393<YYINITIAL> "MAX" { addToken(Token.RESERVED_WORD); }
394<YYINITIAL> "MAX0" { addToken(Token.RESERVED_WORD); }
395<YYINITIAL> "MAX1" { addToken(Token.RESERVED_WORD); }
396<YYINITIAL> "MIN" { addToken(Token.RESERVED_WORD); }
397<YYINITIAL> "MIN0" { addToken(Token.RESERVED_WORD); }
398<YYINITIAL> "MIN1" { addToken(Token.RESERVED_WORD); }
399<YYINITIAL> "MOD" { addToken(Token.RESERVED_WORD); }
400<YYINITIAL> "NINT" { addToken(Token.RESERVED_WORD); }
401<YYINITIAL> "REAL" { addToken(Token.RESERVED_WORD); }
402<YYINITIAL> "SIGN" { addToken(Token.RESERVED_WORD); }
403<YYINITIAL> "SIN" { addToken(Token.RESERVED_WORD); }
404<YYINITIAL> "SINH" { addToken(Token.RESERVED_WORD); }
405<YYINITIAL> "SNGL" { addToken(Token.RESERVED_WORD); }
406<YYINITIAL> "SQRT" { addToken(Token.RESERVED_WORD); }
407<YYINITIAL> "TAN" { addToken(Token.RESERVED_WORD); }
408<YYINITIAL> "TANH" { addToken(Token.RESERVED_WORD); }
409
410<YYINITIAL> {
411
412 {LineTerminator} { addNullToken(); return firstToken; }
413
414 {WhiteSpace}+ { addToken(Token.WHITESPACE); }
415
416 /* String/Character Literals. */
417 {CharDelimiter} { start = zzMarkedPos-1; yybegin(CHAR); }
418 {StringDelimiter} { start = zzMarkedPos-1; yybegin(STRING); }
419
420 /* Comment Literals. */
421 /* Note that we cannot combine these as JFLex doesn't like combining an */
422 /* expression containing the beginning-of-line character '^'. */
423 {Column1CommentBegin} {
424 // Since we change zzStartRead, we have the unfortunate
425 // side-effect of not being able to use the '^' operator.
426 // So we must check whether we're really at the beginning
427 // of the line ourselves...
428 if (zzStartRead==s.offset) {
429 addToken(zzStartRead,zzEndRead, Token.COMMENT_EOL);
430 addNullToken();
431 return firstToken;
432 }
433 else {
434 addToken(Token.IDENTIFIER);
435 }
436 }
437 {Column1Comment2Begin} {
438 // Since we change zzStartRead, we have the unfortunate
439 // side-effect of not being able to use the '^' operator.
440 // So we must check whether we're really at the beginning
441 // of the line ourselves...
442 if (zzStartRead==s.offset) {
443 addToken(zzStartRead,zzEndRead, Token.COMMENT_DOCUMENTATION);
444 addNullToken();
445 return firstToken;
446 }
447 else {
448 addToken(Token.IDENTIFIER);
449 }
450 }
451 {AnywhereCommentBegin} { addToken(zzStartRead,zzEndRead, Token.COMMENT_EOL); addNullToken(); return firstToken; }
452
453 /* Operators. */
454 {Operator} { addToken(Token.OPERATOR); }
455
456 /* Boolean literals. */
457 {Boolean} { addToken(Token.LITERAL_BOOLEAN); }
458
459 {Identifier} { addToken(Token.IDENTIFIER); }
460
461 /* Ended with a line not in a string or char literal. */
462 <<EOF>> { addNullToken(); return firstToken; }
463
464 /* Catch any other (unhandled) characters. */
465 . { addToken(Token.IDENTIFIER); }
466
467}
468
469<CHAR> {
470 [^\'\n]* {}
471 \' { yybegin(YYINITIAL); addToken(start,zzStartRead, Token.LITERAL_CHAR); }
472 \n { addToken(start,zzStartRead-1, Token.LITERAL_CHAR); return firstToken; }
473 <<EOF>> { addToken(start,zzStartRead-1, Token.LITERAL_CHAR); return firstToken; }
474}
475
476<STRING> {
477 [^\"\n]* {}
478 \" { yybegin(YYINITIAL); addToken(start,zzStartRead, Token.LITERAL_STRING_DOUBLE_QUOTE); }
479 \n { addToken(start,zzStartRead-1, Token.LITERAL_STRING_DOUBLE_QUOTE); return firstToken; }
480 <<EOF>> { addToken(start,zzStartRead-1, Token.LITERAL_STRING_DOUBLE_QUOTE); return firstToken; }
481}
Note: See TracBrowser for help on using the repository browser.