Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [JET] Enhancement: public void generate(PrintStream stream, Object argument)
[JET] Enhancement: public void generate(PrintStream stream, Object argument) [message #431717] Wed, 22 July 2009 18:43 Go to next message
Gregor Pfeifer is currently offline Gregor PfeiferFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,
First of all I must say: EMF rocks. I'm writing a compiler and trying
out EMF by using it to model my AST objects. First I was sceptic, but
now I'm excited, because EMF saves me a lot of work.

For the code generation part I use JET. In my scenario, a template can
call other templates recursively. The current interface of a JET
template is:

public String generate(Object argument)

With this interface I have a massive perfomance (and memory) problem,
since every call of a template creates a String. I have extended JET so
that a template can optionally be generated with another interface.

public void generate(PrintStream stream, Object argument)

With this new interface the templates are directly written into one
single stream without generating lots of temporary Strings. Now my
compiler takes just seconds instead of more than 20 minutes to generate
about 10 MB code. I would like to contribute my changes:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=284010

Any comments?

With very best regards
Gregor
Re: [JET] Enhancement: public void generate(PrintStream stream, Object argument) [message #431747 is a reply to message #431717] Thu, 23 July 2009 16:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Gregor,

It would be better to enhance JET2, but if the changes are simple, I'd
certainly be willing to incorporate them in the older JET1 base.


Gregor Pfeifer wrote:
> Hello,
> First of all I must say: EMF rocks. I'm writing a compiler and trying
> out EMF by using it to model my AST objects. First I was sceptic, but
> now I'm excited, because EMF saves me a lot of work.
>
> For the code generation part I use JET. In my scenario, a template can
> call other templates recursively. The current interface of a JET
> template is:
>
> public String generate(Object argument)
>
> With this interface I have a massive perfomance (and memory) problem,
> since every call of a template creates a String. I have extended JET
> so that a template can optionally be generated with another interface.
>
> public void generate(PrintStream stream, Object argument)
>
> With this new interface the templates are directly written into one
> single stream without generating lots of temporary Strings. Now my
> compiler takes just seconds instead of more than 20 minutes to
> generate about 10 MB code. I would like to contribute my changes:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=284010
>
> Any comments?
>
> With very best regards
> Gregor


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [JET] Enhancement: public void generate(PrintStream stream, Object argument) [message #431750 is a reply to message #431747] Thu, 23 July 2009 16:23 Go to previous message
Gregor Pfeifer is currently offline Gregor PfeiferFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,
I use JET1 because my compiler must run outside eclipse. When I
understand it right JET2 requires Eclipse.
Regards
Gregir
Previous Topic:org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www
Next Topic:EMF Ant Task Model Plug-in Class
Goto Forum:
  


Current Time: Tue Apr 16 18:29:35 GMT 2024

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

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

Back to the top