Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » How to generate preserved regions from EGL @template operation(Context is missing?)
How to generate preserved regions from EGL @template operation [message #1007950] Fri, 08 February 2013 12:15 Go to next message
Maarten Bezemer is currently offline Maarten BezemerFriend
Messages: 117
Registered: February 2012
Senior Member
Hi all,

I am trying to generate a preserved region from an EGL template.

myTemplate.egl:
[%
@template
operation MyObject myOperation() {
%][%=out.startPreserve("//", "", "myRegion", true) %]
blah
[%= out.stopPreserve() %][%
}
%]


myFile.egl:
[%
import "myTemplate.egl"
This is my file
[%= myObject.myOperation() %]
More of my file
%]


But the above example returns a NullPointerException:
Error encountered whilst processing template. (generate-files.eol@21:14)
Cause: Internal error: Internal error: Internal error: Internal error: java.lang.NullPointerException
at org.eclipse.epsilon.egl.output.OutputBuffer.startPreserve[OutputBuffer.java:181]
at sun.reflect.GeneratedMethodAccessor48.invoke[Unknown Source]
at sun.reflect.DelegatingMethodAccessorImpl.invoke[DelegatingMethodAccessorImpl.java:43]
at java.lang.reflect.Method.invoke[Method.java:601]
at org.eclipse.epsilon.eol.util.ReflectionUtil.executeMethod[ReflectionUtil.java:175]
at org.eclipse.epsilon.eol.util.ReflectionUtil.executeMethod[ReflectionUtil.java:157]
at org.eclipse.epsilon.eol.execute.PointExecutor.executeOperation[PointExecutor.java:154]
at org.eclipse.epsilon.eol.execute.PointExecutor.execute[PointExecutor.java:75]
at org.eclipse.epsilon.eol.execute.PointExecutor.execute[PointExecutor.java:44]
at org.eclipse.epsilon.eol.execute.PointExecutor.execute[PointExecutor.java:90]
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST[ExecutorFactory.java:226]
...and so on...


When looking around with the debugger it seems that OutputBuffer does have 'context' set, resulting in the NPE when an instance method of 'context' is called.

Am I doing something wrong? Or is it not possible to create a protected region from a EGL @template operation?
Re: How to generate preserved regions from EGL @template operation [message #1008126 is a reply to message #1007950] Sun, 10 February 2013 09:20 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Maarten,

I've reproduced this using the following minimal example.

[%=t()%]

[%
@template
operation t() {%]

[%=out.startPreserve("//", "", "myRegion", true)%]
[%=out.stopPreserve()%]

[%
}
%]


Could you please file a bug report?

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT.Epsilon

Cheers,
Dimitris
Re: How to generate preserved regions from EGL @template operation [message #1008128 is a reply to message #1008126] Sun, 10 February 2013 11:08 Go to previous message
Maarten Bezemer is currently offline Maarten BezemerFriend
Messages: 117
Registered: February 2012
Senior Member
Submitted bug #400391
Previous Topic:EGL - TemplateFactory.setRoot
Next Topic:Emfatic/Eugenia
Goto Forum:
  


Current Time: Fri Apr 26 05:36:14 GMT 2024

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

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

Back to the top