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

📄 csharptokenmaker.java

📁 具有不同语法高亮的编辑器实例
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
    "\6\13\1\u013b\7\13\1\5\4\0\1\5\4\13\1\72"+
    "\1\5\1\0\1\5\5\13\1\u013c\5\13\1\0\3\13"+
    "\2\0\1\13\1\0\2\13\11\0\16\13\1\5\4\0"+
    "\1\5\4\13\1\72\1\5\1\0\1\5\4\13\1\371"+
    "\6\13\1\0\3\13\2\0\1\13\1\0\2\13\11\0"+
    "\16\13\1\5\4\0\1\5\4\13\1\72\1\5\1\0"+
    "\1\5\13\13\1\0\3\13\2\0\1\13\1\0\2\13"+
    "\11\0\6\13\1\131\7\13\1\5\4\0\1\5\4\13"+
    "\1\72\1\5\1\0\1\5\4\13\1\u013d\6\13\1\0"+
    "\3\13\2\0\1\13\1\0\2\13\11\0\16\13\1\271"+
    "\1\0\7\271\1\u013e\6\271\3\u013e\3\271\2\u013e\2\271"+
    "\1\u013e\1\271\1\u013e\1\271\1\146\2\271\1\u013e\12\271"+
    "\1\u013e\5\271\1\u013e\10\271\1\0\7\271\1\u013f\6\271"+
    "\3\u013f\3\271\2\u013f\2\271\1\u013f\1\271\1\u013f\1\271"+
    "\1\146\2\271\1\u013f\12\271\1\u013f\5\271\1\u013f\10\271"+
    "\1\0\7\271\1\u0140\6\271\3\u0140\3\271\2\u0140\2\271"+
    "\1\u0140\1\271\1\u0140\1\271\1\272\2\271\1\u0140\12\271"+
    "\1\u0140\5\271\1\u0140\7\271\1\5\4\0\1\5\4\13"+
    "\1\72\1\5\1\0\1\5\4\13\1\317\6\13\1\0"+
    "\3\13\2\0\1\13\1\0\2\13\11\0\16\13\1\302"+
    "\1\0\3\302\1\u0103\3\302\1\306\6\302\3\306\3\302"+
    "\2\306\2\302\1\306\1\302\1\306\3\302\1\u0104\1\306"+
    "\12\302\1\306\5\302\1\306\10\302\1\0\3\302\1\u0103"+
    "\3\302\1\u0141\6\302\3\u0141\3\302\2\u0141\2\302\1\u0141"+
    "\1\302\1\u0141\3\302\1\u0104\1\u0141\12\302\1\u0141\5\302"+
    "\1\u0141\7\302\1\5\4\0\1\5\4\13\1\72\1\5"+
    "\1\0\1\5\5\13\1\165\5\13\1\0\3\13\2\0"+
    "\1\13\1\0\2\13\11\0\16\13\1\5\4\0\1\5"+
    "\4\13\1\72\1\5\1\0\1\5\3\13\1\u0142\7\13"+
    "\1\0\3\13\2\0\1\13\1\0\2\13\11\0\2\13"+
    "\1\u012b\13\13\1\5\4\0\1\5\4\13\1\72\1\5"+
    "\1\0\1\5\13\13\1\0\3\13\2\0\1\13\1\0"+
    "\2\13\11\0\12\13\1\u0142\3\13\1\5\4\0\1\5"+
    "\4\13\1\72\1\5\1\0\1\5\13\13\1\0\3\13"+
    "\2\0\1\13\1\0\2\13\11\0\1\13\1\u0143\14\13"+
    "\1\5\4\0\1\5\4\13\1\72\1\5\1\0\1\5"+
    "\1\u0144\12\13\1\0\3\13\2\0\1\13\1\0\2\13"+
    "\11\0\16\13\1\5\4\0\1\5\4\13\1\72\1\5"+
    "\1\0\1\5\13\13\1\0\3\13\2\0\1\13\1\0"+
    "\2\13\11\0\2\13\1\u0145\13\13\1\5\4\0\1\5"+
    "\4\13\1\72\1\5\1\0\1\5\1\246\12\13\1\0"+
    "\3\13\2\0\1\13\1\0\2\13\11\0\16\13\1\5"+
    "\4\0\1\5\4\13\1\72\1\5\1\0\1\5\13\13"+
    "\1\0\3\13\2\0\1\13\1\0\2\13\11\0\6\13"+
    "\1\u0146\7\13\57\0\1\u0147\31\0\1\236\127\0\1\u0148"+
    "\14\0\1\5\4\0\5\5\1\0\1\5\1\0\14\5"+
    "\1\0\3\5\2\0\1\5\1\0\2\5\11\0\2\5"+
    "\1\236\14\5\4\0\5\5\1\0\1\5\1\0\14\5"+
    "\1\0\3\5\2\0\1\5\1\0\2\5\11\0\2\5"+
    "\1\u0149\14\5\4\0\1\5\4\13\1\72\1\5\1\0"+
    "\1\5\13\13\1\0\3\13\2\0\1\13\1\0\2\13"+
    "\11\0\1\13\1\165\14\13\1\5\4\0\1\5\4\13"+
    "\1\72\1\5\1\0\1\5\13\13\1\0\3\13\2\0"+
    "\1\13\1\0\2\13\11\0\13\13\1\131\2\13\1\5"+
    "\4\0\1\5\4\13\1\72\1\5\1\0\1\5\5\13"+
    "\1\u014a\5\13\1\0\3\13\2\0\1\13\1\0\2\13"+
    "\11\0\16\13\1\271\1\0\7\271\1\144\6\271\3\144"+
    "\3\271\2\144\2\271\1\144\1\271\1\144\1\271\1\146"+
    "\2\271\1\144\12\271\1\144\5\271\1\144\10\271\1\0"+
    "\7\271\1\273\6\271\3\273\3\271\2\273\2\271\1\273"+
    "\1\271\1\273\1\271\1\146\2\271\1\273\12\271\1\273"+
    "\5\271\1\273\10\271\1\0\7\271\1\144\6\271\3\144"+
    "\3\271\2\144\2\271\1\144\1\271\1\144\1\271\1\272"+
    "\2\271\1\144\12\271\1\144\5\271\1\144\7\271\1\302"+
    "\1\0\3\302\1\u0103\3\302\1\304\6\302\3\304\3\302"+
    "\2\304\2\302\1\304\1\302\1\304\3\302\1\u0104\1\304"+
    "\12\302\1\304\5\302\1\304\7\302\1\5\4\0\1\5"+
    "\4\13\1\72\1\5\1\0\1\5\4\13\1\u014b\6\13"+
    "\1\0\3\13\2\0\1\13\1\0\2\13\11\0\16\13"+
    "\1\5\4\0\1\5\4\13\1\72\1\5\1\0\1\5"+
    "\13\13\1\0\3\13\2\0\1\13\1\0\2\13\11\0"+
    "\1\246\15\13\1\5\4\0\1\5\4\13\1\72\1\5"+
    "\1\0\1\5\13\13\1\0\3\13\2\0\1\13\1\0"+
    "\2\13\11\0\3\13\1\u014c\12\13\1\5\4\0\1\5"+
    "\1\246\3\13\1\72\1\5\1\0\1\5\13\13\1\0"+
    "\3\13\2\0\1\13\1\0\2\13\11\0\16\13\1\5"+
    "\4\0\1\5\4\13\1\72\1\5\1\0\1\5\1\255"+
    "\12\13\1\0\3\13\2\0\1\13\1\0\2\13\11\0"+
    "\16\13\56\0\1\236\71\0\1\u014d\13\0\1\5\4\0"+
    "\5\5\1\0\1\5\1\0\14\5\1\0\3\5\2\0"+
    "\1\5\1\0\2\5\11\0\5\5\1\236\11\5\4\0"+
    "\1\5\4\13\1\72\1\5\1\0\1\5\5\13\1\u014e"+
    "\5\13\1\0\3\13\2\0\1\13\1\0\2\13\11\0"+
    "\16\13\1\5\4\0\1\5\4\13\1\72\1\5\1\0"+
    "\1\5\13\13\1\0\3\13\2\0\1\13\1\0\2\13"+
    "\11\0\6\13\1\246\7\13\1\5\4\0\1\5\4\13"+
    "\1\72\1\5\1\0\1\5\1\13\1\131\11\13\1\0"+
    "\3\13\2\0\1\13\1\0\2\13\11\0\16\13\61\0"+
    "\1\236\10\0\1\5\4\0\1\5\4\13\1\72\1\5"+
    "\1\0\1\5\13\13\1\0\3\13\2\0\1\13\1\0"+
    "\2\13\11\0\3\13\1\u0125\12\13";

  private static int [] zzUnpackTrans() {
    int [] result = new int[17864];
    int offset = 0;
    offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
    return result;
  }

  private static int zzUnpackTrans(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++);
      value--;
      do result[j++] = value; while (--count > 0);
    }
    return j;
  }


  /* error codes */
  private static final int ZZ_UNKNOWN_ERROR = 0;
  private static final int ZZ_NO_MATCH = 1;
  private static final int ZZ_PUSHBACK_2BIG = 2;

  /* error messages for the codes above */
  private static final String ZZ_ERROR_MSG[] = {
    "Unkown internal scanner error",
    "Error: could not match input",
    "Error: pushback value was too large"
  };

  /**
   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
   */
  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();

  private static final String ZZ_ATTRIBUTE_PACKED_0 =
    "\2\0\3\1\1\11\10\1\1\11\17\1\1\11\4\1"+
    "\2\11\11\1\1\11\2\1\1\11\2\1\1\11\1\1"+
    "\1\0\1\1\1\11\12\1\1\0\1\11\40\1\1\11"+
    "\3\1\1\11\27\1\1\11\1\0\2\11\7\0\1\1"+
    "\1\11\7\1\1\0\43\1\1\11\44\1\10\0\35\1"+
    "\1\11\21\1\6\0\32\1\3\0\16\1\2\0\4\1"+
    "\1\0\1\1";

  private static int [] zzUnpackAttribute() {
    int [] result = new int[334];
    int offset = 0;
    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
    return result;
  }

  private static int zzUnpackAttribute(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;
  }

  /** the input device */
  private java.io.Reader zzReader;

  /** the current state of the DFA */
  private int zzState;

  /** the current lexical state */
  private int zzLexicalState = YYINITIAL;

  /** this buffer contains the current text to be matched and is
      the source of the yytext() string */
  private char zzBuffer[];

  /** the textposition at the last accepting state */
  private int zzMarkedPos;

  /** the textposition at the last state to be included in yytext */
  private int zzPushbackPos;

  /** the current text position in the buffer */
  private int zzCurrentPos;

  /** startRead marks the beginning of the yytext() string in the buffer */
  private int zzStartRead;

  /** endRead marks the last character in the buffer, that has been read
      from input */
  private int zzEndRead;

  /** number of newlines encountered up to the start of the matched text */
  private int yyline;

  /** the number of characters up to the start of the matched text */
  private int yychar;

  /**
   * the number of characters from the last newline up to the start of the 
   * matched text
   */
  private int yycolumn;

  /** 
   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
   */
  private boolean zzAtBOL = true;

  /** zzAtEOF == true <=> the scanner is at the EOF */
  private boolean zzAtEOF;

  /* user code: */


/*****************************************************************************/


	/**
	 * Constructor.  This must be here because JFlex does not generate a
	 * no-parameter constructor.
	 */
	public CSharpTokenMaker() {
		super();
	}


/*****************************************************************************/


	/**
	 * Adds the token specified to the current linked list of tokens.
	 *
	 * @param tokenType The token's type.
	 */
	private void addToken(int tokenType) {
		addToken(zzStartRead, zzMarkedPos-1, tokenType);
	}


/*****************************************************************************/


	/**
	 * Adds the token specified to the current linked list of tokens.
	 *
	 * @param tokenType The token's type.
	 */
	private void addToken(int start, int end, int tokenType) {
		int so = start + offsetShift;
		addToken(zzBuffer, start,end, tokenType, so);
	}


/*****************************************************************************/


	/**
	 * Adds the token specified to the current linked list of tokens.
	 *
	 * @param array The character array.
	 * @param start The starting offset in the array.
	 * @param end The ending offset in the array.
	 * @param tokenType The token's type.
	 * @param startOffset The offset in the document at which this token
	 *                    occurs.
	 */
	public void addToken(char[] array, int start, int end, int tokenType, int startOffset) {
		super.addToken(array, start,end, tokenType, startOffset);
		zzStartRead = zzMarkedPos;
	}


/*****************************************************************************/


	/**
	 * Returns the first token in the linked list of tokens generated
	 * from <code>text</code>.  This method must be implemented by
	 * subclasses so they can correctly implement syntax highlighting.
	 *
	 * @param text The text from which to get tokens.
	 * @param initialTokenType The token type we should start with.
	 * @param startOffset The offset into the document at which
	 *        <code>text</code> starts.
	 * @return The first <code>Token</code> in a linked list representing
	 *         the syntax highlighted text.
	 */
	public Token getTokenList(Segment text, int initialTokenType, int startOffset) {

		resetTokenList();
		this.offsetShift = -text.offset + startOffset;

		// Start off in the proper state.
		int state = Token.NULL;
		switch (initialTokenType) {
			case Token.LITERAL_STRING_DOUBLE_QUOTE:
				state = VERBATIMSTRING;
				start = text.offset;
				break;
			case Token.COMMENT_MULTILINE:
				state = DELIMITEDCOMMENT;
				start = text.offset;
				break;
			default:
				state = Token.NULL;
		}

		s = text;
		try {
			yyreset(zzReader);
			yybegin(state);
			return yylex();
		} catch (IOException ioe) {
			ioe.printStackTrace();
			return new DefaultToken();
		}

	}


/*****************************************************************************/


	/**
	 * Refills the input buffer.
	 *
	 * @return      <code>true</code> if EOF was reached, otherwise
	 *              <code>false</code>.
	 * @exception   IOException  if any I/O-Error occurs.
	 */
	private boolean zzRefill() throws java.io.IOException {
		return zzCurrentPos>=s.offset+s.count;
	}


/*****************************************************************************/


	/**
	 * Resets the scanner to read from a new input stream.
	 * Does not close the old reader.
	 *
	 * All internal variables are reset, the old input stream 
	 * <b>cannot</b> be reused (internal buffer is discarded and lost).
	 * Lexical state is set to <tt>YY_INITIAL</tt>.
	 *
	 * @param reader   the new input stream 
	 */
	public final void yyreset(java.io.Reader reader) throws java.io.IOException {
		// 's' has been updated.
		zzBuffer = s.array;
		/*
		 * We replaced the line below with the two below it because zzRefill
		 * no longer "refills" the buffer (since the way we do it, it's always
		 * "full" the first time through, since it points to the segment's
		 * array).  So, we assign zzEndRead here.
		 */
		//zzStartRead = zzEndRead = s.offset;
		zzStartRead = s.offset;
		zzEndRead = zzStartRead + s.count - 1;
		zzCurrentPos = zzMarkedPos = zzPushbackPos = s.offset;
		zzLexicalState = YYINITIAL;
		zzReader = reader;
		zzAtBOL  = true;
		zzAtEOF  = false;
	}


/*****************************************************************************/



  /**
   * Creates a new scanner
   * There is also a java.io.InputStream version of this constructor.
   *
   * @param   in  the java.io.Reader to read input from.
   */
  public CSharpTokenMaker(java.io.Reader in) {
    this.zzReader = in;
  }

⌨️ 快捷键说明

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