亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? tokenmarker.java

?? jedit中獨(dú)立出來(lái)的語(yǔ)法高亮組件
?? JAVA
字號(hào):
/* * TokenMarker.java - Generic token marker * Copyright (C) 1998, 1999 Slava Pestov * * You may use and modify this package for any purpose. Redistribution is * permitted, in both source and binary form, provided that this notice * remains intact in all source distributions of this package. */package org.syntax.jedit.tokenmarker;import javax.swing.text.Segment;import java.util.*;/** * A token marker that splits lines of text into tokens. Each token carries * a length field and an indentification tag that can be mapped to a color * for painting that token.<p> * * For performance reasons, the linked list of tokens is reused after each * line is tokenized. Therefore, the return value of <code>markTokens</code> * should only be used for immediate painting. Notably, it cannot be * cached. * * @author Slava Pestov * @version $Id: TokenMarker.java,v 1.32 1999/12/13 03:40:30 sp Exp $ * * @see org.syntax.jedit.Token */public abstract class TokenMarker{	/**	 * A wrapper for the lower-level <code>markTokensImpl</code> method	 * that is called to split a line up into tokens.	 * @param line The line	 * @param lineIndex The line number	 */	public Token markTokens(Segment line, int lineIndex)	{		if(lineIndex >= length)		{			throw new IllegalArgumentException("Tokenizing invalid line: "				+ lineIndex);		}		lastToken = null;		LineInfo info = lineInfo[lineIndex];		LineInfo prev;		if(lineIndex == 0)			prev = null;		else			prev = lineInfo[lineIndex - 1];		byte oldToken = info.token;		byte token = markTokensImpl(prev == null ?			Token.NULL : prev.token,line,lineIndex);		info.token = token;		/*		 * This is a foul hack. It stops nextLineRequested		 * from being cleared if the same line is marked twice.		 *		 * Why is this necessary? It's all JEditTextArea's fault.		 * When something is inserted into the text, firing a		 * document event, the insertUpdate() method shifts the		 * caret (if necessary) by the amount inserted.		 *		 * All caret movement is handled by the select() method,		 * which eventually pipes the new position to scrollTo()		 * and calls repaint().		 *		 * Note that at this point in time, the new line hasn't		 * yet been painted; the caret is moved first.		 *		 * scrollTo() calls offsetToX(), which tokenizes the line		 * unless it is being called on the last line painted		 * (in which case it uses the text area's painter cached		 * token list). What scrollTo() does next is irrelevant.		 *		 * After scrollTo() has done it's job, repaint() is		 * called, and eventually we end up in paintLine(), whose		 * job is to paint the changed line. It, too, calls		 * markTokens().		 *		 * The problem was that if the line started a multiline		 * token, the first markTokens() (done in offsetToX())		 * would set nextLineRequested (because the line end		 * token had changed) but the second would clear it		 * (because the line was the same that time) and therefore		 * paintLine() would never know that it needed to repaint		 * subsequent lines.		 *		 * This bug took me ages to track down, that's why I wrote		 * all the relevant info down so that others wouldn't		 * duplicate it.		 */		 if(!(lastLine == lineIndex && nextLineRequested))			nextLineRequested = (oldToken != token);		lastLine = lineIndex;		addToken(0,Token.END);		return firstToken;	}	/**	 * An abstract method that splits a line up into tokens. It	 * should parse the line, and call <code>addToken()</code> to	 * add syntax tokens to the token list. Then, it should return	 * the initial token type for the next line.<p>	 *	 * For example if the current line contains the start of a 	 * multiline comment that doesn't end on that line, this method	 * should return the comment token type so that it continues on	 * the next line.	 *	 * @param token The initial token type for this line	 * @param line The line to be tokenized	 * @param lineIndex The index of the line in the document,	 * starting at 0	 * @return The initial token type for the next line	 */	protected abstract byte markTokensImpl(byte token, Segment line,		int lineIndex);	/**	 * Returns if the token marker supports tokens that span multiple	 * lines. If this is true, the object using this token marker is	 * required to pass all lines in the document to the	 * <code>markTokens()</code> method (in turn).<p>	 *	 * The default implementation returns true; it should be overridden	 * to return false on simpler token markers for increased speed.	 */	public boolean supportsMultilineTokens()	{		return true;	}	/**	 * Informs the token marker that lines have been inserted into	 * the document. This inserts a gap in the <code>lineInfo</code>	 * array.	 * @param index The first line number	 * @param lines The number of lines 	 */	public void insertLines(int index, int lines)	{		if(lines <= 0)			return;		length += lines;		ensureCapacity(length);		int len = index + lines;		System.arraycopy(lineInfo,index,lineInfo,len,			lineInfo.length - len);		for(int i = index + lines - 1; i >= index; i--)		{			lineInfo[i] = new LineInfo();		}	}		/**	 * Informs the token marker that line have been deleted from	 * the document. This removes the lines in question from the	 * <code>lineInfo</code> array.	 * @param index The first line number	 * @param lines The number of lines	 */	public void deleteLines(int index, int lines)	{		if (lines <= 0)			return;		int len = index + lines;		length -= lines;		System.arraycopy(lineInfo,len,lineInfo,			index,lineInfo.length - len);	}	/**	 * Returns the number of lines in this token marker.	 */	public int getLineCount()	{		return length;	}	/**	 * Returns true if the next line should be repainted. This	 * will return true after a line has been tokenized that starts	 * a multiline token that continues onto the next line.	 */	public boolean isNextLineRequested()	{		return nextLineRequested;	}	// protected members	/**	 * The first token in the list. This should be used as the return	 * value from <code>markTokens()</code>.	 */	protected Token firstToken;	/**	 * The last token in the list. New tokens are added here.	 * This should be set to null before a new line is to be tokenized.	 */	protected Token lastToken;	/**	 * An array for storing information about lines. It is enlarged and	 * shrunk automatically by the <code>insertLines()</code> and	 * <code>deleteLines()</code> methods.	 */	protected LineInfo[] lineInfo;	/**	 * The number of lines in the model being tokenized. This can be	 * less than the length of the <code>lineInfo</code> array.	 */	protected int length;	/**	 * The last tokenized line.	 */	protected int lastLine;	/**	 * True if the next line should be painted.	 */	protected boolean nextLineRequested;	/**	 * Creates a new <code>TokenMarker</code>. This DOES NOT create	 * a lineInfo array; an initial call to <code>insertLines()</code>	 * does that.	 */	protected TokenMarker()	{		lastLine = -1;	}	/**	 * Ensures that the <code>lineInfo</code> array can contain the	 * specified index. This enlarges it if necessary. No action is	 * taken if the array is large enough already.<p>	 *	 * It should be unnecessary to call this under normal	 * circumstances; <code>insertLine()</code> should take care of	 * enlarging the line info array automatically.	 *	 * @param index The array index	 */	protected void ensureCapacity(int index)	{		if(lineInfo == null)			lineInfo = new LineInfo[index + 1];		else if(lineInfo.length <= index)		{			LineInfo[] lineInfoN = new LineInfo[(index + 1) * 2];			System.arraycopy(lineInfo,0,lineInfoN,0,					 lineInfo.length);			lineInfo = lineInfoN;		}	}	/**	 * Adds a token to the token list.	 * @param length The length of the token	 * @param id The id of the token	 */	protected void addToken(int length, byte id)	{		if(id >= Token.INTERNAL_FIRST && id <= Token.INTERNAL_LAST)			throw new InternalError("Invalid id: " + id);		if(length == 0 && id != Token.END)			return;		if(firstToken == null)		{			firstToken = new Token(length,id);			lastToken = firstToken;		}		else if(lastToken == null)		{			lastToken = firstToken;			firstToken.length = length;			firstToken.id = id;		}		else if(lastToken.next == null)		{			lastToken.next = new Token(length,id);			lastToken = lastToken.next;		}		else		{			lastToken = lastToken.next;			lastToken.length = length;			lastToken.id = id;		}	}	/**	 * Inner class for storing information about tokenized lines.	 */	public class LineInfo	{		/**		 * Creates a new LineInfo object with token = Token.NULL		 * and obj = null.		 */		public LineInfo()		{		}		/**		 * Creates a new LineInfo object with the specified		 * parameters.		 */		public LineInfo(byte token, Object obj)		{			this.token = token;			this.obj = obj;		}		/**		 * The id of the last token of the line.		 */		public byte token;		/**		 * This is for use by the token marker implementations		 * themselves. It can be used to store anything that		 * is an object and that needs to exist on a per-line		 * basis.		 */		public Object obj;	}}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
a4yy欧美一区二区三区| 69久久夜色精品国产69蝌蚪网| 国产一区二区三区四区五区美女 | 日韩一区二区影院| 制服丝袜在线91| 在线观看91av| 91精品黄色片免费大全| 91精品国模一区二区三区| 在线综合+亚洲+欧美中文字幕| 欧美日韩一二三区| 在线成人小视频| 日韩欧美国产精品| 精品国产91九色蝌蚪| 久久日韩粉嫩一区二区三区| 国产性天天综合网| 国产精品久久久久一区| 亚洲欧美激情视频在线观看一区二区三区 | 99精品欧美一区二区蜜桃免费 | 久久视频一区二区| 国产亚洲人成网站| 国产精品久线在线观看| 亚洲精品日产精品乱码不卡| 亚洲综合区在线| 日韩 欧美一区二区三区| 蜜臀av一区二区在线免费观看| 狠狠色丁香久久婷婷综| 成人丝袜高跟foot| 91国在线观看| 日韩午夜在线影院| 国产午夜精品在线观看| 国产精品成人免费精品自在线观看| 亚洲欧美日韩国产成人精品影院| 亚洲福利视频导航| 精品中文字幕一区二区小辣椒| 国产成人精品免费一区二区| 色婷婷亚洲综合| 日韩一区二区三区在线| 日本一区二区视频在线观看| 亚洲精品国产精品乱码不99| 蜜桃视频一区二区三区在线观看| 国产精品一区二区久激情瑜伽 | 欧美唯美清纯偷拍| 久久日韩粉嫩一区二区三区| 亚洲人成网站在线| 日韩 欧美一区二区三区| 成人视屏免费看| 国产一区二区三区四| 91黄色免费网站| 久久免费电影网| 一区二区在线观看不卡| 国精品**一区二区三区在线蜜桃| www.亚洲国产| 日韩欧美色综合网站| 亚洲成av人**亚洲成av**| 精品成人一区二区三区四区| 国产精品色眯眯| 天堂在线一区二区| 丰满亚洲少妇av| 欧美一区二区网站| 亚洲丝袜制服诱惑| 老汉av免费一区二区三区| 91在线一区二区| 精品久久久久久久久久久久久久久久久| 亚洲欧美综合在线精品| 蜜臀av一级做a爰片久久| 91色婷婷久久久久合中文| 精品理论电影在线观看| 一区二区三区视频在线看| 国产老女人精品毛片久久| 欧美日韩在线综合| 中文字幕一区二区三区在线观看| 麻豆精品精品国产自在97香蕉| 91丨九色丨尤物| 国产偷国产偷亚洲高清人白洁| 日韩中文字幕一区二区三区| 91视频.com| 亚洲国产精品v| 国产一区二区在线视频| 9191精品国产综合久久久久久 | 蜜桃av噜噜一区| 亚洲一区成人在线| 久久综合99re88久久爱| 一区二区高清在线| 国产·精品毛片| 精品少妇一区二区三区在线视频| 夜夜嗨av一区二区三区四季av| 成人高清视频免费观看| 国产色综合一区| 久久99国产乱子伦精品免费| 91精品国产黑色紧身裤美女| 亚洲高清中文字幕| 欧美性xxxxxxxx| 亚洲精品福利视频网站| 99久久久精品| 中文字幕欧美一| 99天天综合性| 国产精品久久久久精k8 | 欧美性大战xxxxx久久久| 亚洲欧美一区二区三区久本道91| 国产成人精品亚洲日本在线桃色| 久久亚洲二区三区| 国产麻豆精品95视频| 精品国产伦一区二区三区观看方式 | 国产在线精品一区二区不卡了| 日韩一区二区三区在线视频| 欧美aa在线视频| 精品久久久久99| 韩国精品一区二区| 久久一二三国产| 国产精品亚洲视频| 中文字幕不卡的av| 99视频在线观看一区三区| 综合久久给合久久狠狠狠97色 | 国产亚洲欧美激情| 国产盗摄视频一区二区三区| 国产日韩欧美在线一区| 成人免费高清在线观看| 国产精品电影院| 在线观看亚洲a| 视频一区二区三区在线| 日韩午夜激情av| 国产精品 欧美精品| 中文成人综合网| 91蜜桃传媒精品久久久一区二区| 尤物视频一区二区| 91精品欧美综合在线观看最新| 久久激情五月婷婷| 国产精品美女久久久久高潮| 一本色道久久综合亚洲91| 亚洲综合激情另类小说区| 欧美嫩在线观看| 精品在线观看免费| 国产精品国产自产拍在线| 91极品视觉盛宴| 蜜桃久久久久久久| 欧美韩日一区二区三区四区| 91福利在线导航| 蜜桃av一区二区| 中文字幕一区二区在线观看 | 久久国产精品无码网站| 国产欧美一区二区精品婷婷| 91小视频免费看| 免费在线看成人av| 亚洲国产高清aⅴ视频| 欧美亚洲国产一卡| 韩国精品主播一区二区在线观看 | 欧美日韩高清不卡| 国内精品写真在线观看| 亚洲色图一区二区三区| 91精品婷婷国产综合久久| 成人午夜电影网站| 午夜精品成人在线| 久久精品视频网| 欧美日韩中文一区| 国产麻豆精品95视频| 亚洲国产精品影院| 久久久久久久久久电影| 在线观看三级视频欧美| 国产精品一区二区无线| 亚洲一区二区美女| 国产区在线观看成人精品| 欧美午夜理伦三级在线观看| 国产一二精品视频| 亚洲电影欧美电影有声小说| 国产亚洲欧洲一区高清在线观看| 欧美午夜片在线看| 成人免费毛片a| 理论片日本一区| 亚洲国产日日夜夜| 国产精品久线在线观看| 日韩欧美色电影| 欧美性生活久久| 成av人片一区二区| 黑人巨大精品欧美黑白配亚洲| 亚洲五码中文字幕| 中文字幕不卡在线观看| 精品成人一区二区| 欧美日韩精品欧美日韩精品一| 波多野结衣在线一区| 精品亚洲欧美一区| 日韩激情中文字幕| 一区二区在线看| 亚洲欧洲韩国日本视频| 国产亚洲欧洲997久久综合| 欧美一区二区不卡视频| 91福利区一区二区三区| www.爱久久.com| 国产精品自在欧美一区| 蜜臀久久久久久久| 五月婷婷色综合| 亚洲国产成人tv| 日韩电影在线一区| 欧美日韩视频不卡| 99国产精品久久久| 国产一区二区三区日韩| 美国十次综合导航| 日韩电影在线观看一区| 白白色亚洲国产精品| 成人午夜又粗又硬又大| 国产91在线|亚洲|