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


Java Token.EOF屬性代碼示例

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


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

示例1: nextToken

@Override
public IToken nextToken() {
	if (currentTemplateTextToken != null) {
		if (currentTemplateTextToken.hasNext())
			return currentTemplateTextToken.nextToken();
		else
			currentTemplateTextToken = null;
	}
	if (!getIterator().hasNext())
		return Token.EOF;
	ILexerTokenRegion next = getIterator().next();
	int tokenType = next.getLexerTokenType();
	switch (tokenType) {
	case RULE_TEMPLATE_HEAD:
	case RULE_TEMPLATE_MIDDLE: {
		currentTemplateTextToken = createTemplateToken(tokenType, next);
		return currentTemplateTextToken.nextToken();
	}
	default:
		setCurrentToken(next);
		return createToken(next);
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:23,代碼來源:TemplateAwareTokenScanner.java

示例2: nextToken

public IToken nextToken() {
	boolean isOriginalToken = true;
	if (!nextTokens.isEmpty()) {
		currentToken = nextTokens.remove(0);
		isOriginalToken = false;
	} else {
		currentToken = lexer.getNextToken();
	}
	if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
		return Token.EOF;
	}
	
	if (isOriginalToken) {
		splitCurrentToken();
	}
	
	TextAttribute textAttribute = null;
	String tokenName = currentToken.getName();
	if (tokenName != null) {
		de.darwinspl.preferences.resource.dwprofile.IDwprofileTokenStyle staticStyle = getStaticTokenStyle();
		// now call dynamic token styler to allow to apply modifications to the static
		// style
		de.darwinspl.preferences.resource.dwprofile.IDwprofileTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
		if (dynamicStyle != null) {
			textAttribute = getTextAttribute(dynamicStyle);
		}
	}
	
	return new Token(textAttribute);
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:30,代碼來源:DwprofileTokenScanner.java

示例3: nextToken

public IToken nextToken() {
	boolean isOriginalToken = true;
	if (!nextTokens.isEmpty()) {
		currentToken = nextTokens.remove(0);
		isOriginalToken = false;
	} else {
		currentToken = lexer.getNextToken();
	}
	if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
		return Token.EOF;
	}
	
	if (isOriginalToken) {
		splitCurrentToken();
	}
	
	TextAttribute textAttribute = null;
	String tokenName = currentToken.getName();
	if (tokenName != null) {
		eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTokenStyle staticStyle = getStaticTokenStyle();
		// now call dynamic token styler to allow to apply modifications to the static
		// style
		eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
		if (dynamicStyle != null) {
			textAttribute = getTextAttribute(dynamicStyle);
		}
	}
	
	return new Token(textAttribute);
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:30,代碼來源:HyexpressionTokenScanner.java

示例4: nextToken

public IToken nextToken() {
	boolean isOriginalToken = true;
	if (!nextTokens.isEmpty()) {
		currentToken = nextTokens.remove(0);
		isOriginalToken = false;
	} else {
		currentToken = lexer.getNextToken();
	}
	if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
		return Token.EOF;
	}
	
	if (isOriginalToken) {
		splitCurrentToken();
	}
	
	TextAttribute textAttribute = null;
	String tokenName = currentToken.getName();
	if (tokenName != null) {
		eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaTokenStyle staticStyle = getStaticTokenStyle();
		// now call dynamic token styler to allow to apply modifications to the static
		// style
		eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
		if (dynamicStyle != null) {
			textAttribute = getTextAttribute(dynamicStyle);
		}
	}
	
	return new Token(textAttribute);
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:30,代碼來源:HyvalidityformulaTokenScanner.java

示例5: nextToken

public IToken nextToken() {
	boolean isOriginalToken = true;
	if (!nextTokens.isEmpty()) {
		currentToken = nextTokens.remove(0);
		isOriginalToken = false;
	} else {
		currentToken = lexer.getNextToken();
	}
	if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
		return Token.EOF;
	}
	
	if (isOriginalToken) {
		splitCurrentToken();
	}
	
	TextAttribute textAttribute = null;
	String tokenName = currentToken.getName();
	if (tokenName != null) {
		eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTokenStyle staticStyle = getStaticTokenStyle();
		// now call dynamic token styler to allow to apply modifications to the static
		// style
		eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
		if (dynamicStyle != null) {
			textAttribute = getTextAttribute(dynamicStyle);
		}
	}
	
	return new Token(textAttribute);
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:30,代碼來源:HydatavalueTokenScanner.java

示例6: nextToken

public IToken nextToken() {
	boolean isOriginalToken = true;
	if (!nextTokens.isEmpty()) {
		currentToken = nextTokens.remove(0);
		isOriginalToken = false;
	} else {
		currentToken = lexer.getNextToken();
	}
	if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
		return Token.EOF;
	}
	
	if (isOriginalToken) {
		splitCurrentToken();
	}
	
	TextAttribute textAttribute = null;
	String tokenName = currentToken.getName();
	if (tokenName != null) {
		eu.hyvar.feature.mapping.resource.hymapping.IHymappingTokenStyle staticStyle = getStaticTokenStyle();
		// now call dynamic token styler to allow to apply modifications to the static
		// style
		eu.hyvar.feature.mapping.resource.hymapping.IHymappingTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
		if (dynamicStyle != null) {
			textAttribute = getTextAttribute(dynamicStyle);
		}
	}
	
	return new Token(textAttribute);
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:30,代碼來源:HymappingTokenScanner.java

示例7: nextToken

public IToken nextToken() {
	boolean isOriginalToken = true;
	if (!nextTokens.isEmpty()) {
		currentToken = nextTokens.remove(0);
		isOriginalToken = false;
	} else {
		currentToken = lexer.getNextToken();
	}
	if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
		return Token.EOF;
	}
	
	if (isOriginalToken) {
		splitCurrentToken();
	}
	
	TextAttribute textAttribute = null;
	String tokenName = currentToken.getName();
	if (tokenName != null) {
		eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsTokenStyle staticStyle = getStaticTokenStyle();
		// now call dynamic token styler to allow to apply modifications to the static
		// style
		eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
		if (dynamicStyle != null) {
			textAttribute = getTextAttribute(dynamicStyle);
		}
	}
	
	return new Token(textAttribute);
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:30,代碼來源:HyconstraintsTokenScanner.java

示例8: nextToken

public IToken nextToken() {
	boolean isOriginalToken = true;
	if (!nextTokens.isEmpty()) {
		currentToken = nextTokens.remove(0);
		isOriginalToken = false;
	} else {
		currentToken = lexer.getNextToken();
	}
	if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
		return Token.EOF;
	}
	
	if (isOriginalToken) {
		splitCurrentToken();
	}
	
	TextAttribute textAttribute = null;
	String tokenName = currentToken.getName();
	if (tokenName != null) {
		eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestTokenStyle staticStyle = getStaticTokenStyle();
		// now call dynamic token styler to allow to apply modifications to the static
		// style
		eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
		if (dynamicStyle != null) {
			textAttribute = getTextAttribute(dynamicStyle);
		}
	}
	
	return new Token(textAttribute);
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:30,代碼來源:HymanifestTokenScanner.java

示例9: nextToken

@Override
public IToken nextToken() {
	if (styles == null || styles.size() == 0) {
		lastStyle = Optional.absent();
		return Token.EOF;
	} else {
		lastStyle = Optional.of(styles.get(0));
		styles.remove(0);
		SyntaxStyle styleDef = lastStyle.get().style;
		Color color = ColorManager.getDefault().getColor(styleDef.color);
		return new Token(new TextAttribute(color, null, getStyleBitmap(styleDef)));
	}
}
 
開發者ID:curiosag,項目名稱:ftc,代碼行數:13,代碼來源:ParsedSqlTokensScanner.java

示例10: useContractedElementCompletion

/**
 * Used to determine whether there is any text after the current offset
 * within the same partition, excluding the current word Also returns true
 * if there is no white
 */
private boolean useContractedElementCompletion( int documentOffset,
        IDocument document){
    
    boolean textReached = false;
    boolean isRemainingWhiteSpace = true;
    
    try {
        ITypedRegion region = document.getPartition(documentOffset);
        
        int partitionOffset = region.getOffset();
        int partitionLength = region.getLength();
        
        int readLength = documentOffset - partitionOffset;
        int remainingLength = partitionLength - readLength;
        
        if( document.getLength() >= documentOffset + 1) {
            String firstTwo = document.get(partitionOffset, 2);
            if( firstTwo.equals("<<"))
                return false;
        }
        
        scanner.setRange(document, documentOffset, remainingLength);
        
        IToken token = null;
        while ((token = scanner.nextToken()) != Token.WHITESPACE
                && token != Token.EOF) {
            isRemainingWhiteSpace = false;
            continue;
        }
        
        while ((token = scanner.nextToken()) == Token.WHITESPACE
                && token != Token.EOF) {
            isRemainingWhiteSpace = true;
            continue;
        }
        
        char c = (char) 0;
        
        while ((c == scanner.read())) {
            if( c == XMLTagScanner.EOF)
                break;
            if( c == '<') {
                break;
            }
            if( !Character.isWhitespace(c))
                textReached = true;
            
        }
        
    } catch (BadLocationException e) {
       ExceptionHandler.handle(e);
    }
    
    if( textReached)
        return true;
    if( !isRemainingWhiteSpace && !textReached)
        return true;
    else
        return false;
    
}
 
開發者ID:nextinterfaces,項目名稱:http4e,代碼行數:66,代碼來源:TagContentAssistProcessor.java


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