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


Java IUnorderedGroupHelper类代码示例

本文整理汇总了Java中org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper的典型用法代码示例。如果您正苦于以下问题:Java IUnorderedGroupHelper类的具体用法?Java IUnorderedGroupHelper怎么用?Java IUnorderedGroupHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getGuiceBindingsRt

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	BindFactory factory = new BindFactory()
		.addTypeToType(IParser.class.getName(),getParserClassName(grammar, getNaming()))
		.addTypeToType(ITokenToStringConverter.class.getName(),AntlrTokenToStringConverter.class.getName())
		.addTypeToType(IAntlrTokenFileProvider.class.getName(),getAntlrTokenFileProviderClassName(grammar, getNaming()))
		.addTypeToType(Lexer.class.getName(), getLexerClassName(grammar, getNaming()))
		.addTypeToProviderInstance(getLexerClassName(grammar, getNaming()), "org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getLexerClassName(grammar, getNaming()) + ".class)")
		.addConfiguredBinding("RuntimeLexer",
				"binder.bind(" + Lexer.class.getName() + ".class)"+
				".annotatedWith(com.google.inject.name.Names.named(" +
				"org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
				")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
		.addTypeToType(ITokenDefProvider.class.getName(), AntlrTokenDefProvider.class.getName());
	if (containsUnorderedGroup(grammar))
		factory = factory.addTypeToType(IUnorderedGroupHelper.class.getName(), UnorderedGroupHelper.class.getName());
	return factory.getBindings();
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:19,代码来源:XtextAntlrGeneratorFragment.java

示例2: getGuiceBindingsRt

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	BindFactory factory = new BindFactory()
		.addTypeToType(IParser.class.getName(),getFragmentHelper().getParserClassName(grammar))
		.addTypeToType(ITokenToStringConverter.class.getName(),AntlrTokenToStringConverter.class.getName())
		.addTypeToType(IAntlrTokenFileProvider.class.getName(),getFragmentHelper().getAntlrTokenFileProviderClassName(grammar))
		.addTypeToType(Lexer.class.getName(), getFragmentHelper().getLexerClassName(grammar))
		.addTypeToProviderInstance(getFragmentHelper().getLexerClassName(grammar), "org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getFragmentHelper().getLexerClassName(grammar) + ".class)")
		.addConfiguredBinding("RuntimeLexer",
				"binder.bind(" + Lexer.class.getName() + ".class)"+
				".annotatedWith(com.google.inject.name.Names.named(" +
				"org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
				")).to(" + getFragmentHelper().getLexerClassName(grammar) +".class)")
		.addTypeToType(ITokenDefProvider.class.getName(),AntlrTokenDefProvider.class.getName());
	if (containsUnorderedGroup(grammar))
		factory = factory.addTypeToType(IUnorderedGroupHelper.class.getName(), UnorderedGroupHelper.class.getName());
	if (getOptions().isIgnoreCase()) {
		factory = factory
			.addTypeToType(ITokenSerializer.IKeywordSerializer.class.getName(), IgnoreCaseKeywordSerializer.class.getName())
			.addTypeToType(AbstractIDValueConverter.class.getName(), IgnoreCaseIDValueConverter.class.getName());
	}
	return factory.getBindings();
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:24,代码来源:AntlrGeneratorFragment.java

示例3: getFollowElements

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
public Collection<FE> getFollowElements(String input, boolean strict) {
	TokenSource tokenSource = createTokenSource(input);
	InternalParser parser = createParser();
	parser.setStrict(strict);
	ObservableXtextTokenStream tokens = new ObservableXtextTokenStream(tokenSource, parser);
	tokens.setInitialHiddenTokens(getInitialHiddenTokens());
	parser.setTokenStream(tokens);
	IUnorderedGroupHelper helper = createUnorderedGroupHelper();
	parser.setUnorderedGroupHelper(helper);
	helper.initializeWith(parser);
	tokens.setListener(parser);
	try {
		return Lists.newArrayList(getFollowElements(parser));
	} catch (InfiniteRecursion infinite) {
		return Lists.newArrayList(parser.getFollowElements());
	}
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:18,代码来源:BaseContentAssistParser.java

示例4: announceEof

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
@Override
public void announceEof(int lookAhead) {
	if (!wasRecovering) {
		parser.announceEof(lookAhead);
		if (lookAhead > 1)
			announcedEofWithLA = true;
	}
	if (parser.isDFAPrediction()) {
		int lastGrammarElement = parser.getGrammarElements().size() - 1;
		if (elementToParse instanceof UnorderedGroup && parser.getGrammarElements().get(lastGrammarElement) == elementToParse) {
			IUnorderedGroupHelper helper = parser.getUnorderedGroupHelper();
			if (!helper.canLeave((UnorderedGroup) elementToParse)) {
				wasEof = true;		
			}
		}
	} else {
		wasEof = true;
	}
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:20,代码来源:EofListener.java

示例5: getFollowElements

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
public Collection<FollowElement> getFollowElements(String input, boolean strict) {
	CharStream stream = new ANTLRStringStream(input);
	TokenSource tokenSource = createLexer(stream);
	AbstractInternalContentAssistParser parser = createParser();
	parser.setStrict(strict);
	ObservableXtextTokenStream tokens = new ObservableXtextTokenStream(tokenSource, parser);
	tokens.setInitialHiddenTokens(getInitialHiddenTokens());
	parser.setTokenStream(tokens);
	IUnorderedGroupHelper helper = getUnorderedGroupHelper().get();
	parser.setUnorderedGroupHelper(helper);
	helper.initializeWith(parser);
	tokens.setListener(parser);
	try {
		return Lists.newArrayList(getFollowElements(parser));
	} catch(InfiniteRecursion infinite) {
		return Lists.newArrayList(parser.getFollowElements());
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:19,代码来源:AbstractContentAssistParser.java

示例6: doGetFollowElements

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
/**
 * Initialize the parser properly with the given tokens and process it.
 */
private Collection<FollowElement> doGetFollowElements(AbstractInternalContentAssistParser parser,
		ObservableXtextTokenStream tokens) {
	tokens.setInitialHiddenTokens(getInitialHiddenTokens());
	parser.setTokenStream(tokens);
	IUnorderedGroupHelper helper = getUnorderedGroupHelper().get();
	parser.setUnorderedGroupHelper(helper);
	helper.initializeWith(parser);
	tokens.setListener(parser);
	Collection<FollowElement> followElements = getFollowElements(parser);
	return followElements;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:15,代码来源:CustomN4JSParser.java

示例7: getInitializedUnorderedGroupHelper

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
/**
 * @since 2.14
 */
protected IUnorderedGroupHelper getInitializedUnorderedGroupHelper(FE element, InternalParser parser,
		UnorderedGroup group) {
	final IUnorderedGroupHelper helper = parser.getUnorderedGroupHelper();
	helper.enter(group);
	for (AbstractElement consumed : element.getHandledUnorderedGroupElements()) {
		parser.before(consumed);
		helper.select(group, group.getElements().indexOf(consumed));
		helper.returnFromSelection(group);
		parser.after(consumed);
	}
	return helper;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:16,代码来源:BaseContentAssistParser.java

示例8: getGuiceBindingsRt

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  BindFactory factory = new BindFactory()
      .addTypeToType(IParser.class.getName(), getFragmentHelper().getParserClassName(grammar))
      .addTypeToType(ITokenToStringConverter.class.getName(),
          AntlrTokenToStringConverter.class.getName())
      .addTypeToType(IAntlrTokenFileProvider.class.getName(),
          getFragmentHelper().getAntlrTokenFileProviderClassName(grammar))
      .addTypeToType(Lexer.class.getName(), getFragmentHelper().getLexerClassName(grammar))
      .addTypeToProviderInstance(
          getFragmentHelper().getLexerClassName(grammar),
          "org.eclipse.xtext.parser.antlr.LexerProvider.create("
              + getFragmentHelper().getLexerClassName(grammar) + ".class)")
      .addConfiguredBinding("RuntimeLexer",
          "binder.bind(" + Lexer.class.getName() + ".class)" +
              ".annotatedWith(com.google.inject.name.Names.named(" +
              "org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
              ")).to(" + getFragmentHelper().getLexerClassName(grammar) + ".class)")
      .addTypeToType(ITokenDefProvider.class.getName(), AntlrTokenDefProvider.class.getName());
  if (containsUnorderedGroup(grammar)) {
    factory = factory.addTypeToType(IUnorderedGroupHelper.class.getName(),
        UnorderedGroupHelper.class.getName());
  }
  if (getOptions().isIgnoreCase()) {
    factory = factory
        .addTypeToType(ITokenSerializer.IKeywordSerializer.class.getName(),
            IgnoreCaseKeywordSerializer.class.getName())
        .addTypeToType(AbstractIDValueConverter.class.getName(),
            IgnoreCaseIDValueConverter.class.getName());
  }
  return factory.getBindings();
}
 
开发者ID:antlr4ide,项目名称:antlr4ide,代码行数:33,代码来源:AntlrGeneratorFragmentWithCustomLexer.java

示例9: bindIUnorderedGroupHelper

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
public Class<? extends IUnorderedGroupHelper> bindIUnorderedGroupHelper() {
	return UnorderedGroupHelper.class;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:AbstractN4MFRuntimeModule.java

示例10: getHelper

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
protected IUnorderedGroupHelper getHelper() {
	return helper;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:IgnoreFirstEntranceUnorderedGroupHelper.java

示例11: ignoreFirstEntrance

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
/**
 * Factory method for the {@link IgnoreFirstEntranceUnorderedGroupHelper}.
 */
protected IUnorderedGroupHelper ignoreFirstEntrance(final IUnorderedGroupHelper helper) {
	return new IgnoreFirstEntranceUnorderedGroupHelper(helper);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:7,代码来源:BaseContentAssistParser.java

示例12: createUnorderedGroupHelper

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
/**
 * Creates a new {@link IUnorderedGroupHelper} that is not yet initialized.
 */
protected IUnorderedGroupHelper createUnorderedGroupHelper() {
	return getUnorderedGroupHelper().get();
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:7,代码来源:BaseContentAssistParser.java

示例13: setUnorderedGroupHelper

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
/**
 * Public for testing purpose.
 */
public void setUnorderedGroupHelper(Provider<IUnorderedGroupHelper> unorderedGroupHelper) {
	this.unorderedGroupHelper = unorderedGroupHelper;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:7,代码来源:BaseContentAssistParser.java

示例14: getUnorderedGroupHelper

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
/**
 * Public for testing purpose.
 */
public Provider<IUnorderedGroupHelper> getUnorderedGroupHelper() {
	return unorderedGroupHelper;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:7,代码来源:BaseContentAssistParser.java

示例15: setUnorderedGroupHelper

import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
public void setUnorderedGroupHelper(IUnorderedGroupHelper unorderedGroupHelper) {
	this.unorderedGroupHelper = unorderedGroupHelper;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:BaseInternalContentAssistParser.java


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