本文整理汇总了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();
}
示例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();
}
示例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());
}
}
示例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;
}
}
示例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());
}
}
示例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;
}
示例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;
}
示例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();
}
示例9: bindIUnorderedGroupHelper
import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
public Class<? extends IUnorderedGroupHelper> bindIUnorderedGroupHelper() {
return UnorderedGroupHelper.class;
}
示例10: getHelper
import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
protected IUnorderedGroupHelper getHelper() {
return helper;
}
示例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);
}
示例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();
}
示例13: setUnorderedGroupHelper
import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
/**
* Public for testing purpose.
*/
public void setUnorderedGroupHelper(Provider<IUnorderedGroupHelper> unorderedGroupHelper) {
this.unorderedGroupHelper = unorderedGroupHelper;
}
示例14: getUnorderedGroupHelper
import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
/**
* Public for testing purpose.
*/
public Provider<IUnorderedGroupHelper> getUnorderedGroupHelper() {
return unorderedGroupHelper;
}
示例15: setUnorderedGroupHelper
import org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper; //导入依赖的package包/类
public void setUnorderedGroupHelper(IUnorderedGroupHelper unorderedGroupHelper) {
this.unorderedGroupHelper = unorderedGroupHelper;
}