⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 javatokenmaker.java

📁 具有不同语法高亮的编辑器实例
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
/* The following code was generated by JFlex 1.4.1 on 12/15/05 1:43 PM */

/*
 * JavaTokenMaker.java - Scanner for the Java programming language.
 */
package org.fife.ui.rsyntaxtextarea.modes;

import java.io.*;
import javax.swing.text.Segment;

import org.fife.ui.rsyntaxtextarea.*;


/**
 * Scanner for the Java programming language.<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 JavaTokenMaker.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.4
 *
 */

public class JavaTokenMaker 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 DOCCOMMENT = 2;
  public static final int YYINITIAL = 0;
  public static final int MLC = 1;

  /** 
   * Translates characters to character classes
   */
  private static final String ZZ_CMAP_PACKED = 
    "\11\0\1\20\1\7\1\0\1\20\1\16\22\0\1\20\1\45\1\14"+
    "\1\0\1\17\1\45\1\50\1\6\2\40\1\22\1\42\1\41\1\30"+
    "\1\31\1\21\1\3\3\15\4\5\2\2\1\47\1\41\1\43\1\44"+
    "\1\46\1\47\1\65\1\4\1\71\1\72\1\62\1\27\1\25\1\104"+
    "\1\1\1\73\2\1\1\24\1\75\1\76\1\77\1\101\1\1\1\102"+
    "\1\103\1\74\1\106\1\105\1\1\1\23\2\1\1\40\1\10\1\40"+
    "\1\45\1\17\1\0\1\35\1\13\1\55\1\53\1\34\1\26\1\67"+
    "\1\51\1\57\1\100\1\60\1\36\1\61\1\12\1\52\1\54\1\107"+
    "\1\33\1\37\1\32\1\11\1\64\1\63\1\56\1\66\1\70\1\40"+
    "\1\45\1\40\1\47\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 =
    "\3\0\1\1\1\2\2\3\1\2\1\4\1\5\2\2"+
    "\1\6\1\1\1\7\2\10\4\2\1\10\7\2\1\11"+
    "\1\2\5\10\7\2\1\12\15\2\1\13\1\14\2\13"+
    "\1\15\3\13\1\1\1\16\1\3\1\17\1\16\1\17"+
    "\1\16\1\20\1\16\3\2\3\21\1\4\6\2\1\6"+
    "\1\22\1\23\1\24\27\2\1\0\1\10\1\2\1\25"+
    "\10\2\1\25\4\2\1\12\32\2\1\26\1\27\2\0"+
    "\1\30\11\0\1\1\1\17\1\0\2\20\4\2\1\4"+
    "\1\31\2\21\1\4\5\2\3\6\1\32\43\2\1\33"+
    "\6\2\1\1\43\2\12\0\1\1\4\2\1\4\3\2"+
    "\1\33\1\6\1\34\1\22\1\6\1\35\1\36\6\2"+
    "\1\37\26\2\1\1\41\2\6\0\1\40\4\0\1\1"+
    "\4\2\1\4\1\2\1\6\1\2\1\25\2\2\1\25"+
    "\16\2\1\1\1\2\1\36\40\2\11\0\1\1\5\2"+
    "\1\4\1\2\1\6\14\2\1\1\17\2\1\36\1\2"+
    "\1\36\6\2\1\36\11\2\7\0\15\2\1\1\30\2"+
    "\1\36\10\2\1\40\1\0\51\2\3\0\3\2\1\36"+
    "\44\2\3\0\41\2\3\0\145\2";

  private static int [] zzUnpackAction() {
    int [] result = new int[780];
    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\110\0\220\0\330\0\u0120\0\u0168\0\u01b0\0\u01f8"+
    "\0\u0240\0\u0288\0\u02d0\0\u0318\0\u0360\0\u0288\0\u03a8\0\u03f0"+
    "\0\u0438\0\u0480\0\u04c8\0\u0510\0\u0558\0\u05a0\0\u05e8\0\u0630"+
    "\0\u0678\0\u06c0\0\u0708\0\u0750\0\u0798\0\u0288\0\u0288\0\u07e0"+
    "\0\u0828\0\u0870\0\u0288\0\u08b8\0\u0900\0\u0948\0\u0990\0\u09d8"+
    "\0\u0a20\0\u0a68\0\u0ab0\0\u0af8\0\u0b40\0\u0b88\0\u0bd0\0\u0c18"+
    "\0\u0c60\0\u0ca8\0\u0cf0\0\u0d38\0\u0d80\0\u0dc8\0\u0e10\0\u0e58"+
    "\0\u0ea0\0\u0ee8\0\u0288\0\u0f30\0\u0f78\0\u0288\0\u0fc0\0\u1008"+
    "\0\u1050\0\u1098\0\u10e0\0\u10e0\0\u10e0\0\u1128\0\u1170\0\u11b8"+
    "\0\u1200\0\u1248\0\u1290\0\u12d8\0\u1320\0\u1368\0\u0288\0\u13b0"+
    "\0\u13f8\0\u1440\0\u1488\0\u14d0\0\u1518\0\u1560\0\u15a8\0\u15f0"+
    "\0\u0288\0\u1638\0\u1680\0\u16c8\0\u1710\0\u1758\0\u17a0\0\u17e8"+
    "\0\u1830\0\u1878\0\u18c0\0\u1908\0\u1950\0\u1998\0\u19e0\0\u1a28"+
    "\0\u1a70\0\u1ab8\0\u1b00\0\u1b48\0\u1b90\0\u1bd8\0\u1c20\0\u1c68"+
    "\0\u1cb0\0\u1cf8\0\u0438\0\u1d40\0\u1d88\0\u1dd0\0\u1e18\0\u1e60"+
    "\0\u1ea8\0\u1ef0\0\u1f38\0\u1f80\0\u1fc8\0\u2010\0\u0120\0\u2058"+
    "\0\u20a0\0\u20e8\0\u2130\0\u2178\0\u21c0\0\u2208\0\u2250\0\u2298"+
    "\0\u22e0\0\u2328\0\u2370\0\u23b8\0\u2400\0\u2448\0\u2490\0\u24d8"+
    "\0\u2520\0\u2568\0\u25b0\0\u25f8\0\u2640\0\u2688\0\u26d0\0\u2718"+
    "\0\u2760\0\u27a8\0\u27f0\0\u2838\0\u2880\0\u28c8\0\u0288\0\u0288"+
    "\0\u2910\0\u2958\0\u0288\0\u29a0\0\u29e8\0\u2a30\0\u2a78\0\u2ac0"+
    "\0\u2b08\0\u2b50\0\u2b98\0\u2be0\0\u2c28\0\u2c70\0\u2cb8\0\u10e0"+
    "\0\u2d00\0\u2d48\0\u2d90\0\u2dd8\0\u2e20\0\u2e68\0\u0288\0\u2eb0"+
    "\0\u2ef8\0\u2f40\0\u2f88\0\u2fd0\0\u3018\0\u3060\0\u30a8\0\u30f0"+
    "\0\u3138\0\u3180\0\u31c8\0\u3210\0\u3258\0\u32a0\0\u32e8\0\u3330"+
    "\0\u3378\0\u33c0\0\u3408\0\u3450\0\u3498\0\u34e0\0\u3528\0\u3570"+
    "\0\u35b8\0\u3600\0\u3648\0\u3690\0\u36d8\0\u3720\0\u3768\0\u37b0"+
    "\0\u37f8\0\u3840\0\u3888\0\u38d0\0\u3918\0\u3960\0\u39a8\0\u39f0"+
    "\0\u3a38\0\u3a80\0\u3ac8\0\u3b10\0\u3b58\0\u3ba0\0\u3be8\0\u3c30"+
    "\0\u3c78\0\u3cc0\0\u3d08\0\u3d50\0\u3d98\0\u3de0\0\u3e28\0\u3e70"+
    "\0\u3eb8\0\u3f00\0\u3f48\0\u3f90\0\u3fd8\0\u4020\0\u4068\0\u40b0"+
    "\0\u40f8\0\u4140\0\u4188\0\u41d0\0\u4218\0\u4260\0\u42a8\0\u42f0"+
    "\0\u4338\0\u4380\0\u43c8\0\u4410\0\u4458\0\u44a0\0\u44e8\0\u4530"+
    "\0\u4578\0\u45c0\0\u4608\0\u4650\0\u4698\0\u46e0\0\u4728\0\u4770"+
    "\0\u47b8\0\u4800\0\u4848\0\u4890\0\u48d8\0\u4920\0\u4968\0\u49b0"+
    "\0\u49f8\0\u4a40\0\u4a88\0\u4ad0\0\u4b18\0\u4b60\0\u4ba8\0\u4bf0"+
    "\0\u4c38\0\u4c80\0\u4cc8\0\u4d10\0\u0120\0\u4d58\0\u0288\0\u30f0"+
    "\0\u4da0\0\u0288\0\u0120\0\u4de8\0\u4e30\0\u4e78\0\u4ec0\0\u4f08"+
    "\0\u4f50\0\u0120\0\u4f98\0\u4fe0\0\u5028\0\u5070\0\u50b8\0\u5100"+
    "\0\u5148\0\u5190\0\u51d8\0\u5220\0\u5268\0\u52b0\0\u52f8\0\u5340"+
    "\0\u5388\0\u53d0\0\u5418\0\u5460\0\u54a8\0\u54f0\0\u5538\0\u5580"+
    "\0\u55c8\0\u5610\0\u5658\0\u56a0\0\u56e8\0\u5730\0\u5778\0\u57c0"+
    "\0\u5808\0\u5850\0\u5898\0\u58e0\0\u5928\0\u5970\0\u59b8\0\u5a00"+
    "\0\u5a48\0\u5a90\0\u5ad8\0\u5b20\0\u5b68\0\u5bb0\0\u5bf8\0\u5c40"+
    "\0\u5c88\0\u5cd0\0\u5d18\0\u5d60\0\u5da8\0\u5df0\0\u5e38\0\u5e80"+
    "\0\u5ec8\0\u5f10\0\u5f58\0\u5fa0\0\u5fe8\0\u6030\0\u6078\0\u60c0"+
    "\0\u0288\0\u6108\0\u6150\0\u6198\0\u61e0\0\u6228\0\u6270\0\u62b8"+
    "\0\u6300\0\u6348\0\u6390\0\u63d8\0\u6420\0\u6468\0\u64b0\0\u64f8"+
    "\0\u6540\0\u3528\0\u6588\0\u65d0\0\u6618\0\u6660\0\u66a8\0\u66f0"+
    "\0\u6738\0\u6780\0\u67c8\0\u6810\0\u6858\0\u68a0\0\u68e8\0\u6930"+
    "\0\u6978\0\u69c0\0\u6a08\0\u6a50\0\u6a98\0\u6ae0\0\u6b28\0\u6b70"+
    "\0\u6bb8\0\u6c00\0\u6c48\0\u6c90\0\u6cd8\0\u6d20\0\u6d68\0\u6db0"+
    "\0\u6df8\0\u6e40\0\u6e88\0\u6ed0\0\u6f18\0\u6f60\0\u6fa8\0\u6ff0"+
    "\0\u7038\0\u7080\0\u70c8\0\u7110\0\u7158\0\u71a0\0\u71e8\0\u7230"+
    "\0\u7278\0\u72c0\0\u7308\0\u7350\0\u7398\0\u73e0\0\u7428\0\u7470"+
    "\0\u74b8\0\u7500\0\u7548\0\u7590\0\u75d8\0\u7620\0\u7668\0\u76b0"+
    "\0\u76f8\0\u7740\0\u7788\0\u77d0\0\u7818\0\u7860\0\u78a8\0\u78f0"+
    "\0\u7938\0\u7980\0\u79c8\0\u7a10\0\u7a58\0\u7aa0\0\u7ae8\0\u7b30"+
    "\0\u7b78\0\u7bc0\0\u7c08\0\u7c50\0\u7c98\0\u7ce0\0\u7d28\0\u7d70"+
    "\0\u7db8\0\u7e00\0\u7e48\0\u7e90\0\u7ed8\0\u7f20\0\u7f68\0\u7fb0"+
    "\0\u7ff8\0\u8040\0\u8088\0\u80d0\0\u8118\0\u8160\0\u81a8\0\u81f0"+
    "\0\u8238\0\u8280\0\u82c8\0\u8310\0\u8358\0\u83a0\0\u83e8\0\u8430"+
    "\0\u8478\0\u84c0\0\u8508\0\u8550\0\u8598\0\u85e0\0\u8628\0\u8670"+
    "\0\u86b8\0\u8700\0\u8748\0\u8790\0\u87d8\0\u8820\0\u8868\0\u88b0"+
    "\0\u88f8\0\u8940\0\u8988\0\u89d0\0\u8a18\0\u8a60\0\u8aa8\0\u8af0"+
    "\0\u8b38\0\u8b80\0\u8bc8\0\u8c10\0\u8c58\0\u8ca0\0\u8ce8\0\u8d30"+
    "\0\u8d78\0\u8dc0\0\u8e08\0\u8e50\0\u8e98\0\u8ee0\0\u8f28\0\u8f70"+
    "\0\u8fb8\0\u9000\0\u9048\0\u9090\0\u90d8\0\u9120\0\u9168\0\u91b0"+
    "\0\u91f8\0\u9240\0\u9288\0\u92d0\0\u9318\0\u9360\0\u93a8\0\u93f0"+
    "\0\u9438\0\u9480\0\u94c8\0\u9510\0\u9558\0\u95a0\0\u95e8\0\u9630"+
    "\0\u9678\0\u96c0\0\u9708\0\u9750\0\u9798\0\u97e0\0\u9828\0\u9870"+
    "\0\u98b8\0\u9900\0\u9948\0\u9990\0\u99d8\0\u9a20\0\u9a68\0\u9ab0"+
    "\0\u9af8\0\u9b40\0\u9b88\0\u9bd0\0\u9c18\0\u9c60\0\u9ca8\0\u9cf0"+
    "\0\u9d38\0\u9d80\0\u9dc8\0\u9e10\0\u9e58\0\u9ea0\0\u9ee8\0\u9f30"+
    "\0\u9f78\0\u9fc0\0\ua008\0\ua050\0\ua098\0\ua0e0\0\ua128\0\ua170"+
    "\0\ua1b8\0\ua200\0\ua248\0\ua290\0\ua2d8\0\ua320\0\ua368\0\ua3b0"+
    "\0\ua3f8\0\ua440\0\ua488\0\ua4d0\0\ua518\0\ua560\0\ua5a8\0\ua5f0"+
    "\0\ua638\0\ua680\0\ua6c8\0\ua710\0\ua758\0\ua7a0\0\ua7e8\0\ua830"+
    "\0\ua878\0\ua8c0\0\ua908\0\ua950\0\ua998\0\ua9e0\0\uaa28\0\uaa70"+
    "\0\uaab8\0\uab00\0\uab48\0\uab90\0\uabd8\0\uac20\0\uac68\0\uacb0"+
    "\0\uacf8\0\uad40\0\uad88\0\uadd0\0\uae18\0\uae60\0\uaea8\0\uaef0"+
    "\0\uaf38\0\uaf80\0\uafc8\0\ub010\0\ub058\0\ub0a0\0\ub0e8\0\ub130"+
    "\0\ub178\0\ub1c0\0\ub208\0\ub250\0\ub298\0\ub2e0\0\ub328\0\ub370"+
    "\0\ub3b8\0\ub400\0\ub448\0\ub490\0\ub4d8\0\ub520\0\ub568\0\ub5b0"+
    "\0\ub5f8\0\ub640\0\ub688\0\ub6d0\0\ub718\0\ub760\0\ub7a8\0\ub7f0"+
    "\0\ub838\0\ub880\0\ub8c8\0\ub910\0\ub958\0\ub9a0\0\ub9e8\0\uba30"+
    "\0\uba78\0\ubac0\0\ubb08\0\ubb50\0\ubb98\0\ubbe0\0\ubc28\0\ubc70"+
    "\0\ubcb8\0\ubd00\0\ubd48\0\ubd90\0\ubdd8\0\ube20\0\ube68\0\ubeb0"+
    "\0\ubef8\0\ubf40\0\ubf88\0\ubfd0\0\uc018\0\uc060\0\uc0a8\0\uc0f0"+
    "\0\uc138\0\uc180\0\uc1c8\0\uc210\0\uc258\0\uc2a0\0\uc2e8\0\uc330"+
    "\0\uc378\0\uc3c0\0\uc408\0\uc450\0\uc498\0\uc4e0\0\uc528\0\uc570"+
    "\0\uc5b8\0\uc600\0\uc648\0\uc690\0\uc6d8\0\uc720\0\uc768\0\uc7b0"+
    "\0\uc7f8\0\uc840\0\uc888\0\uc8d0\0\uc918\0\uc960\0\uc9a8\0\uc9f0"+
    "\0\uca38\0\uca80\0\ucac8\0\ucb10\0\ucb58\0\ucba0\0\ucbe8\0\ucc30"+
    "\0\ucc78\0\uccc0\0\ucd08\0\ucd50\0\ucd98\0\ucde0\0\uce28\0\uce70"+
    "\0\uceb8\0\ucf00\0\ucf48\0\ucf90\0\ucfd8\0\ud020\0\ud068\0\ud0b0"+
    "\0\ud0f8\0\ud140\0\ud188\0\ud1d0\0\ud218\0\ud260\0\ud2a8\0\ud2f0"+
    "\0\ud338\0\ud380\0\ud3c8\0\ud410";

  private static int [] zzUnpackRowMap() {
    int [] result = new int[780];
    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\4\1\5\1\6\1\7\1\10\1\6\1\11\1\12"+
    "\1\4\1\5\1\13\1\14\1\15\1\6\1\16\1\5"+
    "\1\17\1\20\1\21\1\5\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\2\21\1\42\1\43\1\44"+
    "\2\5\1\45\1\46\1\47\1\5\1\50\2\5\1\51"+
    "\1\52\1\53\1\54\1\5\1\55\1\5\1\56\1\57"+
    "\1\60\1\61\1\62\1\63\1\64\1\5\1\65\1\66"+
    "\1\67\1\5\1\70\1\71\1\5\7\72\1\73\12\72"+
    "\1\74\65\72\7\75\1\76\12\75\1\77\20\75\1\100"+
    "\21\75\1\101\22\75\6\4\2\0\4\4\1\0\1\4"+
    "\1\0\1\4\3\0\5\4\2\0\6\4\11\0\40\4"+
    "\5\5\2\0\1\102\3\5\1\0\1\5\1\0\1\5"+
    "\3\0\5\5\2\0\6\5\11\0\14\5\1\4\22\5"+
    "\2\103\2\6\1\103\1\6\2\0\4\103\1\0\1\6"+
    "\1\0\1\103\3\0\1\103\1\104\2\105\1\106\1\0"+
    "\1\107\2\103\1\106\1\103\1\104\1\103\11\0\2\103"+
    "\1\105\6\103\1\105\27\103\1\110\1\111\1\103\1\111"+
    "\2\0\4\103\1\0\1\111\1\0\1\103\3\0\1\112"+
    "\1\104\2\105\1\106\1\0\1\107\2\103\1\106\1\103"+
    "\1\104\1\103\11\0\2\103\1\105\2\103\1\112\3\103"+
    "\1\105\25\103\1\4\5\5\2\0\1\102\2\5\1\113"+

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -