Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » modification of ElementInitializers generation
modification of ElementInitializers generation [message #216014] Wed, 21 January 2009 10:27 Go to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 270
Registered: July 2009
Location: Paris Saclay, France
Senior Member
Hi,
I try to modify code generation, so I use dynalic template. I try to modify
ElementInitilizers. To do that I have copied from the CVS
xpt::providers::ElementInitializers. But it does not run, I have the
following error message.
I try to prefix by "gmfgen::" but the mistake is the same.

eclipse.buildId=unknown
java.version=1.6.0_04
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments: -product org.eclipse.sdk.ide
Command-line arguments: -product org.eclipse.sdk.ide -data
E:\experiment -dev
file:C:/Tessier/papyrus-experiment/.metadata/.plugins/org.ec lipse.pde.core/New_configuration/dev.properties -
debug
C:\Tessier\papyrus-experiment\.metadata\.plugins\org.eclipse .pde.core\New_configuration/.options
-os win32 -ws win32 -arch x86


Error
Wed Jan 21 11:04:01 CET 2009
Exception (Couldn't find enum literal or type 'GenLanguage::literal':in
xpt::providers::ElementInitializers on line 82 'GenLanguage::literal') while
generating code

org.eclipse.gmf.internal.xpand.expression.EvaluationExceptio n: Couldn't find
enum literal or type 'GenLanguage::literal':in
xpt::providers::ElementInitializers on line 82 'GenLanguage::literal'
at
org.eclipse.gmf.internal.xpand.expression.ast.FeatureCall.ev aluateInternal(FeatureCall.java:133)
at
org.eclipse.gmf.internal.xpand.expression.ast.Expression.eva luate(Expression.java:44)
at
org.eclipse.gmf.internal.xpand.expression.ast.OperationCall. evaluateInternal(OperationCall.java:58)
at
org.eclipse.gmf.internal.xpand.expression.ast.Expression.eva luate(Expression.java:44)
at
org.eclipse.gmf.internal.xpand.ast.IfStatement.evaluateInter nal(IfStatement.java:82)
at org.eclipse.gmf.internal.xpand.ast.Statement.evaluate(Statem ent.java:30)
at
org.eclipse.gmf.internal.xpand.ast.AbstractDefinition.evalua te(AbstractDefinition.java:94)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.invokeDef inition(ExpandStatement.java:190)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.evaluateI nternal(ExpandStatement.java:161)
at org.eclipse.gmf.internal.xpand.ast.Statement.evaluate(Statem ent.java:30)
at
org.eclipse.gmf.internal.xpand.ast.ForEachStatement.evaluate Internal(ForEachStatement.java:123)
at org.eclipse.gmf.internal.xpand.ast.Statement.evaluate(Statem ent.java:30)
at
org.eclipse.gmf.internal.xpand.ast.AbstractDefinition.evalua te(AbstractDefinition.java:94)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.invokeDef inition(ExpandStatement.java:190)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.evaluateI nternal(ExpandStatement.java:161)
at org.eclipse.gmf.internal.xpand.ast.Statement.evaluate(Statem ent.java:30)
at
org.eclipse.gmf.internal.xpand.ast.AbstractDefinition.evalua te(AbstractDefinition.java:94)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.invokeDef inition(ExpandStatement.java:190)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.evaluateI nternal(ExpandStatement.java:161)
at org.eclipse.gmf.internal.xpand.ast.Statement.evaluate(Statem ent.java:30)
at
org.eclipse.gmf.internal.xpand.ast.AbstractDefinition.evalua te(AbstractDefinition.java:94)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.invokeDef inition(ExpandStatement.java:190)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.evaluateI nternal(ExpandStatement.java:147)
at org.eclipse.gmf.internal.xpand.ast.Statement.evaluate(Statem ent.java:30)
at
org.eclipse.gmf.internal.xpand.ast.AbstractDefinition.evalua te(AbstractDefinition.java:94)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.invokeDef inition(ExpandStatement.java:190)
at
org.eclipse.gmf.internal.xpand.ast.ExpandStatement.evaluateI nternal(ExpandStatement.java:161)
at org.eclipse.gmf.internal.xpand.ast.Statement.evaluate(Statem ent.java:30)
at
org.eclipse.gmf.internal.xpand.ast.AbstractDefinition.evalua te(AbstractDefinition.java:94)
at org.eclipse.gmf.internal.xpand.XpandFacade.evaluate(XpandFac ade.java:60)
at
org.eclipse.gmf.internal.common.codegen.XpandTextEmitter.gen erate(XpandTextEmitter.java:64)
at
org.eclipse.gmf.internal.common.codegen.GeneratorBase.doGene rateJavaClass(GeneratorBase.java:335)
at
org.eclipse.gmf.internal.common.codegen.GeneratorBase.doGene rateJavaClass(GeneratorBase.java:322)
at
org.eclipse.gmf.codegen.util.Generator.generateElementInitia lizers(Generator.java:575)
at org.eclipse.gmf.codegen.util.Generator.customRun(Generator.j ava:166)
at
org.eclipse.papyrus.codegen.PapyrusGenerator.customRun(Papyr usGenerator.java:53)
at
org.eclipse.gmf.internal.common.codegen.GeneratorBase$1.run( GeneratorBase.java:474)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1800)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1782)
at
org.eclipse.gmf.internal.common.codegen.GeneratorBase.doRun( GeneratorBase.java:471)
at
org.eclipse.gmf.internal.common.codegen.GeneratorBase.run(Ge neratorBase.java:90)
at
org.eclipse.gmf.internal.codegen.popup.actions.ExecuteTempla tesOperation.run(ExecuteTemplatesOperation.java:182)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
Re: modification of ElementInitializers generation [message #216833 is a reply to message #216014] Fri, 30 January 2009 12:06 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Patrick,

Do you have an exact copy of the template, or did you copy only this very
definition («DEFINE performInit(GenCommonBase diagramElement, String instanceVar,
GenClass instanceClass, List[int] counters) FOR GenFeatureValueSpec-»)? This
error says: due to some reasons corresponding enumeration (or it’s literal)
was not found.

So, if you have whole GMF in a target platform (gmfgen model available in
default Ecore package registry) + import «IMPORT "http://www.eclipse.org/gmf/2008/GenModel
specified in corresponding custom template this error can be produces only
if you are using old gmfgen model (AFAIKSee from the CVS history “literal”
was added to the GenLanguage enumeration after GMF 2.1 release)…

I suggest you to better use xpt/providers/ElementInitilizers.xpt from org.eclipse.gmf.codegen
plugin of your current target platform – CVS version sometimes is “too fresh”.
:-)

-----------------
Alex Shatalin

P.S. Recently we modified xpand templates engine in GMF (using ImperativeOCL
as a query language instead of xtend one) so I suggest you to base your development
on latest GMF integration/stable builds to avoid custom templates migration
in future.
Previous Topic:Global Actions in Multipage Editor with a Diagram Editor
Next Topic:Association Link problem
Goto Forum:
  


Current Time: Fri Mar 05 08:30:52 GMT 2021

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

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

Back to the top