Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Importing a grammar which inturn has imported a Metamodel
Importing a grammar which inturn has imported a Metamodel [message #50739] Fri, 12 June 2009 17:12 Go to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
Hello All

I am tryin to write a grammar(say gr_1) that has imported another
Grammar(gr_2).
However gr_2 has also imported Metamodel say m_1.

So does using rules of gr_1 in gr_2 valid in the XText?

->Moreover I have suppressed the generation of Metamodel in gr_1.

Can't get it working!!

My implm is somewhat like this:
------------------------------gr_2-----------------------

grammar org.xtext.example.MyDsl4 with org.xtext.samm_dsl.Edifice

generate myDsl4 "http://www.xtext.org/example/MyDsl4"

Core:
('Entity:'core_elem+=MemoryDescriptor)*
;
..
..
------------------------------------
---------------------------gr_1----------------------------- ----

grammar org.xtext.samm_dsl.Edifice with org.eclipse.xtext.common.Terminals

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



import "http://q-impress.eu/samm/core" as refn_core
import "http://q-impress.eu/samm/datatype" as refn_datatypes
import "http://q-impress.eu/samm/deployment/targetenvironment" as
refn_depl_targetenv
import "http://q-impress.eu/samm/deployment/hardware" as refn_depl_hardware
import "http://q-impress.eu/samm/deployment/allocation" as
refn_depl_allocation
import "http://q-impress.eu/samm/behaviour" as refn_behaviour
import "http://q-impress.eu/samm/usagemodel" as refn_usagemodel
import "http://q-impress.eu/samm/staticstructure" as refn_staticstructure

import "http://q-impress.eu/identifier" as ident



Identifier returns ident::Identifier :
Entity;

//This part pertains to Core classes
Entity returns refn_core::Entity:
(NamedEntity | Connector | EndPoint | HardwareDescriptor)
;

..
..

MemoryDescriptor returns refn_depl_hardware::MemoryDescriptor:
'MemoryDescriptor' 'id:' id=STRING '{'
//parent attrib(s)
'doc:' documentation=STRING';'

//class specific attributes
'bw:' bandwidth=INT ';'
'fsbFreq:' fsbFrequency=INT ';'
'accessFreq:' accessLatency=INT ';'
'burstLen:' burstLength=INT ';'
'}'

;
..
..
------------------------------------------------------------ ----------

shows the following error when I run workflow for gr_2

------------------------------------------------------------ -----
4793 [main] ERROR enerator.CompositeGeneratorFragment -
java.lang.NullPointerException
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2373)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2362)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper. <init>(GenPackageImpl.java:2302)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.p repareCache(GenPackageImpl.java:3090)
at
org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageG eneratorAdapter.doPreGenerate(GenPackageGeneratorAdapter.jav a:182)
at
org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAda pter.preGenerate(AbstractGeneratorAdapter.java:256)
at
org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:609)
at
org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:528)
at
org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erateEcoreJavaClasses(EcoreGeneratorFragment.java:277)
at
org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erate(EcoreGeneratorFragment.java:106)
at
org.eclipse.xtext.generator.CompositeGeneratorFragment.gener ate(CompositeGeneratorFragment.java:77)
at
org.eclipse.xtext.generator.LanguageConfig.generate(Language Config.java:68)
at org.eclipse.xtext.generator.Generator.generate(Generator.jav a:269)
at org.eclipse.xtext.generator.Generator.invokeInternal(Generat or.java:80)
at
org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invok e(AbstractWorkflowComponent.java:118)
at
org.eclipse.emf.mwe.core.container.CompositeComponent.intern alInvoke(CompositeComponent.java:101)
at
org.eclipse.emf.mwe.core.container.CompositeComponent.invoke (CompositeComponent.java:86)
at
org.eclipse.emf.mwe.core.WorkflowRunner.executeWorkflow(Work flowRunner.java:412)
at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.j ava:292)
at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner. java:239)

------------------------------------------------------------ -----
Entire console result:
------------------------------------------------------------ -----
0 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
Workflow Engine 0.7.0, Build v200905260637
18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
openarchitectureware.org and contributors
18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running workflow:
C:/Users/Durga/workspace_TMF/org.xtext.example.mydsl4/src/or g/xtext/example/GenerateMyDsl4.mwe
19 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
559 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
platform uri 'C:\Users\Durga\workspace_TMF'
700 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.staticstructure.StaticstructurePackage'
701 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.behaviour.BehaviourPackage'
702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage
'eu.qimpress.samm.deployment.targetenvironment.Targetenviron mentPackage'
702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.deployment.hardware.HardwarePackage'
702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.deployment.allocation.AllocationPackage'
703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
3082 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory '../org.xtext.example.mydsl4/src-gen'
3083 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.example.mydsl4\..\org .xtext.example.mydsl4\src-gen
3084 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory '../org.xtext.example.mydsl4.ui/src-gen'
3084 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.example.mydsl4\..\org .xtext.example.mydsl4.ui\src-gen
3085 [main] INFO e.core.container.CompositeComponent - Generator
3115 [main] INFO ipse.xtext.generator.LanguageConfig - generating
infrastructure for org.xtext.example.MyDsl4 with fragments :
ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment,
EcoreGeneratorFragment, ParseTreeConstructorFragment,
ResourceFactoryFragment, DelegatingGeneratorFragment,
JavaValidatorFragment, JavaScopingFragment, FormatterFragment,
LabelProviderFragment, TransformerFragment, JavaBasedContentAssistFragment
4793 [main] ERROR enerator.CompositeGeneratorFragment -
java.lang.NullPointerException
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2373)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2362)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper. <init>(GenPackageImpl.java:2302)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.p repareCache(GenPackageImpl.java:3090)
at
org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageG eneratorAdapter.doPreGenerate(GenPackageGeneratorAdapter.jav a:182)
at
org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAda pter.preGenerate(AbstractGeneratorAdapter.java:256)
at
org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:609)
at
org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:528)
at
org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erateEcoreJavaClasses(EcoreGeneratorFragment.java:277)
at
org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erate(EcoreGeneratorFragment.java:106)
at
org.eclipse.xtext.generator.CompositeGeneratorFragment.gener ate(CompositeGeneratorFragment.java:77)
at
org.eclipse.xtext.generator.LanguageConfig.generate(Language Config.java:68)
at org.eclipse.xtext.generator.Generator.generate(Generator.jav a:269)
at org.eclipse.xtext.generator.Generator.invokeInternal(Generat or.java:80)
at
org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invok e(AbstractWorkflowComponent.java:118)
at
org.eclipse.emf.mwe.core.container.CompositeComponent.intern alInvoke(CompositeComponent.java:101)
at
org.eclipse.emf.mwe.core.container.CompositeComponent.invoke (CompositeComponent.java:86)
at
org.eclipse.emf.mwe.core.WorkflowRunner.executeWorkflow(Work flowRunner.java:412)
at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.j ava:292)
at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner. java:239)
13763 [main] INFO or.validation.JavaValidatorFragment - executing
generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
13898 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer.NullTokenColorer
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13898 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Comm onAntlrTokenColorer
(contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
13898 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.jface.text.rules.ITokenScanner ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.DefaultTok enScanner
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13898 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.jface.text.rules.ITokenScanner ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Antl rTokenScanner
(contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
org.eclipse.xtext.ui.core.editor.FastLineBasedDamagerRepaire r (contributed
by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
org.eclipse.xtext.ui.core.editor.XtextDamagerRepairer (contributed by
de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.jface.viewers.ILabelProvider ->
org.eclipse.xtext.ui.core.DefaultLabelProvider (contributed by
org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.jface.viewers.ILabelProvider ->
org.xtext.example.labeling.MyDsl4LabelProvider (contributed by
org.eclipse.xtext.ui.generator.labeling.LabelProviderFragmen t)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
org.eclipse.xtext.ui.common.editor.outline.impl.DefaultSeman ticModelTransformer
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
org.xtext.example.outline.MyDsl4Transformer (contributed by
org.eclipse.xtext.ui.generator.outline.TransformerFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider ->
org.eclipse.xtext.common.contentassist.TerminalsProposalProv ider
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider ->
org.xtext.example.contentassist.MyDsl4ProposalProvider (contributed by
org.eclipse.xtext.ui.generator.contentAssist.JavaBasedConten tAssistFragment)
14011 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
completed in 10930ms!
------------------------------------------------------------ ------

sry for posting all these long posts!!..

but I hope tht shall help u know my problem exactly.

Thanks.

Durga
Re: Importing a grammar which inturn has imported a Metamodel [message #50781 is a reply to message #50739] Fri, 12 June 2009 17:49 Go to previous messageGo to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
I specified my grammar wrongly in my previous post.(just interchanged)
Sry. consider this..

------------------------------------------------------------ --
I am tryin to write a grammar(say gr_1) that has imported another
Grammar(gr_2).
However gr_2 has also imported Metamodel say m_1.

So is using rules of gr_2 in gr_1 valid this way in the XText?

->Moreover I have suppressed the generation of Metamodel in gr_2.

Can't get it working!!

My implm is somewhat like this:
------------------------------gr_1-----------------------

grammar org.xtext.example.MyDsl4 with org.xtext.samm_dsl.Edifice

generate myDsl4 "http://www.xtext.org/example/MyDsl4"

Core:
('Entity:'core_elem+=MemoryDescriptor)*
;
..
..
------------------------------------
---------------------------gr_2----------------------------- ----

grammar org.xtext.samm_dsl.Edifice with org.eclipse.xtext.common.Terminals

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



import "http://q-impress.eu/samm/core" as refn_core
import "http://q-impress.eu/samm/datatype" as refn_datatypes
import "http://q-impress.eu/samm/deployment/targetenvironment" as
refn_depl_targetenv
import "http://q-impress.eu/samm/deployment/hardware" as refn_depl_hardware
import "http://q-impress.eu/samm/deployment/allocation" as
refn_depl_allocation
import "http://q-impress.eu/samm/behaviour" as refn_behaviour
import "http://q-impress.eu/samm/usagemodel" as refn_usagemodel
import "http://q-impress.eu/samm/staticstructure" as refn_staticstructure

import "http://q-impress.eu/identifier" as ident



Identifier returns ident::Identifier :
Entity; //This part pertains to Core classes
Entity returns refn_core::Entity:
(NamedEntity | Connector | EndPoint | HardwareDescriptor)
;

..
..

MemoryDescriptor returns refn_depl_hardware::MemoryDescriptor:
'MemoryDescriptor' 'id:' id=STRING '{'
//parent attrib(s)
'doc:' documentation=STRING';'

//class specific attributes
'bw:' bandwidth=INT ';'
'fsbFreq:' fsbFrequency=INT ';'
'accessFreq:' accessLatency=INT ';'
'burstLen:' burstLength=INT ';'
'}'

;
..
..
------------------------------------------------------------ ----------

shows the following error when I run workflow for gr_2

------------------------------------------------------------ -----
4793 [main] ERROR enerator.CompositeGeneratorFragment -
java.lang.NullPointerException
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2373)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2362)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper. <init>(GenPackageImpl.java:2302)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.p repareCache(GenPackageImpl.java:3090)
at
org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageG eneratorAdapter.doPreGenerate(GenPackageGeneratorAdapter.jav a:182)
at
org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAda pter.preGenerate(AbstractGeneratorAdapter.java:256)
at
org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:609)
at
org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:528)
at
org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erateEcoreJavaClasses(EcoreGeneratorFragment.java:277)
at
org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erate(EcoreGeneratorFragment.java:106)
at
org.eclipse.xtext.generator.CompositeGeneratorFragment.gener ate(CompositeGeneratorFragment.java:77)
at
org.eclipse.xtext.generator.LanguageConfig.generate(Language Config.java:68)
at org.eclipse.xtext.generator.Generator.generate(Generator.jav a:269)
at org.eclipse.xtext.generator.Generator.invokeInternal(Generat or.java:80)
at
org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invok e(AbstractWorkflowComponent.java:118)
at
org.eclipse.emf.mwe.core.container.CompositeComponent.intern alInvoke(CompositeComponent.java:101)
at
org.eclipse.emf.mwe.core.container.CompositeComponent.invoke (CompositeComponent.java:86)
at
org.eclipse.emf.mwe.core.WorkflowRunner.executeWorkflow(Work flowRunner.java:412)
at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.j ava:292)
at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner. java:239)

------------------------------------------------------------ -----
Entire console result:
------------------------------------------------------------ -----
0 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
Workflow Engine 0.7.0, Build v200905260637
18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
openarchitectureware.org and contributors
18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running workflow:
C:/Users/Durga/workspace_TMF/org.xtext.example.mydsl4/src/or g/xtext/example/GenerateMyDsl4.mwe
19 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - 559 [main] INFO
lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri
'C:\Users\Durga\workspace_TMF'
700 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.staticstructure.StaticstructurePackage'
701 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.behaviour.BehaviourPackage'
702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage
'eu.qimpress.samm.deployment.targetenvironment.Targetenviron mentPackage'
702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.deployment.hardware.HardwarePackage'
702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.deployment.allocation.AllocationPackage'
703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
3082 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory '../org.xtext.example.mydsl4/src-gen'
3083 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.example.mydsl4\..\org .xtext.example.mydsl4\src-gen
3084 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory '../org.xtext.example.mydsl4.ui/src-gen'
3084 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.example.mydsl4\..\org .xtext.example.mydsl4.ui\src-gen
3085 [main] INFO e.core.container.CompositeComponent - Generator
3115 [main] INFO ipse.xtext.generator.LanguageConfig - generating
infrastructure for org.xtext.example.MyDsl4 with fragments :
ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment,
EcoreGeneratorFragment, ParseTreeConstructorFragment,
ResourceFactoryFragment, DelegatingGeneratorFragment,
JavaValidatorFragment, JavaScopingFragment, FormatterFragment,
LabelProviderFragment, TransformerFragment, JavaBasedContentAssistFragment
4793 [main] ERROR enerator.CompositeGeneratorFragment -
java.lang.NullPointerException
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2373)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2362)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper. <init>(GenPackageImpl.java:2302)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.p repareCache(GenPackageImpl.java:3090)
at
org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageG eneratorAdapter.doPreGenerate(GenPackageGeneratorAdapter.jav a:182)
at
org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAda pter.preGenerate(AbstractGeneratorAdapter.java:256)
at
org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:609)
at
org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:528)
at
org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erateEcoreJavaClasses(EcoreGeneratorFragment.java:277)
at
org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erate(EcoreGeneratorFragment.java:106)
at
org.eclipse.xtext.generator.CompositeGeneratorFragment.gener ate(CompositeGeneratorFragment.java:77)
at
org.eclipse.xtext.generator.LanguageConfig.generate(Language Config.java:68)
at org.eclipse.xtext.generator.Generator.generate(Generator.jav a:269)
at org.eclipse.xtext.generator.Generator.invokeInternal(Generat or.java:80)
at
org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invok e(AbstractWorkflowComponent.java:118)
at
org.eclipse.emf.mwe.core.container.CompositeComponent.intern alInvoke(CompositeComponent.java:101)
at
org.eclipse.emf.mwe.core.container.CompositeComponent.invoke (CompositeComponent.java:86)
at
org.eclipse.emf.mwe.core.WorkflowRunner.executeWorkflow(Work flowRunner.java:412)
at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.j ava:292)
at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner. java:239)
13763 [main] INFO or.validation.JavaValidatorFragment - executing
generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
13898 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer.NullTokenColorer
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13898 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Comm onAntlrTokenColorer
(contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
13898 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.jface.text.rules.ITokenScanner ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.DefaultTok enScanner
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13898 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.jface.text.rules.ITokenScanner ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Antl rTokenScanner
(contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
org.eclipse.xtext.ui.core.editor.FastLineBasedDamagerRepaire r (contributed
by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
org.eclipse.xtext.ui.core.editor.XtextDamagerRepairer (contributed by
de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.jface.viewers.ILabelProvider ->
org.eclipse.xtext.ui.core.DefaultLabelProvider (contributed by
org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.jface.viewers.ILabelProvider ->
org.xtext.example.labeling.MyDsl4LabelProvider (contributed by
org.eclipse.xtext.ui.generator.labeling.LabelProviderFragmen t)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
org.eclipse.xtext.ui.common.editor.outline.impl.DefaultSeman ticModelTransformer
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
org.xtext.example.outline.MyDsl4Transformer (contributed by
org.eclipse.xtext.ui.generator.outline.TransformerFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider ->
org.eclipse.xtext.common.contentassist.TerminalsProposalProv ider
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider ->
org.xtext.example.contentassist.MyDsl4ProposalProvider (contributed by
org.eclipse.xtext.ui.generator.contentAssist.JavaBasedConten tAssistFragment)
14011 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
completed in 10930ms!
------------------------------------------------------------ ------

Thanks.

Durga
Re: Importing a grammar which inturn has imported a Metamodel [message #50831 is a reply to message #50781] Fri, 12 June 2009 18:26 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Durga,

please attach your mwe-file. I assume that you did not register your
imported metamodels in your workflow.
Thanks.

Sebastian

Am 12.06.2009 19:49 Uhr, schrieb Durga Prasana Sahoo:
> I specified my grammar wrongly in my previous post.(just interchanged)
> Sry. consider this..
>
> ------------------------------------------------------------ --
> I am tryin to write a grammar(say gr_1) that has imported another
> Grammar(gr_2).
> However gr_2 has also imported Metamodel say m_1.
>
> So is using rules of gr_2 in gr_1 valid this way in the XText?
>
> ->Moreover I have suppressed the generation of Metamodel in gr_2.
>
> Can't get it working!!
>
> My implm is somewhat like this:
> ------------------------------gr_1-----------------------
>
> grammar org.xtext.example.MyDsl4 with org.xtext.samm_dsl.Edifice
>
> generate myDsl4 "http://www.xtext.org/example/MyDsl4"
>
> Core:
> ('Entity:'core_elem+=MemoryDescriptor)*
> ;
> ..
> ..
> ------------------------------------
> ---------------------------gr_2----------------------------- ----
>
> grammar org.xtext.samm_dsl.Edifice with org.eclipse.xtext.common.Terminals
>
> import "http://www.eclipse.org/emf/2002/Ecore" as ecore
>
>
>
> import "http://q-impress.eu/samm/core" as refn_core
> import "http://q-impress.eu/samm/datatype" as refn_datatypes
> import "http://q-impress.eu/samm/deployment/targetenvironment" as
> refn_depl_targetenv
> import "http://q-impress.eu/samm/deployment/hardware" as refn_depl_hardware
> import "http://q-impress.eu/samm/deployment/allocation" as
> refn_depl_allocation
> import "http://q-impress.eu/samm/behaviour" as refn_behaviour
> import "http://q-impress.eu/samm/usagemodel" as refn_usagemodel
> import "http://q-impress.eu/samm/staticstructure" as refn_staticstructure
>
> import "http://q-impress.eu/identifier" as ident
>
>
>
> Identifier returns ident::Identifier :
> Entity; //This part pertains to Core classes
> Entity returns refn_core::Entity:
> (NamedEntity | Connector | EndPoint | HardwareDescriptor)
> ;
>
> ..
> ..
>
> MemoryDescriptor returns refn_depl_hardware::MemoryDescriptor:
> 'MemoryDescriptor' 'id:' id=STRING '{'
> //parent attrib(s)
> 'doc:' documentation=STRING';'
>
> //class specific attributes
> 'bw:' bandwidth=INT ';'
> 'fsbFreq:' fsbFrequency=INT ';'
> 'accessFreq:' accessLatency=INT ';'
> 'burstLen:' burstLength=INT ';'
> '}'
>
> ;
> ..
> ..
> ------------------------------------------------------------ ----------
>
> shows the following error when I run workflow for gr_2
>
> ------------------------------------------------------------ -----
> 4793 [main] ERROR enerator.CompositeGeneratorFragment -
> java.lang.NullPointerException
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2373)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2362)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper. <init>(GenPackageImpl.java:2302)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.p repareCache(GenPackageImpl.java:3090)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageG eneratorAdapter.doPreGenerate(GenPackageGeneratorAdapter.jav a:182)
>
> at
> org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAda pter.preGenerate(AbstractGeneratorAdapter.java:256)
>
> at
> org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:609)
>
> at
> org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:528)
>
> at
> org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erateEcoreJavaClasses(EcoreGeneratorFragment.java:277)
>
> at
> org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erate(EcoreGeneratorFragment.java:106)
>
> at
> org.eclipse.xtext.generator.CompositeGeneratorFragment.gener ate(CompositeGeneratorFragment.java:77)
>
> at
> org.eclipse.xtext.generator.LanguageConfig.generate(Language Config.java:68)
> at org.eclipse.xtext.generator.Generator.generate(Generator.jav a:269)
> at org.eclipse.xtext.generator.Generator.invokeInternal(Generat or.java:80)
> at
> org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invok e(AbstractWorkflowComponent.java:118)
>
> at
> org.eclipse.emf.mwe.core.container.CompositeComponent.intern alInvoke(CompositeComponent.java:101)
>
> at
> org.eclipse.emf.mwe.core.container.CompositeComponent.invoke (CompositeComponent.java:86)
>
> at
> org.eclipse.emf.mwe.core.WorkflowRunner.executeWorkflow(Work flowRunner.java:412)
>
> at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.j ava:292)
> at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner. java:239)
>
> ------------------------------------------------------------ -----
> Entire console result:
> ------------------------------------------------------------ -----
> 0 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
> Workflow Engine 0.7.0, Build v200905260637
> 18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
> openarchitectureware.org and contributors
> 18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 18 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running workflow:
> C:/Users/Durga/workspace_TMF/org.xtext.example.mydsl4/src/or g/xtext/example/GenerateMyDsl4.mwe
>
> 19 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - 559 [main] INFO
> lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri
> 'C:\Users\Durga\workspace_TMF'
> 700 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.staticstructure.StaticstructurePackage'
> 701 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.behaviour.BehaviourPackage'
> 702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage
> 'eu.qimpress.samm.deployment.targetenvironment.Targetenviron mentPackage'
> 702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.deployment.hardware.HardwarePackage'
> 702 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.deployment.allocation.AllocationPackage'
> 703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
> 703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
> 703 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
> 3082 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
> cleaning directory '../org.xtext.example.mydsl4/src-gen'
> 3083 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
> C:\Users\Durga\workspace_TMF\org.xtext.example.mydsl4\..\org .xtext.example.mydsl4\src-gen
>
> 3084 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
> cleaning directory '../org.xtext.example.mydsl4.ui/src-gen'
> 3084 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
> C:\Users\Durga\workspace_TMF\org.xtext.example.mydsl4\..\org .xtext.example.mydsl4.ui\src-gen
>
> 3085 [main] INFO e.core.container.CompositeComponent - Generator
> 3115 [main] INFO ipse.xtext.generator.LanguageConfig - generating
> infrastructure for org.xtext.example.MyDsl4 with fragments :
> ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment,
> EcoreGeneratorFragment, ParseTreeConstructorFragment,
> ResourceFactoryFragment, DelegatingGeneratorFragment,
> JavaValidatorFragment, JavaScopingFragment, FormatterFragment,
> LabelProviderFragment, TransformerFragment, JavaBasedContentAssistFragment
> 4793 [main] ERROR enerator.CompositeGeneratorFragment -
> java.lang.NullPointerException
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2373)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper.handle(GenPackageImpl.java:2362)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$D ependencyHelper. <init>(GenPackageImpl.java:2302)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.p repareCache(GenPackageImpl.java:3090)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageG eneratorAdapter.doPreGenerate(GenPackageGeneratorAdapter.jav a:182)
>
> at
> org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAda pter.preGenerate(AbstractGeneratorAdapter.java:256)
>
> at
> org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:609)
>
> at
> org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:528)
>
> at
> org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erateEcoreJavaClasses(EcoreGeneratorFragment.java:277)
>
> at
> org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.gen erate(EcoreGeneratorFragment.java:106)
>
> at
> org.eclipse.xtext.generator.CompositeGeneratorFragment.gener ate(CompositeGeneratorFragment.java:77)
>
> at
> org.eclipse.xtext.generator.LanguageConfig.generate(Language Config.java:68)
> at org.eclipse.xtext.generator.Generator.generate(Generator.jav a:269)
> at org.eclipse.xtext.generator.Generator.invokeInternal(Generat or.java:80)
> at
> org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invok e(AbstractWorkflowComponent.java:118)
>
> at
> org.eclipse.emf.mwe.core.container.CompositeComponent.intern alInvoke(CompositeComponent.java:101)
>
> at
> org.eclipse.emf.mwe.core.container.CompositeComponent.invoke (CompositeComponent.java:86)
>
> at
> org.eclipse.emf.mwe.core.WorkflowRunner.executeWorkflow(Work flowRunner.java:412)
>
> at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.j ava:292)
> at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner. java:239)
> 13763 [main] INFO or.validation.JavaValidatorFragment - executing
> generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
> 13898 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding :
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer.NullTokenColorer
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 13898 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding :
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Comm onAntlrTokenColorer
> (contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
> 13898 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding : org.eclipse.jface.text.rules.ITokenScanner ->
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.DefaultTok enScanner
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 13898 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding : org.eclipse.jface.text.rules.ITokenScanner ->
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Antl rTokenScanner (contributed
> by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
> 13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
> org.eclipse.xtext.ui.core.editor.FastLineBasedDamagerRepaire r
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
> org.eclipse.xtext.ui.core.editor.XtextDamagerRepairer (contributed by
> de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
> 13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding : org.eclipse.jface.viewers.ILabelProvider ->
> org.eclipse.xtext.ui.core.DefaultLabelProvider (contributed by
> org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding : org.eclipse.jface.viewers.ILabelProvider ->
> org.xtext.example.labeling.MyDsl4LabelProvider (contributed by
> org.eclipse.xtext.ui.generator.labeling.LabelProviderFragmen t)
> 13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding :
> org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
> org.eclipse.xtext.ui.common.editor.outline.impl.DefaultSeman ticModelTransformer
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding :
> org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
> org.xtext.example.outline.MyDsl4Transformer (contributed by
> org.eclipse.xtext.ui.generator.outline.TransformerFragment)
> 13899 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding :
> org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider
> -> org.eclipse.xtext.common.contentassist.TerminalsProposalProv ider
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 13899 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding :
> org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider
> -> org.xtext.example.contentassist.MyDsl4ProposalProvider (contributed
> by
> org.eclipse.xtext.ui.generator.contentAssist.JavaBasedConten tAssistFragment)
>
> 14011 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
> completed in 10930ms!
> ------------------------------------------------------------ ------
>
> Thanks.
>
> Durga
>
Re: Importing a grammar which inturn has imported a Metamodel [message #51462 is a reply to message #50831] Mon, 15 June 2009 09:18 Go to previous messageGo to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
Hello Sebastian

I indeed registered the generated EPackages in the mwe file.

The generate.mwe file for gr_1 is:

-----------------------------------------------------
<workflow>
<property file="org/xtext/example/GenerateMyDsl4.properties"/>

<property name="runtimeProject" value="../${projectName}"/>

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"
platformUri="${runtimeProject}/..">
<registerGeneratedEPackage
value="eu.qimpress.samm.staticstructure.StaticstructurePackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.behaviour.BehaviourPackage"/>
<registerGeneratedEPackage
value=" eu.qimpress.samm.deployment.targetenvironment.Targetenvironm entPackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.deployment.hardware.HardwarePackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.deployment.allocation.AllocationPackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.datatypes.DatatypesPackage"/>
<registerGeneratedEPackage
value="eu.qimpress.samm.annotation.AnnotationPackage"/>
<registerGeneratedEPackage
value="eu.qimpress.samm.usagemodel.UsagemodelPackage"/>
<registerGeneratedEPackage
value="eu.qimpress.identifier.IdentifierPackage"/>
</bean>

<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="${runtimeProject}/src-gen"/>
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="${runtimeProject}.ui/src-gen"/>

<component class="org.eclipse.xtext.generator.Generator">
<pathRtProject value="${runtimeProject}"/>
<pathUiProject value="${runtimeProject}.ui"/>
<projectNameRt value="${projectName}"/>
<projectNameUi value="${projectName}.ui"/>

<language uri="${grammarURI}" fileExtensions="${file.extensions}">
<!-- Java API to access grammar elements (required by several other
fragments) -->
<fragment
class=" org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragm ent "/>

<!-- generates Java API for the generated EPackages -->
<fragment
class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment "/>

<!-- the serialization component -->
<fragment
class=" org.eclipse.xtext.generator.parseTreeConstructor.ParseTreeCo nstructorFragment "/>

<!-- a custom ResourceFactory for use with EMF -->
<fragment
class=" org.eclipse.xtext.generator.resourceFactory.ResourceFactoryF ragment "
fileExtensions="${file.extensions}"/>

<!-- the following fragment tries to use the Antlr Generator fragment
which can be downloaded from http://www.itemis.com
and falls back to the packrat parser if it's not available. -->
<fragment
class="org.eclipse.xtext.generator.DelegatingGeneratorFragment "
delegate="de.itemis.xtext.antlr.XtextAntlrGeneratorFragment "
message="You are generating without ANTLR. It is highly recommended to
download and use the plugin 'de.itemis.xtext.antlr' \n\t using the update
site http://xtext.itemis.com/updates/milestones.">
<fallback
class="org.eclipse.xtext.generator.parser.PackratParserFragment "/>
</fragment>


<!-- java-based API for validation -->
<fragment
class=" org.eclipse.xtext.generator.validation.JavaValidatorFragment ">
<composedCheck
value="org.eclipse.xtext.validation.ImportUriValidator"/>
</fragment>


<!-- scoping API -->
<fragment
class="org.eclipse.xtext.generator.scoping.JavaScopingFragment "/>

<!-- formatter API -->
<fragment
class="org.eclipse.xtext.generator.formatting.FormatterFragment "/>

<!-- labeling API -->
<fragment
class=" org.eclipse.xtext.ui.generator.labeling.LabelProviderFragmen t "/>

<!-- outline API -->
<fragment
class="org.eclipse.xtext.ui.generator.outline.TransformerFragment "/>


<!-- java-based API for content assistance -->
<fragment
class=" org.eclipse.xtext.ui.generator.contentAssist.JavaBasedConten tAssistFragment "/>

</language>
</component>
</workflow>
------------------------------------------------------------ --------------


But the problem I guess is the inavailability of the following packages:

org.xtext.samm_dsl.edifice
org.xtext.samm_dsl.edifice.util
org.xtext.samm_dsl.edifice.impl

----------------------------------------------

But these packages are indeed not intended to be generated Since, I've
suppressed the generation of ecore model for the edifice dsl.(gr_2)

Thanks.

Durga
Re: Importing a grammar which inturn has imported a Metamodel [message #51489 is a reply to message #50831] Mon, 15 June 2009 09:23 Go to previous messageGo to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
Hello Sebastian

I'm really sry but I must say that the error I get is when I run the
workflow for gr_1( not gr_2).

I messed up the order of grammars!! sry..

Thanks.

Durga
Re: Importing a grammar which inturn has imported a Metamodel [message #51633 is a reply to message #51489] Mon, 15 June 2009 22:43 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Durga,

I guess you did not suppress ecore-generation in the workflow file, that
finally fails with the exception trace that you posted originally.

Please try to establish references to the genmodels of the metamodels
that were imported in your base language. It can be done similar to the
following snippet:

<fragment class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment ">
<genmodels
value="platform:/resource/dontknowthepath/metamodel1.genmodel,
platform:/resource/whateverpath/metamodel2.genmodel"/>
</fragment>

Hope that helps,
Sebastian

Am 15.06.2009 11:23 Uhr, schrieb Durga Prasana Sahoo:
> Hello Sebastian
>
> I'm really sry but I must say that the error I get is when I run the
> workflow for gr_1( not gr_2).
>
> I messed up the order of grammars!! sry..
>
> Thanks.
>
> Durga
>
Previous Topic:Rich text styling in a Xtext-generated editor
Next Topic:Bug in codecompletion?
Goto Forum:
  


Current Time: Thu Nov 14 10:05:04 GMT 2024

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

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

Back to the top