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