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

📄 cplusplustokenmaker.java

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

/*
 * CPlusPlusTokenMaker.java - An object that can take a chunk of text and
 * return a linked list of tokens representing it in C++.
 */
package org.fife.ui.rsyntaxtextarea.modes;

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

import org.fife.ui.rsyntaxtextarea.*;


/**
 * A parser for the C++ programming language.
 *
 * 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 CPlusPlusTokenMaker.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 CPlusPlusTokenMaker 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 YYINITIAL = 0;
  public static final int MLC = 1;

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

  private static int [] zzUnpackAction() {
    int [] result = new int[533];
    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\112\0\224\0\336\0\u0128\0\u0172\0\u01bc\0\u0206"+
    "\0\u0250\0\u029a\0\u02e4\0\u032e\0\u0378\0\u03c2\0\u040c\0\u0456"+
    "\0\u04a0\0\u04ea\0\u0534\0\u057e\0\u05c8\0\u0612\0\u065c\0\u06a6"+
    "\0\u06f0\0\u073a\0\u0784\0\u07ce\0\u06a6\0\u0818\0\224\0\u06a6"+
    "\0\u0862\0\u08ac\0\u08f6\0\u0940\0\u098a\0\u09d4\0\u06a6\0\u0a1e"+
    "\0\u0a68\0\u0ab2\0\u0afc\0\u0b46\0\u0b90\0\u0bda\0\u06a6\0\u0c24"+
    "\0\u06a6\0\u0c6e\0\u0cb8\0\u0d02\0\u0d4c\0\u0d96\0\u0de0\0\u0e2a"+
    "\0\u0e74\0\u0ebe\0\u0f08\0\u0f52\0\u0f9c\0\u0fe6\0\u1030\0\u107a"+
    "\0\u10c4\0\u110e\0\u1158\0\u11a2\0\u11ec\0\u1236\0\u1280\0\u12ca"+
    "\0\u1314\0\u135e\0\u13a8\0\u13f2\0\336\0\u143c\0\u1486\0\u14d0"+
    "\0\u151a\0\u1564\0\u15ae\0\u15f8\0\u1642\0\u168c\0\u16d6\0\u1720"+
    "\0\u176a\0\u17b4\0\u17fe\0\u1848\0\u1892\0\u18dc\0\u1926\0\u1970"+
    "\0\u19ba\0\u1a04\0\u1a4e\0\u1a98\0\u1ae2\0\u1b2c\0\u1b76\0\u1bc0"+
    "\0\u1c0a\0\u1c54\0\u1c9e\0\u1ce8\0\u1d32\0\u1d7c\0\u1dc6\0\u1e10"+
    "\0\u1e5a\0\u1ea4\0\u1eee\0\u1f38\0\u1f82\0\u1fcc\0\u2016\0\u2060"+
    "\0\u20aa\0\u20f4\0\u213e\0\u2188\0\u21d2\0\u06a6\0\u221c\0\u2266"+
    "\0\u06a6\0\u22b0\0\u22fa\0\u06a6\0\u2344\0\u238e\0\u23d8\0\u2422"+
    "\0\u246c\0\u24b6\0\u2500\0\u254a\0\u2594\0\u25de\0\u2628\0\u2672"+
    "\0\u26bc\0\u2706\0\u2750\0\u279a\0\u27e4\0\u282e\0\u2878\0\u28c2"+
    "\0\u290c\0\u2956\0\u29a0\0\u29ea\0\u2a34\0\u2a7e\0\u2ac8\0\u06a6"+
    "\0\u2b12\0\u2b5c\0\u0cb8\0\u2ba6\0\u0cb8\0\u2bf0\0\u2c3a\0\u2c84"+
    "\0\336\0\u2cce\0\u2d18\0\u2d62\0\u2dac\0\u2df6\0\u2e40\0\u2e8a"+
    "\0\u2ed4\0\u2f1e\0\u2f68\0\u2fb2\0\u2ffc\0\u3046\0\u3090\0\u30da"+
    "\0\u3124\0\u316e\0\u31b8\0\u3202\0\u324c\0\u3296\0\u32e0\0\u332a"+
    "\0\u3374\0\u33be\0\u3408\0\336\0\u3452\0\u349c\0\u34e6\0\u3530"+
    "\0\u357a\0\u35c4\0\u360e\0\u3658\0\u36a2\0\u36ec\0\u3736\0\u3780"+
    "\0\u37ca\0\u3814\0\u385e\0\u38a8\0\u38f2\0\u393c\0\u3986\0\u39d0"+
    "\0\u3a1a\0\u3a64\0\u3aae\0\u3af8\0\u3b42\0\u3b8c\0\u3bd6\0\u3c20"+
    "\0\u3c6a\0\u3cb4\0\u3cfe\0\u3d48\0\u3d92\0\u3ddc\0\u3e26\0\u3e70"+
    "\0\u3eba\0\u3f04\0\u3f4e\0\u3f98\0\u3fe2\0\u402c\0\u4076\0\u40c0"+
    "\0\u410a\0\u4154\0\u419e\0\u41e8\0\u4232\0\u427c\0\u42c6\0\u4310"+
    "\0\u435a\0\u43a4\0\u43ee\0\u4438\0\u4482\0\u44cc\0\u4516\0\u4560"+
    "\0\u45aa\0\u45f4\0\u463e\0\u06a6\0\u4688\0\u46d2\0\u471c\0\u4766"+
    "\0\u47b0\0\u47fa\0\u4844\0\u488e\0\u48d8\0\u4922\0\u496c\0\u49b6"+
    "\0\u4a00\0\u4a4a\0\u4a94\0\u4ade\0\u4b28\0\u4b72\0\u4bbc\0\u4c06"+
    "\0\u4c50\0\u4c9a\0\u4ce4\0\u4d2e\0\u4d78\0\u4dc2\0\u4e0c\0\u4e56"+
    "\0\u4ea0\0\u4eea\0\u4f34\0\u4f7e\0\u4fc8\0\u5012\0\u505c\0\u50a6"+
    "\0\u50f0\0\u513a\0\u5184\0\u51ce\0\u5218\0\u5262\0\u52ac\0\u52f6"+
    "\0\u5340\0\u538a\0\u53d4\0\u541e\0\u5468\0\u54b2\0\u54fc\0\u5546"+
    "\0\u5590\0\u55da\0\u5624\0\u566e\0\u56b8\0\u5702\0\u574c\0\u5796"+
    "\0\u57e0\0\u582a\0\u5874\0\u58be\0\u5908\0\u5952\0\u599c\0\u59e6"+
    "\0\u5a30\0\u5a7a\0\u5ac4\0\u5b0e\0\u5b58\0\u5ba2\0\u5bec\0\u5c36"+
    "\0\u5c80\0\u5cca\0\u5d14\0\u5d5e\0\u5da8\0\u5df2\0\u5e3c\0\u5e86"+
    "\0\u5ed0\0\u5f1a\0\u5f64\0\u5fae\0\u5ff8\0\u6042\0\u608c\0\u60d6"+
    "\0\u6120\0\u616a\0\u61b4\0\u61fe\0\u6248\0\u6292\0\u62dc\0\u6326"+
    "\0\u6370\0\u63ba\0\u6404\0\u644e\0\u6498\0\u64e2\0\u652c\0\u6576"+
    "\0\u65c0\0\u660a\0\u6654\0\u669e\0\u66e8\0\u6732\0\u677c\0\u67c6"+
    "\0\u6810\0\u685a\0\u68a4\0\u68ee\0\u6938\0\u6982\0\u69cc\0\u6a16"+
    "\0\u6a60\0\u6aaa\0\u6af4\0\u6b3e\0\u06a6\0\u47fa\0\u6b88\0\u6bd2"+
    "\0\u6c1c\0\u6c66\0\u6cb0\0\u6cfa\0\u6d44\0\u6d8e\0\u6dd8\0\u6e22"+
    "\0\u6e6c\0\u6eb6\0\u6f00\0\u6f4a\0\u6f94\0\u6fde\0\u7028\0\u7072"+
    "\0\u70bc\0\u7106\0\u7150\0\u719a\0\u71e4\0\u722e\0\u7278\0\u72c2"+
    "\0\336\0\u730c\0\u7356\0\u73a0\0\u73ea\0\u7434\0\u747e\0\u74c8"+
    "\0\u7512\0\u755c\0\u75a6\0\u75f0\0\u763a\0\u7684\0\u76ce\0\u7718"+
    "\0\u38f2\0\u7762\0\u77ac\0\u77f6\0\u7840\0\u788a\0\u78d4\0\u791e"+
    "\0\u7968\0\u79b2\0\u79fc\0\u7a46\0\u7a90\0\u7ada\0\u7b24\0\u7b6e"+
    "\0\u7bb8\0\u7c02\0\u7c4c\0\u7c96\0\u7ce0\0\u7d2a\0\u7d74\0\u7dbe"+
    "\0\u7e08\0\u7e52\0\u7e9c\0\u7ee6\0\u7f30\0\u7f7a\0\u7fc4\0\u800e"+
    "\0\u8058\0\u80a2\0\u80ec\0\u8136\0\u8180\0\u81ca\0\u8214\0\u825e"+
    "\0\u82a8\0\u0cb8\0\224\0\u82f2\0\u833c\0\u8386\0\u83d0\0\u841a"+
    "\0\u8464\0\u84ae\0\u84f8\0\u8542\0\u858c\0\u85d6\0\u8620\0\u866a"+
    "\0\u86b4\0\u86fe\0\u8748\0\u8792\0\u87dc\0\u8826\0\u8870\0\u88ba"+
    "\0\u8904\0\u894e\0\u8998\0\u89e2\0\u8a2c\0\u8a76\0\u8ac0\0\u8b0a"+
    "\0\u8b54\0\u8b9e\0\u8be8\0\u8c32\0\u8c7c\0\u8cc6\0\u8d10\0\u8d5a"+
    "\0\u06a6\0\u8da4\0\u8dee\0\u8e38\0\u8e82\0\u8ecc\0\u7f7a\0\u8f16"+
    "\0\u8f60\0\u8faa\0\u8ff4\0\u903e\0\u9088\0\u90d2\0\u911c\0\u9166"+
    "\0\u91b0\0\u91fa\0\336\0\u9244\0\u928e";

  private static int [] zzUnpackRowMap() {
    int [] result = new int[533];
    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\3\1\4\1\5\1\4\1\5\1\4\1\6\1\7"+
    "\1\10\1\11\1\12\1\13\1\14\1\15\1\16\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\5\1\4\1\40\1\41\1\42\1\43\1\44\1\45"+
    "\1\27\2\4\1\46\1\4\1\47\1\50\1\3\1\51"+
    "\2\4\1\52\2\4\1\53\1\4\2\5\1\4\1\54"+
    "\10\4\1\30\1\27\1\35\1\55\1\56\1\57\42\60"+
    "\1\61\5\60\1\62\41\60\6\3\1\0\17\3\11\0"+
    "\3\3\2\0\3\3\2\0\2\3\1\0\1\3\1\0"+
    "\26\3\6\0\1\3\5\4\1\0\17\4\11\0\1\3"+
    "\2\4\2\0\3\4\2\0\2\4\1\0\1\4\1\0"+
    "\1\3\25\4\6\0\2\63\1\5\1\63\1\5\1\64"+
    "\1\0\1\63\1\64\3\63\1\65\4\63\1\66\4\63"+
    "\11\0\1\63\1\5\1\63\2\0\2\63\1\5\2\0"+
    "\1\66\1\65\1\67\1\63\1\0\12\63\2\5\12\63"+
    "\14\0\1\35\20\0\1\35\62\0\1\3\5\4\1\0"+
    "\1\4\1\70\1\4\1\71\4\4\1\72\6\4\11\0"+
    "\1\3\2\4\2\0\3\4\2\0\2\4\1\0\1\4"+
    "\1\0\1\3\5\4\1\73\17\4\6\0\1\3\5\4"+
    "\1\0\4\4\1\74\1\75\1\4\1\76\7\4\11\0"+
    "\1\3\2\4\2\0\3\4\2\0\2\4\1\0\1\4"+
    "\1\0\1\3\6\4\1\77\16\4\6\0\1\3\5\4"+
    "\1\0\1\4\1\100\1\101\2\4\1\102\1\103\1\104"+
    "\1\105\1\106\1\4\1\107\1\110\1\111\1\112\11\0"+
    "\1\3\2\4\2\0\3\4\2\0\2\4\1\0\1\4"+
    "\1\0\1\3\1\4\1\113\5\4\1\114\15\4\6\0"+
    "\1\3\5\4\1\0\2\4\1\115\1\4\1\116\1\4"+
    "\1\117\10\4\11\0\1\3\2\4\2\0\3\4\2\0"+
    "\2\4\1\0\1\4\1\0\1\3\25\4\6\0\1\3"+
    "\5\4\1\0\1\4\1\120\12\4\1\121\2\4\11\0"+
    "\1\3\2\4\2\0\3\4\2\0\2\4\1\0\1\4"+
    "\1\0\1\3\25\4\6\0\1\3\5\4\1\0\1\122"+
    "\7\4\1\123\3\4\1\124\2\4\11\0\1\3\2\4"+
    "\2\0\3\4\2\0\2\4\1\0\1\4\1\0\1\3"+
    "\25\4\6\0\1\3\5\4\1\0\1\4\1\125\1\4"+
    "\1\126\2\4\1\127\1\130\1\4\1\131\1\4\1\132"+
    "\3\4\11\0\1\3\2\4\2\0\3\4\2\0\2\4"+
    "\1\0\1\4\1\0\1\3\1\4\1\133\1\4\1\134"+
    "\1\4\1\135\1\4\1\136\4\4\1\137\10\4\6\0"+
    "\1\3\5\4\1\0\1\4\1\140\12\4\1\141\2\4"+
    "\11\0\1\3\2\4\2\0\3\4\2\0\2\4\1\0"+
    "\1\4\1\0\1\3\25\4\6\0\1\3\5\4\1\0"+
    "\2\4\1\142\10\4\1\143\3\4\11\0\1\3\2\4"+
    "\2\0\3\4\2\0\2\4\1\0\1\4\1\0\1\3"+
    "\25\4\6\0\1\3\5\4\1\0\1\4\1\144\3\4"+
    "\1\145\2\4\1\146\3\4\1\147\2\4\11\0\1\3"+
    "\2\4\2\0\3\4\2\0\2\4\1\0\1\4\1\0"+
    "\1\3\1\4\1\150\1\4\1\151\21\4\6\0\1\3"+
    "\5\4\1\0\4\4\1\152\1\4\1\153\10\4\11\0"+
    "\1\3\2\4\2\0\3\4\2\0\2\4\1\0\1\4"+
    "\1\0\1\3\25\4\6\0\1\3\5\4\1\0\1\4"+
    "\1\154\5\4\1\155\1\156\1\4\1\157\4\4\11\0"+
    "\1\3\2\4\2\0\3\4\2\0\2\4\1\0\1\4"+
    "\1\0\1\3\25\4\6\0\1\3\5\4\1\0\6\4"+
    "\1\160\2\4\1\161\1\162\4\4\11\0\1\3\2\4"+
    "\2\0\1\4\1\163\1\4\2\0\2\4\1\0\1\4"+
    "\1\0\1\3\1\4\1\164\23\4\6\0\1\3\5\4"+
    "\1\0\1\4\1\165\6\4\1\162\5\4\1\166\11\0"+
    "\1\3\2\4\2\0\3\4\2\0\2\4\1\0\1\4"+
    "\1\0\1\3\25\4\6\0\1\3\5\4\1\0\1\4"+
    "\1\167\6\4\1\170\1\4\1\171\1\4\1\172\2\4"+
    "\11\0\1\3\2\4\2\0\1\4\1\173\1\4\2\0"+
    "\2\4\1\0\1\4\1\0\1\3\2\4\1\166\22\4"+
    "\34\0\1\174\112\0\1\35\223\0\1\35\1\0\1\175"+
    "\16\0\1\176\41\0\26\177\1\200\3\177\1\201\4\177"+
    "\1\202\2\177\1\0\47\177\33\0\1\27\112\0\1\27"+
    "\104\0\1\35\6\0\1\35\53\0\37\41\1\203\2\41"+
    "\1\0\1\204\46\41\1\3\5\4\1\0\2\4\1\205"+
    "\1\206\2\4\1\205\1\4\1\207\2\4\1\132\1\210"+
    "\2\4\11\0\1\3\2\4\2\0\3\4\2\0\2\4"+
    "\1\0\1\4\1\0\1\3\25\4\6\0\1\3\5\4"+

⌨️ 快捷键说明

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