Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346035 - [xtext][model inference] weird error marker
Summary: [xtext][model inference] weird error marker
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: M4   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 03:06 EDT by Knut Wannheden CLA
Modified: 2017-10-31 10:59 EDT (History)
4 users (show)

See Also:
sebastian.zarnekow: juno+


Attachments
Grammar to reproduce the error (709 bytes, text/plain)
2011-06-09 06:03 EDT, Jan Koehnlein CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Knut Wannheden CLA 2011-05-17 03:06:24 EDT
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.
Comment 1 Sebastian Zarnekow CLA 2011-05-17 04:24:15 EDT
Pushed to master.
Comment 2 Jan Koehnlein CLA 2011-06-09 06:03:11 EDT
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.
Comment 3 Jan Koehnlein CLA 2011-06-09 06:03:35 EDT
Reopened bug.
Comment 4 Sebastian Zarnekow CLA 2011-08-15 14:45:14 EDT
Works in HEAD.
Comment 5 Sebastian Zarnekow CLA 2011-08-30 01:38:40 EDT
Just saw this problem. Reproducable with Xcore as soon as Xbase is not available in the workspace but installed.
Comment 6 Sebastian Zarnekow CLA 2011-10-26 16:04:57 EDT
I think the steps to reproduce are: Import ecore into the workspace and write a grammar that extends Xbase.
Comment 7 Sebastian Zarnekow CLA 2011-11-09 14:43:39 EST
Pushed another attempt to master and maintenance
Comment 8 Lorenzo Bettini CLA 2011-12-02 09:03:46 EST
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 '.*'?
;
Comment 9 Eclipse Webmaster CLA 2017-10-31 10:47:59 EDT
Requested via bug 522520.

-M.
Comment 10 Eclipse Webmaster CLA 2017-10-31 10:59:01 EDT
Requested via bug 522520.

-M.