001: package net.xoetrope.builder.editor.syntaxhighlight;
002:
003: /*
004: * PerlTokenMarker.java - Perl token marker
005: * Copyright (C) 1998, 1999 Slava Pestov
006: *
007: * You may use and modify this package for any purpose. Redistribution is
008: * permitted, in both source and binary form, provided that this notice
009: * remains intact in all source distributions of this package.
010: */
011:
012: import javax.swing.text.Segment;
013:
014: /**
015: * Perl token marker.
016: *
017: * @author Slava Pestov
018: * @version $Id: PerlTokenMarker.java,v 1.22 2005/01/05 17:20:49 luano Exp $
019: */
020: public class PerlTokenMarker extends TokenMarker {
021: // public members
022: public static final byte S_ONE = Token.INTERNAL_FIRST;
023: public static final byte S_TWO = (byte) (Token.INTERNAL_FIRST + 1);
024: public static final byte S_END = (byte) (Token.INTERNAL_FIRST + 2);
025:
026: public PerlTokenMarker() {
027: this (getKeywords());
028: }
029:
030: public PerlTokenMarker(KeywordMap keywords) {
031: this .keywords = keywords;
032: }
033:
034: public byte markTokensImpl(byte _token, Segment line, int lineIndex) {
035: char[] array = line.array;
036: int offset = line.offset;
037: token = _token;
038: lastOffset = offset;
039: lastKeyword = offset;
040: matchChar = '\0';
041: matchCharBracket = false;
042: matchSpacesAllowed = false;
043: int length = line.count + offset;
044:
045: if (token == Token.LITERAL1 && lineIndex != 0
046: && lineInfo[lineIndex - 1].obj != null) {
047: String str = (String) lineInfo[lineIndex - 1].obj;
048: if (str != null
049: && str.length() == line.count
050: && SyntaxUtilities.regionMatches(false, line,
051: offset, str)) {
052: addToken(line.count, token);
053: return Token.NULL;
054: } else {
055: addToken(line.count, token);
056: lineInfo[lineIndex].obj = str;
057: return token;
058: }
059: }
060:
061: boolean backslash = false;
062: loop: for (int i = offset; i < length; i++) {
063: int i1 = (i + 1);
064:
065: char c = array[i];
066: if (c == '\\') {
067: backslash = !backslash;
068: continue;
069: }
070:
071: switch (token) {
072: case Token.NULL:
073: switch (c) {
074: case '#':
075: if (doKeyword(line, i, c))
076: break;
077: if (backslash)
078: backslash = false;
079: else {
080: addToken(i - lastOffset, token);
081: addToken(length - i, Token.COMMENT1);
082: lastOffset = lastKeyword = length;
083: break loop;
084: }
085: break;
086: case '=':
087: backslash = false;
088: if (i == offset) {
089: token = Token.COMMENT2;
090: addToken(length - i, token);
091: lastOffset = lastKeyword = length;
092: break loop;
093: } else
094: doKeyword(line, i, c);
095: break;
096: case '$':
097: case '&':
098: case '%':
099: case '@':
100: backslash = false;
101: if (doKeyword(line, i, c))
102: break;
103: if (length - i > 1) {
104: if (c == '&'
105: && (array[i1] == '&' || Character
106: .isWhitespace(array[i1])))
107: i++;
108: else {
109: addToken(i - lastOffset, token);
110: lastOffset = lastKeyword = i;
111: token = Token.KEYWORD2;
112: }
113: }
114: break;
115: case '"':
116: if (doKeyword(line, i, c))
117: break;
118: if (backslash)
119: backslash = false;
120: else {
121: addToken(i - lastOffset, token);
122: token = Token.LITERAL1;
123: lineInfo[lineIndex].obj = null;
124: lastOffset = lastKeyword = i;
125: }
126: break;
127: case '\'':
128: if (backslash)
129: backslash = false;
130: else {
131: int oldLastKeyword = lastKeyword;
132: if (doKeyword(line, i, c))
133: break;
134: if (i != oldLastKeyword)
135: break;
136: addToken(i - lastOffset, token);
137: token = Token.LITERAL2;
138: lastOffset = lastKeyword = i;
139: }
140: break;
141: case '`':
142: if (doKeyword(line, i, c))
143: break;
144: if (backslash)
145: backslash = false;
146: else {
147: addToken(i - lastOffset, token);
148: token = Token.OPERATOR;
149: lastOffset = lastKeyword = i;
150: }
151: break;
152: case '<':
153: if (doKeyword(line, i, c))
154: break;
155: if (backslash)
156: backslash = false;
157: else {
158: if (length - i > 2
159: && array[i1] == '<'
160: && !Character
161: .isWhitespace(array[i + 2])) {
162: addToken(i - lastOffset, token);
163: lastOffset = lastKeyword = i;
164: token = Token.LITERAL1;
165: int len = length - (i + 2);
166: if (array[length - 1] == ';')
167: len--;
168: lineInfo[lineIndex].obj = createReadinString(
169: array, i + 2, len);
170: }
171: }
172: break;
173: case ':':
174: backslash = false;
175: if (doKeyword(line, i, c))
176: break;
177: // Doesn't pick up all labels,
178: // but at least doesn't mess up
179: // XXX::YYY
180: if (lastKeyword != 0)
181: break;
182: addToken(i1 - lastOffset, Token.LABEL);
183: lastOffset = lastKeyword = i1;
184: break;
185: case '-':
186: backslash = false;
187: if (doKeyword(line, i, c))
188: break;
189: if (i != lastKeyword || length - i <= 1)
190: break;
191: switch (array[i1]) {
192: case 'r':
193: case 'w':
194: case 'x':
195: case 'o':
196: case 'R':
197: case 'W':
198: case 'X':
199: case 'O':
200: case 'e':
201: case 'z':
202: case 's':
203: case 'f':
204: case 'd':
205: case 'l':
206: case 'p':
207: case 'S':
208: case 'b':
209: case 'c':
210: case 't':
211: case 'u':
212: case 'g':
213: case 'k':
214: case 'T':
215: case 'B':
216: case 'M':
217: case 'A':
218: case 'C':
219: addToken(i - lastOffset, token);
220: addToken(2, Token.KEYWORD3);
221: lastOffset = lastKeyword = i + 2;
222: i++;
223: }
224: break;
225: case '/':
226: case '?':
227: if (doKeyword(line, i, c))
228: break;
229: if (length - i > 1) {
230: backslash = false;
231: char ch = array[i1];
232: if (Character.isWhitespace(ch))
233: break;
234: matchChar = c;
235: matchSpacesAllowed = false;
236: addToken(i - lastOffset, token);
237: token = S_ONE;
238: lastOffset = lastKeyword = i;
239: }
240: break;
241: default:
242: backslash = false;
243: if (!Character.isLetterOrDigit(c) && c != '_')
244: doKeyword(line, i, c);
245: break;
246: }
247: break;
248: case Token.KEYWORD2:
249: backslash = false;
250: // This test checks for an end-of-variable
251: // condition
252: if (!Character.isLetterOrDigit(c) && c != '_'
253: && c != '#' && c != '\'' && c != ':'
254: && c != '&') {
255: // If this is the first character
256: // of the variable name ($'aaa)
257: // ignore it
258: if (i != offset && array[i - 1] == '$') {
259: addToken(i1 - lastOffset, token);
260: lastOffset = lastKeyword = i1;
261: }
262: // Otherwise, end of variable...
263: else {
264: addToken(i - lastOffset, token);
265: lastOffset = lastKeyword = i;
266: // Wind back so that stuff
267: // like $hello$fred is picked
268: // up
269: i--;
270: token = Token.NULL;
271: }
272: }
273: break;
274: case S_ONE:
275: case S_TWO:
276: if (backslash)
277: backslash = false;
278: else {
279: if (matchChar == '\0') {
280: if (Character.isWhitespace(matchChar)
281: && !matchSpacesAllowed)
282: break;
283: else
284: matchChar = c;
285: } else {
286: switch (matchChar) {
287: case '(':
288: matchChar = ')';
289: matchCharBracket = true;
290: break;
291: case '[':
292: matchChar = ']';
293: matchCharBracket = true;
294: break;
295: case '{':
296: matchChar = '}';
297: matchCharBracket = true;
298: break;
299: case '<':
300: matchChar = '>';
301: matchCharBracket = true;
302: break;
303: default:
304: matchCharBracket = false;
305: break;
306: }
307: if (c != matchChar)
308: break;
309: if (token == S_TWO) {
310: token = S_ONE;
311: if (matchCharBracket)
312: matchChar = '\0';
313: } else {
314: token = S_END;
315: addToken(i1 - lastOffset, Token.LITERAL2);
316: lastOffset = lastKeyword = i1;
317: }
318: }
319: }
320: break;
321: case S_END:
322: backslash = false;
323: if (!Character.isLetterOrDigit(c) && c != '_')
324: doKeyword(line, i, c);
325: break;
326: case Token.COMMENT2:
327: backslash = false;
328: if (i == offset) {
329: addToken(line.count, token);
330: if (length - i > 3
331: && SyntaxUtilities.regionMatches(false,
332: line, offset, "=cut"))
333: token = Token.NULL;
334: lastOffset = lastKeyword = length;
335: break loop;
336: }
337: break;
338: case Token.LITERAL1:
339: if (backslash)
340: backslash = false;
341: /* else if(c == '$')
342: backslash = true; */
343: else if (c == '"') {
344: addToken(i1 - lastOffset, token);
345: token = Token.NULL;
346: lastOffset = lastKeyword = i1;
347: }
348: break;
349: case Token.LITERAL2:
350: if (backslash)
351: backslash = false;
352: /* else if(c == '$')
353: backslash = true; */
354: else if (c == '\'') {
355: addToken(i1 - lastOffset, Token.LITERAL1);
356: token = Token.NULL;
357: lastOffset = lastKeyword = i1;
358: }
359: break;
360: case Token.OPERATOR:
361: if (backslash)
362: backslash = false;
363: else if (c == '`') {
364: addToken(i1 - lastOffset, token);
365: token = Token.NULL;
366: lastOffset = lastKeyword = i1;
367: }
368: break;
369: default:
370: throw new InternalError("Invalid state: " + token);
371: }
372: }
373:
374: if (token == Token.NULL)
375: doKeyword(line, length, '\0');
376:
377: switch (token) {
378: case Token.KEYWORD2:
379: addToken(length - lastOffset, token);
380: token = Token.NULL;
381: break;
382: case Token.LITERAL2:
383: addToken(length - lastOffset, Token.LITERAL1);
384: break;
385: case S_END:
386: addToken(length - lastOffset, Token.LITERAL2);
387: token = Token.NULL;
388: break;
389: case S_ONE:
390: case S_TWO:
391: addToken(length - lastOffset, Token.INVALID); // XXX
392: token = Token.NULL;
393: break;
394: default:
395: addToken(length - lastOffset, token);
396: break;
397: }
398: return token;
399: }
400:
401: // private members
402: private KeywordMap keywords;
403: private byte token;
404: private int lastOffset;
405: private int lastKeyword;
406: private char matchChar;
407: private boolean matchCharBracket;
408: private boolean matchSpacesAllowed;
409:
410: private boolean doKeyword(Segment line, int i, char c) {
411: int i1 = i + 1;
412:
413: if (token == S_END) {
414: addToken(i - lastOffset, Token.LITERAL2);
415: token = Token.NULL;
416: lastOffset = i;
417: lastKeyword = i1;
418: return false;
419: }
420:
421: int len = i - lastKeyword;
422: byte id = keywords.lookup(line, lastKeyword, len);
423: if (id == S_ONE || id == S_TWO) {
424: if (lastKeyword != lastOffset)
425: addToken(lastKeyword - lastOffset, Token.NULL);
426: addToken(len, Token.LITERAL2);
427: lastOffset = i;
428: lastKeyword = i1;
429: if (Character.isWhitespace(c))
430: matchChar = '\0';
431: else
432: matchChar = c;
433: matchSpacesAllowed = true;
434: token = id;
435: return true;
436: } else if (id != Token.NULL) {
437: if (lastKeyword != lastOffset)
438: addToken(lastKeyword - lastOffset, Token.NULL);
439: addToken(len, id);
440: lastOffset = i;
441: }
442: lastKeyword = i1;
443: return false;
444: }
445:
446: // Converts < EOF >, < 'EOF' >, etc to <EOF>
447: private String createReadinString(char[] array, int start, int len) {
448: int idx1 = start;
449: int idx2 = start + len - 1;
450:
451: while ((idx1 <= idx2)
452: && (!Character.isLetterOrDigit(array[idx1])))
453: idx1++;
454:
455: while ((idx1 <= idx2)
456: && (!Character.isLetterOrDigit(array[idx2])))
457: idx2--;
458:
459: return new String(array, idx1, idx2 - idx1 + 1);
460: }
461:
462: private static KeywordMap perlKeywords;
463:
464: private static KeywordMap getKeywords() {
465: if (perlKeywords == null) {
466: perlKeywords = new KeywordMap(false);
467: perlKeywords.add("my", Token.KEYWORD1);
468: perlKeywords.add("local", Token.KEYWORD1);
469: perlKeywords.add("new", Token.KEYWORD1);
470: perlKeywords.add("if", Token.KEYWORD1);
471: perlKeywords.add("until", Token.KEYWORD1);
472: perlKeywords.add("while", Token.KEYWORD1);
473: perlKeywords.add("elsif", Token.KEYWORD1);
474: perlKeywords.add("else", Token.KEYWORD1);
475: perlKeywords.add("eval", Token.KEYWORD1);
476: perlKeywords.add("unless", Token.KEYWORD1);
477: perlKeywords.add("foreach", Token.KEYWORD1);
478: perlKeywords.add("continue", Token.KEYWORD1);
479: perlKeywords.add("exit", Token.KEYWORD1);
480: perlKeywords.add("die", Token.KEYWORD1);
481: perlKeywords.add("last", Token.KEYWORD1);
482: perlKeywords.add("goto", Token.KEYWORD1);
483: perlKeywords.add("next", Token.KEYWORD1);
484: perlKeywords.add("redo", Token.KEYWORD1);
485: perlKeywords.add("goto", Token.KEYWORD1);
486: perlKeywords.add("return", Token.KEYWORD1);
487: perlKeywords.add("do", Token.KEYWORD1);
488: perlKeywords.add("sub", Token.KEYWORD1);
489: perlKeywords.add("use", Token.KEYWORD1);
490: perlKeywords.add("require", Token.KEYWORD1);
491: perlKeywords.add("package", Token.KEYWORD1);
492: perlKeywords.add("BEGIN", Token.KEYWORD1);
493: perlKeywords.add("END", Token.KEYWORD1);
494: perlKeywords.add("eq", Token.OPERATOR);
495: perlKeywords.add("ne", Token.OPERATOR);
496: perlKeywords.add("not", Token.OPERATOR);
497: perlKeywords.add("and", Token.OPERATOR);
498: perlKeywords.add("or", Token.OPERATOR);
499:
500: perlKeywords.add("abs", Token.KEYWORD3);
501: perlKeywords.add("accept", Token.KEYWORD3);
502: perlKeywords.add("alarm", Token.KEYWORD3);
503: perlKeywords.add("atan2", Token.KEYWORD3);
504: perlKeywords.add("bind", Token.KEYWORD3);
505: perlKeywords.add("binmode", Token.KEYWORD3);
506: perlKeywords.add("bless", Token.KEYWORD3);
507: perlKeywords.add("caller", Token.KEYWORD3);
508: perlKeywords.add("chdir", Token.KEYWORD3);
509: perlKeywords.add("chmod", Token.KEYWORD3);
510: perlKeywords.add("chomp", Token.KEYWORD3);
511: perlKeywords.add("chr", Token.KEYWORD3);
512: perlKeywords.add("chroot", Token.KEYWORD3);
513: perlKeywords.add("chown", Token.KEYWORD3);
514: perlKeywords.add("closedir", Token.KEYWORD3);
515: perlKeywords.add("close", Token.KEYWORD3);
516: perlKeywords.add("connect", Token.KEYWORD3);
517: perlKeywords.add("cos", Token.KEYWORD3);
518: perlKeywords.add("crypt", Token.KEYWORD3);
519: perlKeywords.add("dbmclose", Token.KEYWORD3);
520: perlKeywords.add("dbmopen", Token.KEYWORD3);
521: perlKeywords.add("defined", Token.KEYWORD3);
522: perlKeywords.add("delete", Token.KEYWORD3);
523: perlKeywords.add("die", Token.KEYWORD3);
524: perlKeywords.add("dump", Token.KEYWORD3);
525: perlKeywords.add("each", Token.KEYWORD3);
526: perlKeywords.add("endgrent", Token.KEYWORD3);
527: perlKeywords.add("endhostent", Token.KEYWORD3);
528: perlKeywords.add("endnetent", Token.KEYWORD3);
529: perlKeywords.add("endprotoent", Token.KEYWORD3);
530: perlKeywords.add("endpwent", Token.KEYWORD3);
531: perlKeywords.add("endservent", Token.KEYWORD3);
532: perlKeywords.add("eof", Token.KEYWORD3);
533: perlKeywords.add("exec", Token.KEYWORD3);
534: perlKeywords.add("exists", Token.KEYWORD3);
535: perlKeywords.add("exp", Token.KEYWORD3);
536: perlKeywords.add("fctnl", Token.KEYWORD3);
537: perlKeywords.add("fileno", Token.KEYWORD3);
538: perlKeywords.add("flock", Token.KEYWORD3);
539: perlKeywords.add("fork", Token.KEYWORD3);
540: perlKeywords.add("format", Token.KEYWORD3);
541: perlKeywords.add("formline", Token.KEYWORD3);
542: perlKeywords.add("getc", Token.KEYWORD3);
543: perlKeywords.add("getgrent", Token.KEYWORD3);
544: perlKeywords.add("getgrgid", Token.KEYWORD3);
545: perlKeywords.add("getgrnam", Token.KEYWORD3);
546: perlKeywords.add("gethostbyaddr", Token.KEYWORD3);
547: perlKeywords.add("gethostbyname", Token.KEYWORD3);
548: perlKeywords.add("gethostent", Token.KEYWORD3);
549: perlKeywords.add("getlogin", Token.KEYWORD3);
550: perlKeywords.add("getnetbyaddr", Token.KEYWORD3);
551: perlKeywords.add("getnetbyname", Token.KEYWORD3);
552: perlKeywords.add("getnetent", Token.KEYWORD3);
553: perlKeywords.add("getpeername", Token.KEYWORD3);
554: perlKeywords.add("getpgrp", Token.KEYWORD3);
555: perlKeywords.add("getppid", Token.KEYWORD3);
556: perlKeywords.add("getpriority", Token.KEYWORD3);
557: perlKeywords.add("getprotobyname", Token.KEYWORD3);
558: perlKeywords.add("getprotobynumber", Token.KEYWORD3);
559: perlKeywords.add("getprotoent", Token.KEYWORD3);
560: perlKeywords.add("getpwent", Token.KEYWORD3);
561: perlKeywords.add("getpwnam", Token.KEYWORD3);
562: perlKeywords.add("getpwuid", Token.KEYWORD3);
563: perlKeywords.add("getservbyname", Token.KEYWORD3);
564: perlKeywords.add("getservbyport", Token.KEYWORD3);
565: perlKeywords.add("getservent", Token.KEYWORD3);
566: perlKeywords.add("getsockname", Token.KEYWORD3);
567: perlKeywords.add("getsockopt", Token.KEYWORD3);
568: perlKeywords.add("glob", Token.KEYWORD3);
569: perlKeywords.add("gmtime", Token.KEYWORD3);
570: perlKeywords.add("grep", Token.KEYWORD3);
571: perlKeywords.add("hex", Token.KEYWORD3);
572: perlKeywords.add("import", Token.KEYWORD3);
573: perlKeywords.add("index", Token.KEYWORD3);
574: perlKeywords.add("int", Token.KEYWORD3);
575: perlKeywords.add("ioctl", Token.KEYWORD3);
576: perlKeywords.add("join", Token.KEYWORD3);
577: perlKeywords.add("keys", Token.KEYWORD3);
578: perlKeywords.add("kill", Token.KEYWORD3);
579: perlKeywords.add("lcfirst", Token.KEYWORD3);
580: perlKeywords.add("lc", Token.KEYWORD3);
581: perlKeywords.add("length", Token.KEYWORD3);
582: perlKeywords.add("link", Token.KEYWORD3);
583: perlKeywords.add("listen", Token.KEYWORD3);
584: perlKeywords.add("log", Token.KEYWORD3);
585: perlKeywords.add("localtime", Token.KEYWORD3);
586: perlKeywords.add("lstat", Token.KEYWORD3);
587: perlKeywords.add("map", Token.KEYWORD3);
588: perlKeywords.add("mkdir", Token.KEYWORD3);
589: perlKeywords.add("msgctl", Token.KEYWORD3);
590: perlKeywords.add("msgget", Token.KEYWORD3);
591: perlKeywords.add("msgrcv", Token.KEYWORD3);
592: perlKeywords.add("no", Token.KEYWORD3);
593: perlKeywords.add("oct", Token.KEYWORD3);
594: perlKeywords.add("opendir", Token.KEYWORD3);
595: perlKeywords.add("open", Token.KEYWORD3);
596: perlKeywords.add("ord", Token.KEYWORD3);
597: perlKeywords.add("pack", Token.KEYWORD3);
598: perlKeywords.add("pipe", Token.KEYWORD3);
599: perlKeywords.add("pop", Token.KEYWORD3);
600: perlKeywords.add("pos", Token.KEYWORD3);
601: perlKeywords.add("printf", Token.KEYWORD3);
602: perlKeywords.add("print", Token.KEYWORD3);
603: perlKeywords.add("push", Token.KEYWORD3);
604: perlKeywords.add("quotemeta", Token.KEYWORD3);
605: perlKeywords.add("rand", Token.KEYWORD3);
606: perlKeywords.add("readdir", Token.KEYWORD3);
607: perlKeywords.add("read", Token.KEYWORD3);
608: perlKeywords.add("readlink", Token.KEYWORD3);
609: perlKeywords.add("recv", Token.KEYWORD3);
610: perlKeywords.add("ref", Token.KEYWORD3);
611: perlKeywords.add("rename", Token.KEYWORD3);
612: perlKeywords.add("reset", Token.KEYWORD3);
613: perlKeywords.add("reverse", Token.KEYWORD3);
614: perlKeywords.add("rewinddir", Token.KEYWORD3);
615: perlKeywords.add("rindex", Token.KEYWORD3);
616: perlKeywords.add("rmdir", Token.KEYWORD3);
617: perlKeywords.add("scalar", Token.KEYWORD3);
618: perlKeywords.add("seekdir", Token.KEYWORD3);
619: perlKeywords.add("seek", Token.KEYWORD3);
620: perlKeywords.add("select", Token.KEYWORD3);
621: perlKeywords.add("semctl", Token.KEYWORD3);
622: perlKeywords.add("semget", Token.KEYWORD3);
623: perlKeywords.add("semop", Token.KEYWORD3);
624: perlKeywords.add("send", Token.KEYWORD3);
625: perlKeywords.add("setgrent", Token.KEYWORD3);
626: perlKeywords.add("sethostent", Token.KEYWORD3);
627: perlKeywords.add("setnetent", Token.KEYWORD3);
628: perlKeywords.add("setpgrp", Token.KEYWORD3);
629: perlKeywords.add("setpriority", Token.KEYWORD3);
630: perlKeywords.add("setprotoent", Token.KEYWORD3);
631: perlKeywords.add("setpwent", Token.KEYWORD3);
632: perlKeywords.add("setsockopt", Token.KEYWORD3);
633: perlKeywords.add("shift", Token.KEYWORD3);
634: perlKeywords.add("shmctl", Token.KEYWORD3);
635: perlKeywords.add("shmget", Token.KEYWORD3);
636: perlKeywords.add("shmread", Token.KEYWORD3);
637: perlKeywords.add("shmwrite", Token.KEYWORD3);
638: perlKeywords.add("shutdown", Token.KEYWORD3);
639: perlKeywords.add("sin", Token.KEYWORD3);
640: perlKeywords.add("sleep", Token.KEYWORD3);
641: perlKeywords.add("socket", Token.KEYWORD3);
642: perlKeywords.add("socketpair", Token.KEYWORD3);
643: perlKeywords.add("sort", Token.KEYWORD3);
644: perlKeywords.add("splice", Token.KEYWORD3);
645: perlKeywords.add("split", Token.KEYWORD3);
646: perlKeywords.add("sprintf", Token.KEYWORD3);
647: perlKeywords.add("sqrt", Token.KEYWORD3);
648: perlKeywords.add("srand", Token.KEYWORD3);
649: perlKeywords.add("stat", Token.KEYWORD3);
650: perlKeywords.add("study", Token.KEYWORD3);
651: perlKeywords.add("substr", Token.KEYWORD3);
652: perlKeywords.add("symlink", Token.KEYWORD3);
653: perlKeywords.add("syscall", Token.KEYWORD3);
654: perlKeywords.add("sysopen", Token.KEYWORD3);
655: perlKeywords.add("sysread", Token.KEYWORD3);
656: perlKeywords.add("syswrite", Token.KEYWORD3);
657: perlKeywords.add("telldir", Token.KEYWORD3);
658: perlKeywords.add("tell", Token.KEYWORD3);
659: perlKeywords.add("tie", Token.KEYWORD3);
660: perlKeywords.add("tied", Token.KEYWORD3);
661: perlKeywords.add("time", Token.KEYWORD3);
662: perlKeywords.add("times", Token.KEYWORD3);
663: perlKeywords.add("truncate", Token.KEYWORD3);
664: perlKeywords.add("uc", Token.KEYWORD3);
665: perlKeywords.add("ucfirst", Token.KEYWORD3);
666: perlKeywords.add("umask", Token.KEYWORD3);
667: perlKeywords.add("undef", Token.KEYWORD3);
668: perlKeywords.add("unlink", Token.KEYWORD3);
669: perlKeywords.add("unpack", Token.KEYWORD3);
670: perlKeywords.add("unshift", Token.KEYWORD3);
671: perlKeywords.add("untie", Token.KEYWORD3);
672: perlKeywords.add("utime", Token.KEYWORD3);
673: perlKeywords.add("values", Token.KEYWORD3);
674: perlKeywords.add("vec", Token.KEYWORD3);
675: perlKeywords.add("wait", Token.KEYWORD3);
676: perlKeywords.add("waitpid", Token.KEYWORD3);
677: perlKeywords.add("wantarray", Token.KEYWORD3);
678: perlKeywords.add("warn", Token.KEYWORD3);
679: perlKeywords.add("write", Token.KEYWORD3);
680:
681: perlKeywords.add("m", S_ONE);
682: perlKeywords.add("q", S_ONE);
683: perlKeywords.add("qq", S_ONE);
684: perlKeywords.add("qw", S_ONE);
685: perlKeywords.add("qx", S_ONE);
686: perlKeywords.add("s", S_TWO);
687: perlKeywords.add("tr", S_TWO);
688: perlKeywords.add("y", S_TWO);
689: }
690: return perlKeywords;
691: }
692: }
|