本文整理汇总了Java中org.eclipse.xtext.parser.antlr.AbstractAntlrParser类的典型用法代码示例。如果您正苦于以下问题:Java AbstractAntlrParser类的具体用法?Java AbstractAntlrParser怎么用?Java AbstractAntlrParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractAntlrParser类属于org.eclipse.xtext.parser.antlr包,在下文中一共展示了AbstractAntlrParser类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTokenSource
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser; //导入依赖的package包/类
@Override
public TokenSource createTokenSource(final CharStream stream) {
if ((this.parser instanceof AbstractAntlrParser)) {
return ((AbstractAntlrParser)this.parser).createLexer(stream);
}
StringConcatenation _builder = new StringConcatenation();
String _name = this.parser.getClass().getName();
_builder.append(_name);
_builder.append(" should be a subclass of ");
String _name_1 = AbstractAntlrParser.class.getName();
_builder.append(_name_1);
throw new IllegalStateException(_builder.toString());
}
示例2: testIssue219
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser; //导入依赖的package包/类
@Test
public void testIssue219() throws Exception {
with(PartialParserTestLanguageStandaloneSetup.class);
String model = "container c1 {\n" + " children {\n" + "-> C ( ch1 )\n" + " }" + "}";
XtextResource resource = getResourceFromString(model);
assertTrue(resource.getErrors().isEmpty());
((PartialParsingHelper) ((AbstractAntlrParser) resource.getParser()).getPartialParser())
.setTokenRegionProvider(null);
resource.update(model.indexOf("ch1") + 1, 1, "x");
}