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


Java Lexer類代碼示例

本文整理匯總了Java中org.eclipse.xtext.parser.antlr.Lexer的典型用法代碼示例。如果您正苦於以下問題:Java Lexer類的具體用法?Java Lexer怎麽用?Java Lexer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: toString

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public String toString(int start, int stop) {
	if (start < 0 || stop < 0) {
		return null;
	}
	CommonToken startToken = (CommonToken) tokens.get(start);
	CommonToken stopToken = (CommonToken) tokens.get(stop);
	CharStream charStream = ((Lexer) tokenSource).getCharStream();
	String result = charStream.toString().substring(startToken.getStartIndex(), stopToken.getStopIndex());
	return result;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:15,代碼來源:LazyTokenStream.java

示例2: isSameTokenSequence

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
protected boolean isSameTokenSequence(String originalText, String newText, int expectedLength) {
	Lexer originalLexer = lexerProvider.get();
	Lexer newLexer = lexerProvider.get();
	originalLexer.setCharStream(new ANTLRStringStream(originalText));
	newLexer.setCharStream(new ANTLRStringStream(newText));
	return isSameTokenSequence(originalLexer, newLexer, expectedLength);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:8,代碼來源:TokenSequencePreservingPartialParsingHelper.java

示例3: getGuiceBindingsUi

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
	BindFactory binder = new BindFactory();
		binder.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper", "org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper");
		if(getNaming().hasIde()){
			binder.addConfiguredBinding("HighlightingLexer",
					"binder.bind(" + Lexer.class.getName() + ".class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ide.LexerIdeBindings.HIGHLIGHTING" +
					")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
				   .addConfiguredBinding("HighlightingTokenDefProvider",
					"binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ide.LexerIdeBindings.HIGHLIGHTING" +
					")).to(" + AntlrTokenDefProvider.class.getName() +".class)");
		} else {
			binder.addConfiguredBinding("HighlightingLexer",
					"binder.bind(" + Lexer.class.getName() + ".class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
					")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
				   .addConfiguredBinding("HighlightingTokenDefProvider",
					"binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
					")).to(" + AntlrTokenDefProvider.class.getName() +".class)");
		}
		return binder.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:30,代碼來源:XtextAntlrGeneratorFragment.java

示例4: bindLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public Class<? extends Lexer> bindLexer() {
	return InternalPkmntcgoLexer.class;
}
 
開發者ID:rehne93,項目名稱:pokemon-tcgo-deck-generator,代碼行數:4,代碼來源:AbstractPkmntcgoRuntimeModule.java

示例5: configureRuntimeLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public void configureRuntimeLexer(Binder binder) {
	binder.bind(Lexer.class)
		.annotatedWith(Names.named(LexerBindings.RUNTIME))
		.to(InternalPkmntcgoLexer.class);
}
 
開發者ID:rehne93,項目名稱:pokemon-tcgo-deck-generator,代碼行數:6,代碼來源:AbstractPkmntcgoRuntimeModule.java

示例6: bindLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public Class<? extends Lexer> bindLexer() {
	return InternalTypesLexer.class;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:AbstractTypesRuntimeModule.java

示例7: configureRuntimeLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public void configureRuntimeLexer(Binder binder) {
	binder.bind(Lexer.class)
		.annotatedWith(Names.named(LexerBindings.RUNTIME))
		.to(InternalTypesLexer.class);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:6,代碼來源:AbstractTypesRuntimeModule.java

示例8: bindLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public Class<? extends Lexer> bindLexer() {
	return InternalRegularExpressionLexer.class;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:AbstractRegularExpressionRuntimeModule.java

示例9: configureRuntimeLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public void configureRuntimeLexer(Binder binder) {
	binder.bind(Lexer.class)
		.annotatedWith(Names.named(LexerBindings.RUNTIME))
		.to(InternalRegularExpressionLexer.class);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:6,代碼來源:AbstractRegularExpressionRuntimeModule.java

示例10: createLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
/**
 * Create a new lexer for the given input.
 */
protected TokenSource createLexer(CharStream stream) {
	Lexer lexer = lexerProvider.get();
	lexer.setCharStream(stream);
	return lexer;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:9,代碼來源:HighlightingParser.java

示例11: bindLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public Class<? extends Lexer> bindLexer() {
	return InternalN4JSLexer.class;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:AbstractN4JSRuntimeModule.java

示例12: configureRuntimeLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public void configureRuntimeLexer(Binder binder) {
	binder.bind(Lexer.class)
		.annotatedWith(Names.named(LexerBindings.RUNTIME))
		.to(InternalN4JSLexer.class);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:6,代碼來源:AbstractN4JSRuntimeModule.java

示例13: bindLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public Class<? extends Lexer> bindLexer() {
	return InternalN4MFLexer.class;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:AbstractN4MFRuntimeModule.java

示例14: configureRuntimeLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public void configureRuntimeLexer(Binder binder) {
	binder.bind(Lexer.class)
		.annotatedWith(Names.named(LexerBindings.RUNTIME))
		.to(InternalN4MFLexer.class);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:6,代碼來源:AbstractN4MFRuntimeModule.java

示例15: bindLexer

import org.eclipse.xtext.parser.antlr.Lexer; //導入依賴的package包/類
public Class<? extends Lexer> bindLexer() {
	return InternalMyDslLexer.class;
}
 
開發者ID:fatalerrortan,項目名稱:Xtext_Xtend_HTML_Generator,代碼行數:4,代碼來源:AbstractMyDslRuntimeModule.java


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