Home » Modeling » TMF (Xtext) » Cannot get GettingStarted to work :(
Cannot get GettingStarted to work :( [message #631438] |
Thu, 07 October 2010 14:39 |
Robin Messages: 25 Registered: August 2010 |
Junior Member |
|
|
Hi,
I'm trying to get XMF working, but did not succeed so far.
I am using eclipse-SDK-3.6-xtext-1.0.1-win32 and doing the GettingStarted Tutorial:
http://wiki.eclipse.org/Xtext/GettingStarted
I unpacked Eclipse to C:\eclipse and the workspace is C:\eclipsew (I tried also other configurations for this, but it does not change anything). I am using Windows XP (also tried the same on Windows 7).
When I try the last step "Content Generation", I get this error:
0 [main] DEBUG org.eclipse.xtext.mwe.Reader - Resource Pathes : [src/model]
0 [main] INFO org.eclipse.xpand2.Generator - No meta models configured, using JavaBeans as default.
219 [main] DEBUG xt.validation.ResourceValidatorImpl - Syntax check OK! Resource: file:/C:/eclipsew/org.xtext.example.mydsl.generator/src/model/Example.mydsl
391 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow workflow.MyDslGenerator: Couldn't find EClass for name 'Greeting'.
java.lang.RuntimeException: Problems running workflow workflow.MyDslGenerator: Couldn't find EClass for name 'Greeting'.
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:82)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
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: org.eclipse.emf.mwe.core.WorkflowInterruptedException: Couldn't find EClass for name 'Greeting'.
at org.eclipse.xtext.mwe.SlotEntry.findEClasses(SlotEntry.java:116)
at org.eclipse.xtext.mwe.SlotEntry.put(SlotEntry.java:76)
at org.eclipse.xtext.mwe.AbstractReader.addModelElementsToContext(AbstractReader.java:87)
at org.eclipse.xtext.mwe.Reader.invokeInternal(Reader.java:166)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:31)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:80)
... 3 more
But I think there's already something wrong before. First of all, I have the following warnings in Eclipse after creating the xtext project:
Description Resource Path Location Type
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. org.xtext.example.mydsl Build path JRE System Library Problem
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. org.xtext.example.mydsl.generator Build path JRE System Library
Problem
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. org.xtext.example.mydsl.ui Build path JRE System Library Problem
The file "plugin.xml" does not exist in the workspace build.properties /org.xtext.example.mydsl.generator line 5 Plug-in Problem
The type DefaultContentOutlineNodeAdapterFactory is deprecated MyDslOutlineNodeAdapterFactory.java /org.xtext.example.mydsl.ui/src/org/xtext/example/ui/outline line 6 Java Problem
The type DefaultContentOutlineNodeAdapterFactory is deprecated MyDslOutlineNodeAdapterFactory.java /org.xtext.example.mydsl.ui/src/org/xtext/example/ui/outline line 8 Java Problem
But since these are only warnings it might not be relevant. Though the message that the "plugin.xml" does not exist in the workspace seems severe.
I think there's already a problem during the DSL generation.
1.) I have a different console output.
Compare http://wiki.eclipse.org/Image:WorkflowLog1.png to mine:
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\eclipsew'
922 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\eclipsew\org.xtext.example.mydsl\..\org.xtext.example.mydsl\src-gen
922 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\eclipsew\org.xtext.example.mydsl\..\org.xtext.example.mydsl.ui\src-gen
1141 [main] INFO ipse.xtext.generator.LanguageConfig - generating infrastructure for org.xtext.example.MyDsl with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, FormatterFragment, LabelProviderFragment, TransformerFragment, OutlineNodeAdapterFactoryFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment
5469 [main] INFO or.validation.JavaValidatorFragment - executing generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
6625 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
2.) I have not the same files after the DSL generation. Compared to http://wiki.eclipse.org/Image:AfterFirstGeneration.png I have only the following files in package "org.xtext.example" of the project "org.xtext.example.mydsl":
MyDslRuntimeModule.java
MyDslStandaloneSetup.java
GenerateMyDsl.mwe2.mwe2
MyDsl.xtext
Please anybody help!! I want to start a university project concerning domain-specific languages using xtext and I am totally stuck.
Regards,
Robin
|
|
| | |
Re: Cannot get GettingStarted to work :( [message #631907 is a reply to message #631463] |
Sun, 10 October 2010 12:41 |
Robin Messages: 25 Registered: August 2010 |
Junior Member |
|
|
Hi,
I did your short test as suggested:
Quote: |
(1) create a new Xtext project with Wizard
|
Did that with all default settings and naming.
Quote: |
(2) run /org.xtext.example.mydsl/src/org/xtext/example/mydsl/Generat eMyDsl.mwe2
|
Gives the following output:
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\eclipsew'
982 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\eclipsew\org.xtext.example.mydsl\..\org.xtext.example.mydsl\src-gen
985 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\eclipsew\org.xtext.example.mydsl\..\org.xtext.example.mydsl.ui\src-gen
1170 [main] INFO ipse.xtext.generator.LanguageConfig - generating infrastructure for org.xtext.example.mydsl.MyDsl with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, FormatterFragment, LabelProviderFragment, TransformerFragment, OutlineNodeAdapterFactoryFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment
6854 [main] INFO or.validation.JavaValidatorFragment - executing generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
7458 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
Quote: |
(3) run /org.xtext.example.mydsl.generator/src/workflow/MyDslGenerat or.mwe2
|
Gives the following output:
0 [main] DEBUG org.eclipse.xtext.mwe.Reader - Resource Pathes : [src/model]
3 [main] INFO org.eclipse.xpand2.Generator - No meta models configured, using JavaBeans as default.
132 [main] DEBUG xt.validation.ResourceValidatorImpl - Syntax check OK! Resource: file:/C:/eclipsew/org.xtext.example.mydsl.generator/src/model/Example.mydsl
850 [main] INFO org.eclipse.xpand2.Generator - Written 3 files to outlet [default](src-gen)
851 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
So I tried again with the complete distribution and the latest documentation tutorial but I have no syntax highlighting then.
Distribution: http://download.itemis.com/distros/eclipse-SDK-3.6-xtext-1.0 .1-win32.zip
Documentation: http://www.eclipse.org/Xtext/documentation/latest/xtext.html #getting-started
Eclipse Directory: c:\eclipse
Workspace Directory: c:\eclipsew
Generate Language Artifacts: Run As -> MWE2 Workflow.
Output:
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\eclipsew'
649 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\eclipsew\org.eclipse.xtext.example.domainmodel\..\org.eclipse.xtext.example.domainmodel\src-gen
650 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\eclipsew\org.eclipse.xtext.example.domainmodel\..\org.eclipse.xtext.example.domainmodel.ui\src-gen
900 [main] INFO ipse.xtext.generator.LanguageConfig - generating infrastructure for org.eclipse.xtext.example.Domainmodel with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, FormatterFragment, LabelProviderFragment, TransformerFragment, OutlineNodeAdapterFactoryFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment
7128 [main] INFO or.validation.JavaValidatorFragment - executing generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
7834 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
Run the Generated IDE Plug-in - Right-click on the Xtext project and choose Run As -> Eclipse Application.
It does not say on which project one should click, as there are three to choose from:
org.eclipse.xtext.example.domainmodel
org.eclipse.xtext.example.domainmodel.generator
org.eclipse.xtext.example.domainmodel.ui
I tried to run all of them as eclipse application, but I always have no syntax hightlighting in the new Eclipse when I create a new project and put "my.entity" in it.
So it works only, if one uses the prebuild examples?!?
Regards, Robin
|
|
| | |
Re: Cannot get GettingStarted to work :( [message #637960 is a reply to message #637921] |
Tue, 09 November 2010 13:40 |
|
Hello Robin,
this may be a bug in the docs. the grammar should be
grammar org.eclipse.xtext.example.Domainmodel
with org.eclipse.xtext.common.Terminals
generate domainmodel "http://www.eclipse.org/xtext/example/Domainmodel"
DomainModel :
(elements+=Type)*;
Type:
DataType | Entity;
DataType:
'datatype' name=ID;
Entity:
'entity' name=ID ('extends' superType=[Entity])? '{'
(features+=Feature)*
'}';
Feature:
name=ID ':' type=TypeRef;
TypeRef:
referenced=[Type] (multi?='*')?;
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
| |
Goto Forum:
Current Time: Tue Apr 23 07:21:36 GMT 2024
Powered by FUDForum. Page generated in 0.03472 seconds
|