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