Importing a grammar which inturn has imported a Metamodel [message #50739] |
Fri, 12 June 2009 17:12 |
Durga Prasana Sahoo 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 |
Durga Prasana Sahoo 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 |
Sebastian Zarnekow 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
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29867 seconds