Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EGL broken by upgrade(Template operations emit no output)
EGL broken by upgrade [message #536377] Thu, 27 May 2010 21:16 Go to next message
Mark Tippetts is currently offline Mark TippettsFriend
Messages: 25
Registered: July 2009
Junior Member
Hello,

I have a number of EGL templates that worked fine until updating to 0.8.9. Operations (now marked with @template) produce no output. For example:
[%
inputAnt.println('InputAnt: ');

for (proj : AntProject in inputAnt.getAllOfType('AntProject')){%]
<project name="[%=proj.name%]" basedir="[%=proj.baseDir%]" default="[%=proj.default%]">
	<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
	[% for (target : AntTarget in proj.element) {
		target.emitTarget();
	}%]
</project>

[%}

@template
operation AntTarget emitTarget() {
self.println('Emitting target ');
%]
	<target>
	</target>
	
[%}
%]


This code produces the following output:
<project name="EpsilonTools" basedir="." default="">
	<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
</project>

As you can see, the operation emitTarget() isn't emitting the targets.

Here's the console output, which shows the operations are being executed:
Buildfile: C:\Eclipse3.5\workspace\epsilontools.engine\design\Build.xml

GenerateBuildXML:
[epsilon.egl - GenerateBuildXML.egl] InputAnt: org.eclipse.epsilon.workflow.tasks.ModelReference@daa718
[epsilon.egl - GenerateBuildXML.egl] Emitting target epsilontools.ant.impl.AntTargetImpl@6a338e (propsFile: null, propsURL: null, propsResource: null) (name: TransformEcore2Logic, description: null)
...
[epsilon.egl - GenerateBuildXML.egl] Emitting target epsilontools.ant.impl.AntTargetImpl@31ebd9 (propsFile: null, propsURL: null, propsResource: null) (name: GenerateEngineConfiguration, description: null)
BUILD SUCCESSFUL
Total time: 766 milliseconds


I'm using the latest interim build, to address the bug in http://www.eclipse.org/forums/index.php?t=msg&th=166758& amp;start=0&

Is this another regression, or is there something I need to do besides adding the @template annotations?
Re: EGL broken by upgrade [message #536435 is a reply to message #536377] Fri, 28 May 2010 08:59 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Mark,

I'm sorry to hear you're having problems with EGL in 0.8.9. I think the following change to the EGL template should cause the ANT targets to be emitted:

[% for (target : AntTarget in proj.element) {
  target.emitTarget();
}%]


becomes:

[% for (target : AntTarget in proj.element) { %]
  [%=target.emitTarget()%]
[%}%]


@template operations return a string that should be output in the main template using a dynamic output section. Hence the [%= target.emitTarget() %] statement.

Prior to 0.8.9, @template operations had access to the main template and could be used without a dynamic output section. Though this was possible, it wasn't the intended semantics, and it's been "fixed" in 0.8.9.

I'll update the EGL documentation to describe how @template operations should be used and how they work. This is an area of EGL that we should describe more thoroughly.

Thanks for reporting this, and sorry once again for the confusion.

Cheers,
Louis.
Re: EGL broken by upgrade [message #536489 is a reply to message #536435] Fri, 28 May 2010 13:21 Go to previous messageGo to next message
Mark Tippetts is currently offline Mark TippettsFriend
Messages: 25
Registered: July 2009
Junior Member
Louis,

That cures what ailed me. Very Happy

Thank you so much!

Mark
Re: EGL broken by upgrade [message #536887 is a reply to message #536489] Mon, 31 May 2010 11:47 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Mark,

Glad to hear that!

For reference, we've summarised the intended use of @template operations in this new article:
http://www.eclipse.org/gmt/epsilon/doc/articles/egl-template -operations/

Thanks again for reporting the issue.

Best,
Louis.
Re: EGL broken by upgrade [message #589439 is a reply to message #536435] Fri, 28 May 2010 13:21 Go to previous message
Mark Tippetts is currently offline Mark TippettsFriend
Messages: 25
Registered: July 2009
Junior Member
Louis,

That cures what ailed me. :d

Thank you so much!

Mark
Re: EGL broken by upgrade [message #589595 is a reply to message #589439] Mon, 31 May 2010 11:47 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Mark,

Glad to hear that!

For reference, we've summarised the intended use of @template operations in this new article:
http://www.eclipse.org/gmt/epsilon/doc/articles/egl-template -operations/

Thanks again for reporting the issue.

Best,
Louis.
Previous Topic:Special assignment operator bug?
Next Topic:Attribute named 'function' in ETL
Goto Forum:
  


Current Time: Fri Apr 19 23:25:01 GMT 2024

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

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

Back to the top