Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312213

Summary: grammar mix-in and reference on the same grammar does not work
Product: [Modeling] TMF Reporter: Rubén Porras Campo <Ruben.PorrasCampo>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: major    
Priority: P3 CC: sebastian.zarnekow
Version: 1.0.0Flags: sebastian.zarnekow: helios+
Target Milestone: RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
grammar described in the problem
none
Fixed in workflows none

Description Rubén Porras Campo CLA 2010-05-10 04:12:54 EDT
Build Identifier: I20100429-1549

I'm using both grammar mix-in and reference for a language. But I
don't get it work.

It worked with MWE, artifacts were generated, code could be compiled for a given model, but BTT.XTEXT stills shows an error if the file is open (Couldn't resolve reference to EPackage '"http://www.xtext.org/mix_in/btpt"').

With MWE2 there is no way to generate the artifacts. The error is

0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri 'C:\eclipse_workspaces\heliosm6'
22043 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - java.lang.reflect.InvocationTargetException
org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
	at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:127)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:126)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:126)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:68)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:51)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
	... 36 more
Caused by: java.lang.IllegalStateException: [XtextLinkingDiagnostic: null:4 Couldn't resolve reference to EPackage '"http://www.xtext.org/mix_in/btpt"'.]
	at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:112)
	... 41 more


The question is, how can I specify the BTT grammar as

grammar org.xtext.mix_in.btt.BTT with org.xtext.mix_in.btc.BTC, so that I can override some of its definitions and at the same time import the BTPT package, so that I can make a cross reference to an entity of it? As I read the documentation I think, that the fact that this does not work it is a bug (and it partially worked MWE, because we never experienced the generator failing because of the error message)

Reproducible: Always

Steps to Reproduce:
compile BTC
compile BPTP
compile BTT
(no you can compile BTT_no_BTC to see that BTPT is indeed to be found)
Comment 1 Rubén Porras Campo CLA 2010-05-10 04:14:42 EDT
Created attachment 167665 [details]
grammar described in the problem
Comment 2 Sebastian Zarnekow CLA 2010-05-10 04:55:00 EDT
There are several problems in the workflow configuration and the Xtext grammars. However, I get a StackoverflowError with the correct configuration.
Comment 3 Rubén Porras Campo CLA 2010-05-10 07:01:19 EDT
Note: for additional info, this Issue has been added after the Post in the TMF forum:

http://www.eclipse.org/forums/index.php?t=msg&th=167610&start=0&

In this post, I mentioned also a StackOverflow with a configuration, just commenting on it in case it helps.
Comment 4 Sebastian Zarnekow CLA 2010-05-10 10:23:45 EDT
Created attachment 167713 [details]
Fixed in workflows

Attached are the fixed workflow- and grammar files. The stackoverflow happend due to an invalid configuration that I oversaw in the workflow.
Comment 5 Sebastian Zarnekow CLA 2010-05-10 10:24:09 EDT
Please reopen the bug if the attachment does not help.
Comment 6 Karsten Thoms CLA 2017-09-19 15:40:26 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.