Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generated ECore package(ECore)
Generated ECore package [message #1692913] Mon, 20 April 2015 14:31 Go to next message
Anakreontas Mentis is currently offline Anakreontas MentisFriend
Messages: 85
Registered: October 2014
Member
I am building a small grammar to experiment with XText.

The grammar is defined according to the SecretCompartments grammar in the documentation.

grammar uk.co.phoebus.p4.P4
import "http://www.eclipse.org/emf/2002/Ecore" as ecore

generate p4 "http://www.eclipse.org/p4"


From the rules I have defined in the grammar I get as expected the EMF classes that encode the AST.

The problem manifests when I run the eclipse plugin. When I edit a file of the language, I get the message:
An internal error occurred during: "XtextReconcilerJob".
java.lang.IllegalStateException: Unresolved proxy http://www.eclipse.org/p4#//View. Make sure the EPackage has been registered.

I suspect the problem is the url defined in the generate clause. The documentation does not expand on this topic perhaps because is common knowledge for eclipse users.

Is the defined url just a unique identifier or should it correspond to an accessible address where the artifacts produced by XText are stored?

Thank you in advance for your reply.
Re: Generated ECore package [message #1692930 is a reply to message #1692913] Mon, 20 April 2015 16:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13885
Registered: July 2009
Senior Member
Hi are you sure you did not mess up the plugin.xml
You may compare plugin.xml and plugin.xml_gen


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generated ECore package [message #1693026 is a reply to message #1692930] Tue, 21 April 2015 10:24 Go to previous messageGo to next message
Anakreontas Mentis is currently offline Anakreontas MentisFriend
Messages: 85
Registered: October 2014
Member
To ensure that there are no problems with the installation I removed all EMF and XText libraries from eclipse and re-installed everything from http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/

Also, I started a new project with the following grammar
grammar uk.co.phoebus.P5

generate p5 "http://www.co.uk/phoebus/P5"

import "http://www.eclipse.org/emf/2002/Ecore" as ecore


View : 'view,' title=STRING width=INT height=INT (vtype=ViewType)? (',@script(' script=ID ')')? LEND
revision = REVISION
;

enum ViewType :
DIRECT= 'direct_input' | DIRECT='direct'
| EVENT = 'event_input' | EVENT = 'event'
| TRANSACTION = 'standard'
| REPORT = 'report'
;

terminal fragment IDFRAG : ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
terminal ID : ('a'..'z'|'A'..'Z') IDFRAG ;
terminal LID : ('_' | '$$') IDFRAG ;
terminal INT returns ecore::EInt : ('0'..'9')+;
terminal STRING : '"' (!'"')* '"';
terminal LEND : (' ' | '\t' | '\r' | '\n')+;
terminal REVISION : '!@revision' !('\n'|'\r')* ('\r'? '\n')? ;

When I run Eclipse to test the plug-in I no longer get the error message reported previously but the situation is worse. Whenever I open a file with an extension associated to the grammar, eclipse freezes and in the console of the main eclipse application where I edit the grammar I get the error message:
!ENTRY org.eclipse.ui 4 0 2015-04-21 11:11:49.968
!MESSAGE Unhandled event loop exception
Error while logging event loop exception:
Exception in thread "Worker-5" Exception in thread "Worker-3" Exception in thread "Worker-2" Exception in thread "Worker-1"

I reduced the grammar to just one syntactic rule to ensure that it is as simple as possible.

The version of eclipse states:
Eclipse Java EE IDE for Web Developers.

Version: Kepler Service Release 2
Build id: 20140224-0627

Perhaps the problems are caused by version incompatibility. Unfortunately the error message I get is not informative and I can not research the cause of the error. I tried debugging, but the program stops in the Worker class which should be internal to Eclipse.
Re: Generated ECore package [message #1693029 is a reply to message #1693026] Tue, 21 April 2015 10:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13885
Registered: July 2009
Senior Member
Hi,

did you have a look at plugin.xml and build.properties

(should not contain warning)

the plugin.xml of the dsl project should contain an ecore registration


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generated ECore package [message #1693040 is a reply to message #1693029] Tue, 21 April 2015 11:47 Go to previous messageGo to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
You should have a plugin.xml file similar to
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
  <extension point="org.eclipse.emf.ecore.generated_package">
    <package 
       uri = "http://www.sarl.io/lang/SARL" 
       class = "io.sarl.lang.sarl.SarlPackage"
       genModel = "model/generated/SARL.genmodel" /> 
  </extension>
</plugin>


And a build.properties file similar to:
source.. = src/,\
          src-gen/
bin.includes = model/,\
               META-INF/,\
               .,\
               plugin.xml,\
               OSGI-INF/
jre.compilation.profile = JavaSE-1.7
Re: Generated ECore package [message #1693075 is a reply to message #1693040] Tue, 21 April 2015 14:26 Go to previous messageGo to next message
Anakreontas Mentis is currently offline Anakreontas MentisFriend
Messages: 85
Registered: October 2014
Member
The plugin.xml complies to your example. The build.properties has some differences.
I have attached the file.
Re: Generated ECore package [message #1693081 is a reply to message #1693075] Tue, 21 April 2015 14:53 Go to previous message
Anakreontas Mentis is currently offline Anakreontas MentisFriend
Messages: 85
Registered: October 2014
Member
[SOLVED]
I updated to
Eclipse IDE for Java Developers
Version: Luna Service Release 2 (4.4.2)
and it runs without problems.

Thank you for your help!
Previous Topic:[SOLVED] A token is not serialized by the Serializer
Next Topic:XtextCon: Only 30 tickets left
Goto Forum:
  


Current Time: Sun Apr 18 11:05:26 GMT 2021

Powered by FUDForum. Page generated in 0.02445 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top