當前位置: 首頁>>代碼示例>>Java>>正文


Java Token.UNDEFINED屬性代碼示例

本文整理匯總了Java中org.eclipse.jface.text.rules.Token.UNDEFINED屬性的典型用法代碼示例。如果您正苦於以下問題:Java Token.UNDEFINED屬性的具體用法?Java Token.UNDEFINED怎麽用?Java Token.UNDEFINED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.jface.text.rules.Token的用法示例。


在下文中一共展示了Token.UNDEFINED屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: evaluate

@Override
public IToken evaluate(ICharacterScanner scanner1, boolean resume) {
	if (!(scanner1 instanceof BatchDocumentPartitionScanner)){
		return Token.UNDEFINED;
	}
	BatchDocumentPartitionScanner scanner = (BatchDocumentPartitionScanner)scanner1;
	if (scanner.getOffset()<ECHO.length()){
		/* would be a problem on start on going back...*/
		return Token.UNDEFINED;
	}
	scanner.unread(); // go to character before
	int charBeforeAsInt = scanner.read(); // get character, moves to origin pos again
	/* fast guard closing:*/
	if (charBeforeAsInt!='o' && charBeforeAsInt!='O'){ // echo ECHO <- last character must be an o other wise guard close...
		return Token.UNDEFINED;
	}
	ICharacterScannerCodePosSupport codePosSupport = new ICharacterScannerCodePosSupport(scanner);
	if (parserSupport.isAfterEchoHandled(codePosSupport)){
		return getSuccessToken();
	}
	codePosSupport.resetToStartPos();
	return Token.UNDEFINED;
}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:23,代碼來源:AfterEchoDocumentRule.java

示例2: evaluate

@Override
public IToken evaluate(ICharacterScanner scanner, boolean resume) {
	int r = scanner.read();
	scanner.unread();
	/* fast guard closing:*/
	if (ICharacterScanner.EOF==r || r!='<'){
		return Token.UNDEFINED;
	}
	
	ICharacterScannerCodePosSupport codePosSupport = new ICharacterScannerCodePosSupport(scanner);
	if (hereStringSupport.isHereStringStateHandled(codePosSupport)){
		return getSuccessToken();
	}
	codePosSupport.resetToStartPos();
	return Token.UNDEFINED;
}
 
開發者ID:de-jcup,項目名稱:eclipse-bash-editor,代碼行數:16,代碼來源:HereStringRule.java

示例3: evaluate

@Override
public IToken evaluate(ICharacterScanner scanner, boolean resume) {
	int r = scanner.read();
	scanner.unread();
	/* fast guard closing:*/
	if (ICharacterScanner.EOF==r || r!='<'){
		return Token.UNDEFINED;
	}
	
	ICharacterScannerCodePosSupport codePosSupport = new ICharacterScannerCodePosSupport(scanner);
	if (hereDocSupport.isHereDocStateHandled(codePosSupport)){
		return getSuccessToken();
	}
	codePosSupport.resetToStartPos();
	return Token.UNDEFINED;
}
 
開發者ID:de-jcup,項目名稱:eclipse-bash-editor,代碼行數:16,代碼來源:HereDocumentRule.java

示例4: doEvaluate

@Override
protected IToken doEvaluate(final ICharacterScanner scanner, final boolean resume) {

  if (resume) {
    if (this.endSequenceDetected(scanner)) {
      return this.fToken;
    }
  } else {
    final int c = scanner.read();
    if (c == this.fStartSequence[0]) {
      if (this.sequenceDetected(scanner, this.fStartSequence, false)) {
        if (this.endSequenceDetected(scanner)) {
          return this.fToken;
        }
      }
    }
  }

  scanner.unread();
  return Token.UNDEFINED;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:21,代碼來源:RelationBoundsRule.java

示例5: evaluate

public IToken evaluate( ICharacterScanner scanner){

      buffer.setLength(0);

      int c = read(scanner);
      if (c == '&') {

         int i = 0;
         do {
            c = read(scanner);
            i++;

            if (c == '<' || c == ']') {
               for (int j = i - 1; j > 0; j--)
                  scanner.unread();
               return Token.UNDEFINED;
            }
         } while (c != ';');
         return fToken;
      }

      scanner.unread();
      return Token.UNDEFINED;
   }
 
開發者ID:nextinterfaces,項目名稱:http4e,代碼行數:24,代碼來源:EscapedCharRule.java

示例6: evaluate

@Override
public IToken evaluate(ICharacterScanner scanner, boolean resume) {
	if (fColumn == UNDEFINED) return doEvaluate(scanner, resume);

	int c = scanner.read();
	scanner.unread();
	if (c == fStartSequence[0]) {
		int col = scanner.getColumn();
		if (col == 1) {
			scanner.unread();
			int p = scanner.read();
			if (p == '\n') col = 0;
		}
		return (fColumn == col ? doEvaluate(scanner, resume) : Token.UNDEFINED);
	}
	return Token.UNDEFINED;
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:17,代碼來源:FirstColumnRule.java

示例7: doEvaluate

/**
 * Does the actual evaluation of the stream.
 * 
 * @param scanner The scanner
 * @param count The initial count of {
 * @return <code>fToken</code> on success, <code>Token.UNDEFINED</code> if
 * the match doesn't succeed
 */
private IToken doEvaluate(ICharacterScanner scanner, int count) {
    boolean inString = false;
    int c = scanner.read();

    if (((char) c) == '{') {
        do {
            c = scanner.read();
            if (((char) c) == '{' && !inString)
                count++;
            else if (((char) c) == '}' && !inString)
                count--;
            else if (((char) c) == '"' && !inString)
                inString = true;
            else if (((char) c) == '"' && inString)
                inString = false;
            else if (c == ICharacterScanner.EOF)
            	return Token.UNDEFINED;
        } while (count > 0);
        return fToken;
    }
    scanner.unread();
    return Token.UNDEFINED;
}
 
開發者ID:eclipse,項目名稱:texlipse,代碼行數:31,代碼來源:BibBraceRule.java

示例8: evaluate

public IToken evaluate(ICharacterScanner scanner) {
    int count = 0;
    int charsRead = 0;
    int c = scanner.read();
    if (((char) c) == '"') {
            do {
                c = scanner.read();
                charsRead++;
                if (c == ICharacterScanner.EOF) {
                    unwind(scanner, charsRead);
                    return Token.UNDEFINED;
                } else if (((char) c) == '{') {
                    count++;
                } else if (((char) c) == '}') {
                    if (count == 0) {
                        unwind(scanner, charsRead);
                        return Token.UNDEFINED;
                    }
                    count--;
                }
            } while (((char) c) != '"');
            return fToken;
    }
    scanner.unread();
    return Token.UNDEFINED;
}
 
開發者ID:eclipse,項目名稱:texlipse,代碼行數:26,代碼來源:BibStringRule.java

示例9: evaluate

@Override
public IToken evaluate(ICharacterScanner scanner) {
	int col = scanner.getColumn();
	if (col == 1) {
		scanner.unread();
		int p = scanner.read();
		if (p == '\n') col = 0;
	}

	try {
		if (col == 0) {
			String text = getScanText(scanner);
			if (tagStarts(text)) {
				gotoEOB(scanner);
				return getSuccessToken();
			}
		}
	} catch (BadLocationException e) {
		Log.error("HtmlCodeRule", e);
	}
	return Token.UNDEFINED;
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:22,代碼來源:HtmlCodeRule.java

示例10: evaluate

public IToken evaluate(ICharacterScanner scanner) {

		buffer.setLength(0);

		charsRead = 0;
		int c = read(scanner);

		if (c == matchString.charAt(0)) {
			do {
				c = read(scanner);
			} while (isOK((char) c));

			if (charsRead == matchString.length()) {
				return fToken;
			} else {
				rewind(scanner);
				return Token.UNDEFINED;
			}

		}

		scanner.unread();
		return Token.UNDEFINED;
	}
 
開發者ID:ncleclipse,項目名稱:ncl30-eclipse,代碼行數:24,代碼來源:CDataRule.java

示例11: doEvaluate

protected IToken doEvaluate(ICharacterScanner scanner, boolean resume) {

		if (resume) {

			if (endSequenceDetected(scanner))
				return fToken;

		} else {
			int c= scanner.read();
			if (c == fStartSequence[0]) {
				scanner.unread();
				scanner.unread();
				int before = scanner.read();
				
				if (before=='\\'){
					return Token.UNDEFINED;
				}
				scanner.read();
				
				if (sequenceDetected(scanner, fStartSequence, false)) {
					if (endSequenceDetected(scanner))
						return fToken;
				}
			}
		}

		scanner.unread();
		return Token.UNDEFINED;
	}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:29,代碼來源:BatchStringRule.java

示例12: evaluate

@Override
public IToken evaluate(ICharacterScanner scanner, boolean resume) {
	char start = (char) scanner.read();
	if ('-' !=start) {
		scanner.unread();
		return Token.UNDEFINED;
	}

	/* check if the former character is a space - if not this is not an argument */
	scanner.unread();
	scanner.unread();
	char beforeStart = (char) scanner.read();
	if (' ' !=beforeStart){
		/* no unread necessary, scanner is at start start*/
		return Token.UNDEFINED;
	}
	/* go after start again*/
	scanner.read();
	
	/* okay could be a parameter*/
	do {
		char c = (char) scanner.read();
		if (! isPartOfParameter(c)) {
			scanner.unread();
			break;
		}
	} while (true);
	return getSuccessToken();
}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:29,代碼來源:CommandParameterRule.java

示例13: evaluate

@Override
public IToken evaluate(final ICharacterScanner scanner) {
  final int c = scanner.read();
  if (c == '[' || c == ']') {
    return this.token;
  }
  scanner.unread();
  return Token.UNDEFINED;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:9,代碼來源:BracketsRule.java

示例14: evaluate

@Override
public IToken evaluate(final ICharacterScanner scanner) {
  final int c = scanner.read();
  if (c == '(' || c == ')') {
    return this.token;
  }
  scanner.unread();
  return Token.UNDEFINED;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:9,代碼來源:BracketsRule.java

示例15: evaluate

@Override
public IToken evaluate(final ICharacterScanner scanner) {
  final int c = scanner.read();
  if (c == this.specChar) {
    return this.token;
  }
  scanner.unread();
  return Token.UNDEFINED;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:9,代碼來源:VerticalBarRule.java


注:本文中的org.eclipse.jface.text.rules.Token.UNDEFINED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。