sastokenmaker.java
来自「具有不同语法高亮的编辑器实例」· Java 代码 · 共 1,517 行 · 第 1/5 页
JAVA
1,517 行
/* The following code was generated by JFlex 1.4.1 on 12/19/05 5:15 PM */
/*
* 02/25/2005
*
* SASTokenMaker.java - Scanner for SAS files.
* Copyright (C) 2005 Robert Futrell
* email@address.com
* www.website.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.fife.ui.rsyntaxtextarea.modes;
import java.io.*;
import javax.swing.text.Segment;
import org.fife.ui.rsyntaxtextarea.*;
/**
* This class generates tokens representing a text stream as SAS.<p>
*
* This implementation was created using
* <a href="http://www.jflex.de/">JFlex</a> 1.4.1; however, the generated file
* was modified for performance. Memory allocation needs to be almost
* completely removed to be competitive with the handwritten lexers (subclasses
* of <code>AbstractTokenMaker</code>, so this class has been modified so that
* Strings are never allocated (via yytext()), and the scanner never has to
* worry about refilling its buffer (needlessly copying chars around).
* We can achieve this because RText always scans exactly 1 line of tokens at a
* time, and hands the scanner this line as an array of characters (a Segment
* really). Since tokens contain pointers to char arrays instead of Strings
* holding their contents, there is no need for allocating new memory for
* Strings.<p>
*
* The actual algorithm generated for scanning has, of course, not been
* modified.<p>
*
* If you wish to regenerate this file yourself, keep in mind the following:
* <ul>
* <li>The generated SASTokenMaker.java</code> file will contain two
* definitions of both <code>zzRefill</code> and <code>yyreset</code>.
* You should hand-delete the second of each definition (the ones
* generated by the lexer), as these generated methods modify the input
* buffer, which we'll never have to do.</li>
* <li>You should also change the declaration/definition of zzBuffer to NOT
* be initialized. This is a needless memory allocation for us since we
* will be pointing the array somewhere else anyway.</li>
* <li>You should NOT call <code>yylex()</code> on the generated scanner
* directly; rather, you should use <code>getTokenList</code> as you would
* with any other <code>TokenMaker</code> instance.</li>
* </ul>
*
* @author Robert Futrell
* @version 0.5
*
*/
public class SASTokenMaker extends AbstractJFlexTokenMaker implements TokenMaker {
/** This character denotes the end of file */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
private static final int ZZ_BUFFERSIZE = 16384;
/** lexical states */
public static final int STRING = 2;
public static final int YYINITIAL = 0;
public static final int MLC = 6;
public static final int CHAR = 4;
/**
* ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
* ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
* at the beginning of a line
* l is of the form l = 2*k, k a non negative integer
*/
private static final int ZZ_LEXSTATE[] = {
0, 1, 2, 2, 3, 3, 4, 4
};
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\11\0\1\3\1\1\25\0\1\3\1\0\1\23\2\0\1\53\1\4"+
"\1\24\2\22\1\6\1\5\1\0\1\5\1\0\1\7\2\2\1\52"+
"\1\51\1\45\5\2\1\0\1\0\1\10\1\12\1\10\2\0\1\26"+
"\1\42\1\27\1\32\1\13\1\33\1\16\1\30\1\21\1\2\1\44"+
"\1\20\1\36\1\15\1\40\1\37\1\14\1\31\1\34\1\17\1\35"+
"\1\46\1\47\1\43\1\41\1\50\3\0\1\10\1\25\1\0\1\26"+
"\1\42\1\27\1\32\1\13\1\33\1\16\1\30\1\21\1\2\1\44"+
"\1\20\1\36\1\15\1\40\1\37\1\14\1\31\1\34\1\17\1\35"+
"\1\46\1\47\1\43\1\41\1\50\1\0\1\5\1\0\1\11\uff81\0";
/**
* Translates characters to character classes
*/
private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
/**
* Translates DFA states to action switch labels.
*/
private static final int [] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\5\0\1\1\1\2\1\1\1\3\1\1\3\4\3\1"+
"\1\5\4\1\1\6\1\7\1\10\15\1\1\5\4\1"+
"\1\3\1\11\1\12\1\13\1\14\1\12\1\15\1\16"+
"\1\12\1\17\1\12\1\20\1\21\1\4\7\1\1\5"+
"\5\1\1\4\3\1\1\4\15\1\1\5\66\1\1\5"+
"\14\1\21\0\1\22\1\5\5\1\1\5\66\1\1\23"+
"\50\1\1\5\15\1\1\5\1\1\1\5\4\1\1\5"+
"\20\1\1\5\3\1\7\0\1\24\2\0\1\24\24\0"+
"\21\1\1\5\6\1\1\5\44\1\1\5\1\1\1\5"+
"\11\1\1\5\7\1\1\5\4\1\1\23\22\1\1\5"+
"\5\1\12\0\1\24\16\0\10\1\1\5\3\1\1\5"+
"\13\1\1\5\2\1\1\5\3\1\1\5\23\1\1\5"+
"\10\1\1\23\2\5\6\1\16\0\42\1\13\0\17\1"+
"\2\0\12\1";
private static int [] zzUnpackAction() {
int [] result = new int[639];
int offset = 0;
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
return result;
}
private static int zzUnpackAction(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/**
* Translates a state to a row index in the transition table
*/
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\54\0\130\0\204\0\260\0\334\0\334\0\u0108"+
"\0\u0134\0\u0160\0\334\0\u018c\0\u01b8\0\u01b8\0\u01e4\0\u0210"+
"\0\u023c\0\u0268\0\u0294\0\u02c0\0\u02ec\0\334\0\334\0\334"+
"\0\u0318\0\u0344\0\u0370\0\u039c\0\u03c8\0\u03f4\0\u0420\0\u044c"+
"\0\u0478\0\u04a4\0\u04d0\0\u04fc\0\u0528\0\u0108\0\u0554\0\u0580"+
"\0\u05ac\0\u05d8\0\u0604\0\334\0\u0630\0\334\0\334\0\u065c"+
"\0\334\0\334\0\u0688\0\334\0\u06b4\0\u0160\0\334\0\u0108"+
"\0\u06e0\0\u070c\0\u0738\0\u0764\0\u0790\0\u07bc\0\u07e8\0\u0814"+
"\0\u0840\0\u086c\0\u0898\0\u08c4\0\u08f0\0\u091c\0\u0948\0\u0974"+
"\0\u09a0\0\u09cc\0\u09f8\0\u0a24\0\u0a50\0\u0a7c\0\u0aa8\0\u0ad4"+
"\0\u0b00\0\u0b2c\0\u0b58\0\u0b84\0\u0bb0\0\u0bdc\0\u0c08\0\u0c34"+
"\0\u0c60\0\u0c8c\0\u0cb8\0\u0ce4\0\u0d10\0\u0d3c\0\u0d68\0\u0d94"+
"\0\u0dc0\0\u0dec\0\u0e18\0\u0e44\0\u0e70\0\u0e9c\0\u0ec8\0\u0ef4"+
"\0\u0f20\0\u0f4c\0\u0f78\0\u0fa4\0\u0fd0\0\u0ffc\0\u1028\0\u1054"+
"\0\u1080\0\u10ac\0\u10d8\0\u1104\0\u1130\0\u115c\0\u1188\0\u11b4"+
"\0\u11e0\0\u120c\0\u1238\0\u1264\0\u1290\0\u12bc\0\u12e8\0\u1314"+
"\0\u1340\0\u136c\0\u1398\0\u13c4\0\u13f0\0\u141c\0\u1448\0\u1474"+
"\0\u14a0\0\u14cc\0\u14f8\0\u1524\0\u1550\0\u157c\0\u15a8\0\u15d4"+
"\0\u1600\0\u162c\0\u1658\0\u1684\0\u16b0\0\u16dc\0\u1708\0\u1734"+
"\0\u1760\0\u178c\0\u17b8\0\u17e4\0\u1810\0\u183c\0\u1868\0\u1894"+
"\0\u18c0\0\u18ec\0\u1918\0\u1944\0\u1970\0\u199c\0\u19c8\0\u19f4"+
"\0\u1a20\0\u1a4c\0\u1a78\0\u1aa4\0\334\0\u1ad0\0\u1afc\0\u1b28"+
"\0\u1b54\0\u1b80\0\u1bac\0\u1bd8\0\u1c04\0\u1c30\0\u1c5c\0\u1c88"+
"\0\u1cb4\0\u1ce0\0\u1d0c\0\u1d38\0\u1d64\0\u1d90\0\u1dbc\0\u1de8"+
"\0\u1e14\0\u1e40\0\u1e6c\0\u1e98\0\u1ec4\0\u1ef0\0\u1f1c\0\u1f48"+
"\0\u1f74\0\u1fa0\0\u1fcc\0\u1ff8\0\u2024\0\u2050\0\u207c\0\u20a8"+
"\0\u20d4\0\u2100\0\u212c\0\u2158\0\u2184\0\u21b0\0\u21dc\0\u2208"+
"\0\u2234\0\u2260\0\u228c\0\u22b8\0\u22e4\0\u2310\0\u233c\0\u2368"+
"\0\u2394\0\u23c0\0\u23ec\0\u2418\0\u2444\0\u2470\0\u249c\0\u24c8"+
"\0\u24f4\0\u2520\0\u0108\0\u254c\0\u2578\0\u25a4\0\u25d0\0\u25fc"+
"\0\u2628\0\u2654\0\u2680\0\u26ac\0\u26d8\0\u2704\0\u2730\0\u275c"+
"\0\u2788\0\u27b4\0\u27e0\0\u280c\0\u2838\0\u2864\0\u2890\0\u28bc"+
"\0\u28e8\0\u2914\0\u2940\0\u296c\0\u2998\0\u29c4\0\u29f0\0\u2a1c"+
"\0\u2a48\0\u2a74\0\u2aa0\0\u2acc\0\u2af8\0\u2b24\0\u2b50\0\u2b7c"+
"\0\u2ba8\0\u2bd4\0\u2c00\0\u2c2c\0\u2c58\0\u2c84\0\u2cb0\0\u2cdc"+
"\0\u2d08\0\u2d34\0\u2d60\0\u2d8c\0\u2db8\0\u2de4\0\u2e10\0\u2e3c"+
"\0\u2e68\0\u2e94\0\u2ec0\0\u2eec\0\u2f18\0\u2f44\0\u2f70\0\u2f9c"+
"\0\u2fc8\0\u2ff4\0\u3020\0\u304c\0\u3078\0\u30a4\0\u30d0\0\u30fc"+
"\0\u3128\0\u3154\0\u3180\0\u31ac\0\u31d8\0\u3204\0\u3230\0\u325c"+
"\0\u3288\0\u32b4\0\u32e0\0\u330c\0\u3338\0\u3364\0\u3390\0\u33bc"+
"\0\u33e8\0\u3414\0\u3440\0\u346c\0\u3498\0\u34c4\0\u34f0\0\334"+
"\0\u351c\0\u3548\0\u3574\0\u35a0\0\u35cc\0\u35f8\0\u3624\0\u3650"+
"\0\u367c\0\u36a8\0\u36d4\0\u3700\0\u372c\0\u3758\0\u3784\0\u37b0"+
"\0\u37dc\0\u3808\0\u3834\0\u3860\0\u388c\0\u38b8\0\u38e4\0\u3910"+
"\0\u393c\0\u3968\0\u3994\0\u39c0\0\u39ec\0\u3a18\0\u3a44\0\u3a70"+
"\0\u3a9c\0\u3ac8\0\u3af4\0\u3b20\0\u3b4c\0\u3b78\0\u3ba4\0\u3bd0"+
"\0\u3bfc\0\u3c28\0\u3c54\0\u3c80\0\u26ac\0\u3cac\0\u3cd8\0\u3d04"+
"\0\u3d30\0\u3d5c\0\u3d88\0\u3db4\0\u3de0\0\u3e0c\0\u3e38\0\u3e64"+
"\0\u3e90\0\u3ebc\0\u3ee8\0\u3f14\0\u3f40\0\u3f6c\0\u3f98\0\u3fc4"+
"\0\u3ff0\0\u401c\0\u4048\0\u4074\0\u40a0\0\u40cc\0\u40f8\0\u4124"+
"\0\u4150\0\u417c\0\u41a8\0\u41d4\0\u4200\0\u422c\0\u4258\0\u4284"+
"\0\u42b0\0\u42dc\0\u4308\0\u1ff8\0\u4334\0\u4360\0\u438c\0\u43b8"+
"\0\u43e4\0\u4410\0\u443c\0\u4468\0\u4494\0\u4308\0\u44c0\0\u44ec"+
"\0\u4518\0\u4544\0\u4570\0\u459c\0\u45c8\0\u45f4\0\u4620\0\u464c"+
"\0\u4678\0\u46a4\0\u46d0\0\u46fc\0\u4728\0\u4754\0\u4780\0\u47ac"+
"\0\u47d8\0\u4804\0\u4830\0\u485c\0\u4888\0\u48b4\0\u48e0\0\u490c"+
"\0\u4938\0\u4964\0\u4990\0\u49bc\0\u49e8\0\u4a14\0\u4a40\0\u4a6c"+
"\0\u4a98\0\u4ac4\0\u4af0\0\u4b1c\0\u4b48\0\u4b74\0\u4ba0\0\u4bcc"+
"\0\u4bf8\0\u4c24\0\u4c50\0\u4c7c\0\u4ca8\0\u4cd4\0\u4d00\0\u4d2c"+
"\0\u4d58\0\u4d84\0\u4db0\0\u4ddc\0\u4e08\0\u4e34\0\u4e60\0\u4e8c"+
"\0\u4eb8\0\u4ee4\0\u4f10\0\u4f3c\0\u4f68\0\u4f94\0\u4fc0\0\u4fec"+
"\0\u5018\0\u5044\0\u5070\0\u509c\0\u50c8\0\u50f4\0\u5120\0\u514c"+
"\0\u15d4\0\u5178\0\u51a4\0\u51d0\0\u51fc\0\u5228\0\u5254\0\u5280"+
"\0\u52ac\0\u52d8\0\u5304\0\u5330\0\u535c\0\u5388\0\u53b4\0\u53e0"+
"\0\u540c\0\u5438\0\u5464\0\u5490\0\u54bc\0\u54e8\0\u5514\0\u5540"+
"\0\u556c\0\u5598\0\u55c4\0\u55f0\0\u561c\0\u5648\0\u5674\0\u56a0"+
"\0\u56cc\0\u56f8\0\u5724\0\u5750\0\u577c\0\u57a8\0\u57d4\0\u5800"+
"\0\u582c\0\u5858\0\u5884\0\u58b0\0\u58dc\0\u5908\0\u5934\0\u5960"+
"\0\u598c\0\u59b8\0\u59e4\0\u5a10\0\u5a3c\0\u5a68\0\u5a94\0\u5ac0"+
"\0\u5aec\0\u5b18\0\u5b44\0\u5b70\0\u5b9c\0\u5bc8\0\u5bf4\0\u5c20"+
"\0\u5c4c\0\u5c78\0\u5ca4\0\u5cd0\0\u5cfc\0\u5d28\0\u5d54\0\u5d80"+
"\0\u5dac\0\u5dd8\0\u5e04\0\u5e30\0\u5e5c\0\u5e88\0\u5eb4\0\u5ee0"+
"\0\u5f0c\0\u5f38\0\u5f64\0\u5f90\0\u5fbc\0\u5fe8\0\u6014\0\u6040"+
"\0\u606c\0\u6098\0\u60c4\0\u60f0\0\u611c\0\u6148\0\u6174\0\u61a0"+
"\0\u61cc\0\u61f8\0\u6224\0\u6250\0\u627c\0\u62a8\0\u62d4\0\u6300"+
"\0\u632c\0\u6358\0\u6384\0\u63b0\0\u63dc\0\u6408\0\u6434\0\u6460"+
"\0\u648c\0\u64b8\0\u64e4\0\u6510\0\u653c\0\u6568\0\u6594\0\u65c0"+
"\0\u65ec\0\u6618\0\u6644\0\u6670\0\u669c\0\u45f4\0\u66c8\0\u66f4"+
"\0\u6720\0\u674c\0\u535c\0\u6778\0\u67a4\0\u67d0\0\u67fc\0\u6828"+
"\0\u6854\0\u6880\0\u68ac\0\u68d8\0\u6904\0\u6930\0\u695c";
private static int [] zzUnpackRowMap() {
int [] result = new int[639];
int offset = 0;
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
return result;
}
private static int zzUnpackRowMap(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
result[j++] = high | packed.charAt(i++);
}
return j;
}
/**
* The transition table of the DFA
*/
private static final int [] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\1\6\1\7\1\10\1\11\1\12\2\13\1\14\1\15"+
"\1\16\1\13\1\17\1\20\1\21\1\22\1\23\1\24"+
"\1\25\1\26\1\27\1\30\1\31\1\32\1\33\1\34"+
"\1\35\1\36\1\37\1\40\1\41\1\42\1\43\1\44"+
"\1\10\1\45\1\46\1\47\1\10\1\50\1\51\3\10"+
"\1\52\1\6\1\7\1\10\1\53\1\12\1\13\1\54"+
"\1\14\1\15\1\16\1\13\1\17\1\20\1\21\1\22"+
"\1\23\1\24\1\25\1\26\1\27\1\30\1\31\1\32"+
"\1\33\1\34\1\35\1\36\1\37\1\40\1\41\1\42"+
"\1\43\1\44\1\10\1\45\1\46\1\47\1\10\1\50"+
"\1\51\3\10\1\52\1\55\1\56\21\55\1\57\30\55"+
"\1\60\1\61\22\60\1\62\27\60\1\63\1\64\4\63"+
"\1\65\45\63\56\0\1\10\10\0\7\10\3\0\26\10"+
"\4\0\1\11\52\0\1\66\10\0\7\66\3\0\26\66"+
"\7\0\1\67\57\0\1\13\43\0\1\10\10\0\1\10"+
"\1\70\1\71\2\10\1\72\1\10\3\0\4\10\1\73"+
"\11\10\1\74\7\10\3\0\1\10\10\0\7\10\3\0"+
"\10\10\1\75\15\10\3\0\1\10\10\0\1\70\6\10"+
"\3\0\13\10\1\76\12\10\3\0\1\10\10\0\1\70"+
"\3\10\1\70\2\10\3\0\4\10\1\77\6\10\1\100"+
"\12\10\3\0\1\10\10\0\1\101\5\10\1\102\3\0"+
"\1\10\1\103\1\10\1\104\1\105\6\10\1\46\12\10"+
"\3\0\1\10\10\0\1\106\3\10\1\70\1\10\1\107"+
"\3\0\1\10\1\110\11\10\1\111\12\10\3\0\1\10"+
"\10\0\2\10\1\112\4\10\3\0\5\10\2\46\2\10"+
"\1\113\14\10\3\0\1\10\10\0\2\10\1\114\1\10"+
"\1\115\1\116\1\117\3\0\1\10\1\120\1\121\2\10"+
"\1\122\4\10\1\123\13\10\3\0\1\10\10\0\2\10"+
"\1\124\1\10\1\125\1\126\1\10\3\0\4\10\1\127"+
"\2\10\1\130\2\10\1\131\2\10\1\132\1\133\7\10"+
"\3\0\1\10\10\0\5\10\1\134\1\135\3\0\1\10"+
"\1\136\1\10\1\137\1\140\5\10\1\141\1\142\12\10"+
"\3\0\1\10\10\0\1\143\3\10\1\144\1\10\1\145"+
"\3\0\1\10\1\146\13\10\1\147\10\10\3\0\1\10"+
"\10\0\1\150\6\10\3\0\1\10\1\151\5\10\1\152"+
"\1\153\15\10\3\0\1\10\10\0\1\154\5\10\1\155"+
"\3\0\1\10\1\156\2\10\1\157\3\10\1\160\1\46"+
"\1\10\1\46\12\10\3\0\1\10\10\0\5\10\1\161"+
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?