本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}