Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generator using external compiler
Generator using external compiler [message #1707223] Thu, 03 September 2015 07:52 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi!

The default Xtext generator implementation relies on our IGenarator to create files through IFileSystemAccess and provides in the background a lot of functionality like handling 'clean' builds and keeping track of already generated files.

We have a language that already has a toolset for compiling the sources. My generator just calls the compiler, but then we don't get the nice extra stuff from the builtins. I can't see a way to "hook" into that, except reading the generated file contents and recreating through IFileSystemAccess, which feels too much of a hack.

So I wonder if there is some other way to use the existing functionality of the generator, while letting the external compiler do the actual generation.

best regards,
Vlad
Re: Generator using external compiler [message #1707230 is a reply to message #1707223] Thu, 03 September 2015 08:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

can you elaborate a bit more on your external compiler?
of course you could simply call it (parameterized) from your IGenerator or IXtextBuilderParticipant


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generator using external compiler [message #1707237 is a reply to message #1707230] Thu, 03 September 2015 08:36 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi,

Yes, it's not a problem to call it and it works fine. The issue is that if I create the output files via IFileSystemAccess, I get help with things that otherwise I need to implement myself: keep track of generated files to clean up when required, keep track of resource change history, handle output configurations, etc. It would be nice and helpful if I could use the existing implementation. I can't see a way, but that doesn't mean it doesn't exist Smile

/Vlad
Re: Generator using external compiler [message #1707239 is a reply to message #1707237] Thu, 03 September 2015 08:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
And your compiler has no interface that acceps a stream or something like that?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generator using external compiler [message #1707242 is a reply to message #1707239] Thu, 03 September 2015 08:49 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
No, it's a python script. It also generates multiple files, so it's not very easy to just make it output to stdout. I already have asked the respective developers, but I thought I'd try to see if there was another way.
Re: Generator using external compiler [message #1707245 is a reply to message #1707242] Thu, 03 September 2015 09:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
then i have no idea

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generator using external compiler [message #1707246 is a reply to message #1707245] Thu, 03 September 2015 09:28 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Ok, thanks!
Previous Topic:Case insensitivity doesn't work with terminal rules
Next Topic:How coud we bind XtextBuilder?
Goto Forum:
  


Current Time: Fri Apr 26 08:30:03 GMT 2024

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

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

Back to the top