~ubuntu-branches/ubuntu/vivid/drmips/vivid-backports

« back to all changes in this revision

Viewing changes to src/pc/DrMIPS/src/org/fife/ui/rsyntaxtextarea/modes/CTokenMaker.flex

  • Committer: Package Import Robot
  • Author(s): Bruno Nova
  • Date: 2014-09-27 12:24:17 UTC
  • Revision ID: package-import@ubuntu.com-20140927122417-2gadkwt9k0u7j4zu
Tags: upstream-1.2.3
Import upstream version 1.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * 11/13/2004
 
3
 *
 
4
 * CTokenMaker.java - An object that can take a chunk of text and
 
5
 * return a linked list of tokens representing it in the C programming
 
6
 * language.
 
7
 * 
 
8
 * This library is distributed under a modified BSD license.  See the included
 
9
 * RSyntaxTextArea.License.txt file for details.
 
10
 */
 
11
package org.fife.ui.rsyntaxtextarea.modes;
 
12
 
 
13
import java.io.*;
 
14
import javax.swing.text.Segment;
 
15
 
 
16
import org.fife.ui.rsyntaxtextarea.*;
 
17
 
 
18
 
 
19
/**
 
20
 * Scanner for the C programming language.
 
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 <code>CTokenMaker.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
%%
 
58
 
 
59
%public
 
60
%class CTokenMaker
 
61
%extends AbstractJFlexCTokenMaker
 
62
%unicode
 
63
%type org.fife.ui.rsyntaxtextarea.Token
 
64
 
 
65
 
 
66
%{
 
67
 
 
68
 
 
69
        /**
 
70
         * Constructor.  This must be here because JFlex does not generate a
 
71
         * no-parameter constructor.
 
72
         */
 
73
        public CTokenMaker() {
 
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
         * @see #addToken(int, int, int)
 
83
         */
 
84
        private void addHyperlinkToken(int start, int end, int tokenType) {
 
85
                int so = start + offsetShift;
 
86
                addToken(zzBuffer, start,end, tokenType, so, true);
 
87
        }
 
88
 
 
89
 
 
90
        /**
 
91
         * Adds the token specified to the current linked list of tokens.
 
92
         *
 
93
         * @param tokenType The token's type.
 
94
         */
 
95
        private void addToken(int tokenType) {
 
96
                addToken(zzStartRead, zzMarkedPos-1, tokenType);
 
97
        }
 
98
 
 
99
 
 
100
        /**
 
101
         * Adds the token specified to the current linked list of tokens.
 
102
         *
 
103
         * @param tokenType The token's type.
 
104
         */
 
105
        private void addToken(int start, int end, int tokenType) {
 
106
                int so = start + offsetShift;
 
107
                addToken(zzBuffer, start,end, tokenType, so);
 
108
        }
 
109
 
 
110
 
 
111
        /**
 
112
         * Adds the token specified to the current linked list of tokens.
 
113
         *
 
114
         * @param array The character array.
 
115
         * @param start The starting offset in the array.
 
116
         * @param end The ending offset in the array.
 
117
         * @param tokenType The token's type.
 
118
         * @param startOffset The offset in the document at which this token
 
119
         *                    occurs.
 
120
         */
 
121
        @Override
 
122
        public void addToken(char[] array, int start, int end, int tokenType, int startOffset) {
 
123
                super.addToken(array, start,end, tokenType, startOffset);
 
124
                zzStartRead = zzMarkedPos;
 
125
        }
 
126
 
 
127
 
 
128
        /**
 
129
         * Returns the text to place at the beginning and end of a
 
130
         * line to "comment" it in a this programming language.
 
131
         *
 
132
         * @return The start and end strings to add to a line to "comment"
 
133
         *         it out.
 
134
         */
 
135
        @Override
 
136
        public String[] getLineCommentStartAndEnd() {
 
137
                return new String[] { "//", null };
 
138
        }
 
139
 
 
140
 
 
141
        /**
 
142
         * Returns the first token in the linked list of tokens generated
 
143
         * from <code>text</code>.  This method must be implemented by
 
144
         * subclasses so they can correctly implement syntax highlighting.
 
145
         *
 
146
         * @param text The text from which to get tokens.
 
147
         * @param initialTokenType The token type we should start with.
 
148
         * @param startOffset The offset into the document at which
 
149
         *                    <code>text</code> starts.
 
150
         * @return The first <code>Token</code> in a linked list representing
 
151
         *         the syntax highlighted text.
 
152
         */
 
153
        public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
 
154
 
 
155
                resetTokenList();
 
156
                this.offsetShift = -text.offset + startOffset;
 
157
 
 
158
                // Start off in the proper state.
 
159
                int state = Token.NULL;
 
160
                switch (initialTokenType) {
 
161
                        case Token.COMMENT_MULTILINE:
 
162
                                state = MLC;
 
163
                                start = text.offset;
 
164
                                break;
 
165
                        default:
 
166
                                state = Token.NULL;
 
167
                }
 
168
 
 
169
                s = text;
 
170
                try {
 
171
                        yyreset(zzReader);
 
172
                        yybegin(state);
 
173
                        return yylex();
 
174
                } catch (IOException ioe) {
 
175
                        ioe.printStackTrace();
 
176
                        return new TokenImpl();
 
177
                }
 
178
 
 
179
        }
 
180
 
 
181
 
 
182
        /**
 
183
         * Refills the input buffer.
 
184
         *
 
185
         * @return      <code>true</code> if EOF was reached, otherwise
 
186
         *              <code>false</code>.
 
187
         * @exception   IOException  if any I/O-Error occurs.
 
188
         */
 
189
        private boolean zzRefill() throws java.io.IOException {
 
190
                return zzCurrentPos>=s.offset+s.count;
 
191
        }
 
192
 
 
193
 
 
194
        /**
 
195
         * Resets the scanner to read from a new input stream.
 
196
         * Does not close the old reader.
 
197
         *
 
198
         * All internal variables are reset, the old input stream 
 
199
         * <b>cannot</b> be reused (internal buffer is discarded and lost).
 
200
         * Lexical state is set to <tt>YY_INITIAL</tt>.
 
201
         *
 
202
         * @param reader   the new input stream 
 
203
         */
 
204
        public final void yyreset(java.io.Reader reader) throws java.io.IOException {
 
205
                // 's' has been updated.
 
206
                zzBuffer = s.array;
 
207
                /*
 
208
                 * We replaced the line below with the two below it because zzRefill
 
209
                 * no longer "refills" the buffer (since the way we do it, it's always
 
210
                 * "full" the first time through, since it points to the segment's
 
211
                 * array).  So, we assign zzEndRead here.
 
212
                 */
 
213
                //zzStartRead = zzEndRead = s.offset;
 
214
                zzStartRead = s.offset;
 
215
                zzEndRead = zzStartRead + s.count - 1;
 
216
                zzCurrentPos = zzMarkedPos = zzPushbackPos = s.offset;
 
217
                zzLexicalState = YYINITIAL;
 
218
                zzReader = reader;
 
219
                zzAtBOL  = true;
 
220
                zzAtEOF  = false;
 
221
        }
 
222
 
 
223
 
 
224
%}
 
225
 
 
226
Letter                          = [A-Za-z]
 
227
LetterOrUnderscore      = ({Letter}|[_])
 
228
Digit                           = [0-9]
 
229
HexDigit                        = {Digit}|[A-Fa-f]
 
230
OctalDigit                      = [0-7]
 
231
Exponent                        = [eE][+-]?{Digit}+
 
232
 
 
233
PreprocessorWord        = define|elif|else|endif|error|if|ifdef|ifndef|include|line|pragma|undef
 
234
 
 
235
Trigraph                                = ("??="|"??("|"??)"|"??/"|"??'"|"??<"|"??>"|"??!"|"??-")
 
236
 
 
237
OctEscape1                      = ([\\]{OctalDigit})
 
238
OctEscape2                      = ([\\]{OctalDigit}{OctalDigit})
 
239
OctEscape3                      = ([\\][0-3]{OctalDigit}{OctalDigit})
 
240
OctEscape                               = ({OctEscape1}|{OctEscape2}|{OctEscape3})
 
241
HexEscape                               = ([\\][xX]{HexDigit}{HexDigit})
 
242
 
 
243
AnyChrChr                                       = ([^\'\n\\])
 
244
Escape                                  = ([\\]([abfnrtv\'\"\?\\0]))
 
245
UnclosedCharLiteral                     = ([\']({Escape}|{OctEscape}|{HexEscape}|{Trigraph}|{AnyChrChr}))
 
246
CharLiteral                             = ({UnclosedCharLiteral}[\'])
 
247
ErrorUnclosedCharLiteral                = ([\'][^\'\n]*)
 
248
ErrorCharLiteral                        = (([\'][\'])|{ErrorUnclosedCharLiteral}[\'])
 
249
AnyStrChr                                       = ([^\"\n\\])
 
250
FalseTrigraph                           = (("?"(("?")*)[^\=\(\)\/\'\<\>\!\-\\\?\"\n])|("?"[\=\(\)\/\'\<\>\!\-]))
 
251
StringLiteral                           = ([\"]((((("?")*)({Escape}|{OctEscape}|{HexEscape}|{Trigraph}))|{FalseTrigraph}|{AnyStrChr})*)(("?")*)[\"])
 
252
UnclosedStringLiteral           = ([\"]([\\].|[^\\\"])*[^\"]?)
 
253
ErrorStringLiteral                      = ({UnclosedStringLiteral}[\"])
 
254
 
 
255
 
 
256
LineTerminator          = \n
 
257
WhiteSpace              = [ \t\f]
 
258
 
 
259
MLCBegin                        = "/*"
 
260
MLCEnd                  = "*/"
 
261
LineCommentBegin        = "//"
 
262
 
 
263
NonFloatSuffix          = (([uU][lL]?)|([lL][uU]?))
 
264
IntegerLiteral          = ({Digit}+{Exponent}?{NonFloatSuffix}?)
 
265
HexLiteral              = ("0"[xX]{HexDigit}+{NonFloatSuffix}?)
 
266
FloatLiteral            = ((({Digit}*[\.]{Digit}+)|({Digit}+[\.]{Digit}*)){Exponent}?[fFlL]?)
 
267
ErrorNumberFormat       = (({IntegerLiteral}|{HexLiteral}|{FloatLiteral}){NonSeparator}+)
 
268
 
 
269
NonSeparator            = ([^\t\f\r\n\ \(\)\{\}\[\]\;\,\.\=\>\<\!\~\?\:\+\-\*\/\&\|\^\%\"\']|"#")
 
270
Identifier              = ({LetterOrUnderscore}({LetterOrUnderscore}|{Digit}|[$])*)
 
271
ErrorIdentifier = ({NonSeparator}+)
 
272
 
 
273
 
 
274
URLGenDelim                             = ([:\/\?#\[\]@])
 
275
URLSubDelim                             = ([\!\$&'\(\)\*\+,;=])
 
276
URLUnreserved                   = ({LetterOrUnderscore}|{Digit}|[\-\.\~])
 
277
URLCharacter                    = ({URLGenDelim}|{URLSubDelim}|{URLUnreserved}|[%])
 
278
URLCharacters                   = ({URLCharacter}*)
 
279
URLEndCharacter                 = ([\/\$]|{Letter}|{Digit})
 
280
URL                                             = (((https?|f(tp|ile))"://"|"www.")({URLCharacters}{URLEndCharacter})?)
 
281
 
 
282
%state MLC
 
283
%state EOL_COMMENT
 
284
 
 
285
%%
 
286
 
 
287
<YYINITIAL> {
 
288
 
 
289
        /* Keywords */
 
290
        "auto" |
 
291
        "break" |
 
292
        "case" |
 
293
        "const" |
 
294
        "continue" |
 
295
        "default" |
 
296
        "do" |
 
297
        "else" |
 
298
        "enum" |
 
299
        "extern" |
 
300
        "for" |
 
301
        "goto" |
 
302
        "if" |
 
303
        "register" |
 
304
        "return" |
 
305
        "sizeof" |
 
306
        "static" |
 
307
        "struct" |
 
308
        "switch" |
 
309
        "typedef" |
 
310
        "union" |
 
311
        "volatile" |
 
312
        "while"                                 { addToken(Token.RESERVED_WORD); }
 
313
 
 
314
        /* Data types. */
 
315
        "char" |
 
316
        "div_t" |
 
317
        "double" |
 
318
        "float" |
 
319
        "int" |
 
320
        "ldiv_t" |
 
321
        "long" |
 
322
        "short" |
 
323
        "signed" |
 
324
        "size_t" |
 
325
        "unsigned" |
 
326
        "void" |
 
327
        "wchar_t"                               { addToken(Token.DATA_TYPE); }
 
328
 
 
329
        /* Standard functions */
 
330
        "abort" |
 
331
        "abs" |
 
332
        "acos" |
 
333
        "asctime" |
 
334
        "asin" |
 
335
        "assert" |
 
336
        "atan2" |
 
337
        "atan" |
 
338
        "atexit" |
 
339
        "atof" |
 
340
        "atoi" |
 
341
        "atol" |
 
342
        "bsearch" |
 
343
        "btowc" |
 
344
        "calloc" |
 
345
        "ceil" |
 
346
        "clearerr" |
 
347
        "clock" |
 
348
        "cosh" |
 
349
        "cos" |
 
350
        "ctime" |
 
351
        "difftime" |
 
352
        "div" |
 
353
        "errno" |
 
354
        "exit" |
 
355
        "exp" |
 
356
        "fabs" |
 
357
        "fclose" |
 
358
        "feof" |
 
359
        "ferror" |
 
360
        "fflush" |
 
361
        "fgetc" |
 
362
        "fgetpos" |
 
363
        "fgetwc" |
 
364
        "fgets" |
 
365
        "fgetws" |
 
366
        "floor" |
 
367
        "fmod" |
 
368
        "fopen" |
 
369
        "fprintf" |
 
370
        "fputc" |
 
371
        "fputs" |
 
372
        "fputwc" |
 
373
        "fputws" |
 
374
        "fread" |
 
375
        "free" |
 
376
        "freopen" |
 
377
        "frexp" |
 
378
        "fscanf" |
 
379
        "fseek" |
 
380
        "fsetpos" |
 
381
        "ftell" |
 
382
        "fwprintf" |
 
383
        "fwrite" |
 
384
        "fwscanf" |
 
385
        "getchar" |
 
386
        "getc" |
 
387
        "getenv" |
 
388
        "gets" |
 
389
        "getwc" |
 
390
        "getwchar" |
 
391
        "gmtime" |
 
392
        "isalnum" |
 
393
        "isalpha" |
 
394
        "iscntrl" |
 
395
        "isdigit" |
 
396
        "isgraph" |
 
397
        "islower" |
 
398
        "isprint" |
 
399
        "ispunct" |
 
400
        "isspace" |
 
401
        "isupper" |
 
402
        "isxdigit" |
 
403
        "labs" |
 
404
        "ldexp" |
 
405
        "ldiv" |
 
406
        "localeconv" |
 
407
        "localtime" |
 
408
        "log10" |
 
409
        "log" |
 
410
        "longjmp" |
 
411
        "malloc" |
 
412
        "mblen" |
 
413
        "mbrlen" |
 
414
        "mbrtowc" |
 
415
        "mbsinit" |
 
416
        "mbsrtowcs" |
 
417
        "mbstowcs" |
 
418
        "mbtowc" |
 
419
        "memchr" |
 
420
        "memcmp" |
 
421
        "memcpy" |
 
422
        "memmove" |
 
423
        "memset" |
 
424
        "mktime" |
 
425
        "modf" |
 
426
        "offsetof" |
 
427
        "perror" |
 
428
        "pow" |
 
429
        "printf" |
 
430
        "putchar" |
 
431
        "putc" |
 
432
        "puts" |
 
433
        "putwc" |
 
434
        "putwchar" |
 
435
        "qsort" |
 
436
        "raise" |
 
437
        "rand" |
 
438
        "realloc" |
 
439
        "remove" |
 
440
        "rename" |
 
441
        "rewind" |
 
442
        "scanf" |
 
443
        "setbuf" |
 
444
        "setjmp" |
 
445
        "setlocale" |
 
446
        "setvbuf" |
 
447
        "setvbuf" |
 
448
        "signal" |
 
449
        "sinh" |
 
450
        "sin" |
 
451
        "sprintf" |
 
452
        "sqrt" |
 
453
        "srand" |
 
454
        "sscanf" |
 
455
        "strcat" |
 
456
        "strchr" |
 
457
        "strcmp" |
 
458
        "strcmp" |
 
459
        "strcoll" |
 
460
        "strcpy" |
 
461
        "strcspn" |
 
462
        "strerror" |
 
463
        "strftime" |
 
464
        "strlen" |
 
465
        "strncat" |
 
466
        "strncmp" |
 
467
        "strncpy" |
 
468
        "strpbrk" |
 
469
        "strrchr" |
 
470
        "strspn" |
 
471
        "strstr" |
 
472
        "strtod" |
 
473
        "strtok" |
 
474
        "strtol" |
 
475
        "strtoul" |
 
476
        "strxfrm" |
 
477
        "swprintf" |
 
478
        "swscanf" |
 
479
        "system" |
 
480
        "tanh" |
 
481
        "tan" |
 
482
        "time" |
 
483
        "tmpfile" |
 
484
        "tmpnam" |
 
485
        "tolower" |
 
486
        "toupper" |
 
487
        "ungetc" |
 
488
        "ungetwc" |
 
489
        "va_arg" |
 
490
        "va_end" |
 
491
        "va_start" |
 
492
        "vfprintf" |
 
493
        "vfwprintf" |
 
494
        "vprintf" |
 
495
        "vsprintf" |
 
496
        "vswprintf" |
 
497
        "vwprintf" |
 
498
        "wcrtomb" |
 
499
        "wcscat" |
 
500
        "wcschr" |
 
501
        "wcscmp" |
 
502
        "wcscoll" |
 
503
        "wcscpy" |
 
504
        "wcscspn" |
 
505
        "wcsftime" |
 
506
        "wcslen" |
 
507
        "wcsncat" |
 
508
        "wcsncmp" |
 
509
        "wcsncpy" |
 
510
        "wcspbrk" |
 
511
        "wcsrchr" |
 
512
        "wcsrtombs" |
 
513
        "wcsspn" |
 
514
        "wcsstr" |
 
515
        "wcstod" |
 
516
        "wcstok" |
 
517
        "wcstol" |
 
518
        "wcstombs" |
 
519
        "wcstoul" |
 
520
        "wcsxfrm" |
 
521
        "wctob" |
 
522
        "wctomb" |
 
523
        "wmemchr" |
 
524
        "wmemcmp" |
 
525
        "wmemcpy" |
 
526
        "wmemmove" |
 
527
        "wmemset" |
 
528
        "wprintf" |
 
529
        "wscanf"                                { addToken(Token.FUNCTION); }
 
530
 
 
531
        /* Standard-defined macros. */
 
532
        "__DATE__" |
 
533
        "__TIME__" |
 
534
        "__FILE__" |
 
535
        "__LINE__" |
 
536
        "__STDC__"                              { addToken(Token.PREPROCESSOR); }
 
537
 
 
538
        {LineTerminator}                                { addNullToken(); return firstToken; }
 
539
 
 
540
        {Identifier}                                    { addToken(Token.IDENTIFIER); }
 
541
 
 
542
        {WhiteSpace}+                                   { addToken(Token.WHITESPACE); }
 
543
 
 
544
        /* Preprocessor directives */
 
545
        "#"{WhiteSpace}*{PreprocessorWord}      { addToken(Token.PREPROCESSOR); }
 
546
 
 
547
        /* String/Character Literals. */
 
548
        {CharLiteral}                                   { addToken(Token.LITERAL_CHAR); }
 
549
        {UnclosedCharLiteral}                   { addToken(Token.ERROR_CHAR); /*addNullToken(); return firstToken;*/ }
 
550
        {ErrorUnclosedCharLiteral}              { addToken(Token.ERROR_CHAR); addNullToken(); return firstToken; }
 
551
        {ErrorCharLiteral}                              { addToken(Token.ERROR_CHAR); }
 
552
        {StringLiteral}                         { addToken(Token.LITERAL_STRING_DOUBLE_QUOTE); }
 
553
        {UnclosedStringLiteral}                 { addToken(Token.ERROR_STRING_DOUBLE); addNullToken(); return firstToken; }
 
554
        {ErrorStringLiteral}                    { addToken(Token.ERROR_STRING_DOUBLE); }
 
555
 
 
556
        /* Comment Literals. */
 
557
        {MLCBegin}                                      { start = zzMarkedPos-2; yybegin(MLC); }
 
558
        {LineCommentBegin}                      { start = zzMarkedPos-2; yybegin(EOL_COMMENT); }
 
559
 
 
560
        /* Separators. */
 
561
        "(" |
 
562
        ")" |
 
563
        "[" |
 
564
        "]" |
 
565
        "{" |
 
566
        "}"                                                     { addToken(Token.SEPARATOR); }
 
567
 
 
568
        /* Operators. */
 
569
        {Trigraph} |
 
570
        "=" |
 
571
        "+" |
 
572
        "-" |
 
573
        "*" |
 
574
        "/" |
 
575
        "%" |
 
576
        "~" |
 
577
        "<" |
 
578
        ">" |
 
579
        "<<" |
 
580
        ">>" |
 
581
        "==" |
 
582
        "+=" |
 
583
        "-=" |
 
584
        "*=" |
 
585
        "/=" |
 
586
        "%=" |
 
587
        ">>=" |
 
588
        "<<=" |
 
589
        "^" |
 
590
        "&" |
 
591
        "&&" |
 
592
        "|" |
 
593
        "||" |
 
594
        "?" |
 
595
        ":" |
 
596
        "," |
 
597
        "!" |
 
598
        "++" |
 
599
        "--" |
 
600
        "." |
 
601
        ","                                                     { addToken(Token.OPERATOR); }
 
602
 
 
603
        /* Numbers */
 
604
        {IntegerLiteral}                                { addToken(Token.LITERAL_NUMBER_DECIMAL_INT); }
 
605
        {HexLiteral}                                    { addToken(Token.LITERAL_NUMBER_HEXADECIMAL); }
 
606
        {FloatLiteral}                                  { addToken(Token.LITERAL_NUMBER_FLOAT); }
 
607
        {ErrorNumberFormat}                             { addToken(Token.ERROR_NUMBER_FORMAT); }
 
608
 
 
609
        /* Some lines will end in '\' to wrap an expression. */
 
610
        "\\"                                                    { addToken(Token.IDENTIFIER); }
 
611
 
 
612
        {ErrorIdentifier}                               { addToken(Token.ERROR_IDENTIFIER); }
 
613
 
 
614
        /* Other punctuation, we'll highlight it as "identifiers." */
 
615
        ";"                                                     { addToken(Token.IDENTIFIER); }
 
616
 
 
617
        /* Ended with a line not in a string or comment. */
 
618
        <<EOF>>                                         { addNullToken(); return firstToken; }
 
619
 
 
620
        /* Catch any other (unhandled) characters and flag them as bad. */
 
621
        .                                                       { addToken(Token.ERROR_IDENTIFIER); }
 
622
 
 
623
}
 
624
 
 
625
<MLC> {
 
626
 
 
627
        [^hwf\n\*]+                                     {}
 
628
        {URL}                                           { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_MULTILINE); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_MULTILINE); start = zzMarkedPos; }
 
629
        [hwf]                                           {}
 
630
 
 
631
        \n                                                      { addToken(start,zzStartRead-1, Token.COMMENT_MULTILINE); return firstToken; }
 
632
        {MLCEnd}                                                { yybegin(YYINITIAL); addToken(start,zzStartRead+1, Token.COMMENT_MULTILINE); }
 
633
        \*                                                      {}
 
634
        <<EOF>>                                         { addToken(start,zzStartRead-1, Token.COMMENT_MULTILINE); return firstToken; }
 
635
 
 
636
}
 
637
 
 
638
 
 
639
<EOL_COMMENT> {
 
640
        [^hwf\n]+                               {}
 
641
        {URL}                                   { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_EOL); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_EOL); start = zzMarkedPos; }
 
642
        [hwf]                                   {}
 
643
        \n                                              { addToken(start,zzStartRead-1, Token.COMMENT_EOL); addNullToken(); return firstToken; }
 
644
        <<EOF>>                                 { addToken(start,zzStartRead-1, Token.COMMENT_EOL); addNullToken(); return firstToken; }
 
645
}