Community
Participate
Working Groups
The following grammar: grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals import "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.ecore" as xbase generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" Model: greetings+=Greeting*; Greeting returns xbase::XExpression : {Greeting} 'Hello'; // copied from Terminals terminal ID : '^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; results in a strange error marker on the ID rule: "Cannot inherit from DataType XSwitchExpression". The reason that the error is reported against the ID rule is that the UnexpectedClassInfoException's superInfo is null as is the EClassifierInfo for a terminal rule ID as the Ecore metamodel hasn't been explicitly imported. Adding an import for the Ecore metamodel gets rid of the error marker. But note that the UnexpectedClassInfoException are still being thrown but not reported.
Pushed to master.
Created attachment 197676 [details] Grammar to reproduce the error Still reprodcible with the attached grammar, which reveals a second error if the MWE workflow is run.
Reopened bug.
Works in HEAD.
Just saw this problem. Reproducable with Xcore as soon as Xbase is not available in the workspace but installed.
I think the steps to reproduce are: Import ecore into the workspace and write a grammar that extends Xbase.
Pushed another attempt to master and maintenance
I'm afraid this problem shows up again in Xtext 2.1.1 with a grammar that extends Xbase... not always though... and the workflow runs fine, though the .xtext file has error markers on data type rules, such as QualifiedNameWithWildcard: QualifiedName '.*'? ;
Requested via bug 522520. -M.