@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()); }
@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"); }