Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » generation of an Xtext grammar(Xtext grammar from Ecore model)
generation of an Xtext grammar [message #871552] Mon, 14 May 2012 11:58 Go to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
i'm a beginner with Xtext and using eclipse-SDK-3.7.1-Xtext-2.2.1-win32

i'have problem when i'm generating Xtext grammar from an Ecore model , in fact i've succeed to generate the grammar but the grammar generated has 2 warnings and i don"t know how to fixed them.

the problem i have is with the 2 first imported files:
the first imported file : give me this warning " The imported package is not on the classpath of this project which may lead to follow up errors."
The second imported file give me this warning "[/quote] The imported package refers to elements the package registry instead of using the instances from the workspace".

can somebody help me to fix this.
  • Attachment: Test1.png
    (Size: 138.16KB, Downloaded 186 times)
Re: generation of an Xtext grammar [message #871554 is a reply to message #871552] Mon, 14 May 2012 12:02 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
i' can't put the code i' dont know why i have an error when i put the code , but you can see the picture and you will see the 2 warnings i'm talking about.
thks
My best regards ,
Frank
Re: generation of an Xtext grammar [message #871579 is a reply to message #871552] Mon, 14 May 2012 13:06 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
Please put the Project Test1 on the classpath of your language.

Regards,
Holger
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: generation of an Xtext grammar [message #871621 is a reply to message #871579] Mon, 14 May 2012 14:44 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
that is the problem Holger , looking at the warnings i know that i'm suppose to put it on the same path but i don't know how to put it on the same path.
i would be very gratefull if you can tel me how to do it.

My regards,
frank
Re: generation of an Xtext grammar [message #871625 is a reply to message #871621] Mon, 14 May 2012 14:47 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
Open up the Manifest.MF in org.xtext.example.mydsl/META-INF.
Go to Dependencies and add Test1


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: generation of an Xtext grammar [message #871945 is a reply to message #871625] Tue, 15 May 2012 07:38 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
Hi Holger
i did as you said but nothing change , i still have the same warning .

i've tried to add Tester1 in the dependency panel as you see in the picture , it appears as a plugin and not a package , hope is a right way to do it , i just add it as a plugin because there was not such a package called Tester1 among the possible importable package
  • Attachment: Test5.png
    (Size: 89.46KB, Downloaded 186 times)
  • Attachment: Test4.png
    (Size: 84.01KB, Downloaded 168 times)
Re: generation of an Xtext grammar [message #871973 is a reply to message #871945] Tue, 15 May 2012 08:25 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
Am 15.05.12 09:38, schrieb frank fotso:
> Hi Holger
> i did as you said but nothing change , i still have the same warning .
>
> i've tried to add Tester1 in the dependency panel as you see in the picture , it appears as a plugin and not a package , hope is a right way to do it , i just add it as a plugin because there was not such a package called Tester1 among the possible importable package
Could you please attach your bundles here?



--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: generation of an Xtext grammar [message #871982 is a reply to message #871973] Tue, 15 May 2012 08:50 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
i don't understand clearly what you want me to do?
but i've zip all the project you will see it u=il the following Zip package.
  • Attachment: All.zip
    (Size: 313.32KB, Downloaded 187 times)
Re: generation of an Xtext grammar [message #871984 is a reply to message #871982] Tue, 15 May 2012 08:52 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
you can see it in the package org.xtext.example.monDsl
Re: generation of an Xtext grammar [message #872061 is a reply to message #871984] Tue, 15 May 2012 11:57 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
the MANIFEST.MF looks correct:

 org.eclipse.xtext;bundle-version="2.1.0";
       org.eclipse.xtext.xbase;bundle-version="2.1.0";
       org.apache.log4j;bundle-version="1.2.1";
       org.apache.commons.logging;bundle-version="1.0.4"; 
       org.eclipse.xtext.generator;
       org.eclipse.emf.codegen.ecore;
       org.eclipse.emf.mwe.utils;
       org.eclipse.emf.mwe2.launch;
       Tester1;bundle-version="1.0.0";
Re: generation of an Xtext grammar [message #872099 is a reply to message #872061] Tue, 15 May 2012 13:08 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
I have no idea how you did that but inside of the zip there are files
with names like All/foo/bar/src-gen/....

It would be nix if you would use the export mechanism fron eclipse to
export the necessary projects into a zip. Mark the project and then
right click export..
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: generation of an Xtext grammar [message #872138 is a reply to message #872099] Tue, 15 May 2012 14:23 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
sorry for all the inconveniences :
that is it.
  • Attachment: All.zip
    (Size: 314.33KB, Downloaded 159 times)
Re: generation of an Xtext grammar [message #872141 is a reply to message #872138] Tue, 15 May 2012 14:26 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
i have exported all the file generated by eclipse that is why you have many file
Re: generation of an Xtext grammar [message #872148 is a reply to message #872138] Tue, 15 May 2012 14:39 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
Two things.

Test1 need Xtext nature. Rightclick on project->configure->add XtextNature

Then you have to refere to your EPackage with the NsUri ->

import "file:/D:/frank/workspace/EEPROM_2nd_pass.xsd"

BTW: Change that to something else like http://www.eeprom.com/1.0 etc.



--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: generation of an Xtext grammar [message #872151 is a reply to message #872148] Tue, 15 May 2012 14:49 Go to previous messageGo to next message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
oki thks
one of the warning has dissapear , it remains one known as : " The imported package refers to elements the package registry instead of using the instances from the workspace " .
how can i fix that one
Re: generation of an Xtext grammar [message #872176 is a reply to message #872151] Tue, 15 May 2012 15:35 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
The problem is that that the EPackage
http://www.eclipse.org/emf/2003/XMLType references
"http://www.eclipse.org/emf/2002/Ecore" transitive so that you have
"http://www.eclipse.org/emf/2002/Ecore" twice in the scope. Therefore
this warning appears but can be ignored. I agree that the message is not
very helpful so feel free to file a bug.

<eStructuralFeatures xsi:type="ecore:EReference" name="instanceType"
lowerBound="1"
eType="ecore:EClass
http://www.eclipse.org/emf/2002/Ecore#//EDataType"
resolveProxies="false"> <---- Here is the problem
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value=":5"/>
<details key="kind" value="simple"/>
</eAnnotations>
</eStructuralFeatures>

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: generation of an Xtext grammar [message #872537 is a reply to message #872176] Wed, 16 May 2012 09:44 Go to previous message
frank fotso is currently offline frank fotsoFriend
Messages: 91
Registered: May 2012
Member
Thks a lot Holger for your help.
now is ok i can continu even if i still have some error , hope i will manage it quickly.
for the 2nd warning i will look for a solution.

also can you if you have more interesting documents or tutorials send it to me please or give me a link , i'm doing an internship and one the main subject of it is Xtext so i want to increase my level in the domain.

Thks a lot


Frank
Previous Topic:EMap support
Next Topic:two grammar rules should be independent
Goto Forum:
  


Current Time: Thu Mar 28 23:04:02 GMT 2024

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

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

Back to the top