-2

After upgrading Xtext in my Eclipse from 2.3.1 to 2.4.3, I see these errors in the log:

org.eclipse.xtext.parser.ParseException: java.lang.ClassCastException: org.eclipse.xtext.impl.KeywordImpl cannot be cast to org.eclipse.xtext.RuleCall
                at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:105)
                at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.parse(AbstractAntlrParser.java:84)
                at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:62)
                at org.eclipse.xtext.parser.AbstractParser.parse(AbstractParser.java:32)
                at org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:162)
                at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:81)
                at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
                at org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.loadResource(XtextDocumentProvider.java:227)

What's causing this? How do I get rid of them?

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • 1
    A little google-fu turns up [this](http://www.eclipse.org/forums/index.php/t/461977/) Eclipse forum thread; recommendation is to regenerate Xcore's grammar. – Brian S Jan 16 '14 at 16:38

1 Answers1

0

According to this Eclipse Forum post, when a grammar A extends B (B is often Xbase or Xcore), then changes in B mean that A has to be regenerated.

In my case, I upgraded to a new version of Xbase. Hence the need to run the MWE workflow again to update the sources.

Kudos to Brian S for finding the blog post.

Community
  • 1
  • 1
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820