当前位置: 首页>>代码示例>>Java>>正文


Java ICharacterScanner.unread方法代码示例

本文整理汇总了Java中org.eclipse.jface.text.rules.ICharacterScanner.unread方法的典型用法代码示例。如果您正苦于以下问题:Java ICharacterScanner.unread方法的具体用法?Java ICharacterScanner.unread怎么用?Java ICharacterScanner.unread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.text.rules.ICharacterScanner的用法示例。


在下文中一共展示了ICharacterScanner.unread方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanupAndReturn

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
boolean cleanupAndReturn(ICharacterScanner scanner, boolean result){
	if (result){
		return true; // do not clean up - pos is as wanted
	}
	if (count==0){
		return result;
	}
	if (count>0){
		while(count!=0){
			scanner.unread();
			count--;
		}
	}else{
		while(count!=0){
			scanner.read();
			count++;
		}
	}
	return false;
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:21,代码来源:Counter.java

示例2: evaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
@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,代码行数:17,代码来源:HereStringRule.java

示例3: evaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
@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,代码行数:17,代码来源:HereDocumentRule.java

示例4: doEvaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
@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,代码行数:22,代码来源:RelationBoundsRule.java

示例5: cleanupAndReturn

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
private boolean cleanupAndReturn(ICharacterScanner scanner, boolean result){
	if (result){
		return true; // do not clean up - pos is as wanted
	}
	if (count==0){
		return result;
	}
	if (count>0){
		while(count!=0){
			scanner.unread();
			count--;
		}
	}else{
		while(count!=0){
			scanner.read();
			count++;
		}
	}
	return false;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:21,代码来源:ExactWordPatternRule.java

示例6: evaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
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:nextinterfaces,项目名称:http4e,代码行数:25,代码来源:CDataRule.java

示例7: sequenceDetected

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
protected boolean sequenceDetected(ICharacterScanner scanner,
		char[] sequence, boolean eofAllowed) {
	int c = scanner.read();
	if (sequence[0] == '<') {
		if (c == '?') {
			// processing instruction - abort
			scanner.unread();
			return false;
		}
		if (c == '!') {
			scanner.unread();
			// comment - abort
			return false;
		}
		if (c == '/') {
			// end tag
			scanner.unread();
			return false;
		}
	} else if (sequence[0] == '>') {
		scanner.unread();
	}
	return super.sequenceDetected(scanner, sequence, eofAllowed);
}
 
开发者ID:ncleclipse,项目名称:ncl30-eclipse,代码行数:25,代码来源:StartTagRule.java

示例8: evaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
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,代码行数:25,代码来源:CDataRule.java

示例9: scannerUnread

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
private void scannerUnread(ICharacterScanner scanner, Counter counter) {
	scanner.unread();
	counter.count--;
	if (trace){
		int length = traceSb.length();
		if (length<1){
			traceSb.append("[(-1)]");
		}else{
			length=length-1;
			traceSb.setLength(length);
		}
	}
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:14,代码来源:ExactWordPatternRule.java

示例10: doEvaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
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,代码行数:30,代码来源:BatchStringRule.java

示例11: evaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
@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,代码行数:30,代码来源:CommandParameterRule.java

示例12: evaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
@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,代码行数:10,代码来源:BracketsRule.java

示例13: endSequenceDetected

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
@Override
protected boolean endSequenceDetected(final ICharacterScanner scanner) {

  int readCount = 1;
  int c;
  int open = 0;
  while ((c = scanner.read()) != ICharacterScanner.EOF) {

    if (c == '{') {
      open++;
    } else if (c == '}') {
      open--;
      if (open == 0) {
        if (this.sequenceDetected(scanner, this.fEndSequence, this.fBreaksOnEOF)) {
          return true;
        }
      }
    }

    readCount++;
  }

  for (; readCount > 0; readCount--) {
    scanner.unread();
  }

  return false;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:29,代码来源:RelationBoundsRule.java

示例14: evaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
@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,代码行数:10,代码来源:BracketsRule.java

示例15: evaluate

import org.eclipse.jface.text.rules.ICharacterScanner; //导入方法依赖的package包/类
@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,代码行数:10,代码来源:VerticalBarRule.java


注:本文中的org.eclipse.jface.text.rules.ICharacterScanner.unread方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。